* tracepoint.c (tracepoint_operation): Call the modify_tracepoint_hook

if it exists.
        Remove static declaration of free_actions.

        * tracepoint.h: Add declaration of free_actions.

        * gdbtk.c (gdbtk_modify_tracepoint): Define new tracepoint modification
hook.
        (gdbtk_print_frame_info): Define this hook so that current_source_symtab
        is set properly.
        (gdb_actions_command): Use free_actions () from tracepoint.c/h.
This commit is contained in:
Keith Seitz 1998-02-11 02:33:22 +00:00
parent bae2276c5b
commit a5f4fbff1d
5 changed files with 52 additions and 13 deletions

View File

@ -1,3 +1,16 @@
Tue Feb 10 17:50:37 1998 Keith Seitz <keiths@onions.cygnus.com>
* tracepoint.c (tracepoint_operation): Call the modify_tracepoint_hook
if it exists.
Remove static declaration of free_actions.
* tracepoint.h: Add declaration of free_actions.
Tue Feb 10 12:17:13 1998 Fred Fish <fnf@cygnus.com>
* symtab.c (decode_line_1): Revert change that mistakenly
removed assignment of sals[0].pc field.
Mon Feb 10 12:37:47 1998 Philippe De Muyter <phdm@macqel.be>
* m68k/tm-delta68.h (EXTRACT_RETURN_VALUE): Type argument for

View File

@ -1,3 +1,10 @@
Tue Feb 10 17:50:37 1998 Keith Seitz <keiths@onions.cygnus.com>
* gdbtk.c (gdbtk_modify_tracepoint): Define new tracepoint modification hook.
(gdbtk_print_frame_info): Define this hook so that current_source_symtab
is set properly.
(gdb_actions_command): Use free_actions () from tracepoint.c/h.
Mon Jan 26 11:37:55 1998 Keith Seitz <keiths@onions.cygnus.com>
* gdbtk.c (gdb_actions_command): Make note of next action

View File

@ -1,5 +1,5 @@
/* Tcl/Tk interface routines.
Copyright 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Written by Stu Grossman <grossman@cygnus.com> of Cygnus Support.
@ -151,7 +151,9 @@ static char *find_file_in_dir PARAMS ((char *));
static int gdb_get_tracepoint_list PARAMS ((ClientData, Tcl_Interp *, int, Tcl_Obj *CONST objv[]));
static void gdbtk_create_tracepoint PARAMS ((struct tracepoint *));
static void gdbtk_delete_tracepoint PARAMS ((struct tracepoint *));
static void gdbtk_modify_tracepoint PARAMS ((struct tracepoint *));
static void tracepoint_notify PARAMS ((struct tracepoint *, const char *));
static void gdbtk_print_frame_info PARAMS ((struct symtab *, int, int, int));
void gdbtk_pre_add_symbol PARAMS ((char *));
void gdbtk_post_add_symbol PARAMS ((void));
@ -2077,8 +2079,7 @@ gdbtk_init ( argv0 )
gdb_get_tracepoint_list, NULL, NULL);
command_loop_hook = tk_command_loop;
print_frame_info_listing_hook =
(void (*) PARAMS ((struct symtab *, int, int, int))) null_routine;
print_frame_info_listing_hook = gdbtk_print_frame_info;
query_hook = gdbtk_query;
flush_hook = gdbtk_flush;
create_breakpoint_hook = gdbtk_create_breakpoint;
@ -2095,6 +2096,7 @@ gdbtk_init ( argv0 )
post_add_symbol_hook = gdbtk_post_add_symbol;
create_tracepoint_hook = gdbtk_create_tracepoint;
delete_tracepoint_hook = gdbtk_delete_tracepoint;
modify_tracepoint_hook = gdbtk_modify_tracepoint;
#ifndef WINNT
/* Get the file descriptor for the X server */
@ -2610,6 +2612,13 @@ gdbtk_delete_tracepoint (tp)
tracepoint_notify (tp, "delete");
}
static void
gdbtk_modify_tracepoint (tp)
struct tracepoint *tp;
{
tracepoint_notify (tp, "modify");
}
static void
tracepoint_notify(tp, action)
struct tracepoint *tp;
@ -2708,13 +2717,9 @@ gdb_actions_command (clientData, interp, objc, objv)
}
/* Free any existing actions */
for (temp = tp->actions; temp != NULL; temp = next)
{
next = temp->next;
if (temp->action)
free (temp->action);
free (temp);
}
if (tp->actions != NULL)
free_actions (tp);
step_count = 0;
Tcl_ListObjGetElements (interp, objv[2], &nactions, &actions);
@ -2920,6 +2925,16 @@ TclDebug (va_alist)
Tcl_Eval (interp, buf);
}
static void
gdbtk_print_frame_info (s, line, stopline, noerror)
struct symtab *s;
int line;
int stopline;
int noerror;
{
current_source_symtab = s;
current_source_line = line;
}
/* Come here during initialize_all_files () */

View File

@ -517,8 +517,6 @@ enum tracepoint_opcode
delete
};
static void free_actions PARAMS((struct tracepoint *));
/* This function implements enable, disable and delete. */
static void
tracepoint_operation (t, from_tty, opcode)
@ -531,9 +529,13 @@ tracepoint_operation (t, from_tty, opcode)
switch (opcode) {
case enable:
t->enabled = enabled;
if (modify_tracepoint_hook)
modify_tracepoint_hook (t);
break;
case disable:
t->enabled = disabled;
if (modify_tracepoint_hook)
modify_tracepoint_hook (t);
break;
case delete:
if (tracepoint_chain == t)
@ -1005,7 +1007,7 @@ validate_actionline (line, t)
}
/* worker function */
static void
void
free_actions (t)
struct tracepoint *t;
{

View File

@ -98,8 +98,10 @@ extern struct tracepoint *tracepoint_chain;
void (*create_tracepoint_hook) PARAMS ((struct tracepoint *));
void (*delete_tracepoint_hook) PARAMS ((struct tracepoint *));
void (*modify_tracepoint_hook) PARAMS ((struct tracepoint *));
struct tracepoint *get_tracepoint_by_number PARAMS ((char **));
void free_actions PARAMS((struct tracepoint *));
/* Walk the following statement or block through all tracepoints.
ALL_TRACEPOINTS_SAFE does so even if the statment deletes the current