From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8565 invoked by alias); 7 Oct 2008 04:07:46 -0000 Received: (qmail 8377 invoked by uid 22791); 7 Oct 2008 04:07:45 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 07 Oct 2008 04:07:06 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 8CC002A96B2; Tue, 7 Oct 2008 00:07:04 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id REO02KCab4tW; Tue, 7 Oct 2008 00:07:04 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 579D32A96B1; Tue, 7 Oct 2008 00:07:04 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id B8F6AE7ACD; Mon, 6 Oct 2008 21:07:03 -0700 (PDT) Date: Tue, 07 Oct 2008 04:07:00 -0000 From: Joel Brobecker To: Michael Snyder Cc: "gdb-patches@sourceware.org" , Daniel Jacobowitz , Pedro Alves , teawater Subject: Re: [RFA] Reverse Debugging, 3/5 Message-ID: <20081007040703.GF28138@adacore.com> References: <48E3CD0B.8020003@vmware.com> <20081006212132.GB21853@adacore.com> <48EA83AD.9040004@vmware.com> <20081006214317.GD21853@adacore.com> <48EAA2C6.2020502@vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48EAA2C6.2020502@vmware.com> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00200.txt.bz2 > >I think part of the issue is that, to me, "step_into_function" is > >a misleading name for that function, as it implies that we haven't > >stepped into the function yet. So, what the function does is, > >now that we've stepped into the function, see if we need to continue > >somewhere a little farther or not. So, to me, doing the reverse of > >"step_into_function" meant going back to the calling site... When I wrote that, I wasn't asking you to change the name. I hope you didn't feel forced to do it... > * infrun.c (step_into_function): Rename to stepped_into_function. Can I suggest: handle_stepped_into_function. This follows the "handle_inferior_event" style while explaining that we're handling the situation we're dealing with. Same for handle_stepped_into_function_backwards. > + /* Find start of appropriate source line (either first or > + last line in callee, depending on execution > + direction). */ > + if (target_get_execution_direction () == EXEC_REVERSE) > + stepped_into_function_backward (ecs); > + else > + stepped_into_function (ecs); > return; I think that the comment is redundant in this case. Hopefully the function name should give a good clue of what it is supposed to do (handle the case of just having stepped into a function, either forward or backwards depending on the execution direction). The actual details of how they do it do not matter at this level, and keeping a copy here introduces some chances that it might become out of date. > +/* Inferior has stepped into a subroutine call with source code that ^ The inferior... > + we should not step over. Do step to the first line of code in > + it. */ > +/* Inferior has stepped backward into a subroutine call with source Same here: "The inferior..." > + code that we should not step over. Do step to the beginning of the > + last line of code in it. */ I am sorry - perhaps this is because it's getting late, but I'm getting confused again. What does it mean to step backward into a subroutine call? My understanding was completely wrong. Could you give maybe an example at the user-interface level? Maybe it's a typo in the function description, but the function implementation doesn't seem to be doing what you say it is. "Do step to the beginning of the current line of code"? (I'm still interested in my example) > +static void > +stepped_into_function_backward (struct execution_control_state *ecs) English question: Are "backward" and "backwards" interchangeable? If these two words are strictly equivalent, I'd like for us to remain consistent. But if now, can you explain to me what the difference is? > + if (s && s->language != language_asm) > + ecs->stop_func_start = gdbarch_skip_prologue (current_gdbarch, > + ecs->stop_func_start); Depending of your answer to my question above, I'm wondering if we should actually do a prologue skip... -- Joel