public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* feature request: set step-mode smart
@ 2012-04-21 11:07 Ilya Basin
  2012-04-25  3:20 ` Sergio Durigan Junior
  0 siblings, 1 reply; 6+ messages in thread
From: Ilya Basin @ 2012-04-21 11:07 UTC (permalink / raw)
  To: gdb

Hi! Sometimes you need to step into a function that is called via a
jump table. In this case gdb behaves inconveniently:
Either you leave default step-mode and gdb can't step into that
function or you set step-mode on and gdb will step into all functions
without sources.

I think, gdb should try to stepi a fixed number of instructions (~100)
searching for a code line and if not found, step out.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: feature request: set step-mode smart
  2012-04-21 11:07 feature request: set step-mode smart Ilya Basin
@ 2012-04-25  3:20 ` Sergio Durigan Junior
  2012-04-25  9:44   ` Jonas Maebe
  0 siblings, 1 reply; 6+ messages in thread
From: Sergio Durigan Junior @ 2012-04-25  3:20 UTC (permalink / raw)
  To: Ilya Basin; +Cc: gdb

On Saturday, April 21 2012, Ilya Basin wrote:

> Hi! Sometimes you need to step into a function that is called via a
> jump table. In this case gdb behaves inconveniently:
> Either you leave default step-mode and gdb can't step into that
> function or you set step-mode on and gdb will step into all functions
> without sources.
>
> I think, gdb should try to stepi a fixed number of instructions (~100)
> searching for a code line and if not found, step out.

Hello Ilya,

Thanks for the message.  Could you please also create an entry in the
GDB Bugzilla as well?  The link is http://sourceware.org/bugzilla/

This is not a guarantee that someone will actually implement this
request, but at least we can keep a record of such things.

Thanks.

-- 
Sergio

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: feature request: set step-mode smart
  2012-04-25  3:20 ` Sergio Durigan Junior
@ 2012-04-25  9:44   ` Jonas Maebe
  2012-04-25 10:08     ` Re[2]: " Ilya Basin
  0 siblings, 1 reply; 6+ messages in thread
From: Jonas Maebe @ 2012-04-25  9:44 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: Ilya Basin, gdb


Sergio Durigan Junior wrote on Wed, 25 Apr 2012:

> On Saturday, April 21 2012, Ilya Basin wrote:
>
>> I think, gdb should try to stepi a fixed number of instructions (~100)
>> searching for a code line and if not found, step out.
>
> Thanks for the message.  Could you please also create an entry in the
> GDB Bugzilla as well?  The link is http://sourceware.org/bugzilla/
>
> This is not a guarantee that someone will actually implement this
> request, but at least we can keep a record of such things.

I'd definitely immediately add a "me too". Our compiler also generates  
dispatch stubs without debug info in a number of cases, and adding  
code to gdb to recognize all possible variations on all architectures  
we support (about 8 by now, I think) is not something anyone has felt  
up to figuring out yet. In the long term, it also does not seem  
tenable to add pattern recognition to gdb for stubs generated by all  
possible compilers (and possibly different versions of those compilers).


Jonas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re[2]: feature request: set step-mode smart
  2012-04-25  9:44   ` Jonas Maebe
@ 2012-04-25 10:08     ` Ilya Basin
  2012-04-25 10:40       ` Jonas Maebe
  0 siblings, 1 reply; 6+ messages in thread
From: Ilya Basin @ 2012-04-25 10:08 UTC (permalink / raw)
  To: Jonas Maebe; +Cc: Sergio Durigan Junior, gdb

JM> up to figuring out yet. In the long term, it also does not seem
JM> tenable to add pattern recognition to gdb for stubs generated by all  
JM> possible compilers (and possibly different versions of those compilers).

No one's speaking about pattern recognition.


-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re[2]: feature request: set step-mode smart
  2012-04-25 10:08     ` Re[2]: " Ilya Basin
@ 2012-04-25 10:40       ` Jonas Maebe
  2012-04-25 10:55         ` Kevin Pouget
  0 siblings, 1 reply; 6+ messages in thread
From: Jonas Maebe @ 2012-04-25 10:40 UTC (permalink / raw)
  To: Ilya Basin; +Cc: Sergio Durigan Junior, gdb


Ilya Basin wrote on Wed, 25 Apr 2012:

> JM> up to figuring out yet. In the long term, it also does not seem
> JM> tenable to add pattern recognition to gdb for stubs generated by all
> JM> possible compilers (and possibly different versions of those compilers).
>
> No one's speaking about pattern recognition.

If gdb does not automatically step a number of instructions to see  
whether subsequent code has debug information, you need pattern  
recognition in gdb to automatically detect such situations and to  
avoid the problem you described (gdb skipping or stepping over such  
code, rather than stepping into it). See this thread:  
http://sourceware.org/ml/gdb/2009-04/msg00008.html


Jonas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re[2]: feature request: set step-mode smart
  2012-04-25 10:40       ` Jonas Maebe
@ 2012-04-25 10:55         ` Kevin Pouget
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Pouget @ 2012-04-25 10:55 UTC (permalink / raw)
  To: Ilya Basin; +Cc: Jonas Maebe, Sergio Durigan Junior, gdb

On Wed, Apr 25, 2012 at 12:40 PM, Jonas Maebe <jonas.maebe@elis.ugent.be> wrote:
>
>
> Ilya Basin wrote on Wed, 25 Apr 2012:
>
>
>> JM> up to figuring out yet. In the long term, it also does not seem
>> JM> tenable to add pattern recognition to gdb for stubs generated by all
>> JM> possible compilers (and possibly different versions of those
>> compilers).
>>
>> No one's speaking about pattern recognition.
>
>
> If gdb does not automatically step a number of instructions to see whether
> subsequent code has debug information, you need pattern recognition in gdb
> to automatically detect such situations and to avoid the problem you
> described (gdb skipping or stepping over such code, rather than stepping
> into it). See this thread:
> http://sourceware.org/ml/gdb/2009-04/msg00008.html
>
>
> Jonas
>


FWIW, I did something somehow similar lastly, which works fine if you
know the "profile" of your trampoline function (not re-tested):

>  gdb.execute("stepi")
>  start_frame = gdb.newest_frame()
>  while True:
>    start_frame = gdb.newest_frame()
>    gdb.execute("stepi")
>    new_frame = gdb.newest_frame()
>    if start_frame != new_frame:
>        break

this script should step into the trampoline function and execute its
assembly instructions until the first frame creation (function call).


Kevin

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-25 10:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-21 11:07 feature request: set step-mode smart Ilya Basin
2012-04-25  3:20 ` Sergio Durigan Junior
2012-04-25  9:44   ` Jonas Maebe
2012-04-25 10:08     ` Re[2]: " Ilya Basin
2012-04-25 10:40       ` Jonas Maebe
2012-04-25 10:55         ` Kevin Pouget

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).