Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Joel Brobecker <brobecker@adacore.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, 4/5
Date: Mon, 06 Oct 2008 22:18:00 -0000	[thread overview]
Message-ID: <48EA8E20.9090306@vmware.com> (raw)
In-Reply-To: <20081006215637.GE21853@adacore.com>

Joel Brobecker wrote:
>>       * breakpoint.c (breakpoint_silence): New function.
>>       * infcmd.c (finish_command): Check for reverse exec direction.
> 
> You're going to hate me, now :).  This is another instance where
> I think we can break the code a little differently:
> 
>   1. finish_command_backwards (I would have prefered
>      "reverse_finish_command but :-P)

If this were the function that directly implemented
the reverse-finish command, I would have named it like that.

There's actually another function that implements the
reverse-finish command.  This function is a helper,
one that just does part of the job.

> 
>   2. finish_command_forward
> 
>   3. finish_command:
>      {
>        [do all the stuff about checking for args, etc]
>        if (target_get_exec_dir () == EXEC_REVERSE)
>          finish_command_backwards ()
>        else
>          finish_command_forward ()
>      }
> 
> That way, we just split the finish_command code into two parts
> without moving some of the code, and it's clear that the two paths
> are completely distinct.  The "branch-off" approach (that we used
> for Ada but that I'm trying to avoid like the plague now) does obscure
> the structure of your program.

OK, I'm not totally opposed to the idea.  ;-)


>> +void
>> +breakpoint_silence (struct breakpoint *b)
>> +{
>> +  /* Silence the breakpoint.  */
>> +  b->silent = 1;
> 
> Minor nit: This name brings little meaning when I see it being called.
> Can we change it to "make_breakpoint_silent"?  That way, the comment
> in the body becomes useless and can be removed.

Yeah, ok.



>> +  if (find_pc_partial_function (get_frame_pc (get_current_frame ()),
>> +                             NULL, &func_addr, NULL) == 0)
>> +    internal_error (__FILE__, __LINE__,
>> +                 "Finish: couldn't find function.");
> 
> Internal error? I understand that it should probably never happen
> in this context, but how about making it a simple error instead.
> If we trip this check, it's true that something went wrong, but
> let's just abort the command and let the user try to continue
> rather than asking the user whether we should abort the whole
> session.
> 
>> +  /* TODO: Let's not worry about async until later.  */
> 
> Should we add a check now, though, and error out if async was requested?

Yeah.  Will do.


>> +      /* (Kludgy way of letting wait_for_inferior know...) */
>> +      tp->step_range_start = tp->step_range_end = 1;
> 
> AARGH! More special meaning to these addresses. We really ought to
> clean these up and put some specific flags in the structure, one day.
> I don't know why we're trying so hard to resume these fields.

OK, in this instance, I did not add the special meaning.
I was only following what practice was already there.  ;-)




  reply	other threads:[~2008-10-06 22:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-01 19:21 Michael Snyder
2008-10-06 21:27 ` Pedro Alves
2008-10-06 21:50   ` Michael Snyder
2008-10-06 21:57 ` Joel Brobecker
2008-10-06 22:18   ` Michael Snyder [this message]
2008-10-07  3:18     ` Joel Brobecker
2008-10-06 22:42   ` Tom Tromey
2008-10-06 22:55     ` Michael Snyder
2008-10-06 22:59       ` Tom Tromey
2008-10-07  3:15       ` 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=48EA8E20.9090306@vmware.com \
    --to=msnyder@vmware.com \
    --cc=brobecker@adacore.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --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