This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch 1/2 - Add support for probing DW_AT_ranges defined inline instances


  Hi,

  these 2 patches allow SystemTap to locate and instrument inline instances of
functions defined by a DW_AT_ranges attribute.

  The first patch is a fix for elfutils' libdw/dwarf_ranges to not sign extend
the range start addres on 32-bit architectures.

  The second patch adds support for locating inline instance in SystemTap.

  Sébastien.



  Author: Sébastien Dugué <sebastien.dugue@bull.net>

  Fix dwarf_ranges() to not sign extend the range start address on 32-bit
architectures. Otherwise, callers of this function may end up with a
negative range start address.


---
 libdw/ChangeLog      |    7 +++++++
 libdw/dwarf_ranges.c |   10 +++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

Index: elfutils-0.125/libdw/dwarf_ranges.c
===================================================================
--- elfutils-0.125.orig/libdw/dwarf_ranges.c	2007-02-28 17:49:22.000000000 +0100
+++ elfutils-0.125/libdw/dwarf_ranges.c	2007-03-27 11:23:35.000000000 +0200
@@ -135,21 +135,25 @@ dwarf_ranges (Dwarf_Die *die, ptrdiff_t 
       < die->cu->address_size * 2)
     goto invalid;
 
+  Dwarf_Addr base_marker;
   Dwarf_Addr begin;
   Dwarf_Addr end;
+
   if (die->cu->address_size == 8)
     {
       begin = read_8ubyte_unaligned_inc (die->cu->dbg, readp);
+      base_marker = begin;
       end = read_8ubyte_unaligned_inc (die->cu->dbg, readp);
     }
   else
     {
-      begin = (Dwarf_Sword) read_4sbyte_unaligned_inc (die->cu->dbg,
-						       readp);
+      base_marker = (Dwarf_Sword) read_4sbyte_unaligned (die->cu->dbg,
+							 readp);
+      begin = read_4ubyte_unaligned_inc (die->cu->dbg, readp);
       end = read_4ubyte_unaligned_inc (die->cu->dbg, readp);
     }
 
-  if (begin == (Dwarf_Addr) -1l) /* Base address entry.  */
+  if (base_marker == (Dwarf_Addr) -1l) /* Base address entry.  */
     {
       *basep = end;
       goto next;
Index: elfutils-0.125/libdw/ChangeLog
===================================================================
--- elfutils-0.125.orig/libdw/ChangeLog	2007-01-18 15:42:04.000000000 +0100
+++ elfutils-0.125/libdw/ChangeLog	2007-04-04 11:46:39.000000000 +0200
@@ -1,3 +1,10 @@
+2007-04-04  Sébastien Dugué  <sebastien.dugue@bull.net>
+
+	* dwarf_ranges.c (dwarf_ranges): Fix dwarf_ranges() to not sign
+	extend the range start address on 32-bit architectures. Otherwise,
+	callers of this function may end up with anegative range start
+	address.
+
 2006-12-17  Roland McGrath  <roland@redhat.com>
 
 	* dwarf_getlocation.c (dwarf_getlocation_addr): Use zero as base


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]