8devices / carambola2

Carambola 2 - an AR9331/SoC based PCB
GNU General Public License v2.0
56 stars 43 forks source link

Recovering stack trace on dumped core #66

Closed mpbn4 closed 3 years ago

mpbn4 commented 8 years ago

Hello,

I know it is not an issue, but I didn't find any other place to ask this question directly.

Could you help me to recover a stack trace for MIPS architecture same as specified in:

http://stackoverflow.com/questions/9809810/gdb-corrupted-stack-frame-how-to-debug

for x86? I have a core dump with same problem.

I have a cross compilation environment on my PC and the core dump comes from the target (which is carambola2).

When I modify

set $pc = *(void **)$esp

to:

set $pc = *(void **)$sp.

I get "you can't do that without a process to debug". I would like to know if it is possible to recover this stack trace the way described in the above topic.

mantas-p commented 8 years ago

Hi,

You can use gdbserver on Carambola2 and connect to it with gdb running on PC to have live debug session. Then this trick might work. You can even try to install gdb package on Carambola2, though you may run out of RAM or flash space doing so.

Another idea is to modify coredump file itself: http://stackoverflow.com/questions/7611082/linuxmips-temporarily-change-register-contents-when-viewing-core-dump didn't try that, but may work for you.

valinskas commented 3 years ago

Closing issue, 5y+ since last activity.