From 4285dc9a58fbdae1516c4117a3f9297b822f27ff Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 20 May 2009 15:24:02 +0200 Subject: Fetch and store both debug_frame and eh_frame tables. * runtime/sym.h (_stp_module): Remove unwind_data, unwind_data_len and unwind_is_ehframe fields. Add debug_frame, eh_frame, debug_frame_len, eh_frame_len and eh_frame_addr fields. * runtime/unwind.c: Use debug_frame and debug_frame_len instead of unwind_data and unwind_data_len throughout. (cie_for_fde): Take unwind_data and is_ehframe as direct arguments. * runtime/unwind/unwind.h (cie_for_fde): New function declaration. * translate.cxx (get_unwind_data): Fetch and return both debug_frame and eh_frame tables. (dump_unwindsyms): Dump both debug_frame and eh_frame tables. --- runtime/sym.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'runtime/sym.h') diff --git a/runtime/sym.h b/runtime/sym.h index 80c334fb..7e28ebe6 100644 --- a/runtime/sym.h +++ b/runtime/sym.h @@ -42,11 +42,13 @@ struct _stp_module { unsigned long dwarf_module_base; /* the stack unwind data for this module */ - void *unwind_data; + void *debug_frame; + void *eh_frame; void *unwind_hdr; - uint32_t unwind_data_len; + uint32_t debug_frame_len; + uint32_t eh_frame_len; uint32_t unwind_hdr_len; - uint32_t unwind_is_ehframe; /* unwind data comes from .eh_frame */ + unsigned long eh_frame_addr; /* Orig load address (offset) .eh_frame */ /* build-id information */ unsigned char *build_id_bits; unsigned long build_id_offset; -- cgit From 129de9ef18cd142e31ed509a7704d4faf0879f4c Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 3 Jun 2009 15:36:03 +0200 Subject: Detect kretprobe trampoline and use fallback unwinder. * runtime/sym.h (_stp_kretprobe_trampoline): Document. * translate.cxx (unwindsym_dump_context): Add stp_kretprobe_trampoline_addr. (dump_unwindsyms): Detect kretprobe_trampoline_holder symbol address. (emit_symbol_data): Initialize and emit _stp_kretprobe_trampoline. * runtime/transport/symbols.c (_stp_do_relocation): Detect kernel load address and adjust _stp_kretprobe_trampoline. * runtime/stack-i386.c (__stp_stack_print): Always use fallback unwinder when hitting kretprobe_trampoline_holder. * runtime/stack-x86_64.c (__stp_stack_print): Likewise. --- runtime/sym.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/sym.h') diff --git a/runtime/sym.h b/runtime/sym.h index 7e28ebe6..ca69345f 100644 --- a/runtime/sym.h +++ b/runtime/sym.h @@ -61,10 +61,10 @@ struct _stp_module { static struct _stp_module *_stp_modules []; static unsigned _stp_num_modules; - -/* the number of modules in the arrays */ - -static unsigned long _stp_kretprobe_trampoline = 0; +/* Used in the unwinder to special case unwinding through kretprobes. */ +/* Initialized through translator (stap-symbols.h) relative to kernel */ +/* load address, fixup by transport symbols _stp_do_relocation */ +static unsigned long _stp_kretprobe_trampoline; static unsigned long _stp_module_relocate (const char *module, const char *section, unsigned long offset); static struct _stp_module *_stp_get_unwind_info (unsigned long addr); -- cgit