* How to step into multi-command statements
@ 2004-08-21 17:30 Tron Thomas
2004-08-21 17:41 ` Bob Rossi
2004-08-23 17:05 ` Andrew Cagney
0 siblings, 2 replies; 4+ messages in thread
From: Tron Thomas @ 2004-08-21 17:30 UTC (permalink / raw)
To: gdb
If I were debugging a program and ran across code like the following:
string text;
...
formatter.DisplayText(text.c_str());
What commands do I use to step into the DisplayText method of the
formatter object? Stepping into the statement takes me into the code
for the c_str method of the string class, which I don't care about.
After getting into this code I'm finding it impossible to get into the
actual code I want. Instead I end up being going to the next statement
that follows the call to DisplayText.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to step into multi-command statements
2004-08-21 17:30 How to step into multi-command statements Tron Thomas
@ 2004-08-21 17:41 ` Bob Rossi
2004-08-22 10:53 ` Joel Brobecker
2004-08-23 17:05 ` Andrew Cagney
1 sibling, 1 reply; 4+ messages in thread
From: Bob Rossi @ 2004-08-21 17:41 UTC (permalink / raw)
To: Tron Thomas; +Cc: gdb
On Sat, Aug 21, 2004 at 10:30:25AM -0700, Tron Thomas wrote:
> If I were debugging a program and ran across code like the following:
>
> string text;
> ...
> formatter.DisplayText(text.c_str());
>
> What commands do I use to step into the DisplayText method of the
> formatter object? Stepping into the statement takes me into the code
> for the c_str method of the string class, which I don't care about.
> After getting into this code I'm finding it impossible to get into the
> actual code I want. Instead I end up being going to the next statement
> that follows the call to DisplayText.
You need to 'step', 'finish', 'step', 'finish', until you get to the
function that you want.
Bob Rossi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to step into multi-command statements
2004-08-21 17:41 ` Bob Rossi
@ 2004-08-22 10:53 ` Joel Brobecker
0 siblings, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2004-08-22 10:53 UTC (permalink / raw)
To: Tron Thomas, gdb
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to step into multi-command statements
2004-08-21 17:30 How to step into multi-command statements Tron Thomas
2004-08-21 17:41 ` Bob Rossi
@ 2004-08-23 17:05 ` Andrew Cagney
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Cagney @ 2004-08-23 17:05 UTC (permalink / raw)
To: Tron Thomas; +Cc: gdb
> If I were debugging a program and ran across code like the following:
>
> string text;
> ...
> formatter.DisplayText(text.c_str());
>
> What commands do I use to step into the DisplayText method of the formatter object? Stepping into the statement takes me into the code for the c_str method of the string class, which I don't care about. After getting into this code I'm finding it impossible to get into the actual code I want. Instead I end up being going to the next statement that follows the call to DisplayText.
Try:
(gdb) advance formatter.DisplayText
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-08-23 17:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-21 17:30 How to step into multi-command statements Tron Thomas
2004-08-21 17:41 ` Bob Rossi
2004-08-22 10:53 ` Joel Brobecker
2004-08-23 17:05 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox