| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
apply e85b65ce fix to loongarch64
Signed-off-by: Shuo Wang <wangshuo_1994@foxmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow local and remote unwinding through signal frames
when variable length SVE registers are pushed onto the
stack.
The vector length is saved by the kernel into the signal
context, but it is not scaled in the same way that
dwarf expects it to be. Therefore a conditional has
been added to tdep_access_regs() that scales the value
depending on whether it is going to be accessed through
a register or through memory.
Signed-off-by: James Clark <james.clark@arm.com>
Change-Id: Ie16aa22b36127ba5aa81f20280b1df7e4ba6d49b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows remote only unwinding though an SVE
function that pushes SVE registers onto the stack[1].
The remote unwinder is responsible for providing the
value of the VG register at the time the sample was
taken.
[1]: https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst
Signed-off-by: James Clark <james.clark@arm.com>
Change-Id: I8a203b73b17cd4a07afc1fdc55ad11765d73e173
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the 0 magic number and use the existing macro
DWARF_MEM_LOC that makes it more readable that signal
frame locations are stored in memory.
No functional changes.
Signed-off-by: James Clark <james.clark@arm.com>
Change-Id: I5b15b4111290dec8e678b8bbd8c9d62d6e52fda0
|
|
|
|
|
|
|
|
|
| |
Simplify the restoration sequence in case of tail calls, and use the
long-supported "jr" alias instead of the fully spelled out jirl form
for brevity.
Suggested-by: qiaopengcheng <qiaopengcheng-hf@loongson.cn>
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original port was done with an early in-house port of Linux that, in
addition to slightly different UAPI headers, also featured a MIPS-like
ABI (the so-called "old world" ABI). The upstream ABI has been revised
since long ago and already frozen, so adjust the port for the "new world".
In particular, we don't have the 24-byte signal trampoline area any more
which was a MIPS o32 thing.
We don't need to keep compatibility for the old-world kernels, because
distributions using said kernels invariably packaged their own libunwind
fork with corresponding support, and the few users tracking upstream
kernels should all have moved on.
Fixes: c5f1d12c77de ("Add port for Linux on LoongArch")
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The libunwind LoongArch64 port was done using an early fork of Linux,
with slightly different naming for the register definition symbols.
The libunwind port went in before the kernel port got finalized and
merged, and was never adjusted; so fixing the usage here before release.
Practically no user would be affected since everyone on (development)
upstream kernels would have migrated long ago.
Fixes: c5f1d12c77de ("Add port for Linux on LoongArch")
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
A recent change missed adding a new header to the dist list. `make distckeck`
now runs successfully once again.
Fixes #409
|
|
|
| |
This change fixes unwinding from the vsyscall region. Although vsyscall has been phased out, it is still possible to call into it at an address where libunwind is unable to step out of.
|
| |
|
|
|
|
|
|
|
| |
* Fix typos
* Cleanup trailing whitespaces in committed files
* Update include/tdep-ia64/libunwind_i.h
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The coredump remote was architected on the assumption that the .text and
.eh_frame sections were mapped onto the same segment, and that that segment was
always the first PT_LOAD segment in an ELF file. Well, that was never a valid
assumption, and moderns releases of various toolchains have started splitting
the PT_LOAD segments for security reasons.
This change implements an M:N mapping of PT_LOAD segments in a coredump file to
backing ELF files and calculates and adjusts offsets appropriately. Because the
backing files get mapped in a lot of file I/O operations have been replaced with
simple memory reads. Once a backing file is memory mapped is stays mapped until
the address space is destroyed.
The ucd_*.[ch] files contain only functions that should not be exposed through
the public API so they;re not mangled using the UB naming schedule because I
just bring myself to write code with undefined behaviour.
Reformatted some of the changed files using `astyle --style=gnu` for internal
consistency withing the file.
Fixes #363
|
|
|
|
|
|
|
|
|
| |
The existing code was identifying the segment containing the executable code
(.text section) by assuming it was effectively the first loadable segment. Th
has always worked up until recently but was an invalid assumption. The right
thing to do is check the segment flags to see if the execute bit is set.
This change does just that. Tested on Linux x86_64, no new regressions.
|
|
|
|
|
|
|
| |
Data of this type was added for the s390x port doesn't exists on all OSes. It
needs to be autodetected and optioned out.
Fixes #373
|
| |
|
|
|
|
|
|
|
|
| |
* Add remote unwinding support for macOS
* Fix broken Win build by bumping minimum language requirement to C11
* Update license headers
* Rename remote_unwind to remote
* Revert Gparser.c
|
|
|
|
|
|
|
|
|
|
| |
Instead of struct elf_prstatus or struct prstatus, QNX has a procfs_status
typedef. Added autoconfigury to detect that and switched using a preprocessor
macro to define the type used as a typedef of UCD_proc_status_t instead.
Also changed some field name references where required.
Signed-off-by: Stephen Webb <swebb@blackberry.com>
|
|
|
|
|
|
|
|
|
|
| |
This change adds s390x coredump support, it contains the following:
It adds reading the NT_FPREGSET notes, as the floating point registers are needed for unwinding on s390x.
The fpregset is added to the thread data structure.
The getter for floating point registers was implemented (at least for s390x).
A register mapping for the registers in NT_PRSTATUS was added, as the register indices of the enum in libunwind are different to those in prstatus.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following pull request, targeting aarch64, introduced a build
failure:
https://github.com/libunwind/libunwind/pull/360
(f67ef2867bc5e74cdadb3acb790c3fc6161b22e9)
The failing build was with the msvc compiler. According to
https://docs.microsoft.com/en-us/cpp/assembler/inline/inline-assembler?view=msvc-170
the compiler only supports inline asm on x86.
Since the inline assembly is only for local unwinding, this patch fixes
the build by only compiling the inline assembly if UNW_REMOTE_ONLY is
not defined. This works because the msvc build has UNW_REMOTE_ONLY set
in the CMakeLists.txt file.
|
|
|
|
| |
This reverts commit a9d50ef5066e8ff959dee5df5f997cc72c528f26.
|
|
|
|
|
|
|
|
|
|
| |
When cross-compiling for Linux on Windows using VC toolchain
(in dotnet/runtime), we get the following error:
> error C2057: expected constant expression
This is because VC runtime does not support VLAs
The fix is to use a C constant.
|
| |
|
| |
|
|
|
|
|
| |
Mostly just relevant for fp registers, which are frequently mostly just
ignored otherwise.
|
|
|
|
|
|
| |
In the case that the CFI is incorrect, the return address column entry
may be incorrect and point outside of the range of the program. Add a
cheap validation to prevent the errant memory access.
|
| |
|
| |
|
|
|
|
| |
While here, mention that FreeBSD/PPC64 is also supported.
|
| |
|
|
|
|
| |
when it is logically appropriate.
|
|
|
|
|
| |
This converts the invalid arithmetic negation on an unsigned value
to use the identity of bitwise negation plus one.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the ability for libunwind to unwind a stack where the
return address obtained from the arm64 link register (x30) has
a pointer authentication code (PAC).
Without this patch, the unw_step function terminates early, leaving the
user the impression there is only a leaf frame when there are more.
The reason for the premature termination is that an aarch64 specific
CFI opcode 'DW_CFA_AARCH64_negate_ra_state' is not recognised, and
treated as unexpected. Upon the next iteration's call of unw_step, it
reports the end of the stack.
For an expected callstack of
loop // most recent call
call3
call2
call1
main // oldest call
The caller of libunwind observes:
unw_step() = 1
unw_get_reg(UNW_REG_IP) = 0, pc = 0xaaaae4720798
unw_step() = 1
unw_get_reg(UNW_REG_IP) = 0, pc = 0x5faaaae47207cc // ip with PAC
unw_step() = 0 // premature end
For remote unwinding, this patch adds an optional callback function
'ptrauth_insn_mask' on unw_accessors_t so that unw_step can correctly
strip off the PAC to leave the correct return address. This also has
the benefit that an attempt to get the name of the function with
unw_get_proc_name can succeed.
The callback is given the original unw_addr_space_t and as_arg as given
to unw_init_remote. The application needs to ensure the mask to be
returned is somehow available on the as_arg and callback should return
it.
The callback is only needed for remote unwinding. In local unwinding,
an instruction is used to strip the PAC.
A description of pointer authentication is in the armv8 reference manual
available here:
https://developer.arm.com/documentation/ddi0487/ha/?lang=en
(Version H.a, section D5.1.5 Pointer authentication in AArch64 state,
page D5-4772)
Also documentation for the use of DWARF with pointer authentication, in
particular the RA_SIGN_STATE:
https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst
|
| |
|
|
|
|
| |
- causes deadlock in signal handler
|
| |
|