mirror of
https://github.com/JakeHillion/drgn.git
synced 2024-12-23 01:33:06 +00:00
libdrgn: ppc64: fix fetching cr fields from pt_regs
The condition register fields are numbered from most significant to least significant. Also, the CFI for unwinding the condition register fields restores them in their position in the condition register, so do the same when initially populating them. Signed-off-by: Omar Sandoval <osandov@osandov.com>
This commit is contained in:
parent
547333d8ca
commit
36df5fc076
@ -159,7 +159,7 @@ set_initial_registers_from_struct_ppc64(Dwfl_Thread *thread, const void *regs,
|
||||
/* cr0 - cr7 */
|
||||
uint64_t ccr = READ_REGISTER(38);
|
||||
for (int i = 0; i < 8; i++)
|
||||
dwarf_regs[i] = (ccr >> (4 * i)) & 0xf;
|
||||
dwarf_regs[i] = ccr & (UINT64_C(0xf) << (28 - 4 * i));
|
||||
if (!dwfl_thread_state_registers(thread, 68, 8, dwarf_regs))
|
||||
return drgn_error_libdwfl();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user