summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2008-09-10 17:43:42 +0200
committerMark Wielaard <mjw@redhat.com>2008-09-10 17:43:42 +0200
commit675fb1ddeec8cd22e17ab989f8a813a375ae6226 (patch)
tree75909a476c3dbeef1ee440cf8f78f68c6ed31a01
parente0c72583f8fb7a61d052c58b8e9c6df0925bc234 (diff)
downloadsystemtap-steved-675fb1ddeec8cd22e17ab989f8a813a375ae6226.tar.gz
systemtap-steved-675fb1ddeec8cd22e17ab989f8a813a375ae6226.tar.xz
systemtap-steved-675fb1ddeec8cd22e17ab989f8a813a375ae6226.zip
Rename _stp_module module_base output to dwarf_module_base and document.
-rw-r--r--ChangeLog5
-rw-r--r--runtime/ChangeLog5
-rw-r--r--runtime/sym.h7
-rw-r--r--runtime/unwind.c6
-rw-r--r--translate.cxx2
5 files changed, 20 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ce62fb6..b1abd19f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-09-10 Mark Wielaard <mjw@redhat.com>
+ * translate.cxx (dump_unwindsyms): Rename module_base output to
+ dwarf_module_base.
+
+2008-09-10 Mark Wielaard <mjw@redhat.com>
+
* translate.cxx (dump_unwindsyms): Output module_base.
2008-09-10 Mark Wielaard <mjw@redhat.com>
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index 6ff15b8a..2438ee5e 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,5 +1,10 @@
2008-09-10 Mark Wielaard <mjw@redhat.com>
+ * sym.h (_stp_module): Rename module_base to dwarf_module_base.
+ * unwind.c (adjustStartLoc): Document and use dwarf_module_base.
+
+2008-09-10 Mark Wielaard <mjw@redhat.com>
+
* runtime.h (CONFIG_FRAME_POINTER): Don't enable when
STP_USE_DWARF_UNWINDER is already defined.
diff --git a/runtime/sym.h b/runtime/sym.h
index 564f4eb2..5888d2c7 100644
--- a/runtime/sym.h
+++ b/runtime/sym.h
@@ -33,8 +33,11 @@ struct _stp_module {
/* any notifier hooks that will tell us when a module */
/* is unloading. */
unsigned long module; /* XXX: why not struct module * ? */
-
- unsigned long module_base;
+
+ /* This is to undo .debug_frame relocation performed by elfutils, */
+ /* which is done during the translate phase when we encode the */
+ /* unwind data into the module. See adjustStartLoc() in unwind.c. */
+ unsigned long dwarf_module_base;
/* the stack unwind data for this module */
void *unwind_data;
diff --git a/runtime/unwind.c b/runtime/unwind.c
index db8ae664..bc8a93dc 100644
--- a/runtime/unwind.c
+++ b/runtime/unwind.c
@@ -550,7 +550,9 @@ static int processCFI(const u8 *start, const u8 *end, unsigned long targetLoc, s
return result && ptr.p8 == end && (targetLoc == 0 || state->label == NULL);
}
-// This is an address inside a module, adjust.
+// If this is an address inside a module, adjust for section relocation
+// and the elfutils base relocation done during loading of the .dwarf_frame
+// in translate.cxx.
static unsigned long
adjustStartLoc (unsigned long startLoc,
struct _stp_module *m,
@@ -560,7 +562,7 @@ adjustStartLoc (unsigned long startLoc,
{
startLoc = _stp_module_relocate (m->name, s->name,
startLoc);
- startLoc -= m->module_base;
+ startLoc -= m->dwarf_module_base;
}
return startLoc;
}
diff --git a/translate.cxx b/translate.cxx
index 7c1469df..4620f76f 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -4551,7 +4551,7 @@ dump_unwindsyms (Dwfl_Module *m,
c->output << "struct _stp_module _stp_module_" << stpmod_idx << " = {" << endl;
c->output << ".name = " << lex_cast_qstring (modname) << ", " << endl;
- c->output << ".module_base = 0x" << hex << base << dec << ", " << endl;
+ c->output << ".dwarf_module_base = 0x" << hex << base << dec << ", " << endl;
if (unwind != NULL)
{