aboutsummaryrefslogtreecommitdiff
path: root/gdb/location.h
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2016-02-09 10:02:53 -0800
committerKeith Seitz <keiths@redhat.com>2016-02-09 10:02:53 -0800
commiteeb1af437c6f1ca111bc31b63eefc5344b553681 (patch)
tree738acf4e476b72caadaaebddc064c4b217faccf3 /gdb/location.h
parent609332f15cc2ad651d0ebd573010595a4593e89a (diff)
downloadfsf-binutils-gdb-eeb1af437c6f1ca111bc31b63eefc5344b553681.zip
fsf-binutils-gdb-eeb1af437c6f1ca111bc31b63eefc5344b553681.tar.gz
fsf-binutils-gdb-eeb1af437c6f1ca111bc31b63eefc5344b553681.tar.bz2
Refactor string_to_event_location for legacy linespec support.
This patch refactors string_to_event_location, breaking it into two separate functions: 1) string_to_event_location_basic A "basic" string parser that implements support for "legacy" linespecs (linespec, address, and probe locations). This function is intended to be used by any UI wishing/needing to support this legacy behavior. 2) string_to_event_location This is now intended as a CLI-only function which adds explicit location parsing in a CLI-appropriate manner (in the form of traditional option/value pairs). Together these patches serve to simplify string-to-event location parsing for all existing non-CLI interfaces (MI, guile, and python). gdb/ChangeLog * location.c (string_to_explicit_location): Note that "-p" is reserved for probe locations and return NULL for any input that starts with that. (string_to_event_location): Move "legacy" linespec code to ... (string_to_event_location_basic): ... here. * location.h (string_to_event_location): Update comment. (string_to_event_location_basic): New function.
Diffstat (limited to 'gdb/location.h')
-rw-r--r--gdb/location.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/gdb/location.h b/gdb/location.h
index b2cf45e..8b19f34 100644
--- a/gdb/location.h
+++ b/gdb/location.h
@@ -207,12 +207,24 @@ extern struct event_location *
but invalid, input, e.g., if it is called with missing argument parameters
or invalid options.
- The return result must be freed with delete_event_location. */
+ The return result must be freed with delete_event_location.
+
+ This function is intended to be used by CLI commands and will parse
+ explicit locations in a CLI-centric way. Other interfaces should use
+ string_to_event_location_basic if they want to maintain support for
+ legacy specifications of probe, address, and linespec locations. */
extern struct event_location *
string_to_event_location (char **argp,
const struct language_defn *langauge);
+/* Like string_to_event_location, but does not attempt to parse explicit
+ locations. */
+
+extern struct event_location *
+ string_to_event_location_basic (char **argp,
+ const struct language_defn *language);
+
/* Attempt to convert the input string in *ARGP into an explicit location.
ARGP is advanced past any processed input. Returns an event_location
(malloc'd) if an explicit location was successfully found in *ARGP,