From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3207 invoked by alias); 19 Nov 2008 00:44:14 -0000 Received: (qmail 3107 invoked by uid 22791); 19 Nov 2008 00:44:13 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Nov 2008 00:43:23 +0000 Received: from zps38.corp.google.com (zps38.corp.google.com [172.25.146.38]) by smtp-out.google.com with ESMTP id mAJ0hL8v024505 for ; Tue, 18 Nov 2008 16:43:21 -0800 Received: from rv-out-0708.google.com (rvfb17.prod.google.com [10.140.179.17]) by zps38.corp.google.com with ESMTP id mAJ0gLqY030813 for ; Tue, 18 Nov 2008 16:43:20 -0800 Received: by rv-out-0708.google.com with SMTP id b17so5227264rvf.42 for ; Tue, 18 Nov 2008 16:43:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.141.137.8 with SMTP id p8mr240609rvn.170.1227055400215; Tue, 18 Nov 2008 16:43:20 -0800 (PST) In-Reply-To: <20081118125838.0613C412301@localhost> References: <20081118125838.0613C412301@localhost> Date: Wed, 19 Nov 2008 14:07:00 -0000 Message-ID: Subject: Re: [RFA] dummy frame handling cleanup, plus inferior fun call signal handling improvement From: Doug Evans To: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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-11/txt/msg00492.txt.bz2 On Tue, Nov 18, 2008 at 4:58 AM, Doug Evans wrote: > Hi. This patch was in progress when I wrote > http://sourceware.org/ml/gdb-patches/2008-11/msg00391.html > This patch subsumes that one. > > There are two things this patch does: > 1) properly pop dummy frames more often > 2) make the inferior resumable after an inferior function call gets a > signal without having to remember to do "signal 0" > > 1) properly pop dummy frames more often > > Ulrich asked: >> I agree that it would be better if call_function_by_hand were to call >> dummy_frame_pop in this case. However, why exactly is this a bug? > > It's a bug because it's confusing to not pop the frame in the places > where one is able to. Plus it's, well, unclean. > I recognize that the dummy frame stack can't be precisely managed because > the user can do things like: > > set $orig_pc = $pc > set $orig_sp = $sp > break my_fun > call my_fun() > set $pc = $orig_pc > set $sp = $orig_sp > continue > > [This doesn't always work, but you get the idea.] > At the "continue", the inferior function call no longer exists and > gdb's mechanisms for removing the dummy frame from dummy_frame_stack > will never trigger (until the program is resumed and cleanup_dummy_frames > is called). But we can still keep things clean > and unconfusing for the common case. For completeness' sake, To catch cases like these one could do things like compare $sp with $dummy_frame_stack.*.regcache.sp every time execution stops.