Re: [PATCH] Fix call functions command bug in 64-bit programs for AIX

Ulrich Weigand via Gdb-patches
2022-11-14T18:44:09Z

> {
> /* PT_WRITE_GPR requires the buffer parameter to point to an 8-byte
> area, even if the register is really only 32 bits. */
> long long buf;
> if (register_size (gdbarch, regno) == 8)
> memcpy (&buf, addr, 8);
> else
> buf = *addr;
> printf ("val in regno = %d via buf is %d and *addr is %d\n", regno, bu
f, *addr);

This doesn't work - buf is a "long long", so you need to use "%lld" to print
it, not just "%d". That's why the output for "buf" was wrong.

Also, please print the result of "register_size (gdbarch, regno)" as well,
so we know for sure which part of the if condition is actually taken.

Bye,
Ulrich