This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to step into multi-command statements


> You need to 'step', 'finish', 'step', 'finish', until you get to the
> function that you want.

Funny. One of our users actually asked for an enhancement to implement
a function that would do a step-last, ie step into the last function
being called in the line of code. For instance, given the following 
code:

         Foo (A, Bar (B));

steplast would land inside Foo, not Bar.

The premise for this request was that WDB, the HP/UX debugger, was
implementing it.

I looked at HP's implementation, and they were basically using two
approaches, as far as I can remember:
  - heuristics, knowing how calls where implemented on their target
    (this is for older versions of their compiler)
  - debug info, generated by their recent compiler.

We are still not exactly sure that this would be very useful
enhancement, especially if we don't get any help from the compiler
as the HP compiler does. Right now, our position is that it is easy
to write a user-command that does something close:

         define stepfunc
             tbreak $arg0
             cont
         end

With the function above, it's not entirely automatic, as you have
to give the name of the function you want to step in, but it is also
more flexible, as you can step into the function you want, it doesn't
have to be the last function called.

Food for thoughts...

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]