Re: [RFC] setting the raw content of a register

Jerome Guitton
2012-05-22T15:25:20Z

Pedro Alves (palves@redhat.com):

> What about :
>
> p $f14 = {double} {0xFFF0000000000050}

I've been testing with a bareboard PPC, and this needs malloc;
let me check how it would work on a target with malloc. Any chance
that it would give me something different than my macro "raw_to_double"
(that uses the stack instead of the heap)?

define raw_to_double
set $stack_content = *((long long *) ($sp - 8))
set *((long long *) ($sp - 8)) = $arg0
x/2x ((double *) ($sp - 8))
p *((double *) ($sp - 8))
set *((long long *) ($sp - 8)) = $stack_content
end

(gdb) raw_to_double 0xFFF0000000000050
0x1fffd8: 0xfff00000 0x00000050
$3 = -nan(0x000000050)
(gdb) set $f14 = $
(gdb) info registers $f14
f14 nan(0x100000001) (raw 0x7ff0000100000001)