From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 7AD6A385842B; Fri, 29 Apr 2022 22:24:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AD6A385842B 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] Merge probe and ordinary tracepoints X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 5d926615e9684d1f9a95801106300ade64548dcc X-Git-Newrev: 8d89123dc22188d5560f452bc52baba50d154a91 Message-Id: <20220429222411.7AD6A385842B@sourceware.org> Date: Fri, 29 Apr 2022 22:24:11 +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, 29 Apr 2022 22:24:11 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D8d89123dc221= 88d5560f452bc52baba50d154a91 commit 8d89123dc22188d5560f452bc52baba50d154a91 Author: Tom Tromey Date: Sun Jan 16 17:27:00 2022 -0700 Merge probe and ordinary tracepoints =20 Right now, probe tracepoints are handled by a separate ops object. However, they differ only in a small way from ordinary tracepoints, and furthermore can be distinguished by their event location. =20 This patch merges the two cases, just as was done for breakpoints. Diff: --- gdb/breakpoint.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index c7fa53c53e2..ecea7024624 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -12273,6 +12273,9 @@ std::vector tracepoint::decode_location (struct event_location *location, struct program_space *search_pspace) { + if (event_location_type (location) =3D=3D PROBE_LOCATION) + return bkpt_probe_decode_location (this, location, search_pspace); + return decode_location_default (this, location, search_pspace); } =20 @@ -12288,15 +12291,6 @@ tracepoint_probe_create_sals_from_location bkpt_probe_create_sals_from_location (location, canonical, type_wanted); } =20 -static std::vector -tracepoint_probe_decode_location (struct breakpoint *b, - struct event_location *location, - struct program_space *search_pspace) -{ - /* We use the same method for breakpoint on probes. */ - return bkpt_probe_decode_location (b, location, search_pspace); -} - void dprintf_breakpoint::re_set () { @@ -14582,7 +14576,6 @@ initialize_breakpoint_ops (void) ops =3D &tracepoint_probe_breakpoint_ops; *ops =3D vtable_breakpoint_ops; ops->create_sals_from_location =3D tracepoint_probe_create_sals_from_loc= ation; - ops->decode_location =3D tracepoint_probe_decode_location; =20 /* Static tracepoints with marker (`-m'). */ ops =3D &strace_marker_breakpoint_ops;