From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22987 invoked by alias); 22 May 2007 16:47:28 -0000 Received: (qmail 22739 invoked by uid 22791); 22 May 2007 16:47:22 -0000 X-Spam-Check-By: sourceware.org Received: from mms3.broadcom.com (HELO MMS3.broadcom.com) (216.31.210.19) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 22 May 2007 16:47:16 +0000 Received: from [10.10.64.154] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.1)); Tue, 22 May 2007 09:47:02 -0700 X-Server-Uuid: 20144BB6-FB76-4F11-80B6-E6B2900CA0D7 Received: by mail-irva-10.broadcom.com (Postfix, from userid 47) id B33F02AF; Tue, 22 May 2007 09:47:02 -0700 (PDT) Received: from mail-irva-8.broadcom.com (mail-irva-8 [10.10.64.221]) by mail-irva-10.broadcom.com (Postfix) with ESMTP id 9FAD12AE; Tue, 22 May 2007 09:47:02 -0700 (PDT) Received: from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com [10.10.64.146]) by mail-irva-8.broadcom.com (MOS 3.7.5a-GA) with ESMTP id FHV70804; Tue, 22 May 2007 09:47:02 -0700 (PDT) Received: from NT-IRVA-0752.brcm.ad.broadcom.com ( nt-irva-0752.brcm.ad.broadcom.com [10.8.194.67]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id 1899569CA3; Tue, 22 May 2007 09:47:02 -0700 (PDT) Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: Info reg sp Date: Tue, 22 May 2007 16:47:00 -0000 Message-ID: In-Reply-To: <20070522163204.GA25392@caradoc.them.org> References: <20070522153414.GA23001@caradoc.them.org> <20070522163204.GA25392@caradoc.them.org> From: "Robert Norton" To: "Daniel Jacobowitz" cc: gdb@sourceware.org X-WSS-ID: 6A4DC10C38G32133947-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-05/txt/msg00112.txt.bz2 =20 > -----Original Message----- > From: Daniel Jacobowitz [mailto:drow@false.org]=20 > Sent: 22 May 2007 17:32 >=20 > Not a very satisfactory immunity; it will just print nothing.=20 > I think this was reported as a bug before. True. I think the correct fix is not target specific (hence the original email). Either at the frame level (as you suggest) or simply by changing the code in infcmd.c (but this is less general). In any case this is fixed for me for now by the following code in my print_registers_info: if (regnum > NUM_REGS+NUM_PSEUDO_REGS) { /* this happens when user types e.g. 'info reg sp'=20 * because sp is a builtin user reg -- try to handle * it elegantly */ struct value *user_val =3D value_of_user_reg (regnum, frame); /* we assume that user_val is a long, is this valid? */ LONGEST user_val_long =3D value_as_long(user_val); const char *regname =3D user_reg_map_regnum_to_name(get_frame_arch(frame), regnum); fputs_filtered (regname, gdb_stdout); /* 12 is magic: it's appropriate for the maximum length of a register name */ print_spaces_filtered (12 - strlen (regname), gdb_stdout); printf_filtered("0x%llx\n", user_val_long); return; } As a secondary thought a 'print_user_reg' function would be nice. Thanks again, Robert