From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21764 invoked by alias); 24 Mar 2014 09:21:57 -0000 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 Received: (qmail 21752 invoked by uid 89); 24 Mar 2014 09:21:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Mar 2014 09:21:54 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 24 Mar 2014 02:17:17 -0700 X-ExtLoop1: 1 Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga001.jf.intel.com with ESMTP; 24 Mar 2014 02:21:51 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.2]) by IRSMSX102.ger.corp.intel.com ([169.254.2.73]) with mapi id 14.03.0123.003; Mon, 24 Mar 2014 09:21:12 +0000 From: "Metzger, Markus T" To: Jan Kratochvil CC: "gdb-patches@sourceware.org" , "Pedro Alves (palves@redhat.com)" Subject: RE: [PATCH 2/2] btrace: avoid symbol lookup Date: Mon, 24 Mar 2014 09:21:00 -0000 Message-ID: References: <1394182665-14164-1-git-send-email-markus.t.metzger@intel.com> <1394182665-14164-3-git-send-email-markus.t.metzger@intel.com> <20140310214252.GA3105@host2.jankratochvil.net> <20140321172215.GA15215@host2.jankratochvil.net> <20140324083710.GA3317@host2.jankratochvil.net> In-Reply-To: <20140324083710.GA3317@host2.jankratochvil.net> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00572.txt.bz2 > -----Original Message----- > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > Sent: Monday, March 24, 2014 9:37 AM > On Mon, 24 Mar 2014 08:55:33 +0100, Metzger, Markus T wrote: > > > I do not think providing incorrect behavior for performance reasons i= s a > valid > > > tradeoff. The right way would be to fix the DWARF lookups to be fast > > > enough. > [...] > > The only actual change in functionality I was able to observe was missi= ng > > parens for the main function, >=20 > I agree in 99.9% of usecases it will work the same. This still does not = prove > it is correct. >=20 > I believe I can create a reproducer with two overlapping functions: > 0..1: a() > 2..3: b() > 4..6: a() > 7..8: b() > properly describe by DW_AT_ranges which will work with former GDB but > which > will no longer work with patched GDB. >=20 > This may definitely happen for some user .S code with hand-coded DWARF. > I do not say it necessarilly happens with any real world compiler output. >=20 > This may happen for gdb.dwarf2/dw2-objfile-overlap.exp which comes from > a real > world case of Linux kernel modules mapping. >=20 > But maybe I miss something and I would fail to create the reproducer, if = you > do not agree I can create a .S with hand coded DWARF I can try to create = one. No need. I certainly agree that one can write such an assembly file and th= at one can describe this in DWARF but not in ELF. To describe this in ELF one would split a and b and thus end up with 4 func= tions - that's what compilers seem to be doing today. And they also seem to emit DWARF that describes it that way. > Corner cases are the ones most difficult to debug and it is a pity when > debugger provides incorrect output in such corner cases. I agree. > As I said maybe this compromise is acceptable as it may not be hit in real > world usage cases but I do not want to make this decision. If you just look hard enough, I guess you will find everything somewhere. Those who use compilers, on the other hand, may not even be able to tell the difference - except that it's faster which allows them to use bigger buffers and thus record longer traces. > > I think the compromise is rather between a nice, general solution that > > benefits everybody and a local solution that only benefits btrace >=20 > This is the second reason why I did not agree with the patch. GDB needs = to > be > faster and if this PC->functionname mapping can be accelerated such way > then > it should be done globally. The specific problem of btrace is that it needs to do a huge number of symb= ol lookups within a single GDB command. I do not know any other GDB command that gets anywhere near to that. Regards, Markus. Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052