From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10962 invoked by alias); 20 Apr 2006 19:49:14 -0000 Received: (qmail 10953 invoked by uid 22791); 20 Apr 2006 19:49:12 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 20 Apr 2006 19:49:10 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k3KJn9lE026114; Thu, 20 Apr 2006 15:49:09 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.11.6) with ESMTP id k3KJn8Qs023644; Thu, 20 Apr 2006 15:49:08 -0400 Received: from [172.16.24.50] (bluegiant.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.12.8/8.12.8) with ESMTP id k3KJn7Tq018271; Thu, 20 Apr 2006 15:49:07 -0400 Message-ID: <4447E5B2.1080601@redhat.com> Date: Thu, 20 Apr 2006 19:49:00 -0000 From: Michael Snyder User-Agent: Mozilla Thunderbird 1.0.7-1.4.1 (X11/20050929) MIME-Version: 1.0 To: Daniel Jacobowitz CC: Eli Zaretskii , gdb-patches@sources.redhat.com Subject: Re: [RFA] Reverse debugging, part 2/3: core interface References: <442DAA95.6050708@redhat.com> <444427CA.5060108@redhat.com> <20060420160012.GE11710@nevyn.them.org> In-Reply-To: <20060420160012.GE11710@nevyn.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00294.txt.bz2 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.