This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: exp/1811: "set var x = y" doesn't work properly if sizeof(x) < sizeof(register)
- From: Daniel Jacobowitz <dan at debian dot org>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 21 Nov 2004 16:58:00 -0000
- Subject: Re: exp/1811: "set var x = y" doesn't work properly if sizeof(x) < sizeof(register)
- Reply-to: Daniel Jacobowitz <dan at debian dot org>
The following reply was made to PR exp/1811; it has been noted by GNATS.
From: Daniel Jacobowitz <dan@debian.org>
To: Randolph Chung <tausq@debian.org>, gdb-gnats@sources.redhat.com
Cc:
Subject: Re: exp/1811: "set var x = y" doesn't work properly if sizeof(x) < sizeof(register)
Date: Sun, 21 Nov 2004 11:55:50 -0500
On Fri, Nov 19, 2004 at 04:38:00PM -0000, Randolph Chung wrote:
> well, yes, but....
>
> gdb doesn't do the sign extension right? it just writes the byte into
> the register. if i look at the code that gcc generates, it looks
> something like:
Yes. My opinion is that GDB probably -should- do the sign extension.
When storing into a value which lives in a register, convert it to the
type of the register.
I'm not sure if we can do this cleanly; consider a struct of word
size that lives in a register. We've got to represent that somehow,
and now we don't.
--
Daniel Jacobowitz