This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
bias not always set in dwfl_module_dwarf/eh_cfi()
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 02 Feb 2010 15:52:40 +0100
- Subject: bias not always set in dwfl_module_dwarf/eh_cfi()
Hi,
When dwfl_module_dwarf_cfi() and dwfl_module_eh_cfi() return a cached
result they don't set the bias argument. This patch makes it always set
it. There is a testcase in the systemtap testuite (sdt_misc.exp) that
relies on this behavior.
OK to push?
Thanks,
Mark
>From 32989993d469498a713284be8b6991ec2d2378ec Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw@redhat.com>
Date: Tue, 2 Feb 2010 15:45:24 +0100
Subject: [PATCH] Always set bias in dwfl_module_dwarf_cfi() and dwfl_module_eh_cfi().
---
libdwfl/ChangeLog | 5 +++++
libdwfl/dwfl_module_dwarf_cfi.c | 5 ++++-
libdwfl/dwfl_module_eh_cfi.c | 5 ++++-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index d9e6e65..db8b966 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-02 Mark Wielaard <mjw@redhat.com>
+
+ * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias.
+ * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise
+
2010-01-07 Roland McGrath <roland@redhat.com>
* core-file.c (dwfl_core_file_report): Use elf_getphdrnum.
diff --git a/libdwfl/dwfl_module_dwarf_cfi.c b/libdwfl/dwfl_module_dwarf_cfi.c
index b02bfaf..e851a1f 100644
--- a/libdwfl/dwfl_module_dwarf_cfi.c
+++ b/libdwfl/dwfl_module_dwarf_cfi.c
@@ -80,7 +80,10 @@ dwfl_module_dwarf_cfi (mod, bias)
return NULL;
if (mod->dwarf_cfi != NULL)
- return mod->dwarf_cfi;
+ {
+ *bias = mod->debug.bias;
+ return mod->dwarf_cfi;
+ }
return __libdwfl_set_cfi (mod, &mod->dwarf_cfi,
INTUSE(dwarf_getcfi)
diff --git a/libdwfl/dwfl_module_eh_cfi.c b/libdwfl/dwfl_module_eh_cfi.c
index a3cf624..36a495f 100644
--- a/libdwfl/dwfl_module_eh_cfi.c
+++ b/libdwfl/dwfl_module_eh_cfi.c
@@ -59,7 +59,10 @@ dwfl_module_eh_cfi (mod, bias)
return NULL;
if (mod->eh_cfi != NULL)
- return mod->eh_cfi;
+ {
+ *bias = mod->main.bias;
+ return mod->eh_cfi;
+ }
__libdwfl_getelf (mod);
if (mod->elferr != DWFL_E_NOERROR)
--
1.6.6