From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15515 invoked by alias); 4 Mar 2011 23:34:34 -0000 Received: (qmail 15276 invoked by uid 22791); 4 Mar 2011 23:34:33 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate6.uk.ibm.com (HELO mtagate6.uk.ibm.com) (194.196.100.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 Mar 2011 23:34:28 +0000 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate6.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p24NYPG2023184 for ; Fri, 4 Mar 2011 23:34:25 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p24NYcTQ1908976 for ; Fri, 4 Mar 2011 23:34:38 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p24NYP3t032118 for ; Fri, 4 Mar 2011 16:34:25 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p24NYOIV032112; Fri, 4 Mar 2011 16:34:24 -0700 Message-Id: <201103042334.p24NYOIV032112@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Sat, 05 Mar 2011 00:34:24 +0100 Subject: Re: [RFA] dwarf2loc.c, loclist_read_variable, Assert frame not null To: msnyder@vmware.com (Michael Snyder) Date: Fri, 04 Mar 2011 23:34:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (gdb-patches@sourceware.org) In-Reply-To: <4D7169A9.4000207@vmware.com> from "Michael Snyder" at Mar 04, 2011 02:37:29 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 2011-03/txt/msg00342.txt.bz2 Michael Snyder wrote: > Now, I've heard a rumor that frame-infos can never be null. > > If that's true, then instead of this patch, we should just > delete the earlier check for null. It's not quite that simple -- with the ->read_variable callbacks, there are two classes of symbols: those that can only be evaluated relative to a frame, and those that can be evaluated without any reference to a frame (e.g. globals). For the latter, it is valid to pass a NULL frame argument to the ->read_variable callback, while it is invalid for the former. To distinguish between the two, the caller is supposed to call the ->read_needs_frame callback before calling ->read_variable. However, in the particular case of *location list* symbols, we currently always require a frame anyway. See the corresponding ->read_needs_frame implementation: static int loclist_read_needs_frame (struct symbol *symbol) { /* If there's a location list, then assume we need to have a frame to choose the appropriate location expression. With tracking of global variables this is not necessarily true, but such tracking is disabled in GCC at the moment until we figure out how to represent it. */ return 1; } So, given this situation, I'd suggest to remove the check for a NULL frame in loclist_read_variable, and replace it with a global assertion that frame is non-NULL -- but with a comment refering to the explanation in loclist_read_needs_frame for this specific case ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com