From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11693 invoked by alias); 17 Sep 2007 13:10:59 -0000 Received: (qmail 11681 invoked by uid 22791); 17 Sep 2007 13:10:58 -0000 X-Spam-Check-By: sourceware.org Received: from province.act-europe.fr (HELO province.act-europe.fr) (212.157.227.214) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 17 Sep 2007 13:10:54 +0000 Received: by province.act-europe.fr (Postfix, from userid 560) id 21B461660AB; Mon, 17 Sep 2007 15:10:52 +0200 (CEST) Date: Mon, 17 Sep 2007 13:10:00 -0000 From: Jerome Guitton To: gdb-patches@sourceware.org Subject: Re: [RFA] dwarf2loc, guard against null Message-ID: <20070917131052.GA28874@adacore.com> References: <20070917120443.GA21276@adacore.com> <20070917121503.GA7606@caradoc.them.org> <20070917122654.GY93930@adacore.com> <20070917123048.GA8537@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070917123048.GA8537@caradoc.them.org> User-Agent: Mutt/1.4.2.2i 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: 2007-09/txt/msg00215.txt.bz2 Daniel Jacobowitz (drow@false.org): > On Mon, Sep 17, 2007 at 02:26:54PM +0200, Jerome Guitton wrote: > > * retry to print the variable => end up in dwarf_expr_frame_base, > > no frame, crash. > > > > We are (probably) still using a wrong .debug_info at this point. > > Yeah. Shouldn't you have gotten a "no such variable in this scope" > error? I'm not sure how symbol lookup found a local variable without > any frame. Right. Actually, it got the selected frame (deprecated_selected_frame) in deprecated_safe_get_selected_frame. This function reads: struct frame_info * deprecated_safe_get_selected_frame (void) { if (!target_has_registers || !target_has_stack || !target_has_memory) return NULL; return get_selected_frame (NULL); } When the inferior is dead, target_has_registers (resp. target_has_memory, target_has_stack) should be false and deprecated_safe_get_selected_frame should return NULL. This is the bug in my vxWorks-specific backend (I should pop some target vector at mourn_inferior, I guess). Anyway, when deprecated_safe_get_selected_frame returns NULL, I get the message "Address of "db" is unknown". Much better. Now back to the original problem: assertion or error? I guess that the question is: in which cases get_frame_block can return NULL?