Stack unwinding does not work targeting an x86 elf on an x86_64 system
There seems to be an issue doing stack unwinding when using the tcf-agent to debug an x86 elf on an x86_64 system. The stack unwinder seems to fail at decoding the .eh_frame correctly and when decoding the DW_CFA_def_cfa command uses the register number mapping for x86_64 instead of x86 causing the cfa to be wrong.
The issue can simply be reproduced with the following main.c, compiled with the following arguments with gcc
x86 elf: gcc -g -O0 -m32 main.c -o 32-bit-gcc
x86_64 elf: gcc -g -O0 -m64 main.c -o 64-bit-gcc
Setting a breakpoint at the end function will show a correct stack unwinding for the 64-bit-gcc binary but will have a broken stack trace for the 32-bit-gcc one. main.c