summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/breakpoint.c10
-rw-r--r--gdb/linespec.c3
-rw-r--r--gdb/location.c8
-rw-r--r--gdb/location.h4
4 files changed, 6 insertions, 19 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 82937a3b78a..7e008ba87a4 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -8422,8 +8422,9 @@ create_breakpoints_sal (struct gdbarch *gdbarch,
/* Note that 'location' can be NULL in the case of a plain
'break', without arguments. */
location_spec_up locspec
- = (canonical->locspec != NULL
- ? copy_location_spec (canonical->locspec.get ()) : NULL);
+ = (canonical->locspec != nullptr
+ ? canonical->locspec->clone ()
+ : nullptr);
gdb::unique_xmalloc_ptr<char> filter_string
(lsal.canonical != NULL ? xstrdup (lsal.canonical) : NULL);
@@ -8924,7 +8925,7 @@ create_breakpoint (struct gdbarch *gdbarch,
{
std::unique_ptr <breakpoint> b = new_breakpoint_from_type (gdbarch,
type_wanted);
- b->locspec = copy_location_spec (locspec);
+ b->locspec = locspec->clone ();
if (parse_extra)
b->cond_string = NULL;
@@ -12029,8 +12030,7 @@ strace_marker_create_breakpoints_sal (struct gdbarch *gdbarch,
for (size_t i = 0; i < lsal.sals.size (); i++)
{
- location_spec_up locspec
- = copy_location_spec (canonical->locspec.get ());
+ location_spec_up locspec = canonical->locspec->clone ();
std::unique_ptr<tracepoint> tp
(new tracepoint (gdbarch,
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 063944bb9a1..f992477b1d6 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -3083,8 +3083,7 @@ location_spec_to_sals (linespec_parser *parser,
{
addr = linespec_expression_to_pc (&addr_string);
if (PARSER_STATE (parser)->canonical != NULL)
- PARSER_STATE (parser)->canonical->locspec
- = copy_location_spec (locspec);
+ PARSER_STATE (parser)->canonical->locspec = locspec->clone ();
}
else
addr = addr_spec->address;
diff --git a/gdb/location.c b/gdb/location.c
index 4d0b60ff9c7..19b58ab4f5b 100644
--- a/gdb/location.c
+++ b/gdb/location.c
@@ -355,14 +355,6 @@ explicit_location_spec::to_linespec () const
/* See description in location.h. */
-location_spec_up
-copy_location_spec (const location_spec *src)
-{
- return src->clone ();
-}
-
-/* See description in location.h. */
-
const char *
location_spec_to_string (struct location_spec *locspec)
{
diff --git a/gdb/location.h b/gdb/location.h
index 0a2f1799bc4..8275fa9c731 100644
--- a/gdb/location.h
+++ b/gdb/location.h
@@ -297,10 +297,6 @@ const explicit_location_spec *
explicit_location_spec *
as_explicit_location_spec (location_spec *locspec);
-/* Return a copy of the given SRC location spec. */
-
-extern location_spec_up copy_location_spec (const location_spec *src);
-
/* Attempt to convert the input string in *ARGP into a location_spec.
ARGP is advanced past any processed input. Always returns a non-nullptr
location_spec unique pointer object.