From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3132 invoked by alias); 10 Apr 2012 08:19:11 -0000 Received: (qmail 3065 invoked by uid 22791); 10 Apr 2012 08:19:07 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Tue, 10 Apr 2012 08:18:51 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3A8InTD022377 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 10 Apr 2012 04:18:49 -0400 Received: from host2.jankratochvil.net (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3A8Iiu7030321 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 10 Apr 2012 04:18:47 -0400 Date: Tue, 10 Apr 2012 08:19:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org, Eli Zaretskii Subject: Re: [2/2] RFA: implement 'set print symbol' Message-ID: <20120410081843.GA27643@host2.jankratochvil.net> References: <871uo2giob.fsf@fleche.redhat.com> <20120409191420.GA1010@host2.jankratochvil.net> <87fwcc679z.fsf@fleche.redhat.com> <83pqbg7i1n.fsf@gnu.org> <87r4vw4nxu.fsf@fleche.redhat.com> <83lim46rk7.fsf@gnu.org> <20120410065226.GA23852@host2.jankratochvil.net> <83aa2k6n96.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83aa2k6n96.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg00175.txt.bz2 On Tue, 10 Apr 2012 09:48:21 +0200, Eli Zaretskii wrote: > Why do we need to retain the old behavior? You yourself said that no > one will find this option to use it. I have checked some (the first) FAIL cases of the testsuite and it does not seem to be acceptable to be printed by default in its current form: Breakpoint 7, marker3 (a=0x400918 <__dso_handle+48> "stack", b=0x400912 <__dso_handle+42> "trace") at ./gdb.base/break1.c:48^M Section Headers: [Nr] Name Type Address Off Size ES Flg Lk Inf Al [15] .rodata PROGBITS 00000000004008e0 0008e0 00003e 00 A 0 0 8 [16] .eh_frame_hdr PROGBITS 0000000000400920 000920 00006c 00 A 0 0 4 Symbol table '.symtab' contains 84 entries: Value Size Type Bind Vis Ndx Name 00000000004008e8 0 OBJECT GLOBAL HIDDEN 15 __dso_handle 0000000000400920 0 SECTION LOCAL DEFAULT 16 __dso_handle is a false resolution. So if it should be default there should be at least restriction to ignore size-less objects. The question is whether there should be also a possibility to resolve the address even to size-less objects, something like (hypothetical): set print symbol no set print symbol sizeful-only (default) set print symbol always but I think "set print symbol always" does not have to exist - there is always the explicit "info symbol" command for special cases and the RFE PR/13907 should work fine with "set print symbol sizeful-only". But even with size-ful objects the default on is not great: (gdb) p t_structs_a(struct_val1) $92 = "foo" Symbol table '.symtab' contains 177 entries: Num: Value Size Type Bind Vis Ndx Name 43: 0000000000603a90 8 OBJECT LOCAL DEFAULT 25 buf.2559 Such local symbols just make no sense to display IMO. Maybe there could be GDB hack to suppress the \.\d+$ symbols from GCC? Or even GCC suppressing them? Too much information I thought may be the reason why some old-school hackers may prefer the original behavior (I sure prefer the new behavior). But I do not mind if the option exists / does not exist there either way, it is up to Tom. There is still an open issue of updating the whole testsuite if the default is changed. Thanks, Jan