From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24413 invoked by alias); 30 Nov 2014 18:59:29 -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 24400 invoked by uid 89); 30 Nov 2014 18:59:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: glazunov.sibelius.xs4all.nl Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 30 Nov 2014 18:59:25 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id sAUIxG47018671; Sun, 30 Nov 2014 19:59:16 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id sAUIxFTU016422; Sun, 30 Nov 2014 19:59:15 +0100 (CET) Date: Sun, 30 Nov 2014 18:59:00 -0000 Message-Id: <201411301859.sAUIxFTU016422@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: brobecker@adacore.com CC: dtaylor@emc.com, gdb-patches@sourceware.org In-reply-to: <20141130152036.GC4882@adacore.com> (message from Joel Brobecker on Sun, 30 Nov 2014 19:20:36 +0400) Subject: Re: RFA bug fix -- x86-64 stabs and deprecated fp register References: <3508.1416603484@usendtaylorx2l> <20141130152036.GC4882@adacore.com> X-SW-Source: 2014-11/txt/msg00755.txt.bz2 > Date: Sun, 30 Nov 2014 19:20:36 +0400 > From: Joel Brobecker > > David, > > On Fri, Nov 21, 2014 at 03:58:04PM -0500, David Taylor wrote: > > Sometimes when using STABS on x86-64 GNU/Linux, GDB does not know which > > register to use for the frame pointer and as a result offsets from the > > frame pointer are treated as absolute addresses rather than as > > offsets... > > > > This patch provides a default for when the debug information doesn't > > specify which register to use. > > > > We have seen this problem when debugging problems with a previous > > release of our software (I believe it was built with GCC 4.5.x, if that > > matters). > > > > There were no regressions on x86-64 GNU/Linux. > > > > 2014-11-21 David Taylor > > > > * amd64-tdep.c (amd64_init_abi): Set default frame pointer. > > I don't think your patch is correct, as it is going to affect > the outcome of... > > (gdb) print $fp > > ... for frameless functions compiled with DWARF2. See > std-regs.c:value_of_builtin_frame_fp_reg. > > If we were to apply your patch, it would unconditionally print > the contents of the %rbp register as the result, which is not > what we've been printing so far. > > I wish I could suggest another approach but I haven't had to touch > stabs support in several years, now. If you provided a bit more details > as to what actually happened in the debugger and where, I might be > able to help you better. But any effort is much better spent on switching to DWARF2. STABS support ws already considered obsolete when AMD64 support was added to GDB more than a decade ago.