From: Pedro Alves <pedro@palves.net>
To: gdb-patches@sourceware.org
Subject: [PATCH 4/7] Convert location_spec_empty_p to a method
Date: Fri, 27 May 2022 19:02:45 +0100 [thread overview]
Message-ID: <20220527180248.2990723-5-pedro@palves.net> (raw)
In-Reply-To: <20220527180248.2990723-1-pedro@palves.net>
This converts location_spec_empty_p to a method of location_spec,
simplifying users, as they no longer have to use
std::unique_ptr::get().
Change-Id: I83381a729896f12e1c5a1b4d6d4c2eb1eb6582ff
---
gdb/breakpoint.c | 3 +--
gdb/location.c | 10 +---------
gdb/location.h | 4 ----
3 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 403b70067d7..ea54c6c161b 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3699,8 +3699,7 @@ create_exception_master_breakpoint (void)
static int
breakpoint_location_spec_empty_p (const struct breakpoint *b)
{
- return (b->locspec != nullptr
- && location_spec_empty_p (b->locspec.get ()));
+ return (b->locspec != nullptr && b->locspec->empty_p ());
}
void
diff --git a/gdb/location.c b/gdb/location.c
index 19b58ab4f5b..ae056f35296 100644
--- a/gdb/location.c
+++ b/gdb/location.c
@@ -855,7 +855,7 @@ string_to_location_spec (const char **stringp,
/* If the user really specified a location spec, then we're
done. */
- if (!location_spec_empty_p (locspec.get ()))
+ if (!locspec->empty_p ())
return locspec;
/* Otherwise, the user _only_ specified optional flags like
@@ -876,14 +876,6 @@ string_to_location_spec (const char **stringp,
/* See description in location.h. */
-int
-location_spec_empty_p (const location_spec *locspec)
-{
- return locspec->empty_p ();
-}
-
-/* See description in location.h. */
-
void
set_location_spec_string (struct location_spec *locspec,
std::string &&string)
diff --git a/gdb/location.h b/gdb/location.h
index f52469d770f..2b825ef0cb0 100644
--- a/gdb/location.h
+++ b/gdb/location.h
@@ -363,10 +363,6 @@ extern location_spec_up
const struct language_defn *language,
explicit_completion_info *completion_info);
-/* A convenience function for testing for unset location specs. */
-
-extern int location_spec_empty_p (const location_spec *locspec);
-
/* Set the location specs's string representation. */
extern void set_location_spec_string (struct location_spec *locspec,
--
2.36.0
next prev parent reply other threads:[~2022-05-27 18:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 18:02 [PATCH 0/7] location -> location spec Pedro Alves
2022-05-27 18:02 ` [PATCH 1/7] event_location -> location_spec Pedro Alves
2022-05-28 10:08 ` Philippe Waroquiers
2022-05-30 15:02 ` Pedro Alves
2022-05-27 18:02 ` [PATCH 2/7] Eliminate the two-level data structures behind location_specs Pedro Alves
2022-05-30 15:09 ` Pedro Alves
2022-05-27 18:02 ` [PATCH 3/7] Eliminate copy_location_spec Pedro Alves
2022-05-27 18:02 ` Pedro Alves [this message]
2022-05-27 18:02 ` [PATCH 5/7] Convert location_spec_type to a method Pedro Alves
2022-05-27 18:02 ` [PATCH 6/7] Convert location_spec_to_string " Pedro Alves
2022-05-27 18:02 ` [PATCH 7/7] Convert set_location_spec_string " Pedro Alves
2022-05-30 15:20 ` Pedro Alves
2022-06-15 19:47 ` [PATCH 0/7] location -> location spec Tom Tromey
2022-06-17 9:24 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220527180248.2990723-5-pedro@palves.net \
--to=pedro@palves.net \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).