This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PING] [PATCH] Make skip without argument skip the current inline function
- From: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Simon Marchi <simark at simark dot ca>
- Date: Mon, 6 Jan 2020 08:07:54 +0000
- Subject: [PING] [PATCH] Make skip without argument skip the current inline function
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KcrboZLpkSS6riuvCBFJANfODYiLnDBy2o+iQxRdchw=; b=bfGyh+Xl1vpqiQQ5Xk51QC4MjO7CyxiTdlBnPYMyHXx0o8gHljTm0UFxAyazViAO7CdAnNFz700pT39LKvAQIse69NCZD+y/Mksc+xzA6hiFf0dCjmszo0RsTXJHViwRDM2jTlUzDRrqATtedUY22olSfJ76Sp6/I/ZuKmsLw9A4ktucCD46DGN9Q3FhFGcf7EWNk947HpANoQpl0H26K2NrMho/Y4xYGOsDEBhUkdkfubHSdqPe+GXjMgSWc1ddJs0Kak75tt6dtM7tVd8BstqVy6JOr1zI38eo0N4btVNMS5lQYCWj002k9QTJdNsgz8mQgmQTTpM8pFpZ5t86eg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hJogLjZWHKi/V52nYTO/u+hV3TwlrtQqLX6LQ9L3j0d2o0gvkShPhvFOd+S4zqHXV3Wjuc21kOA4y993s1AXHreubW37SidqPPG1qzlhq/HOy7IpZ6TLHZ8ORFHntoML38gPcIJAZ56xkopMvYm7SdnfwdeOSeCMFQwjoqnAxUT+Zicp/9M4CsBcqCJxql0r4bUtnTBX8rQTWcsoHtAog7IRfVUPlIGKaSThvRClFDp1QxxiXz31sycT6TVLE1oSoVr7OXy7XZ9x8aiwPbefQcUEpAHggtgRZ1g6J3x+WfMO6KfCQROXp63gv7tIHHoyMeWuOWPUcJJwWxuHfhakBQ==
- References: <AM0PR08MB37141AC1C52E85784FD4BD77E4250@AM0PR08MB3714.eurprd08.prod.outlook.com>
Hi,
I'd like to ping for this patch here:
https://sourceware.org/ml/gdb-patches/2019-12/msg01056.html
Thanks
Bernd.
On 12/28/19 2:30 PM, Bernd Edlinger wrote:
> Hi,
>
> this would in a way complete the skip inlined function feature.
> That is make the skip command, when used without arguments, figure
> out if there is an inlined function currently executing, and skip
> that in future.
>
> Well, not sure if that is worth a mention in the NEWS, maybe when the
> remaining patch 'Fix an issue with the gdb step-over aka. "n" command'
> which prevents accidentally stepping over a possibly skipped inline
> function accidentally to step back into the inline function again.
>
>
> gdb:
> 2019-12-28 Bernd Edlinger <bernd.edlinger@hotmail.de>
>
> * skip.c (skip_function_command): Make skip w/o arguments use the
> name of the inlined function if pc is inside any inlined function.
>
> gdb/testsuite:
> 2019-12-28 Bernd Edlinger <bernd.edlinger@hotmail.de>
>
> * gdb.base/skip-inline.exp: Extend test.
>
>
> Thanks
> Bernd.
>
>
> From 75d3db50829ceac30fd92124b2df9ea730bf71de Mon Sep 17 00:00:00 2001
> From: Bernd Edlinger <bernd.edlinger@hotmail.de>
> Date: Wed, 25 Dec 2019 16:35:32 +0100
> Subject: [PATCH] Make skip without argument skip the current inline function
>
> Previously always the outermost function block was used, but
> since skip is now able to skip over inline functions it is more
> natural to skip the inline function that the program is currently
> executing.
> ---
> gdb/skip.c | 17 +++++++----------
> gdb/testsuite/gdb.base/skip-inline.exp | 14 ++++++++++++++
> 2 files changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/gdb/skip.c b/gdb/skip.c
> index a869aaa..9f2e5c6 100644
> --- a/gdb/skip.c
> +++ b/gdb/skip.c
> @@ -209,18 +209,15 @@ skip_function_command (const char *arg, int from_tty)
> /* Default to the current function if no argument is given. */
> if (arg == NULL)
> {
> + frame_info *fi = get_selected_frame (_("No default function now."));
> + struct symbol *sym = get_frame_function (fi);
> const char *name = NULL;
> - CORE_ADDR pc;
>
> - if (!last_displayed_sal_is_valid ())
> - error (_("No default function now."));
> -
> - pc = get_last_displayed_addr ();
> - if (!find_pc_partial_function (pc, &name, NULL, NULL))
> - {
> - error (_("No function found containing current program point %s."),
> - paddress (get_current_arch (), pc));
> - }
> + if (sym != NULL)
> + name = sym->print_name ();
> + else
> + error (_("No function found containing current program point %s."),
> + paddress (get_current_arch (), get_frame_pc (fi)));
> skip_function (name);
> return;
> }
> diff --git a/gdb/testsuite/gdb.base/skip-inline.exp b/gdb/testsuite/gdb.base/skip-inline.exp
> index 4ab9ecf..c1a0556 100644
> --- a/gdb/testsuite/gdb.base/skip-inline.exp
> +++ b/gdb/testsuite/gdb.base/skip-inline.exp
> @@ -76,3 +76,17 @@ with_test_prefix "triple step" {
> gdb_test "step 3" ".*" "step over baz, again"
> gdb_test "bt" "\\s*\\#0\\s+main.*" "again back to main"
> }
> +
> +if ![runto_main] {
> + fail "can't run to main"
> + return
> +}
> +
> +gdb_test "skip delete" ".*" "skip delete"
> +
> +with_test_prefix "skip current frame" {
> + gdb_test "bt" "\\s*\\#0\\s+main.*" "in the main"
> + gdb_test "step" ".*" "step into foo"
> + gdb_test "bt" "\\s*\\#0\\s+foo.*" "in the foo"
> + gdb_test "skip" "Function foo will be skipped when stepping\." "skip"
> +}
>