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/python/python.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gdb/python/python.c') diff --git a/gdb/python/python.c b/gdb/python/python.c index 7faad2b..8f526bb 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -868,7 +868,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args) const char *arg = NULL; gdbpy_ref<> result; gdbpy_ref<> unparsed; - event_location_up location; + location_spec_up locspec; if (! PyArg_ParseTuple (args, "|s", &arg)) return NULL; @@ -883,17 +883,17 @@ gdbpy_decode_line (PyObject *self, PyObject *args) } if (arg != NULL) - location = string_to_event_location_basic (&arg, current_language, - symbol_name_match_type::WILD); + locspec = string_to_location_spec_basic (&arg, current_language, + symbol_name_match_type::WILD); std::vector decoded_sals; symtab_and_line def_sal; gdb::array_view sals; try { - if (location != NULL) + if (locspec != NULL) { - decoded_sals = decode_line_1 (location.get (), 0, NULL, NULL, 0); + decoded_sals = decode_line_1 (locspec.get (), 0, NULL, NULL, 0); sals = decoded_sals; } else -- cgit v1.1