summaryrefslogtreecommitdiff
path: root/gdb/gdbtk/generic/gdbtk-hooks.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2001-04-23 20:27:54 +0000
committerKeith Seitz <keiths@redhat.com>2001-04-23 20:27:54 +0000
commit562d3a3c18379f2113dc8ebed9a87530aaa7da99 (patch)
treebd963f869c77f39def5125a35607d4857d156c2d /gdb/gdbtk/generic/gdbtk-hooks.c
parent799f89349eba5b3c6379b083fdded15a690bf623 (diff)
downloadgdb-562d3a3c18379f2113dc8ebed9a87530aaa7da99.tar.gz
* generic/gdbtk-cmds.c (gdb_get_breakpoint_info): If unable
to find the requested breakpoint for lookup, check if it is about to be deleted and return information about that breakpoint. (gdb_get_tracepoint_info): Ditto for tracepoints. * generic/gdbtk-hooks.c (gdbtk_deleted_bp): New global. (gdbtk_delete_breakpoint): Remember the deleted breakpoint for gdb_get_breakpoint_info, in case it is called during the event notification. (gdbtk_delete_tracepoints): Ditto for tracepoints.
Diffstat (limited to 'gdb/gdbtk/generic/gdbtk-hooks.c')
-rw-r--r--gdb/gdbtk/generic/gdbtk-hooks.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/gdbtk/generic/gdbtk-hooks.c b/gdb/gdbtk/generic/gdbtk-hooks.c
index c647aa1fa5f..5f70202a546 100644
--- a/gdb/gdbtk/generic/gdbtk-hooks.c
+++ b/gdb/gdbtk/generic/gdbtk-hooks.c
@@ -66,6 +66,20 @@ volatile int in_fputs = 0;
that it should forcibly detach from the target. */
int gdbtk_force_detach = 0;
+/* Set/cleared by gdbtk_delete_breakpoint/tracepoint. Unfortunately,
+ clear_command (in breakpoint.c) takes the breakpoint off of the
+ breakpoint_chain before deleting the breakpoint. The BreakpointEvent
+ which is created as a result of any breakpoint/tracepoint event
+ calls gdb_get_breakpoint_info will, therefore, not find a breakpoint
+ about which to return information. So we keep a handle on the deleted
+ breakpoint when we're deleting it, and teach gdb_get_breakpoint_info
+ to check for this variable whenever a breakpoint lookup fails.
+
+ Why not just change BreakpointEvent? Good question. Answer: I refuse
+ to allow BreakpointEvents to be all public variables. They are not.
+ They ONLY depend on the breakpoint number (gdb's handle for them). */
+void *gdbtk_deleted_bp = NULL;
+
extern void (*pre_add_symbol_hook) (char *);
extern void (*post_add_symbol_hook) (void);
extern void (*selected_frame_level_changed_hook) (int);
@@ -637,7 +651,10 @@ static void
gdbtk_delete_breakpoint (b)
struct breakpoint *b;
{
+ /* Hack. See comments near top of this file. */
+ gdbtk_deleted_bp = b;
breakpoint_notify (b, "delete");
+ gdbtk_deleted_bp = NULL;
}
static void
@@ -767,7 +784,10 @@ static void
gdbtk_delete_tracepoint (tp)
struct tracepoint *tp;
{
+ /* Hack. See comments near top of this file. */
+ gdbtk_deleted_bp = tp;
tracepoint_notify (tp, "delete");
+ gdbtk_deleted_bp = NULL;
}
static void