peadar / pstack

Print stack traces from running processes, or core files. Supports aarch64, x86_64, and i386
BSD 2-Clause "Simplified" License
132 stars 31 forks source link

arm32: incomplete type ‘Elf::CoreRegisters {aka Elf::user_regs_struct}’ #18

Open wasphin opened 2 years ago

wasphin commented 2 years ago

Failed to cross-compile for arm32, which seems to have no definition for user_regs_struct, is there any workaround for this?

error: invalid application of ‘sizeof’ to incomplete type ‘Elf::CoreRegisters {aka Elf::user_regs_struct}’
                memcpy(reg, &prstatus.pr_reg, sizeof(*reg));
peadar commented 2 years ago

Hi, Thanks for the report. I submitted https://github.com/peadar/pstack/commit/a7827700814c79174528c60cd43337db72357a6f to fix the build issue, but there are other problems causing the stack unwinding to fail - that'll take longer to fix. I need to work out how 32-bit arm differs from other platforms in how it uses the eh_frame section.

peadar commented 2 years ago

Ah - I remember now. Realistically, the stack unwinding in pstack won't work for arm32, because it uses a different, arm32-specific section to encode the rules for unwinding the stack. I at least have a device I can test with now (i.e., I found my raspberry pi in a box of junk), so I can try and make sense of the .ARM.extab and .ARM.exidx tables in the next few weeks.

cornermoss commented 7 months ago

warning: exception unwinding stack: no FDE/CIE/CFI for instruction address

pstack 2.4.7 still does not support ARM-32 (eg, Novatek NT98632 arm-ca53-linux-gnueabihf-8.4) . process.cc ThreadStack::unwind not support arm ?