libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MIPS unwind only backtraces 2 local levels...


From: Sergey Korolev
Subject: Re: MIPS unwind only backtraces 2 local levels...
Date: Tue, 15 Jun 2021 00:34:54 +0300

You should build your sources with

CFLAGS += -g1 -fno-omit-frame-pointer ...
LDFLAGS += -g1 -fno-omit-frame-pointer ... (if you are using LTO)

and then split executables (and libraries) to files with DWARF unwind tables
and files with debug symbols only; for each {executable}:

objcopy --only-keep-debug .../root/{executable} .../root/usr/lib/debug/{executable}.debug
objcopy --strip-debug .../root/{executable}
objcopy --add-gnu-debuglink=.../root/usr/lib/debug/{executable}.debug {executable}

where {executable} is a relative root path to a binary file (/usr/bin/exe for example).
You may not copy /usr/lib/debug to a target rootfs but use it to translate addresses to symbols on a host.

Check also that you built all linked libraries (including libc) with -g1 and -fno-omit-frame-pointer
to get full traces.

If you are using musl for MIPS, make sure you have a patch adding CFI directives to assembler sources.
For example https://github.com/keenetic/musl/commit/ee63340090e3261d04bc7e664f352a7e7dd1c32f
(based on http://lists.openwrt.org/pipermail/openwrt-devel/2020-June/029807.html).

On Mon, Jun 14, 2021 at 10:29 PM Story, Lenny <lstory@irobot.com> wrote:
Greetings,

The backtraces on my MIPS target are only going two levels, which happen to be declared inside my local file.

Because of its size, the target is stripped of the dwarf .debug_ * seconds, and the .symtab.  Its just too big to load with symbols included.  I am only looking to get the frame addresses from the target, and plan on performing the symbol resolution off target.

What should I look for in trying to see the trace back to main ? 

Thanks !
-Lenny

This e-mail message and any files attached may contain information that iRobot Corporation considers confidential and/or proprietary or may later designate as confidential and proprietary. If you are not the intended recipient, please contact the sender and delete the email immediately. Unauthorized use or distribution is strictly prohibited.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]