From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1540 invoked by alias); 12 Mar 2010 15:26:47 -0000 Received: (qmail 1532 invoked by uid 22791); 12 Mar 2010 15:26:47 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Mar 2010 15:26:42 +0000 Received: (qmail 19790 invoked from network); 12 Mar 2010 15:26:41 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Mar 2010 15:26:41 -0000 From: Pedro Alves To: gdb-patches@sourceware.org, Eli Zaretskii Subject: Re: PATCH: Support x86 pseudo registers Date: Fri, 12 Mar 2010 15:26:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-19-generic; KDE/4.3.2; x86_64; ; ) Cc: hjl.tools@gmail.com, msnyder@vmware.com References: <20100301170152.GA20106@intel.com> <201003120423.07852.pedro@codesourcery.com> <83ljdy0wn9.fsf@gnu.org> In-Reply-To: <83ljdy0wn9.fsf@gnu.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201003121526.37646.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2010-03/txt/msg00450.txt.bz2 On Friday 12 March 2010 08:30:50, Eli Zaretskii wrote: > > From: Pedro Alves > > Date: Fri, 12 Mar 2010 04:23:07 +0000 > > Cc: "H.J. Lu" , > > msnyder@vmware.com > > > > I just realized that this change means that $sp is now just > > a 16-bit word of $esp, instead of a pseudo-register resolving to > > either $esp/$rsp (32-bit/64-bit). I can't say it is actually wrong to > > have it that way > > I think it's very wrong, because it means we no longer have a generic > stack pointer register, at least not on x86. Is that true? A certainly agree very much that it's not convenient to have $sp not be the largest stack pointer. I said the above based on: @cindex standard registers @value{GDBN} has four ``standard'' register names that are available (in expressions) on most machines---whenever they do not conflict with an ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ architecture's canonical mnemonics for registers. The register names ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @code{$pc} and @code{$sp} are used for the program counter register and the stack pointer. @code{$fp} is used for a register that contains a pointer to the current stack frame, and @code{$ps} is used for a register that contains the processor status. For example, you could print the program counter in hex with So, should that sentence of the manual be relaxed? I guess this would be a good place to at least mention the x86 $sp is always $esp or $rsp. -- Pedro Alves