Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] Reverse debugging, part 2/3: core interface
Date: Thu, 20 Apr 2006 19:49:00 -0000	[thread overview]
Message-ID: <4447E5B2.1080601@redhat.com> (raw)
In-Reply-To: <20060420160012.GE11710@nevyn.them.org>

Daniel Jacobowitz wrote:
> On Mon, Apr 17, 2006 at 04:42:02PM -0700, Michael Snyder wrote:
> 
>>@@ -1371,6 +1384,62 @@
>>       do_cleanups (old_chain);
>>     }
>> }
>>+
>>+static void
>>+finish_backwards (struct symbol *function)
>>+{
>>+  struct symtab_and_line sal;
>>+  struct breakpoint *breakpoint;
>>+  struct cleanup *old_chain;
>>+  CORE_ADDR func_addr;
>>+
>>+  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.");
>>+
>>+  sal = find_pc_line (func_addr, 0);
>>+
>>+  /* Let's cheat and not worry about async until later.  */
> 
> 
> :-(
> > 
> What problems does it present?  Need to use completions?

I have no idea, that's why I have deferred thinking about it.

> Async operation has been getting a bit musty.  I don't think it's fair
> to insist you straighten that out before this goes in.  But, it would
> be nice to issue an error here, instead of doing something quite
> possibly wrong.

Yes, I agree.  I'll undertake to do it.

>>+  /* We don't need a return value.  */
>>+  proceed_to_finish = 0;
>>+  /* Special case: if we're sitting at the function entry point, 
>>+     then all we need to do is take a reverse singlestep.  We
>>+     don't need to set a breakpoint, and indeed it would do us
>>+     no good to do so.
>>+
>>+     Note that this can only happen at frame #0, since there's
>>+     no way that a function up the stack can have a return address
>>+     that's equal to its entry point.  */
>>+
>>+  if (sal.pc != read_pc ())
> 
> Above you used get_frame_pc, here you use read_pc. 

Good catch.  It should probably be get_frame_pc.
You agree?


> More importantly...
> 
> 
>>+    {
>>+      /* Set breakpoint and continue.  */
>>+      breakpoint = 
>>+	set_momentary_breakpoint (sal, 
>>+				  get_frame_id (get_selected_frame (NULL)),
>>+				  bp_breakpoint);
> 
> ...above you used get_current_frame, here you used get_selected_frame.
> Which is it?  I think that it should be the selected frame in all three
> cases, by analogy with finish, and there should probably be a similar
> error for cases without a caller.

Oh man, you're making my head hurt.  Which is, I suppose, a good thing.

What's the difference, now?  Is 'current_frame' the execution frame,
and 'selected_frame' the displayed one?  (ie. the "up/down" one?)

If that's the case, then I think you're right, it should be
the selected frame.

I have to break off and go meet someone.  This is all good
feedback, I'll pick up the rest of your email this afternoon.


  reply	other threads:[~2006-04-20 19:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <442DAA95.6050708@redhat.com>
2006-04-01 12:34 ` Eli Zaretskii
2006-04-01 16:10   ` Daniel Jacobowitz
2006-04-01 16:24     ` Eli Zaretskii
2006-04-17 23:42   ` Michael Snyder
2006-04-18  9:04     ` Eli Zaretskii
2006-04-20 16:00     ` Daniel Jacobowitz
2006-04-20 19:49       ` Michael Snyder [this message]
2006-04-20 19:52         ` Daniel Jacobowitz

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=4447E5B2.1080601@redhat.com \
    --to=msnyder@redhat.com \
    --cc=drow@false.org \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.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