This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: register type as signed or unsigned?
- From: ligang at sunnorth dot com dot cn
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gdb at sourceware dot org
- Date: Wed, 11 Oct 2006 08:37:57 +0800
- Subject: Re: register type as signed or unsigned?
Daniel Jacobowitz <drow@false.org> 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