aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-11-06 18:20:52 +0000
committerDaniel Jacobowitz <drow@false.org>2003-11-06 18:20:52 +0000
commite049a4b52e7b68f3bc47d4221c6fe84d03ccf1cf (patch)
tree7a1ef4139e29d3afa5e967bddfcb2275482fee15 /gdb
parentadeee247f4fb02f62001298feba359b3437533dc (diff)
downloadgdb-e049a4b52e7b68f3bc47d4221c6fe84d03ccf1cf.zip
gdb-e049a4b52e7b68f3bc47d4221c6fe84d03ccf1cf.tar.gz
gdb-e049a4b52e7b68f3bc47d4221c6fe84d03ccf1cf.tar.bz2
* breakpoint.c (allocate_bp_location): Take bpt and bp_type
arguments. Initialize owner and type for the new breakpoint location item. (set_raw_breakpoint): Update call to allocate_bp_location.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/breakpoint.c44
2 files changed, 49 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7e755b9..3ab0bb3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2003-11-06 Daniel Jacobowitz <drow@mvista.com>
+ * breakpoint.c (allocate_bp_location): Take bpt and bp_type
+ arguments. Initialize owner and type for the new breakpoint
+ location item.
+ (set_raw_breakpoint): Update call to allocate_bp_location.
+
+2003-11-06 Daniel Jacobowitz <drow@mvista.com>
+
* breakpoint.h (struct bp_location): Add a chain pointer.
* breakpoint.c (ALL_BP_LOCATIONS, ALL_BP_LOCATIONS_SAFE): New
macros.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 6d80d74..9294cef 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3910,13 +3910,53 @@ adjust_breakpoint_address (CORE_ADDR bpaddr)
/* Allocate a struct bp_location. */
struct bp_location *
-allocate_bp_location (void)
+allocate_bp_location (struct breakpoint *bpt, enum bptype bp_type)
{
struct bp_location *loc, *loc_p;
loc = xmalloc (sizeof (struct bp_location));
memset (loc, 0, sizeof (*loc));
+ loc->owner = bpt;
+
+ switch (bp_type)
+ {
+ case bp_breakpoint:
+ case bp_until:
+ case bp_finish:
+ case bp_longjmp:
+ case bp_longjmp_resume:
+ case bp_step_resume:
+ case bp_through_sigtramp:
+ case bp_watchpoint_scope:
+ case bp_call_dummy:
+ case bp_shlib_event:
+ case bp_thread_event:
+ case bp_overlay_event:
+ case bp_catch_load:
+ case bp_catch_unload:
+ loc->loc_type = bp_loc_software_breakpoint;
+ break;
+ case bp_hardware_breakpoint:
+ loc->loc_type = bp_loc_hardware_breakpoint;
+ break;
+ case bp_hardware_watchpoint:
+ case bp_read_watchpoint:
+ case bp_access_watchpoint:
+ loc->loc_type = bp_loc_hardware_watchpoint;
+ break;
+ case bp_watchpoint:
+ case bp_catch_fork:
+ case bp_catch_vfork:
+ case bp_catch_exec:
+ case bp_catch_catch:
+ case bp_catch_throw:
+ loc->loc_type = bp_loc_other;
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, "unknown breakpoint type");
+ }
+
/* Add this breakpoint to the end of the chain. */
loc_p = bp_location_chain;
@@ -3954,7 +3994,7 @@ set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype)
b = (struct breakpoint *) xmalloc (sizeof (struct breakpoint));
memset (b, 0, sizeof (*b));
- b->loc = allocate_bp_location ();
+ b->loc = allocate_bp_location (b, bptype);
b->loc->requested_address = sal.pc;
b->loc->address = adjust_breakpoint_address (b->loc->requested_address);
if (sal.symtab == NULL)