drgn/libdrgn
Omar Sandoval 0a6aaaae5d libdrgn: define structure for storing processor register values
libdwfl stores registers in an array of uint64_t indexed by the DWARF
register number. This is suboptimal for a couple of reasons:

1. Although the DWARF specification states that registers should be
   numbered for "optimal density", in practice this isn't the case. ABIs
   include unused ranges of numbers and don't order registers based on
   how likely they are to be known (e.g., caller-saved registers usually
   aren't recovered while unwinding the stack, but they are often
   numbered before callee-saved registers).
2. This precludes support for registers larger than 64 bits, like SSE
   registers.

For our own unwinder, we want to store registers in an
architecture-specific format to solve both of these problems.

So, have each architecture define its layout with registers arranged for
space efficiency and convenience when parsing saved registers from core
dumps. Instead of generating an arch_foo.c file from arch_foo.c.in,
separately define the logical register order in an arch_foo.defs file,
and use it to generate an arch_foo.inc file that is included from
arch_foo.c. The layout is defined as a macro in arch_foo.c. While we're
here, drop some register definitions that aren't useful at the moment.

Then, define struct drgn_register_state to efficiently store registers
in the defined format.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2021-03-15 16:36:38 -07:00
..
build-aux libdrgn: define structure for storing processor register values 2021-03-15 16:36:38 -07:00
elfutils Update elfutils and revert activation frame patch 2020-05-20 13:38:49 -07:00
examples libdrgn: add load_debug_info example program 2020-07-10 16:18:58 -07:00
include Update copyright headers to Facebook and add missing headers 2020-05-15 15:13:02 -07:00
m4 libdrgn: build with bundled elfutils 2019-09-19 11:07:12 -07:00
python libdrgn: python: add missing function name to Object.format_() exceptions 2021-03-08 14:27:33 -08:00
.gitignore Document with Sphinx 2019-04-11 12:48:15 -07:00
arch_ppc64.c libdrgn: define structure for storing processor register values 2021-03-15 16:36:38 -07:00
arch_ppc64.defs libdrgn: define structure for storing processor register values 2021-03-15 16:36:38 -07:00
arch_register_layout.h libdrgn: define structure for storing processor register values 2021-03-15 16:36:38 -07:00
arch_x86_64.c libdrgn: define structure for storing processor register values 2021-03-15 16:36:38 -07:00
arch_x86_64.defs libdrgn: define structure for storing processor register values 2021-03-15 16:36:38 -07:00
binary_buffer.c Fix some include-what-you-use warnings and update for Bear 3 2021-02-26 16:05:49 -08:00
binary_buffer.h libdrgn: binary_buffer: add binary_buffer_next_[us]int() 2021-03-15 12:13:45 -07:00
binary_search_tree.h libdrgn: consistently use __ for __attribute__ names 2021-02-21 03:16:23 -08:00
bitops.h libdrgn: split bit operations into their own header 2020-10-09 17:44:15 -07:00
cityhash.h libdrgn: consistently use __ for __attribute__ names 2021-02-21 03:16:23 -08:00
configure.ac drgn 0.0.9 2021-02-17 02:19:09 -08:00
debug_info.c libdrgn: debug_info: save platform per module 2021-03-15 12:13:48 -07:00
debug_info.h libdrgn: debug_info: save platform per module 2021-03-15 12:13:48 -07:00
Doxyfile libdrgn: fix Doxygen 2020-09-30 01:32:33 -07:00
drgn.h.in libdrgn: clean up usage of drgn_stop 2021-03-05 12:46:06 -08:00
dwarf_index.c libdrgn: debug_info: save platform per module 2021-03-15 12:13:48 -07:00
dwarf_index.h libdrgn: debug_info: try to find DIE specification when parsing type 2021-03-08 15:24:24 -08:00
error.c libdrgn: rename "unavailable" objects to "absent" objects 2020-12-29 14:58:26 -08:00
error.h libdrgn: clean up usage of drgn_stop 2021-03-05 12:46:06 -08:00
hash_table.c libdrgn: consistently use __ for __attribute__ names 2021-02-21 03:16:23 -08:00
hash_table.h libdrgn: consistently use __ for __attribute__ names 2021-02-21 03:16:23 -08:00
helpers.h Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
kdump.c libdrgn: add powerpc stack trace support 2021-01-29 11:31:59 -08:00
language_c.c libdrgn: clean up usage of drgn_stop 2021-03-05 12:46:06 -08:00
language.c libdrgn: simplify language fall back handling 2021-01-08 10:46:35 -08:00
language.h libdrgn: simplify language fall back handling 2021-01-08 10:46:35 -08:00
lazy_object.c libdrgn: replace lazy types with lazy objects 2021-01-08 17:39:51 -08:00
lazy_object.h libdrgn: replace lazy types with lazy objects 2021-01-08 17:39:51 -08:00
lexer.c Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
lexer.h Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
linux_kernel_helpers.c Track byte order in scalar types instead of objects 2021-02-19 21:41:29 -08:00
linux_kernel.c libdrgn: clean up usage of drgn_stop 2021-03-05 12:46:06 -08:00
linux_kernel.h libdrgn: linux kernel: remove THREAD_SIZE object finder 2020-12-10 02:08:13 -08:00
Makefile.am libdrgn: define structure for storing processor register values 2021-03-15 16:36:38 -07:00
memory_reader.c libdrgn: add {min,max}_iconst() and rewrite min() and max() 2020-10-10 23:48:03 -07:00
memory_reader.h libdrgn: fix Doxygen 2020-09-30 01:32:33 -07:00
minmax.h libdrgn: add {min,max}_iconst() and rewrite min() and max() 2020-10-10 23:48:03 -07:00
object_index.c Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
object_index.h libdrgn: fold drgn_type_index into drgn_program 2020-08-26 17:36:35 -07:00
object.c libdrgn: improve truncate_signed() and truncate_unsigned() 2021-02-26 16:05:49 -08:00
object.h Track byte order in scalar types instead of objects 2021-02-19 21:41:29 -08:00
path.c Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
path.h libdrgn: fix Doxygen 2020-09-30 01:32:33 -07:00
platform.c libdrgn: define structure for storing processor register values 2021-03-15 16:36:38 -07:00
platform.h libdrgn: define structure for storing processor register values 2021-03-15 16:36:38 -07:00
pp.h libdrgn: add preprocessor utility macros 2020-10-09 16:36:59 -07:00
program.c libdrgn: debug_info: pass around Dwfl_Module instead of bias 2021-01-21 10:12:29 -08:00
program.h libdrgn: add drgn_platform getters 2021-02-26 16:05:49 -08:00
register_state.c libdrgn: define structure for storing processor register values 2021-03-15 16:36:38 -07:00
register_state.h libdrgn: define structure for storing processor register values 2021-03-15 16:36:38 -07:00
serialize.c libdrgn: add copy_lsbytes() 2021-03-15 12:13:48 -07:00
serialize.h libdrgn: add copy_lsbytes() 2021-03-15 12:13:48 -07:00
siphash.h Update copyright headers to Facebook and add missing headers 2020-05-15 15:13:02 -07:00
splay_tree.c Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
stack_trace.c Remove register numbers from API and add register aliases 2021-01-28 17:47:45 -08:00
stack_trace.h Fix some include-what-you-use warnings and update for Bear 3 2021-02-26 16:05:49 -08:00
string_builder.c libdrgn: add {min,max}_iconst() and rewrite min() and max() 2020-10-10 23:48:03 -07:00
string_builder.h libdrgn: consistently use __ for __attribute__ names 2021-02-21 03:16:23 -08:00
symbol.c Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
symbol.h Update copyright headers to Facebook and add missing headers 2020-05-15 15:13:02 -07:00
type.c Fix some include-what-you-use warnings and update for Bear 3 2021-02-26 16:05:49 -08:00
type.h Track byte order in scalar types instead of objects 2021-02-19 21:41:29 -08:00
util.h libdrgn: define HOST_LITTLE_ENDIAN 2021-02-26 16:05:49 -08:00
vector.c libdrgn: fix vector_shrink_to_fit() with size 0 2021-01-06 17:47:39 -08:00
vector.h libdrgn: consistently use __ for __attribute__ names 2021-02-21 03:16:23 -08:00