]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Add length read hooks
authorPetr Machata <pmachata@redhat.com>
Tue, 28 Apr 2009 16:38:27 +0000 (18:38 +0200)
committerPetr Machata <pmachata@redhat.com>
Tue, 28 Apr 2009 16:38:27 +0000 (18:38 +0200)
libdw/ChangeLog
libdw/libdwP.h
libdw/libdw_readhooks.c

index 55c87014df4d2b7281d3d9d7b989fff6c03e19b7..ff33e7edef197892020890850309adab65995152 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-28  Petr Machata  <pmachata@redhat.com>
+
+       * libdwP.h (__libdw_read_length_inc, __libdw_read_length):
+       New internal functions.
+       * dwarf_readhooks.c: Implement the above.
+
 2009-04-23  Petr Machata  <pmachata@redhat.com>
 
        * dwarf_formaddr.c (dwarf_formaddr): Call __libdw_read_* instead
index 41676911518d92525a1f87026f7b418e68e6e5c5..4a1e4b2bf308cc44c0e8bab67e86bb05e5c06280 100644 (file)
@@ -448,6 +448,11 @@ int __libdw_relocate_offset (Dwarf *dbg,
                             int width, Dwarf_Off *val)
   internal_function;
 
+int __libdw_relocate_length (Dwarf *dbg,
+                            int sec_index, uintptr_t addr,
+                            int width, Dwarf_Addr *val)
+  internal_function;
+
 #define READ_AND_RELOCATE(RELOC_HOOK)                                  \
   {                                                                    \
     int status;                                                                \
@@ -488,6 +493,14 @@ __libdw_read_offset_inc (Dwarf *dbg,
   READ_AND_RELOCATE (__libdw_relocate_offset)
 }
 
+static inline int
+__libdw_read_length_inc (Dwarf *dbg,
+                        int sec_index, unsigned char **addr,
+                        int width, Dwarf_Addr *ret)
+{
+  READ_AND_RELOCATE (__libdw_relocate_length)
+}
+
 #undef READ_AND_RELOCATE
 
 static inline int
@@ -508,6 +521,15 @@ __libdw_read_offset (Dwarf *dbg,
                                  width, ret);
 }
 
+static inline int
+__libdw_read_length (Dwarf *dbg,
+                    int sec_index, const unsigned char *addr,
+                    int width, Dwarf_Word *ret)
+{
+  return __libdw_read_length_inc (dbg, sec_index, (unsigned char **)&addr,
+                                 width, ret);
+}
+
 #define ADDR_ESCAPE(width) \
   (width == 8 ? (Elf64_Addr)-1 : (Elf64_Addr)(Elf32_Addr)-1)
 
index 404f12aa72efaca057b4d93a7146b0a581e846fd..93c98642907714e8d2f4316ba1e6aa3cc999874d 100644 (file)
@@ -72,3 +72,13 @@ __libdw_relocate_offset (Dwarf *dbg __attribute__ ((unused)),
 {
   return 0;
 }
+
+internal_function int
+__libdw_relocate_length (Dwarf *dbg __attribute__ ((unused)),
+                        int sec_index __attribute__ ((unused)),
+                        uintptr_t addr __attribute__ ((unused)),
+                        int width __attribute__ ((unused)),
+                        Dwarf_Addr *val __attribute__ ((unused)))
+{
+  return 0;
+}