From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8439 invoked by alias); 20 Aug 2012 17:50:53 -0000 Received: (qmail 8429 invoked by uid 22791); 20 Aug 2012 17:50:51 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Aug 2012 17:50:36 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7KHoZi3026180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 20 Aug 2012 13:50:35 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q7KHoYCh031307 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 20 Aug 2012 13:50:35 -0400 From: Tom Tromey To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: RFC: printing pointers to global (data) variable on Windows... References: <20120816152255.GA2836@adacore.com> <87zk5umwj3.fsf@fleche.redhat.com> <20120816224524.GC2798@adacore.com> <87628hmwbr.fsf@fleche.redhat.com> <20120817231554.GF2798@adacore.com> <20120820150849.GQ2798@adacore.com> Date: Mon, 20 Aug 2012 17:50:00 -0000 In-Reply-To: <20120820150849.GQ2798@adacore.com> (Joel Brobecker's message of "Mon, 20 Aug 2012 08:08:49 -0700") Message-ID: <87mx1ph2qd.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2012-08/txt/msg00553.txt.bz2 Joel> + By default, it is assumed that the symbol size can be determined, Joel> + which means that the "has_size" flag of the returned minimal symbol Joel> + is set to 1. What about defaulting it to zero, applying the appended, and then fixing up the fallout? I could do the mechanics of this if you think it is ok; and if you plan to go forward with this. Tom diff --git a/gdb/symtab.h b/gdb/symtab.h index 5401b22..05bc706 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -361,7 +361,12 @@ struct minimal_symbol #define MSYMBOL_TARGET_FLAG_1(msymbol) (msymbol)->target_flag_1 #define MSYMBOL_TARGET_FLAG_2(msymbol) (msymbol)->target_flag_2 -#define MSYMBOL_SIZE(msymbol) (msymbol)->size +#define MSYMBOL_SIZE(msymbol) ((msymbol)->size + 0) +#define SET_MSYMBOL_SIZE(msymbol, sz) \ + do { \ + (msymbol)->size = sz; \ + (msymbol)->has_size = 1; \ + } while (0) #define MSYMBOL_TYPE(msymbol) (msymbol)->type #include "minsyms.h"