Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Paul Koning <Paul_Koning@dell.com>
Cc: Eli Zaretskii <eliz@gnu.org>, temp@sourceboost.com, gdb@sourceware.org
Subject: Re: Getting pissed off by gdb. Please help with stepping in.
Date: Thu, 18 Mar 2010 19:06:00 -0000	[thread overview]
Message-ID: <e394668d1003181206k7c56d533n7aa77f12aa60ad27@mail.gmail.com> (raw)
In-Reply-To: <D8CEBB6AE9D43848BD2220619A43F326538E10@M31.equallogic.com>

To me it's the difference between stepping during

  foo(1);

and

  foo (bar());

In the former, the last "step" that returns from foo returns to the
caller - it's intuitive and what I expect.
In the latter, the last "step" in bar doesn't return to the caller,
instead it proceeds until we get into foo.  I just stepped out of a
function - how come I've also stepped into another function?

Also, when typing "s" and then constantly hitting <return> to move
things along, it's useful to see that extra step in the flow of the
program: the point between the return from bar and the call to foo.

As a data point, there is a time where stepping does stop in the
middle of a source line: next over longjmp (he says after having just
revisited why longjmp.exp has failures on amd64 (pointer mangling) and
tried it on i386).  According to the thread from bug 9270, the
intended fix IIUC is to keep stepping through the longjmp until it
returns - I wonder if there's an overlap here.

On Thu, Mar 18, 2010 at 11:37 AM, Paul Koning <Paul_Koning@dell.com> wrote:
> I'd say it is useful because it matches the documentation.  "s" is
> documented as "run until you're at a different source line".  In
> foo(bar()), the source line you come to after exit from bar() is the
> call to foo(), not the first line of foo -- that would take "s 2".
>
>        paul
>
>> -----Original Message-----
>> From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On
>> Behalf Of Eli Zaretskii
>> Sent: Thursday, March 18, 2010 2:31 PM
>> To: Doug Evans
>> Cc: temp@sourceboost.com; gdb@sourceware.org
>> Subject: Re: Getting pissed off by gdb. Please help with stepping in.
>>
>> > Date: Thu, 18 Mar 2010 08:10:41 -0700
>> > From: Doug Evans <dje@google.com>
>> > Cc: temp@sourceboost.com, gdb@sourceware.org
>> >
>> > Here's what gdb 7.1 does:
>> >
>> > (gdb) f
>> > #0  bar () at stepout.c:4
>> > 4       int bar () { return 1; }
>> > (gdb) s
>> > foo (x=1) at stepout.c:6
>> > 6       void foo (int x) { g = x; }
>> > (gdb)
>> >
>> > Note that we've stepped out of bar and into foo.
>> >
>> > Here is what Pavel is expecting instead:
>> >
>> > (gdb) f
>> > #0  bar () at stepout.c:4
>> > 4       int bar () { return 1; }
>> > (gdb) s
>> > 0x00000000004003b7 in main () at stepout.c:11
>> > 11        foo (bar ());
>> > (gdb)
>>
>> Thanks.  But why is ``what Pavel is expecting'' useful?  What use-case
>> does it handle that the v7.1 behavior does not?
>


  reply	other threads:[~2010-03-18 19:06 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18  2:39 temp
2010-03-18  3:00 ` Hui Zhu
2010-03-18  3:03 ` Nathan Froyd
2010-03-18  7:22 ` Doug Evans
2010-03-18  9:07   ` Eli Zaretskii
2010-03-18 15:10     ` Doug Evans
2010-03-18 15:21       ` Pedro Alves
2010-03-18 18:33         ` Eli Zaretskii
2010-03-18 18:55           ` Pedro Alves
2010-03-18 19:38             ` Eli Zaretskii
2010-03-18 19:54               ` Mark Kettenis
2010-03-18 20:43                 ` Doug Evans
2010-03-18 20:51                   ` Michael Snyder
2010-03-18 21:17                     ` Pedro Alves
2010-03-18 21:12                 ` Eli Zaretskii
2010-03-18 23:37                 ` Paul Hilfinger
2010-03-19  9:51                 ` Richard Earnshaw
2010-03-19 10:41                   ` Mark Kettenis
2010-03-19 13:19                     ` Eli Zaretskii
2010-03-19 10:19                 ` André Pönitz
2010-03-18 15:28       ` Doug Evans
2010-03-18 18:31       ` Eli Zaretskii
2010-03-18 18:37         ` Paul Koning
2010-03-18 19:06           ` Doug Evans [this message]
2010-03-18 20:48             ` Jonas Maebe
2010-03-18 13:33   ` Daniel Jacobowitz
2010-03-18 14:06     ` André Pönitz
2010-03-18 14:13       ` Daniel Jacobowitz
2010-03-18 14:33         ` André Pönitz
2010-03-18 14:39           ` Daniel Jacobowitz
2010-03-18 14:54             ` André Pönitz
2010-03-18 15:40     ` Doug Evans
2010-03-18 17:41   ` Michael Snyder
2010-03-18 22:44 ` temp

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=e394668d1003181206k7c56d533n7aa77f12aa60ad27@mail.gmail.com \
    --to=dje@google.com \
    --cc=Paul_Koning@dell.com \
    --cc=eliz@gnu.org \
    --cc=gdb@sourceware.org \
    --cc=temp@sourceboost.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