aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2007-11-29 07:48:21 +0000
committerVladimir Prus <vladimir@codesourcery.com>2007-11-29 07:48:21 +0000
commitc36b740af1121b812f151980b89722f39ef0b808 (patch)
treea585e51b543f904bc43c70ac6661f25c981349a6 /gdb/breakpoint.c
parent5c45b5dc5021892ff8ecc8d63044e91514cb9e11 (diff)
downloadgdb-c36b740af1121b812f151980b89722f39ef0b808.zip
gdb-c36b740af1121b812f151980b89722f39ef0b808.tar.gz
gdb-c36b740af1121b812f151980b89722f39ef0b808.tar.bz2
Stop infrun from tracking breakpoint insertion status.
The checks of breakpoints_inserted before calling remove_breakpoints are removed, as remove_breakpoint won't touch uninserted breakpoints. In a number of places, we're interested if a breakpoint is inserted at particular PC, and we now use breakpoint_inserted_here_p. In a few places, insert_breakpoints can be called unconditionally, since it won't try to insert already inserted breakpoint. * breakpoint.h (regular_breakpoint_inserted_here_p): New declaration. * breakpoint.c (regular_breakpoint_inserted_here_p): New. (breakpoint_inserted_here_p): Use regular_breakpoint_inserted_here_p. * infrun.c (breakpoints_inserted): Remove. (resume): Don't check for breakpoints_inserted before remove_hw_watchpoints. Use breakpoint_inserted_here_p. (proceed, init_wait_for_inferior): Don't set breakpoints_inserted. (handle_inferior_event): Don't use breakpoints_inserted. Use breakpoints_meant_to_be_inserted and breakpoints_inserted_here_p. (insert_step_resume_breakpoint_at_sal, keep_going): Use breakpoints_meant_to_be_inserted. Don't set breakpoints_inserted. (normal_stop): Don't check for breakpoints_inserted. Don't set breakpoints_inserted. (keep_going): Don't check for breakpoints_inserted. (insert_step_resume_breakpoint_at_sal): Don't insert breakpoints
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index f8e3cef..49958e6 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1757,12 +1757,13 @@ breakpoint_here_p (CORE_ADDR pc)
}
-/* breakpoint_inserted_here_p (PC) is just like breakpoint_here_p(),
- but it only returns true if there is actually a breakpoint inserted
- at PC. */
+/* Returns non-zero if there's a breakpoint inserted at PC, which is
+ inserted using regular breakpoint_chain/bp_location_chain mechanism.
+ This does not check for single-step breakpoints, which are
+ inserted and removed using direct target manipulation. */
int
-breakpoint_inserted_here_p (CORE_ADDR pc)
+regular_breakpoint_inserted_here_p (CORE_ADDR pc)
{
const struct bp_location *bpt;
@@ -1783,8 +1784,18 @@ breakpoint_inserted_here_p (CORE_ADDR pc)
return 1;
}
}
+ return 0;
+}
+
+/* Returns non-zero iff there's either regular breakpoint
+ or a single step breakpoint inserted at PC. */
+
+int
+breakpoint_inserted_here_p (CORE_ADDR pc)
+{
+ if (regular_breakpoint_inserted_here_p (pc))
+ return 1;
- /* Also check for software single-step breakpoints. */
if (single_step_breakpoint_inserted_here_p (pc))
return 1;