aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-cmds.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2022-05-23 20:15:18 +0100
committerPedro Alves <pedro@palves.net>2022-06-17 09:41:24 +0100
commit264f98902f27497f7494933628b0f5c4e117fe59 (patch)
tree7a56e489f4441c3132a4d2b0b636a64ace58cd7c /gdb/cli/cli-cmds.c
parent14e283ff4e0656327179a5b69954796af3807b66 (diff)
downloadgdb-264f98902f27497f7494933628b0f5c4e117fe59.zip
gdb-264f98902f27497f7494933628b0f5c4e117fe59.tar.gz
gdb-264f98902f27497f7494933628b0f5c4e117fe59.tar.bz2
event_location -> location_spec
Currently, GDB internally uses the term "location" for both the location specification the user input (linespec, explicit location, or an address location), and for actual resolved locations, like the breakpoint locations, or the result of decoding a location spec to SaLs. This is expecially confusing in the breakpoints module, as struct breakpoint has these two fields: breakpoint::location; breakpoint::loc; "location" is the location spec, and "loc" is the resolved locations. And then, we have a method called "locations()", which returns the resolved locations as range... The location spec type is presently called event_location: /* Location we used to set the breakpoint. */ event_location_up location; and it is described like this: /* The base class for all an event locations used to set a stop event in the inferior. */ struct event_location { and even that is incorrect... Location specs are used for finding actual locations in the program in scenarios that have nothing to do with stop events. E.g., "list" works with location specs. To clean all this confusion up, this patch renames "event_location" to "location_spec" throughout, and then all the variables that hold a location spec, they are renamed to include "spec" in their name, like e.g., "location" -> "locspec". Similarly, functions that work with location specs, and currently have just "location" in their name are renamed to include "spec" in their name too. Change-Id: I5814124798aa2b2003e79496e78f95c74e5eddca
Diffstat (limited to 'gdb/cli/cli-cmds.c')
-rw-r--r--gdb/cli/cli-cmds.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 31911eb..18fb6e6 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -970,13 +970,13 @@ edit_command (const char *arg, int from_tty)
/* Now should only be one argument -- decode it in SAL. */
arg1 = arg;
- event_location_up location = string_to_event_location (&arg1,
- current_language);
+ location_spec_up locspec = string_to_location_spec (&arg1,
+ current_language);
if (*arg1)
error (_("Junk at end of line specification."));
- std::vector<symtab_and_line> sals = decode_line_1 (location.get (),
+ std::vector<symtab_and_line> sals = decode_line_1 (locspec.get (),
DECODE_LINE_LIST_MODE,
NULL, NULL, 0);
@@ -1241,18 +1241,18 @@ list_command (const char *arg, int from_tty)
dummy_beg = 1;
else
{
- event_location_up location = string_to_event_location (&arg1,
- current_language);
-
- /* We know that the ARG string is not empty, yet the attempt to parse
- a location from the string consumed no characters. This most
- likely means that the first thing in ARG looks like a location
- condition, and so the string_to_event_location call stopped
- parsing. */
+ location_spec_up locspec
+ = string_to_location_spec (&arg1, current_language);
+
+ /* We know that the ARG string is not empty, yet the attempt to
+ parse a location spec from the string consumed no characters.
+ This most likely means that the first thing in ARG looks like
+ a location spec condition, and so the string_to_location_spec
+ call stopped parsing. */
if (arg1 == arg)
error (_("Junk at end of line specification."));
- sals = decode_line_1 (location.get (), DECODE_LINE_LIST_MODE,
+ sals = decode_line_1 (locspec.get (), DECODE_LINE_LIST_MODE,
NULL, NULL, 0);
filter_sals (sals);
if (sals.empty ())
@@ -1297,17 +1297,17 @@ list_command (const char *arg, int from_tty)
know it was ambiguous. */
const char *end_arg = arg1;
- event_location_up location
- = string_to_event_location (&arg1, current_language);
+ location_spec_up locspec
+ = string_to_location_spec (&arg1, current_language);
if (*arg1)
error (_("Junk at end of line specification."));
std::vector<symtab_and_line> sals_end
= (dummy_beg
- ? decode_line_1 (location.get (), DECODE_LINE_LIST_MODE,
+ ? decode_line_1 (locspec.get (), DECODE_LINE_LIST_MODE,
NULL, NULL, 0)
- : decode_line_1 (location.get (), DECODE_LINE_LIST_MODE,
+ : decode_line_1 (locspec.get (), DECODE_LINE_LIST_MODE,
NULL, sal.symtab, sal.line));
filter_sals (sals_end);