aboutsummaryrefslogtreecommitdiff
path: root/gdb/location.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-01-14 07:24:18 -0700
committerTom Tromey <tom@tromey.com>2022-01-18 10:00:00 -0700
commitdab863ef408588aba1c396901e3e5070948d2047 (patch)
tree9ce96ef1d6d47d125ba54fd3d235f4d41d2eb281 /gdb/location.h
parente53c95d40b128a1e794b27ec8b166ae1445356eb (diff)
downloadfsf-binutils-gdb-dab863ef408588aba1c396901e3e5070948d2047.zip
fsf-binutils-gdb-dab863ef408588aba1c396901e3e5070948d2047.tar.gz
fsf-binutils-gdb-dab863ef408588aba1c396901e3e5070948d2047.tar.bz2
Remove a use of xfree in location.c
This small cleanup removes a use of xfree from location.c, by switching to unique_xmalloc_ptr. One function is only used in location.c, so it is made static. And, another function is changed to avoid a copy.
Diffstat (limited to 'gdb/location.h')
-rw-r--r--gdb/location.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/gdb/location.h b/gdb/location.h
index c6e1402..b391ce3 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 gdb::unique_xmalloc_ptr<char>
explicit_location_to_linespec (const struct explicit_location *explicit_loc);
/* Return a string representation of the LOCATION.
@@ -286,6 +280,6 @@ extern int event_location_empty_p (const struct event_location *location);
extern void
set_event_location_string (struct event_location *location,
- const char *string);
+ gdb::unique_xmalloc_ptr<char> string);
#endif /* LOCATION_H */