From: Tom de Vries <tdevries@suse.de>
To: Simon Marchi <simark@simark.ca>,
Bruno Larsen <blarsen@redhat.com>,
gdb-patches@sourceware.org
Subject: Re: [PATCH v4 2/2] gdb/reverse: Fix stepping over recursive functions
Date: Tue, 25 Oct 2022 18:22:30 +0200 [thread overview]
Message-ID: <d4575b12-fd39-4b73-fd06-c901788062e7@suse.de> (raw)
In-Reply-To: <95cc9197-e54a-f6ea-8092-d6d0063c58a3@simark.ca>
On 10/25/22 16:55, Simon Marchi via Gdb-patches wrote:
> On 10/5/22 06:38, Bruno Larsen via Gdb-patches wrote:
>> Currently, when using GDB to do reverse debugging, if we try to use the
>> command "reverse next" to skip a recursive function, instead of skipping
>> all of the recursive calls and stopping in the previous line, we stop at
>> the second to last recursive call, and need to manually step backwards
>> until we leave the first call. This is well documented in PR gdb/16678.
>>
>> This bug happens because when GDB notices that a reverse step has
>> entered into a function, GDB will add a step_resume_breakpoint at the
>> start of the function, then single step out of the prologue once that
>> breakpoint is hit. The problem was happening because GDB wouldn't give
>> that step_resume_breakpoint a frame-id, so the first time the breakpoint
>> was hit, the inferior would be stopped. This is fixed by giving the
>> current frame-id to the breakpoint.
>>
>> This commit also changes gdb.reverse/step-reverse.c to contain a
>> recursive function and attempt to both, skip it altogether, and to skip
>> the second call from inside the first call, as this setup broke a
>> previous version of the patch.
>> ---
>> gdb/infrun.c | 2 +-
>> gdb/testsuite/gdb.reverse/step-precsave.exp | 6 ++-
>> gdb/testsuite/gdb.reverse/step-reverse.c | 19 ++++++-
>> gdb/testsuite/gdb.reverse/step-reverse.exp | 55 +++++++++++++++++++--
>> 4 files changed, 74 insertions(+), 8 deletions(-)
>
> Hi Bruno,
>
> I see these failures since this commit:
>
> $ make check TESTS="gdb.reverse/step-reverse.exp" RUNTESTFLAGS="--target_board=native-gdbserver"
> FAIL: gdb.reverse/step-reverse.exp: reverse next over recursion again
> FAIL: gdb.reverse/step-reverse.exp: enter recursive function
> FAIL: gdb.reverse/step-reverse.exp: step over recursion inside the recursion
>
On aarch64, I ran into another regression due to this commit (test-case
gdb.reverse/solib-precsave.exp), filed as
https://sourceware.org/bugzilla/show_bug.cgi?id=29721 .
Thanks,
- Tom
next prev parent reply other threads:[~2022-10-25 16:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 10:38 [PATCH v4 0/2] Fix reverse nexting over recursions Bruno Larsen
2022-10-05 10:38 ` [PATCH v4 1/2] Change calculation of frame_id by amd64 epilogue unwinder Bruno Larsen
2022-10-25 13:44 ` Simon Marchi
2022-10-25 13:51 ` Bruno Larsen
2022-10-25 13:59 ` Simon Marchi
2022-10-25 14:13 ` Bruno Larsen
2022-10-25 14:37 ` Simon Marchi
2022-10-05 10:38 ` [PATCH v4 2/2] gdb/reverse: Fix stepping over recursive functions Bruno Larsen
2022-10-25 14:55 ` Simon Marchi
2022-10-25 16:22 ` Tom de Vries [this message]
2022-11-02 17:03 ` Bruno Larsen
2022-11-02 17:46 ` Simon Marchi
2022-11-03 9:08 ` [PATCH] gdb/testsuite: add KFAILs to gdb.reverse/step-reverse.exp Bruno Larsen
2022-11-03 13:06 ` Simon Marchi
2022-11-03 14:30 ` [PATCHv2] " Bruno Larsen
2022-11-03 16:59 ` Simon Marchi
2022-11-04 11:06 ` Bruno Larsen
2022-10-20 7:42 ` [PING][PATCH v4 0/2] Fix reverse nexting over recursions Bruno Larsen
2022-10-20 18:56 ` Tom Tromey
2022-10-21 10:50 ` Bruno Larsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d4575b12-fd39-4b73-fd06-c901788062e7@suse.de \
--to=tdevries@suse.de \
--cc=blarsen@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).