summaryrefslogtreecommitdiff
path: root/gdb/location.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/location.h')
-rw-r--r--gdb/location.h28
1 files changed, 10 insertions, 18 deletions
diff --git a/gdb/location.h b/gdb/location.h
index c6e1402d762..ff21c1c21cc 100644
--- a/gdb/location.h
+++ b/gdb/location.h
@@ -109,16 +109,10 @@ struct explicit_location
extern enum event_location_type
event_location_type (const struct event_location *);
-/* Return a malloc'd explicit string representation of the given
- explicit location. The location must already be canonicalized/valid. */
+/* Return a linespec string representation of the given explicit
+ location. The location must already be canonicalized/valid. */
-extern char *
- explicit_location_to_string (const struct explicit_location *explicit_loc);
-
-/* Return a malloc'd linespec string representation of the given
- explicit location. The location must already be canonicalized/valid. */
-
-extern char *
+extern std::string
explicit_location_to_linespec (const struct explicit_location *explicit_loc);
/* Return a string representation of the LOCATION.
@@ -175,7 +169,7 @@ extern const char *
/* Create a new probe location. */
-extern event_location_up new_probe_location (const char *probe);
+extern event_location_up new_probe_location (std::string &&probe);
/* Return the probe location (a string) of the given event_location
(which must be of type PROBE_LOCATION). */
@@ -211,12 +205,11 @@ extern event_location_up
copy_event_location (const struct event_location *src);
/* Attempt to convert the input string in *ARGP into an event_location.
- ARGP is advanced past any processed input. Returns an event_location
- (malloc'd) if an event location was successfully found in *ARGP,
- NULL otherwise.
+ ARGP is advanced past any processed input. Always returns a non-nullptr
+ event_location unique pointer object.
- This function may call error() if *ARGP looks like properly formed,
- but invalid, input, e.g., if it is called with missing argument parameters
+ This function may call error() if *ARGP looks like properly formed, but
+ invalid, input, e.g., if it is called with missing argument parameters
or invalid options.
This function is intended to be used by CLI commands and will parse
@@ -281,11 +274,10 @@ extern event_location_up
extern int event_location_empty_p (const struct event_location *location);
-/* Set the location's string representation. If STRING is NULL, clear
- the string representation. */
+/* Set the location's string representation. */
extern void
set_event_location_string (struct event_location *location,
- const char *string);
+ std::string &&string);
#endif /* LOCATION_H */