From: Simon Sobisch <simonsobisch@gnu.org>
To: Chris Packham <judge.packham@gmail.com>
Cc: GDB Mailing list <gdb@sourceware.org>
Subject: Re: Is there an option to "silent-step"/ "silent-next" (possibly in python and/or mi)?
Date: Thu, 9 Feb 2023 09:36:25 +0100 [thread overview]
Message-ID: <9b4d3553-5f20-5ba1-8cdf-0d7d213695a9@gnu.org> (raw)
In-Reply-To: <CAFOYHZAmqoJ40bGxkiP3roE3WUZoyeO4jTWTX9MiomoNyk6zXQ@mail.gmail.com>
Thank you for taking care!
When doing everything "manually" then 'skip' helps a lot - but the case
is something like the following:
#line source.c 550
{
int somevar;
#line source.y 12
int interesting = some_call ();
#line source.c 560
morecode();
morecode_calling_code_in_source_y_at_line_55();
morecode();
morecode();
#line source.y 13
another_call ();
the goal is to "step" from source.y line 12 into some_call(), but when
returning back "stepping over" everything until we are "withing"
morecode_calling_code_in_source_y_at_line_55 and when coming back reach
another_call(), without knowing what code is between. It may consist of
several lines or none, consist of several function code, inline
assembler, ...
If done "automatically" with a defined command (in my case with python)
then I can "see" that those lines are not part of "source.y" and can go
on stepping, skipping would not be possible as the called functions may
be in the same source, too.
The problem is that on each "step" there's an event that leads to the
Debugger showing the source I'm not interested in.
Simon
Am 09.02.2023 um 08:00 schrieb Chris Packham:
>
>
> On Thu, 9 Feb 2023, 2:44 AM Simon Sobisch via Gdb, <gdb@sourceware.org
> <mailto:gdb@sourceware.org>> wrote:
>
> For "stepping in the current source" (given a mixed-source) I look
> for a
> way to "silent step" / "silent next".
> This will be useful for example if you debug within Bison and/or Flex
> generated sources and don't want to step through the state / token
> machine, having only the Bison / Flex _source_ be visible.
>
> Getting the source name from the frame and comparing this after a
> step/next is no big problem in GDB using python
> gdb.selected_frame().find_sal().symtab.fullname()
>
> Using GDB in TUI mode I commonly "stay" in the source I'm interested in
> this way, but the GDB command line gets "flooded" with all the
> intermediate frame positions I'm not interested in.
>
> So: is there a way to do a "step"/"next" with suppressing the normal
> output and mi stop events normally send?
>
> Thank you for any pointers,
> Simon
>
>
> Does the `skip` command do what you want? I use it for skipping
> uninteresting things like memset() or printf() when stepping.
>
next prev parent reply other threads:[~2023-02-09 8:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 13:44 Simon Sobisch
2023-02-09 7:00 ` Chris Packham
2023-02-09 8:36 ` Simon Sobisch [this message]
2023-02-10 16:59 ` Tom Tromey
2023-02-12 12:38 ` Philippe Waroquiers
2023-02-12 14:46 ` Tom Tromey
2023-02-12 17:22 ` Philippe Waroquiers
2023-02-13 7:38 ` Aktemur, Tankut Baris
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=9b4d3553-5f20-5ba1-8cdf-0d7d213695a9@gnu.org \
--to=simonsobisch@gnu.org \
--cc=gdb@sourceware.org \
--cc=judge.packham@gmail.com \
/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).