We are running the uclibc linux on ARM 9. The problem is uclibc doesn't support backtrace. When a core dump happens, I cannot grab the call stack.
Does anyone have a good solution for that?
For example, an existing porting of backtrace for uclibc, or any good method to grab the call stack when a core dump happens (uclibc+ARM+Linux)?
Update:
It seems that a patch was created to support
backtrace()
on uclibc for x86 and ARM (XScale) and it makes use of the__libc_stack_end
symbol.Original Answer:
I worked on a project where the version of glibc we were using did not provide a functional
backtrace()
for our ARM processor, so we developed our own outside of glibc using the__libc_stack_end
symbol. Below is the resulting code. Perhaps you can use it to write a uclibcbacktrace()
function.Note: The
__libc_stack_end
symbol is no longer exported in more recent versions of glibc and I'm not sure of the existence of it or a similar symbol in uclibc.Have a look at the same question asked here:
http://lists.uclibc.org/pipermail/uclibc/2010-June/044115.html
which mentions a patch from here:
http://git.stlinux.com/?p=stm/uclibc.git;a=commit;h=d6a3d9ece5922a337800a8e2ed4db7e226f9ccb3