From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1551) id 85A4A3858292; Fri, 17 Jun 2022 09:23:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85A4A3858292 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pedro Alves To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Convert location_spec_empty_p to a method X-Act-Checkin: binutils-gdb X-Git-Author: Pedro Alves X-Git-Refname: refs/heads/master X-Git-Oldrev: 5c1ddcb69a01c3d4985ecffbbab126a4e8cd4e33 X-Git-Newrev: 238dc9af03392ecd8129ee54a340efd736782cf9 Message-Id: <20220617092330.85A4A3858292@sourceware.org> Date: Fri, 17 Jun 2022 09:23:30 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2022 09:23:30 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D238dc9af0339= 2ecd8129ee54a340efd736782cf9 commit 238dc9af03392ecd8129ee54a340efd736782cf9 Author: Pedro Alves Date: Fri May 27 16:28:29 2022 +0100 Convert location_spec_empty_p to a method =20 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(). =20 Change-Id: I83381a729896f12e1c5a1b4d6d4c2eb1eb6582ff Diff: --- 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 7e008ba87a4..bfa9e68fdbe 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 !=3D nullptr - && location_spec_empty_p (b->locspec.get ())); + return (b->locspec !=3D nullptr && b->locspec->empty_p ()); } =20 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, =20 /* 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; =20 /* Otherwise, the user _only_ specified optional flags like @@ -876,14 +876,6 @@ string_to_location_spec (const char **stringp, =20 /* See description in location.h. */ =20 -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 8275fa9c731..f3b63320c2e 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); =20 -/* 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. */ =20 extern void set_location_spec_string (struct location_spec *locspec,