From 264f98902f27497f7494933628b0f5c4e117fe59 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 23 May 2022 20:15:18 +0100 Subject: 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 --- gdb/linespec.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gdb/linespec.h') diff --git a/gdb/linespec.h b/gdb/linespec.h index bb89755..9d3e84d 100644 --- a/gdb/linespec.h +++ b/gdb/linespec.h @@ -70,9 +70,9 @@ struct linespec_result object. */ bool pre_expanded = false; - /* If PRE_EXPANDED is non-zero, this is set to the location entered - by the user. */ - event_location_up location; + /* If PRE_EXPANDED is true, this is set to the location spec + entered by the user. */ + location_spec_up locspec; /* The sals. The vector will be freed by the destructor. */ std::vector lsals; @@ -81,11 +81,11 @@ struct linespec_result /* Decode a linespec using the provided default symtab and line. */ extern std::vector - decode_line_1 (const struct event_location *location, int flags, + decode_line_1 (const location_spec *locspec, int flags, struct program_space *search_pspace, struct symtab *default_symtab, int default_line); -/* Parse LOCATION and return results. This is the "full" +/* Parse LOCSPEC and return results. This is the "full" interface to this module, which handles multiple results properly. @@ -124,7 +124,7 @@ extern std::vector strcmp sense) to FILTER will be returned; all others will be filtered out. */ -extern void decode_line_full (struct event_location *location, int flags, +extern void decode_line_full (struct location_spec *locspec, int flags, struct program_space *search_pspace, struct symtab *default_symtab, int default_line, struct linespec_result *canonical, -- cgit v1.1