Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
		Daniel Jacobowitz <drow@false.org>,
		Pedro Alves <pedro@codesourcery.com>,
	teawater <teawater@gmail.com>
Subject: Re: [RFA] Reverse Debugging, 3/5
Date: Tue, 07 Oct 2008 04:07:00 -0000	[thread overview]
Message-ID: <20081007040703.GF28138@adacore.com> (raw)
In-Reply-To: <48EAA2C6.2020502@vmware.com>

> >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


  reply	other threads:[~2008-10-07  4:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-01 19:20 Michael Snyder
2008-10-06 20:09 ` Pedro Alves
2008-10-06 20:54   ` Michael Snyder
2008-10-06 21:14     ` Pedro Alves
2008-10-06 21:22       ` Michael Snyder
2008-10-06 21:26       ` Joel Brobecker
2008-10-06 21:47         ` Michael Snyder
2008-10-06 21:22 ` Joel Brobecker
     [not found]   ` <48EA83AD.9040004@vmware.com>
2008-10-06 21:43     ` Joel Brobecker
2008-10-06 23:46       ` Michael Snyder
2008-10-07  4:07         ` Joel Brobecker [this message]
2008-10-07 18:46           ` Michael Snyder
2008-10-08  0:31             ` Joel Brobecker

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=20081007040703.GF28138@adacore.com \
    --to=brobecker@adacore.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    --cc=pedro@codesourcery.com \
    --cc=teawater@gmail.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