From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32644 invoked by alias); 31 May 2011 18:43:27 -0000 Received: (qmail 32632 invoked by uid 22791); 31 May 2011 18:43:26 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_BL_SPAMCOP_NET,TW_BJ X-Spam-Check-By: sourceware.org Received: from exprod5og114.obsmtp.com (HELO exprod5og114.obsmtp.com) (64.18.0.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 31 May 2011 18:43:12 +0000 Received: from il93mgrg01.am.mot-mobility.com ([144.188.21.13]) (using TLSv1) by exprod5ob114.postini.com ([64.18.4.12]) with SMTP ID DSNKTeU2v5LKVXK3ft7r3S3qM3bj5FFsAL96@postini.com; Tue, 31 May 2011 11:43:11 PDT Received: from il93mgrg01.am.mot-mobility.com ([10.22.94.167]) by il93mgrg01.am.mot-mobility.com (8.14.3/8.14.3) with ESMTP id p4VIedOQ028973 for ; Tue, 31 May 2011 14:40:39 -0400 (EDT) Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by il93mgrg01.am.mot-mobility.com (8.14.3/8.14.3) with ESMTP id p4VIcrml027146 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=OK) for ; Tue, 31 May 2011 14:40:39 -0400 (EDT) Received: by mail-pw0-f42.google.com with SMTP id 3so2438944pwj.15 for ; Tue, 31 May 2011 11:43:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.65.103 with SMTP id w7mr2494396pbs.127.1306867390245; Tue, 31 May 2011 11:43:10 -0700 (PDT) Received: by 10.143.38.4 with HTTP; Tue, 31 May 2011 11:43:10 -0700 (PDT) In-Reply-To: References: Date: Tue, 31 May 2011 18:43:00 -0000 Message-ID: Subject: Re: Symbol file scope? From: Andrei Warkentin To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-CFilter-Loop: Reflected 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: 2011-05/txt/msg00703.txt.bz2 Hi, On Tue, May 31, 2011 at 12:08 PM, Tom Tromey wrote: >>>>>> "Andrei" =3D=3D Andrei Warkentin writes: > > Andrei> It would be nice to be able to > Andrei> have globals be searched for first in the object file to which the > Andrei> current scope is in. Additionally, it would be nice to be able to > Andrei> implement "module scope" in the same fashion as "file scope", so = you > Andrei> can look at globals in any module like this - > > Andrei> (gdb) print &'DxeCore.dll'::gST > Andrei> $15 =3D (EFI_SYSTEM_TABLE **) 0x17fca6f0 > Andrei> (gdb) print &'IsaBusDxe.dll'::gST > Andrei> $16 =3D (EFI_SYSTEM_TABLE **) 0x17e21da4 > > This seems like a good feature. > > Andrei> 1) Modifies lookup_symbol_global to use > Andrei> lookup_global_symbol_from_objfile before lookup_symbol_aux_symatb= s or > Andrei> solib_global_lookup > Andrei> 2) Modifies lookup_symtab to match symbol object file as well. It > Andrei> returns the first symtab, which is good enough for > Andrei> lookup_symbol_global logic to work. (I basically wanted to avoid > Andrei> modifying c-exp, p-exp, etc, parsers) > > I'd have to see it and hear more rationale for the placement. > Offhand it seems reasonable. > > Andrei> 3) Fixes location completion to match object file names as well. > > Thanks. > > Andrei> 4) Adds a list-symbol-files command to list all objfiles and their > Andrei> locations, or list only those that match objfile/source file name= s. > Andrei> I.e - > Andrei> gdb) list-symbol-files DiskIo.c Dispatcher.c EhciDxe.dll > > This should be an "info" subcommand instead. > > Andrei> I have a patch here - > Andrei> https://github.com/andreiw/andreiw-wip/blob/master/gdb/0001-GDB-I= nitial-prototype-of-symbol-file-scope-module-sc.patch > > I glanced at it but didn't try to do any serious review. > I'd suggest: rebase, write a ChangeLog entry, and submit here. > You'll also have to update the docs and write some tests. > > If you don't have copyright assignment paperwork in place, please > contact me off-list so we can get you started on that. =A0It is best to > start this early, because sometimes it takes a while. > Thanks for the feedback. Will start cleaning up the patch into something that can be submitted. A