drgn/libdrgn
Omar Sandoval cbdf6094b7 libdrgn: ppc64: fix DWARF link register confusion
The usage of the link register in DWARF is a little confusing. On entry
to a function, the link register contains the address that should be
returned to. However, for DWARF, the link register is usually used as
the CFI return_address_register, which means that in an unwound frame,
it will contain the same thing as the program counter. I initially
thought that this was a mistake, believing that the link register should
contain the _next_ return address. However, after a return (with the blr
instruction), the link register will indeed contain the same address as
the program counter. This is consistent with our documentation of
register values for function call frames: "the register values are the
values when control returns to this frame".

So, rename our internal "ra" register to "lr", expose it to the API, and
add a little more documentation to the ppc64 initial register code.

Fixes: 221a218704 ("libdrgn: add powerpc stack trace support")
Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-06-25 22:39:30 -07:00
..
build-aux libdrgn: rework architecture definition files 2022-06-25 22:39:26 -07:00
examples Fix various lints 2022-02-17 10:45:42 -08:00
include libdrgn: add latest elf.h and dwarf.h to support elfutils 0.165 2021-03-21 23:18:39 -07:00
m4 libdrgn: add autoconf option to enable compiler warnings 2022-03-01 15:38:05 -08:00
python libdrgn: add DRGN_ERROR_NOT_IMPLEMENTED 2022-04-28 13:38:38 -07:00
.gitignore libdrgn: use memswitch for linux_kernel_object_find 2022-02-08 02:03:11 -08:00
arch_aarch64.c libdrgn: add stub AArch64 architecture with relocation implementation 2022-04-19 00:23:56 -07:00
arch_arm.c libdrgn: add stub Arm architecture with relocation implementation 2022-04-19 00:25:05 -07:00
arch_i386.c libdrgn: add stub i386 architecture with relocation implementation 2022-04-19 00:21:59 -07:00
arch_ppc64_defs.py libdrgn: ppc64: fix DWARF link register confusion 2022-06-25 22:39:30 -07:00
arch_ppc64.c libdrgn: ppc64: fix DWARF link register confusion 2022-06-25 22:39:30 -07:00
arch_riscv.c libdrgn: add stub RISC-V architecture with relocation implementation 2022-04-19 11:51:23 -07:00
arch_x86_64_defs.py libdrgn: x86-64: add a few more register definitions 2022-06-25 22:39:30 -07:00
arch_x86_64.c libdrgn: x86-64: add a few more register definitions 2022-06-25 22:39:30 -07:00
array.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
binary_buffer.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
binary_buffer.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
binary_search_tree.h libdrgn: binary_search_tree: move member and entry_to_key to DEFINE_BINARY_SEARCH_TREE_FUNCTIONS() 2022-05-24 15:26:39 -07:00
bitops.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
cfi.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
cfi.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
cityhash.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
configure.ac drgn 0.0.19 2022-05-18 13:57:02 -07:00
debug_info.c libdrgn: move alloc_or_reuse() to util.h 2022-06-01 05:11:58 -07:00
debug_info.h libdrgn: handle reading data from SHT_NOBITS sections 2022-01-27 12:23:09 -08:00
Doxyfile libdrgn: clean up stale comment references and Doxygen warnings 2021-03-16 16:15:43 -07:00
drgn.h.in libdrgn: add drgn_error_dwrite() 2022-05-23 11:09:10 -07:00
dwarf_info.c libdrgn: support reference and absent objects with >64-bit integer types 2022-04-28 13:38:38 -07:00
dwarf_info.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
error.c libdrgn: add drgn_error_dwrite() 2022-05-23 11:09:10 -07:00
error.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
hash_table.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
hash_table.h libdrgn: hash_table: sanity check integer sizes more 2022-04-12 16:18:46 -07:00
helpers.h Implement a new API for representing threads 2022-01-11 17:28:17 -08:00
kdump.c libdrgn: add stub RISC-V architecture with relocation implementation 2022-04-19 11:51:23 -07:00
language_c.c Enable prog.type to work with classes 2022-02-22 14:55:23 -08:00
language.c Fix various lints 2022-02-17 10:45:42 -08:00
language.h Enable prog.type to work with classes 2022-02-22 14:55:23 -08:00
lazy_object.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
lazy_object.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
lexer.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
lexer.h Enable prog.type to work with classes 2022-02-22 14:55:23 -08:00
linux_kernel_helpers.c Fix various lints 2022-02-17 10:45:42 -08:00
linux_kernel_object_find.inc.strswitch libdrgn: use memswitch for linux_kernel_object_find 2022-02-08 02:03:11 -08:00
linux_kernel.c libdrgn: linux_kernel: match explicitly-reported kernel modules by build ID 2022-06-01 14:21:12 -07:00
linux_kernel.h Implement a new API for representing threads 2022-01-11 17:28:17 -08:00
Makefile.am libdrgn: rework architecture definition files 2022-06-25 22:39:26 -07:00
memory_reader.c libdrgn: binary_search_tree: move member and entry_to_key to DEFINE_BINARY_SEARCH_TREE_FUNCTIONS() 2022-05-24 15:26:39 -07:00
memory_reader.h libdrgn: binary_search_tree: move member and entry_to_key to DEFINE_BINARY_SEARCH_TREE_FUNCTIONS() 2022-05-24 15:26:39 -07:00
minmax.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
nstring.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
object_index.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
object_index.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
object.c libdrgn: support reference and absent objects with >64-bit integer types 2022-04-28 13:38:38 -07:00
object.h libdrgn: support reference and absent objects with >64-bit integer types 2022-04-28 13:38:38 -07:00
orc_info.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
orc_info.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
orc.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
path.c Fix various lints 2022-02-17 10:45:42 -08:00
path.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
platform.c libdrgn: add stub RISC-V architecture with relocation implementation 2022-04-19 11:51:23 -07:00
platform.h libdrgn: rework architecture definition files 2022-06-25 22:39:26 -07:00
pp.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
program.c libdrgn: fix drgn_program_crashed_thread() on !SMP kernels 2022-04-01 15:10:04 -07:00
program.h Fix various lints 2022-02-17 10:45:42 -08:00
register_state.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
register_state.h libdrgn: rework architecture definition files 2022-06-25 22:39:26 -07:00
serialize.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
serialize.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
splay_tree.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
stack_trace.c libdrgn: stack_trace: fix byte order for drgn_stack_frame_register() 2022-06-24 09:17:56 -07:00
stack_trace.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
string_builder.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
string_builder.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
symbol.c Add methods to return multiple matching symbols 2022-01-15 11:44:33 -08:00
symbol.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
type.c Enable prog.type to work with classes 2022-02-22 14:55:23 -08:00
type.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
util.h libdrgn: move alloc_or_reuse() to util.h 2022-06-01 05:11:58 -07:00
vector.c Update copyright headers to Meta 2021-11-21 15:59:44 -08:00
vector.h Update copyright headers to Meta 2021-11-21 15:59:44 -08:00