| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we have unwound the frame and then cannot set the return address
we wouldn't set any error. That meant that a dwfl_thread_getframes ()
call could end in an error, but without any dwfl_errno set, producing
the "no error" error message.
If we cannot set the return address at the end of unwinding the frame
that means that either the return address register is bogus (error),
or that the return address is undefined (end of the call stack).
This fixes the run-backtrace-native-biarch.sh testcase for me on an
i386 on x86_64 setup with gcc 7.2.1 and glibc 2.17.
Signed-off-by: Mark Wielaard <mark@klomp.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use __attribute__ ((fallthrough)) to indicate switch case fall through
instead of a comment. This ensures that the fallthrough warning is not
triggered even if the file is pre-processed (hence stripping the
comments) before it is compiled.
The actual fallback implementation is hidden behind a FALLBACK macro in
case the compiler doesn't support it.
Finally, the -Wimplict-fallthrough warning was upgraded to only allow
the attribute to satisfy it; a comment alone is no longer sufficient.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
|
|
|
|
|
|
| |
We only include them where we actually need them and only on linux.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This change also creates a new header file libeu.h to provide the
prototypes for the function of libeu. That hides the definition of function
crc32, which can conflict with zlib, from libelf. It also prevents mistakes
to refer those functions from a component which doesn't link with libeu,
such as libelf.
Signed-off-by: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
|
|
|
|
|
|
|
| |
new_unwound didn't check whether malloc was successful. Check that we
could allocate memory before use and return DWFL_E_NOMEM otherwise.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Ebl backends can define an offset that must be applied to the value of
the "return address register" defined in the CFI ABI information.
This patch makes the unwinder to use that offset when reading the RA
CFI register.
Signed-off-by: Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
| |
* Nested functions 'pop' and 'push' in libdwfl/frame_unwind.c
are moved to file scope. Used local variables are passed in
struct eval_stack.
Signed-off-by: Chih-Hung Hsieh <chh@google.com>
|
|
|
|
|
| |
Signed-off-by: Chih-Hung Hsieh <chh@google.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ARM EABI says that the zero bit of function symbol st_value indicates
whether the symbol points to a THUMB or ARM function. Also the return
value address in an unwind will contain the same extra bit to indicate
whether to return to a regular ARM or THUMB function. Add a new ebl
function to mask off such bits and turn a function value into a function
address so that we get the actual value that a function symbol or return
address points to. It isn't easily possible to reuse the existing
ebl_resolve_sym_value for this purpose, so we end up with another hook
that can be used from dwfl_module_getsym, handle_cfi and elflint.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
| |
Found by gcc -fsanitize=undefined while running the backtrace-core-ppc test.
runtime error: shift exponent 45 is too large for 32-bit type 'unsigned int'
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For PPC64 we skip resetting the return register if it is already set.
This is because on PPC64 there are two DWARF registers numbers that can
represent the same register. Setting the return address again confuses
the unwinder. But we do want to reset it if the register number
(non-translated by the ppc64 ebl) is equal to the actual register number
as set in the CIE as return address. This happens on older toolchains in
.debug_frame where the return address is set to 108, but the ebl abi_cfi
also sets register number 65.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
| |
On PPC64 there are two DWARF registers numbers that can represent the
same register. If that register is the CIE return register then we only
want to set it once. The second setting will confuse the unwinder.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
| |
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
The result of dwarf_cfi_addrframe should have been freed when done.
Dwfl_Module cached the reloc_info and the eh_cfi it which also should
have been released when disposing of the module.
Reported-by: Masatake YAMATO <yamato@redhat.com>
Tested-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|
|
|
|
| |
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
|