aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2015-08-11 17:09:35 -0700
committerKeith Seitz <keiths@redhat.com>2015-08-11 17:09:35 -0700
commita06efdd6effd149a1d392df8d62824e44872003a (patch)
tree993b11cd0c0a8553769d8ff981d87559010117f6 /gdb/breakpoint.c
parentf00aae0f7b11c4dc85c38d5fad46975033ba3fff (diff)
downloadgdb-a06efdd6effd149a1d392df8d62824e44872003a.zip
gdb-a06efdd6effd149a1d392df8d62824e44872003a.tar.gz
gdb-a06efdd6effd149a1d392df8d62824e44872003a.tar.bz2
Explicit locations: introduce address locations
This patch adds support for address locations, of the form "*ADDR". [Support for address linespecs has been removed/replaced by this "new" location type.] This patch also converts any existing address locations from its previous linespec type. gdb/ChangeLog: * breakpoint.c (create_thread_event_breakpoint, init_breakpoint_sal): Convert linespec to address location. * linespec.c (canonicalize_linespec): Do not handle address locations here. (convert_address_location_to_sals): New function; contents moved from ... (convert_linespc_to_sals): ... here. (parse_linespec): Remove address locations from linespec grammar. Remove handling of address locations. (linespec_lex_to_end): Remove handling of address linespecs. (event_location_to_sals): Handle ADDRESS_LOCATION. (linespec_expression_to_pc): Export. * linespec.h (linespec_expression_to_pc): Add declaration. * location.c (struct event_location.u) <address>: New member. (new_address_location, get_address_location): New functions. (copy_event_location, delete_event_location, event_location_to_string) (string_to_event_location, event_location_empty_p): Handle address locations. * location.h (enum event_location_type): Add ADDRESS_LOCATION. (new_address_location, get_address_location): Declare. * python/py-finishbreakpoint.c (bpfinishpy_init): Convert linespec to address location. * spu-tdep.c (spu_catch_start): Likewise.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 395da1f..b05c93a 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -7660,19 +7660,14 @@ delete_std_terminate_breakpoint (void)
struct breakpoint *
create_thread_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address)
{
- char *tmp;
struct breakpoint *b;
- struct cleanup *cleanup;
b = create_internal_breakpoint (gdbarch, address, bp_thread_event,
&internal_breakpoint_ops);
b->enable_state = bp_enabled;
/* location has to be used or breakpoint_re_set will delete me. */
- tmp = xstrprintf ("*%s", paddress (b->loc->gdbarch, b->loc->address));
- cleanup = make_cleanup (xfree, tmp);
- b->location = new_linespec_location (&tmp);
- do_cleanups (cleanup);
+ b->location = new_address_location (b->loc->address);
update_global_location_list_nothrow (UGLL_MAY_INSERT);
@@ -9244,16 +9239,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
if (location != NULL)
b->location = location;
else
- {
- char *tmp;
- struct cleanup *cleanup;
-
- tmp = xstrprintf ("*%s",
- paddress (b->loc->gdbarch, b->loc->address));
- cleanup = make_cleanup (xfree, tmp);
- b->location = new_linespec_location (&tmp);
- do_cleanups (cleanup);
- }
+ b->location = new_address_location (b->loc->address);
b->filter = filter;
}