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
commit5b56227bdc000d129d393772f1e4544b5ea0fd46 (patch)
treefdc2dc4b0a2d0a2581a066d9e87f802504728536 /gdb/breakpoint.c
parenta06efdd6effd149a1d392df8d62824e44872003a (diff)
downloadgdb-5b56227bdc000d129d393772f1e4544b5ea0fd46.zip
gdb-5b56227bdc000d129d393772f1e4544b5ea0fd46.tar.gz
gdb-5b56227bdc000d129d393772f1e4544b5ea0fd46.tar.bz2
Explicit locations: introduce probe locations
This patch adds support for probe locations and converts existing probe linespec locations to the new location type. gdb/ChangeLog: * break-catch-throw.c (re_set_exception_catchpoint): Convert linespec for stap probe to probe location. * breakpoint.c (create_longjmp_master_breakpoint) (create_exception_master_breakpoint): Likewise. (break_command_1): Remove local variable `arg_cp'. Check location type to set appropriate breakpoint ops methods. (trace_command): Likewise. * linespec.c (event_location_to_sals): Assert on probe locations. * location.c (EL_PROBE): Add macro definition. (new_probe_location, get_probe_location): New functions. (copy_event_location, delete_event_location, event_location_to_string) (string_to_event_location, event_location_empty_p): Handle probe locations. * location.h (enum event_location_type): Add PROBE_LOCATION. (new_probe_location, get_probe_location): Declare. * probe.c (parse_probes): Assert that LOCATION is a probe location. Convert linespec into probe location.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index b05c93a..0597688 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3517,7 +3517,6 @@ create_longjmp_master_breakpoint (void)
int i;
struct probe *probe;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
- char *p;
for (i = 0;
VEC_iterate (probe_p,
@@ -3532,8 +3531,8 @@ create_longjmp_master_breakpoint (void)
objfile),
bp_longjmp_master,
&internal_breakpoint_ops);
- p = ASTRDUP ("-probe-stap libc:longjmp");
- b->location = new_linespec_location (&p);
+ b->location
+ = new_probe_location ("-probe-stap libc:longjmp");
b->enable_state = bp_disabled;
}
@@ -3695,15 +3694,14 @@ create_exception_master_breakpoint (void)
++i)
{
struct breakpoint *b;
- char *p;
b = create_internal_breakpoint (gdbarch,
get_probe_address (probe,
objfile),
bp_exception_master,
&internal_breakpoint_ops);
- p = ASTRDUP ("-probe-stap libgcc:unwind");
- b->location = new_linespec_location (&p);
+ b->location
+ = new_probe_location ("-probe-stap libgcc:unwind");
b->enable_state = bp_disabled;
}
@@ -9850,7 +9848,6 @@ break_command_1 (char *arg, int flag, int from_tty)
? bp_hardware_breakpoint
: bp_breakpoint);
struct breakpoint_ops *ops;
- const char *arg_cp = arg;
struct event_location *location;
struct cleanup *cleanup;
@@ -9858,7 +9855,8 @@ break_command_1 (char *arg, int flag, int from_tty)
cleanup = make_cleanup_delete_event_location (location);
/* Matching breakpoints on probes. */
- if (arg_cp != NULL && probe_linespec_to_ops (&arg_cp) != NULL)
+ if (location != NULL
+ && event_location_type (location) == PROBE_LOCATION)
ops = &bkpt_probe_breakpoint_ops;
else
ops = &bkpt_breakpoint_ops;
@@ -14983,11 +14981,11 @@ trace_command (char *arg, int from_tty)
struct breakpoint_ops *ops;
struct event_location *location;
struct cleanup *back_to;
- const char *arg_cp = arg;
location = string_to_event_location (&arg, current_language);
back_to = make_cleanup_delete_event_location (location);
- if (arg_cp != NULL && probe_linespec_to_ops (&arg_cp) != NULL)
+ if (location != NULL
+ && event_location_type (location) == PROBE_LOCATION)
ops = &tracepoint_probe_breakpoint_ops;
else
ops = &tracepoint_breakpoint_ops;