libunwind-devel
[Top][All Lists]
Advanced

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

[Libunwind-devel] MIPS Support and others


From: Rene Nielsen
Subject: [Libunwind-devel] MIPS Support and others
Date: Fri, 12 Aug 2016 07:13:35 +0000

Hi folks,

I have attached three patches that fit on top of master repo as of today
(bc8698f).

Let me explain each of them separately:

--------------------------------------oOo--------------------------------------
mips-remote-support.patch:
libunwind already had support for local unwind on a MIPS. This patch makes
support for remote unwinding on a MIPS.

I should add a few words to the changes to _UPT_access_mem.c: On MIPS, an
unw_word_t is defined as a 64-bit integer whether it's compiled for a 32- or a
64-bit MIPS.

When doing remote unwinding using the default _UPT_accessors, dwarf_readu8()
therefore expects _UPT_access_mem() to return a 64-bit integer. However, if
compiled on a 32-bit MIPS, only 32 bits are valid upon return from
_UPT_access_mem(). The patch detects this and will in this case perform two
calls to ptrace(PTRACE_POKE/PEEK_DATA) and organize the return value according
to endianness.

--------------------------------------oOo--------------------------------------
compile-warnings.patch:
This fixes a number of compiler warnings I got when compiling for mips32el with
gcc 5.3.0.

--------------------------------------oOo--------------------------------------
get-image-name.patch:
This patch adds a new public function, unw_get_image_name(), which may be used
to obtain the image name given a program counter. It is very similar to
unw_get_proc_name(), but returns the name of the binary rather than the name of
the function containing the program counter.

I used to use libbacktrace (libgcc_s), which doesn't support remote unwinding
(which is why I started using libunwind). In libbacktrace, the output of
backtrace_symbols() is a string that contains both the image and the proc name,
and I really like that, which is why I made support for that in libunwind.

The new function is supported for both local and remote unwinding, but not for
coredumps.

--------------------------------------oOo--------------------------------------
Let me stress that I've only tested these patches on a MIPS32 running little
endian.

Regards,
Rene Schipp von Branitz Nielsen

Attachment: mips-remote-support.patch
Description: mips-remote-support.patch

Attachment: compile-warnings.patch
Description: compile-warnings.patch

Attachment: get-image-name.patch
Description: get-image-name.patch


reply via email to

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