This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Setting a floating point register to raw hex value


On Fri, Oct 19, 2007 at 05:48:05PM -0200, Thiago Jung Bauermann wrote:
> You mean that rs6000_convert_register_p should return true for every
> type that's not double, and then GDB would try to convert a void * to a
> double and fail?

Maybe.  To be honest, I didn't think that would reach this point at
all for the expression "(void *) $f0".  I thought that would take the
value of the register and call value_cast.  But I guess that's not
happening, or else we're marking the result of the cast as an lvalue.

GCC stopped doing that; maybe we should too.

What we really want here is not:

  set (long) $f0 = 0x1

but rather something like:

  set $f0 = reinterpret_cast<double>(0x1)

No, I'm not seriously suggesting we implement reinterpret_cast, which
C++ wouldn't let us use like that anyway.
> $sp - 8 will mess with the function's frame if he happens to be stepping
> through the prologue. Just telling to make sure Grzegorz is aware of
> it...

Depends on the architecture - only if you have a red zone.

> > Oddly, this does not work on PowerPC.  I can't figure out why
> > not.  It certainly ought to work; perhaps it requires a current
> > version of GDB, since 0x1 is a denormal.  It does work for normals,
> > though, so I know the approach is sound.
> 
> It worked for me in GDB 6.7 but not in HEAD.

Hmm, failed for me in 6.6.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]