From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28533 invoked by alias); 16 Sep 2013 11:21:37 -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 28518 invoked by uid 89); 16 Sep 2013 11:21:36 -0000 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, 16 Sep 2013 11:21:36 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_50,KAM_STOCKGEN,KHOP_THREADED,RDNS_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mga09.intel.com Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 16 Sep 2013 04:18:31 -0700 X-ExtLoop1: 1 Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga002.jf.intel.com with ESMTP; 16 Sep 2013 04:21:32 -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; Mon, 16 Sep 2013 12:21:31 +0100 From: "Metzger, Markus T" To: Jan Kratochvil CC: "gdb-patches@sourceware.org" Subject: RE: [patch v4 18/24] record-btrace: extend unwinder Date: Mon, 16 Sep 2013 11:21:00 -0000 Message-ID: References: <1372842874-28951-1-git-send-email-markus.t.metzger@intel.com> <1372842874-28951-19-git-send-email-markus.t.metzger@intel.com> <20130818190842.GN24153@host2.jankratochvil.net> In-Reply-To: <20130818190842.GN24153@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: 2013-09/txt/msg00436.txt.bz2 > -----Original Message----- > From: Jan Kratochvil [mailto:jan.kratochvil@redhat.com] > Sent: Sunday, August 18, 2013 9:09 PM > > An assertion in get_frame_id at frame.c:340 requires that a frame > > provides a stack address. The record-btrace unwinder can't provide > > this since the trace does not contain data. I incorrectly set > > stack_addr_p to 1 to avoid the assertion. >=20 > Primarily record-btrace can provide the stack address. You know $sp at t= he > end of the recoding and you can query .eh_frame/.debug_frame at any PC > address what is the difference between $sp and caller's $sp at that exact= PC. > This assumes either all the involved binaries were built with -fasynchron= ous- > unwind-tables (for .eh_frame) or that debug info (for .debug_frame) is > present. The former is true in Fedora / Red Hat distros, unaware how oth= ers. This would only hold for functions that have not yet returned to their call= er. If we go back far enough, the branch trace will also contain functions that have already returned to their caller for which we do not have any informat= ion. I would even argue that this is the majority of functions in the branch tra= ce. > The current method of constant STACK_ADDR may have some problems with > frame_id_inner() but I did not investigate it more. By looking at the code, frame_id_inner () should always fail since all btra= ce frames have stack_addr =3D=3D 0. On the other hand, frame_id_inner is only called for frames of type NORMAL_FRAME, whereas btrace frames have type BTRACE_FRAME. > > When evaluating arguments for printing the stack back trace, there's > > an ugly error displayed: "error reading variable: can't compute CFA for= this > frame". > > The error is correct, we can't compute the CFA since we don't have the > > stack at that time, but it is rather annoying at this place and makes > > the back trace difficult to read. This has meanwhile been resolved. This had been a side-effect of throwing an error in to_fetch_registers. When I just return, function arguments are correctly displayed as unavailable and the "can't compute CFA for this fram= e" message is gone. > > + if (bfun =3D=3D NULL) > > + return ""; >=20 > _("") I replaced this with ??. > > + > > + msym =3D bfun->msym; > > + sym =3D bfun->sym; > > + > > + if (sym !=3D NULL) > > + return SYMBOL_PRINT_NAME (sym); > > + else if (msym !=3D NULL) > > + return SYMBOL_PRINT_NAME (msym); > > + else > > + return ""; >=20 > _("") I replaced this with ??. 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