From a5f4fbff1d7bb92016ad30c287c2a15e3c28ee54 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Wed, 11 Feb 1998 02:33:22 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 13 +++++++++++++ gdb/ChangeLog-gdbtk | 7 +++++++ gdb/gdbtk.c | 35 +++++++++++++++++++++++++---------- gdb/tracepoint.c | 8 +++++--- gdb/tracepoint.h | 2 ++ 5 files changed, 52 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b0c32dea1cd..9cd35fac70e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,16 @@ +Tue Feb 10 17:50:37 1998 Keith Seitz + + * 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 + + * 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 * m68k/tm-delta68.h (EXTRACT_RETURN_VALUE): Type argument for diff --git a/gdb/ChangeLog-gdbtk b/gdb/ChangeLog-gdbtk index 7873d965df2..871edffbcf4 100644 --- a/gdb/ChangeLog-gdbtk +++ b/gdb/ChangeLog-gdbtk @@ -1,3 +1,10 @@ +Tue Feb 10 17:50:37 1998 Keith Seitz + + * 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 * gdbtk.c (gdb_actions_command): Make note of next action diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c index 63cb938e0f8..6041f7185dd 100644 --- a/gdb/gdbtk.c +++ b/gdb/gdbtk.c @@ -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 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 () */ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 936df3d91ab..e77f1038715 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -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; { diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h index 0ff59821a4b..ad6a7b0d9a7 100644 --- a/gdb/tracepoint.h +++ b/gdb/tracepoint.h @@ -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 -- 2.30.2