From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 1BFD83858D39; Tue, 4 Oct 2022 23:42:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BFD83858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664926951; bh=IRcuX6ot5MUqunRPc7eM446d1wzQ3qnncKhhzq9YxB4=; h=From:To:Subject:Date:From; b=M63k2cPgdG3RZWNEKAzx5i3SIIOQhvslCRuhaBDvmeZjQ+Tfvz66BRdSY4BIhTN7c VTE4Ppv03CQnFj0ZmRbPXfFdzlFhMVoCXbqEiBzTiT6DgaTqgqF3CxPKQ42rdCXJI8 5SMGhrvhvgE8KGfCVjPmyVxXfESrVwqdrFso7SdU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Remove decode_location_spec_default X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 27e602128ba5a8b8c0e457c1812721c8dca612c4 X-Git-Newrev: 8f5bc64185aafbc6ec26c889bc67367600fc027e Message-Id: <20221004234231.1BFD83858D39@sourceware.org> Date: Tue, 4 Oct 2022 23:42:31 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D8f5bc64185aa= fbc6ec26c889bc67367600fc027e commit 8f5bc64185aafbc6ec26c889bc67367600fc027e Author: Tom Tromey Date: Thu Sep 29 17:16:04 2022 -0600 Remove decode_location_spec_default =20 This removes decode_location_spec_default, inlining it into its sole caller. =20 Regression tested on x86-64 Fedora 34. Diff: --- gdb/breakpoint.c | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 002f4a935b1..c8c34120aa0 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -100,10 +100,6 @@ static void create_breakpoints_sal (struct gdbarch *, int, int, int, int, unsigned); =20 -static std::vector decode_location_spec_default - (struct breakpoint *b, struct location_spec *locspec, - struct program_space *search_pspace); - static int can_use_hardware_watchpoint (const std::vector &vals); =20 @@ -11692,7 +11688,21 @@ code_breakpoint::decode_location_spec (location_sp= ec *locspec, if (locspec->type () =3D=3D PROBE_LOCATION_SPEC) return bkpt_probe_decode_location_spec (this, locspec, search_pspace); =20 - return decode_location_spec_default (this, locspec, search_pspace); + struct linespec_result canonical; + + decode_line_full (locspec, DECODE_LINE_FUNFIRSTLINE, search_pspace, + NULL, 0, &canonical, multiple_symbols_all, + filter.get ()); + + /* We should get 0 or 1 resulting SALs. */ + gdb_assert (canonical.lsals.size () < 2); + + if (!canonical.lsals.empty ()) + { + const linespec_sals &lsal =3D canonical.lsals[0]; + return std::move (lsal.sals); + } + return {}; } =20 /* Virtual table for internal breakpoints. */ @@ -12750,31 +12760,6 @@ create_sals_from_location_spec_default (location_s= pec *locspec, parse_breakpoint_sals (locspec, canonical); } =20 -/* Decode the line represented by S by calling decode_line_full. This is = the - default function for the `decode_location' method of breakpoint_ops. */ - -static std::vector -decode_location_spec_default (struct breakpoint *b, - location_spec *locspec, - program_space *search_pspace) -{ - struct linespec_result canonical; - - decode_line_full (locspec, DECODE_LINE_FUNFIRSTLINE, search_pspace, - NULL, 0, &canonical, multiple_symbols_all, - b->filter.get ()); - - /* We should get 0 or 1 resulting SALs. */ - gdb_assert (canonical.lsals.size () < 2); - - if (!canonical.lsals.empty ()) - { - const linespec_sals &lsal =3D canonical.lsals[0]; - return std::move (lsal.sals); - } - return {}; -} - /* Reset a breakpoint. */ =20 static void