From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24588 invoked by alias); 18 Mar 2010 19:06:31 -0000 Received: (qmail 24356 invoked by uid 22791); 18 Mar 2010 19:06:30 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Mar 2010 19:06:26 +0000 Received: from kpbe16.cbf.corp.google.com (kpbe16.cbf.corp.google.com [172.25.105.80]) by smtp-out.google.com with ESMTP id o2IJ6Ntt003779 for ; Thu, 18 Mar 2010 20:06:24 +0100 Received: from wwb39 (wwb39.prod.google.com [10.241.241.103]) by kpbe16.cbf.corp.google.com with ESMTP id o2IJ5ts0021847 for ; Thu, 18 Mar 2010 12:06:22 -0700 Received: by wwb39 with SMTP id 39so1275306wwb.11 for ; Thu, 18 Mar 2010 12:06:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.85.74 with SMTP id t52mr103412wee.208.1268939181084; Thu, 18 Mar 2010 12:06:21 -0700 (PDT) In-Reply-To: References: <11611.203.63.255.139.1268879984.squirrel@webmail5.pair.com> <834okdv5wb.fsf@gnu.org> Date: Thu, 18 Mar 2010 19:06:00 -0000 Message-ID: Subject: Re: Getting pissed off by gdb. Please help with stepping in. From: Doug Evans To: Paul Koning Cc: Eli Zaretskii , temp@sourceboost.com, gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00144.txt.bz2 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 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 wrote: > I'd say it is useful because it matches the documentation. =A0"s" is > documented as "run until you're at a different source line". =A0In > 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". > > =A0 =A0 =A0 =A0paul > >> -----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 >> > Cc: temp@sourceboost.com, gdb@sourceware.org >> > >> > Here's what gdb 7.1 does: >> > >> > (gdb) f >> > #0 =A0bar () at stepout.c:4 >> > 4 =A0 =A0 =A0 int bar () { return 1; } >> > (gdb) s >> > foo (x=3D1) at stepout.c:6 >> > 6 =A0 =A0 =A0 void foo (int x) { g =3D x; } >> > (gdb) >> > >> > Note that we've stepped out of bar and into foo. >> > >> > Here is what Pavel is expecting instead: >> > >> > (gdb) f >> > #0 =A0bar () at stepout.c:4 >> > 4 =A0 =A0 =A0 int bar () { return 1; } >> > (gdb) s >> > 0x00000000004003b7 in main () at stepout.c:11 >> > 11 =A0 =A0 =A0 =A0foo (bar ()); >> > (gdb) >> >> Thanks. =A0But why is ``what Pavel is expecting'' useful? =A0What use-ca= se >> does it handle that the v7.1 behavior does not? >