From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4065 invoked by alias); 18 Sep 2013 08:28:27 -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 4051 invoked by uid 89); 18 Sep 2013 08:28:27 -0000 Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2013 08:28:27 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_50,KHOP_THREADED,RDNS_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mga14.intel.com Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga102.ch.intel.com with ESMTP; 18 Sep 2013 01:28:23 -0700 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by AZSMGA002.ch.intel.com with ESMTP; 18 Sep 2013 01:28:22 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.69]) by IRSMSX101.ger.corp.intel.com ([163.33.3.153]) with mapi id 14.03.0123.003; Wed, 18 Sep 2013 09:28:21 +0100 From: "Metzger, Markus T" To: Jan Kratochvil CC: "gdb-patches@sourceware.org" Subject: RE: [patch v4 24/24] record-btrace: skip tail calls in back trace Date: Wed, 18 Sep 2013 08:28:00 -0000 Message-ID: References: <1372842874-28951-1-git-send-email-markus.t.metzger@intel.com> <1372842874-28951-25-git-send-email-markus.t.metzger@intel.com> <20130818190949.GS24153@host2.jankratochvil.net> In-Reply-To: Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00570.txt.bz2 > -----Original Message----- > From: Metzger, Markus T > Sent: Tuesday, September 17, 2013 4:28 PM > > reverse-next^M > > __GI_____strtoul_l_internal (nptr=3D, endptr=3D, > > base=3D, group=3D, loc=3D)= at > > ../stdlib/strtol_l.c:531^M > > 531 }^M > > (gdb) FAIL: gdb.btrace/rn-dl-bind.exp: rn-dl-bind, 2.3 bt^M > > #0 __GI_____strtoul_l_internal (nptr=3D, > > endptr=3D, base=3D, group=3D, > > loc=3D) at ../stdlib/strtol_l.c:531^M > > #1 0x00007ffff7228f8d in __GI_strtoul (nptr=3D > Registers are not available in btrace record history>, endptr=3D > reading > > variable: Registers are not available in btrace record history>, > > base=3D > record history>) at ../stdlib/strtol.c:108^M > > #2 _dl_runtime_resolve () at ../sysdeps/x86_64/dl-trampoline.S:56^M > > #3 0x00000000004004c6 in ?? ()^M > > #4 0x00000000004004fb in strtoul@plt ()^M > > #5 0x000000000040060c in test () at ./gdb.btrace/rn-dl-bind.c:26^M > > #6 0x0000000000400621 in main () at ./gdb.btrace/rn-dl-bind.c:35^M > > Backtrace stopped: not enough registers or memory available to unwind > > further^M >=20 > I need to investigate this. If we skip tail calls, GDB recognizes that we reverse-stepped into a subroutine and keeps stepping. If we don't skip tail calls, GDB fails to recognize this and stops stepping due to the absence of line information. The line information is also missing when we skip tail calls, but the stepp= ed- into-subroutine check comes before the has-line-info check. When searching for the caller frame id in infrun.c, GDB skips artificial fr= ames including normal TAILCALL_FRAMEs. I guess this is why it works for live stepping and also for record-full. One way to solve this would be to add a BTRACE_TAILCALL_FRAME and extend struct target_ops to provide two optional unwinders that are both tried before any arch unwinder. I'd try this unless you have a better idea. 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