Re: Is there an option to "silent-step"/ "silent-next" (possibly in python and/or mi)?

Simon Sobisch via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
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, <[email protected] 
> <mailto:[email protected]>> 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.
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.