From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2582 invoked by alias); 11 Oct 2006 00:35:50 -0000 Received: (qmail 2568 invoked by uid 22791); 11 Oct 2006 00:35:49 -0000 X-Spam-Check-By: sourceware.org Received: from Unknown (HELO mswbj01.sunnorth.com.cn) (218.247.162.66) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 11 Oct 2006 00:35:43 +0000 Received: from maillog.sunnorth.com.cn (unverified [172.20.10.250]) by mswbj01.sunnorth.com.cn (Clearswift SMTPRS 5.2.5) with ESMTP id ; Wed, 11 Oct 2006 08:37:04 +0800 Received: from ntns1cn.sunnorth.com.cn (ntns1cn.sunnorth.com.cn [172.20.10.252]) by maillog.sunnorth.com.cn (8.12.10/8.12.10) with ESMTP id k9B1momQ026934; Wed, 11 Oct 2006 09:48:50 +0800 In-Reply-To: <20061010125001.GA17340@nevyn.them.org> To: Daniel Jacobowitz Cc: gdb@sourceware.org Subject: Re: register type as signed or unsigned? MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.5 September 26, 2003 Message-ID: From: ligang@sunnorth.com.cn Date: Wed, 11 Oct 2006 00:35:00 -0000 Content-Type: text/plain; charset="US-ASCII" 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/msg00054.txt.bz2 Daniel Jacobowitz wrote on 2006-10-10 20:50:02: > 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". That is to say, whether builtin_type_int32 or builtin_type_uint32 is correct for GDB. But how to understand "more natural" and how dose it affect "info reg"? Would you please give me some more hints? > -- > Daniel Jacobowitz > CodeSourcery