Only question marks in backtrace reported by gdb on ARM

后端 未结 2 1338
無奈伤痛
無奈伤痛 2020-12-31 17:12

I\'m trying to debug a software with gdbserver on ARM to get a backtrace of a crash. Unfortunately I get only question marks. Everywhere, I read this problem is simply relat

2条回答
  •  生来不讨喜
    2020-12-31 18:00

    One trick you can sometimes use when you get the "SEGV at address 0" problem is to manually pop the return address from the top of the stack into the pc and trying to do a stack trace from there. This assumes that you got to address 0 by doing an indirect call through a NULL pointer, which is the most common way of getting to address 0.

    Now I'm not too familiar with ARM, but on an x86 PC, you would do:

    (gdb) set $eip = *(void **)$esp
    (gdb) set $esp = $esp + 4
    

    and then do another backtrace to figure out where you really are.

    If you can figure out the calling convention used for ARM by your compiler, you should be able to do something similar.

提交回复
热议问题