From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27961 invoked by alias); 3 Dec 2014 03:43: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 27950 invoked by uid 89); 3 Dec 2014 03:43:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-vc0-f172.google.com Received: from mail-vc0-f172.google.com (HELO mail-vc0-f172.google.com) (209.85.220.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 03 Dec 2014 03:43:24 +0000 Received: by mail-vc0-f172.google.com with SMTP id hq11so6583262vcb.3 for ; Tue, 02 Dec 2014 19:43:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ohlBPA/aXkEY8/3viOqop4ieol7/zxvfUqKjCCaxX74=; b=JeZXKP7cuzDKUBzuPGwZbaFPQ5skyRB+mcqyknHFKeR1OHpJs1J4QEkPP+es6ltLF+ aXP4IrhtKGPb2yJi+/4CIfQM9VfjF5eIUwLHlnHJubS8sCwQuCRGxNZOlZr5aHDfdys3 Kg8YLLHTBmxB0pYZ5wx40oD6GNhl5R1OzdaWK0sQQsT5Qlxggf11U1S22trXw+pTitzu xdCgWW4x5lamzh5pDCoI+d9avRMis+TyWoRuRPb+5DEbk4n7VKhiCH5nmna9xXDe9crH TsJWGhUmDJ8Rn6NZ8hn+HkpSBRZ3+Piclisczap0U6yYVgfhRYmqu4qjOWUB7tW7E5hU 8TWA== X-Gm-Message-State: ALoCoQkiQ9q9laZU4c4REHcKMqCCqxjWeTAPgyAsJVbcgEAxu5kYDJba6VOFWjK9o2yrQIAsAKDN MIME-Version: 1.0 X-Received: by 10.52.28.7 with SMTP id x7mr1388258vdg.27.1417578201597; Tue, 02 Dec 2014 19:43:21 -0800 (PST) Received: by 10.52.114.101 with HTTP; Tue, 2 Dec 2014 19:43:21 -0800 (PST) In-Reply-To: <3508.1416603484@usendtaylorx2l> References: <3508.1416603484@usendtaylorx2l> Date: Wed, 03 Dec 2014 03:43:00 -0000 Message-ID: Subject: Re: RFA bug fix -- x86-64 stabs and deprecated fp register From: Doug Evans To: David Taylor Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-12/txt/msg00050.txt.bz2 On Fri, Nov 21, 2014 at 12:58 PM, 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. > > diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c > index e69da01..5a68c33 100644 > --- a/gdb/amd64-tdep.c > +++ b/gdb/amd64-tdep.c > @@ -3006,6 +3006,8 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch * > gdbarch) > set_gdbarch_ps_regnum (gdbarch, AMD64_EFLAGS_REGNUM); /* %eflags */ > set_gdbarch_fp0_regnum (gdbarch, AMD64_ST0_REGNUM); /* %st(0) */ > > + set_gdbarch_deprecated_fp_regnum (gdbarch, AMD64_RBP_REGNUM); /* %rbp */ > + > /* The "default" register numbering scheme for AMD64 is referred to > as the "DWARF Register Number Mapping" in the System V psABI. > The preferred debugging format for all known AMD64 targets is Hi. I haven't dug too deep to understand whether this is a good fix or not, but I have a request. Given the discussion, I think it's reasonable to assume a future reader of the code will ask "Why is this code here?" One of my pet peeves is having to spend too much time answering that question, and while I would much rather have such questions answered in the code, I also don't want to have to read more than a few sentences (in general - certainly there are cases where a paragraph or two in the code can be invaluable). At any rate ... I'll let you decide whether to add something to the code or to the commit message (or both), but at a minimum please add a full description to the commit message that explains things. Thanks!