From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10607 invoked by alias); 20 Apr 2012 14:12:24 -0000 Received: (qmail 10567 invoked by uid 22791); 20 Apr 2012 14:12:20 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Apr 2012 14:11:59 +0000 Received: by vcbfy7 with SMTP id fy7so1614707vcb.0 for ; Fri, 20 Apr 2012 07:11:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record :x-gm-message-state; bh=hYo0J16ZtkhbRHN/f7go32NedcMuDe+pM2ExrnfqQrM=; b=pa/e9y644rBB3RfwswOqmMrdIlytX5xdwo3GxP1/5ZznPqSrJO+8bg7cf9fyy2rekA Dxc9N8PtDw7SBgTWGjdREQdE2FiE4HyCm4g5i86qrzzGO5cmKBbOKCh4pUT+bYIN8XDP PTMlaYUMPWPMT1UBq7VsJqfxnUAIjUjb3LGc+7JOd8F2Ry0WOE86EaIDAczBsqwQjV8X 3HZ4faVgdH/qx+cpGPRRWlOzsvrmQe2IKTRhU5IVcXwMETNa3S0Vjoym8TvJ1FVvnzdA L7ErYmLdoAX5CHFnW3JIpoO8hfYD35SWo00Jn3uZtxJ1adLAdsRbbwDM7n8UqQzxRbwE VzCA== Received: by 10.220.63.9 with SMTP id z9mr4807612vch.64.1334931118395; Fri, 20 Apr 2012 07:11:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.63.9 with SMTP id z9mr4807596vch.64.1334931118248; Fri, 20 Apr 2012 07:11:58 -0700 (PDT) Received: by 10.220.115.78 with HTTP; Fri, 20 Apr 2012 07:11:58 -0700 (PDT) In-Reply-To: References: <831unms3jy.fsf@gnu.org> <4F8F187D.3050402@redhat.com> <878vhsojgd.fsf@fleche.redhat.com> Date: Fri, 20 Apr 2012 14:16:00 -0000 Message-ID: Subject: Re: [RFC - Python scripting] New methods Symtab.global_block and Symtab.static_block (docs included) From: Doug Evans To: Matt Rice Cc: Siva Chandra , Tom Tromey , Phil Muldoon , Eli Zaretskii , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQkk/aejbJQE1ustFvoVCjK/AUMNjHpmeWmh0lWN8l5TvJK/mkru8fw44zIhBjtrloqByqWmNrHrzlBk9sznFC3gh6juo5WqO0U5GvyTOoxUFKuPJf1mU/NZ28rxWPmK83p5prSH+Ha9daNkWeygd787VPE4dQ== 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: 2012-04/txt/msg00681.txt.bz2 On Fri, Apr 20, 2012 at 4:43 AM, Matt Rice wrote: > =A0 =A0 =A0/* This shouldn't be necessary, but as a last resort > =A0 =A0 =A0 * try looking in the 'other kind' even though the psymtab > =A0 =A0 =A0 * claimed the symbol was one thing. =A0It's possible that > =A0 =A0 =A0 * the psymtab gets it wrong in some cases. > =A0 =A0 =A0 */ > =A0 =A0 =A0block =3D BLOCKVECTOR_BLOCK (bv, other_kind); > =A0 =A0 =A0sym =3D lookup_block_symbol (block, name, STRUCT_DOMAIN); > > .... > > =A0 =A0 =A0/* This shouldn't be necessary, but as a last resort try > =A0 =A0 =A0 =A0 looking in the statics even though the psymtab claimed > =A0 =A0 =A0 =A0 the symbol was global, or vice-versa. =A0It's possible > =A0 =A0 =A0 =A0 that the psymtab gets it wrong in some cases. =A0*/ > > =A0 =A0 =A0/* FIXME: carlton/2002-09-30: Should we really do that? > =A0 =A0 =A0 =A0 If that happens, isn't it likely to be a GDB error, in > =A0 =A0 =A0 =A0 which case we should fix the GDB error rather than > =A0 =A0 =A0 =A0 silently dealing with it here? =A0So I'd vote for > =A0 =A0 =A0 =A0 removing the check for the symbol in the other > =A0 =A0 =A0 =A0 block. =A0*/ > =A0 =A0 =A0block =3D BLOCKVECTOR_BLOCK (bv, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 kind =3D= =3D GLOBAL_BLOCK ? > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 STATIC_BL= OCK : GLOBAL_BLOCK); That reminds me, thanks! [Assuming I'm remembering correctly, can be dangerous at times :-)] The cost of this can be, umm, quite depressing.