aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-12-10 07:22:07 -0700
committerTom Tromey <tom@tromey.com>2023-12-13 14:12:52 -0700
commite7cdec6605837a5b79442fc06bd66d6372025040 (patch)
treef96afe68afb3f01f15fb2659ba78dd042818bf43 /gdb/breakpoint.c
parent63fc64a8d0ea8cb0bce0137db68503a75a6ecfe4 (diff)
downloadfsf-binutils-gdb-e7cdec6605837a5b79442fc06bd66d6372025040.zip
fsf-binutils-gdb-e7cdec6605837a5b79442fc06bd66d6372025040.tar.gz
fsf-binutils-gdb-e7cdec6605837a5b79442fc06bd66d6372025040.tar.bz2
Use unique_xmalloc_ptr in linespec_location_spec
This changes linespec_location_spec to use unique_xmalloc_ptr, removing some manual memory management. Reviewed-By: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 699919e..957bef2 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -8835,7 +8835,8 @@ parse_breakpoint_sals (location_spec *locspec,
if (locspec->type () == LINESPEC_LOCATION_SPEC)
{
- const char *spec = as_linespec_location_spec (locspec)->spec_string;
+ const char *spec
+ = as_linespec_location_spec (locspec)->spec_string.get ();
if (spec == NULL)
{
@@ -8886,7 +8887,7 @@ parse_breakpoint_sals (location_spec *locspec,
const char *spec = NULL;
if (locspec->type () == LINESPEC_LOCATION_SPEC)
- spec = as_linespec_location_spec (locspec)->spec_string;
+ spec = as_linespec_location_spec (locspec)->spec_string.get ();
if (!cursal.symtab
|| (spec != NULL
@@ -12474,7 +12475,7 @@ strace_marker_create_sals_from_location_spec (location_spec *locspec,
struct linespec_sals lsal;
const char *arg_start, *arg;
- arg = arg_start = as_linespec_location_spec (locspec)->spec_string;
+ arg = arg_start = as_linespec_location_spec (locspec)->spec_string.get ();
lsal.sals = decode_static_tracepoint_spec (&arg);
std::string str (arg_start, arg - arg_start);
@@ -12541,7 +12542,7 @@ std::vector<symtab_and_line>
static_marker_tracepoint::decode_location_spec (location_spec *locspec,
program_space *search_pspace)
{
- const char *s = as_linespec_location_spec (locspec)->spec_string;
+ const char *s = as_linespec_location_spec (locspec)->spec_string.get ();
std::vector<symtab_and_line> sals = decode_static_tracepoint_spec (&s);
if (sals.size () > static_trace_marker_id_idx)