From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6678 invoked by alias); 10 Oct 2006 12:50:12 -0000 Received: (qmail 6669 invoked by uid 22791); 10 Oct 2006 12:50:11 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 10 Oct 2006 12:50:05 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GXH3a-0004WF-Ri; Tue, 10 Oct 2006 08:50:02 -0400 Date: Tue, 10 Oct 2006 12:50:00 -0000 From: Daniel Jacobowitz To: ligang@sunnorth.com.cn Cc: gdb@sourceware.org Subject: Re: register type as signed or unsigned? Message-ID: <20061010125001.GA17340@nevyn.them.org> Mail-Followup-To: ligang@sunnorth.com.cn, gdb@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00052.txt.bz2 On Tue, Oct 10, 2006 at 04:39:18PM +0800, ligang@sunnorth.com.cn wrote: > hello all, > > I am porting GDB to a new target. > I am not aware of the meaning of register type. > You can do as follows: > set_gdbarch_register_type (gdbarch, builtin_type_int32); > or > set_gdbarch_register_type (gdbarch, builtin_type_uint32); > > What is the real difference between the two situation? > Why should GDB specify the register type as signed or unsigned? > Dose it mean the former must use regcache_cooked_read_signed() and the > latter must use > regcache_cooked_read_unsigned()? No; in fact, it doesn't make much difference. You should use whichever is "more natural" for your target instruction set; it will affect "print $reg" and "info reg". -- Daniel Jacobowitz CodeSourcery