]>
Commit | Line | Data |
---|---|---|
9a5de187 MH |
1 | /* -*- linux-c -*- |
2 | * Copyright (C) 2005-2008 Red Hat Inc. | |
33f88a80 FCE |
3 | * |
4 | * This file is part of systemtap, and is free software. You can | |
5 | * redistribute it and/or modify it under the terms of the GNU General | |
6 | * Public License (GPL); either version 2, or (at your option) any | |
7 | * later version. | |
8 | */ | |
9 | ||
aaf2af3e FCE |
10 | #ifndef _STP_SYM_H_ |
11 | #define _STP_SYM_H_ | |
33f88a80 | 12 | |
f1bad60c | 13 | struct _stp_symbol { |
9a5de187 MH |
14 | unsigned long addr; |
15 | const char *symbol; | |
16 | }; | |
33f88a80 | 17 | |
7795c7e7 FCE |
18 | struct _stp_section { |
19 | const char *name; | |
2d0ddea1 | 20 | unsigned long static_addr; /* XXX non-null if everywhere the same. */ |
60ad8eba | 21 | unsigned long size; /* length of the address space module covers. */ |
7795c7e7 FCE |
22 | struct _stp_symbol *symbols; /* ordered by address */ |
23 | unsigned num_symbols; | |
24 | }; | |
25 | ||
26 | ||
9a5de187 | 27 | struct _stp_module { |
7795c7e7 | 28 | const char* name; |
30cb532a | 29 | const char* path; /* canonical path used for runtime matching. */ |
7795c7e7 FCE |
30 | struct _stp_section *sections; |
31 | unsigned num_sections; | |
32 | ||
675fb1dd MW |
33 | /* This is to undo .debug_frame relocation performed by elfutils, */ |
34 | /* which is done during the translate phase when we encode the */ | |
35 | /* unwind data into the module. See adjustStartLoc() in unwind.c. */ | |
36 | unsigned long dwarf_module_base; | |
6b2fda54 | 37 | |
9a5de187 | 38 | /* the stack unwind data for this module */ |
4285dc9a | 39 | void *debug_frame; |
9424498b | 40 | void *debug_hdr; |
4285dc9a | 41 | void *eh_frame; |
aaf2af3e | 42 | void *unwind_hdr; |
4285dc9a | 43 | uint32_t debug_frame_len; |
9424498b | 44 | uint32_t debug_hdr_len; |
4285dc9a | 45 | uint32_t eh_frame_len; |
aaf2af3e | 46 | uint32_t unwind_hdr_len; |
4285dc9a | 47 | unsigned long eh_frame_addr; /* Orig load address (offset) .eh_frame */ |
0f33053e | 48 | unsigned long unwind_hdr_addr; /* same for .eh_frame_hdr */ |
29495972 WH |
49 | /* build-id information */ |
50 | unsigned char *build_id_bits; | |
51 | unsigned long build_id_offset; | |
0d633db2 | 52 | unsigned long notes_sect; |
29495972 | 53 | int build_id_len; |
f1bad60c MH |
54 | }; |
55 | ||
f1bad60c | 56 | |
1b94bf6d | 57 | /* Defined by translator-generated stap-symbols.h. */ |
4c2732a1 JS |
58 | static struct _stp_module *_stp_modules []; |
59 | static unsigned _stp_num_modules; | |
1b94bf6d | 60 | |
129de9ef MW |
61 | /* Used in the unwinder to special case unwinding through kretprobes. */ |
62 | /* Initialized through translator (stap-symbols.h) relative to kernel */ | |
63 | /* load address, fixup by transport symbols _stp_do_relocation */ | |
64 | static unsigned long _stp_kretprobe_trampoline; | |
f1bad60c | 65 | |
a049e342 MW |
66 | static unsigned long _stp_kmodule_relocate (const char *module, |
67 | const char *section, | |
68 | unsigned long offset); | |
69 | static unsigned long _stp_umodule_relocate (const char *module, | |
70 | unsigned long offset, | |
71 | struct task_struct *tsk); | |
9a5de187 | 72 | static struct _stp_module *_stp_get_unwind_info (unsigned long addr); |
7795c7e7 | 73 | |
aaf2af3e | 74 | #endif /* _STP_SYM_H_ */ |