This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PING**2] [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: Sun, 12 Jan 2020 08:13:21 +0000
- Subject: [PING**2] [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=xVkwrsXUCAiGjTEybA4DO9hd3CrFNQRFfn9xHvBojOY=; b=dH8ZO4De9jUJHQXKJMhcKUfwlc0ehZPqnY5GEyXlOzVPiCLCSvCNfGUEIJyKFSkQ14aUNbrNtakUziYHmAeSatV8UfqtltAsfQCKU4HSJifetSxGjXPxQE+AxLMlftZzGQ5XZOYEe99Q/BwdFRiKryRKL9U9CweGpcMnoWk3liVtgcceHNGmjYvl18YOItQAtNYAOvuGpcI58NvPB8YELljfKJrbNADax39+O0l/jg3rBK0oEG73AaGGaM+qD5T15Up4OQEwIUqcn3e8I8aUCNajXRPwEns4qyxvyi0AfIwp0BL4BayZd5oJKE8OtfcCq6+ov+x5UrUZ101rYHjbhA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hSajm8nMBVUP2K7EC58C8w4zdYmwztnlCijM5N5UwQuVfxpnNqcxuzSekZ/mvm5oG+Mf3xhJQL3Z3I4Lzab1SOkDXfQ6Jujt3h2O3/hSF90Wkn83N1vl39/zoL8Ex+yX2y6Qu9dxeCbg+U1K4kHnnHPj+PY52hpSRbge0J035Pj+ssAhbZsAQzlIDrttlw4bb+n/ciYRVIMUwl+L3ls16G1HZR0kiGTcP1L52oDqJ+qCnG5Cg9aoQcRRI8+MCVV0f7/aa/Nh9lIEAbbDYAH1i+HUyv1eidC3svnHxgIoF07hVTjhmBkRzxUBQ/Ms8gIu+uSeGsZiEPxT+Pz5uc267Q==
- References: <AM0PR08MB37141AC1C52E85784FD4BD77E4250@AM0PR08MB3714.eurprd08.prod.outlook.com> <AM0PR08MB3714BE8E6F199CCF30FCB59AE43C0@AM0PR08MB3714.eurprd08.prod.outlook.com>
Ping...
On 1/6/20 9:07 AM, Bernd Edlinger wrote:
> 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"
>> +}
>>