summaryrefslogtreecommitdiff
path: root/libdw
diff options
context:
space:
mode:
Diffstat (limited to 'libdw')
-rw-r--r--libdw/ChangeLog4
-rw-r--r--libdw/memory-access.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 78321654..6492c976 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,5 +1,9 @@
2018-06-12 Mark Wielaard <mark@klomp.org>
+ * memory-access.h (read_3ubyte_unaligned_inc): New define.
+
+2018-06-12 Mark Wielaard <mark@klomp.org>
+
* libdw.h (__libdw_dieabbrev): Set die->abbrev to DWARF_END_ABBREV
on failure.
diff --git a/libdw/memory-access.h b/libdw/memory-access.h
index 22918cb9..a39ad6d2 100644
--- a/libdw/memory-access.h
+++ b/libdw/memory-access.h
@@ -362,6 +362,11 @@ read_3ubyte_unaligned (Dwarf *dbg, const unsigned char *p)
}
+#define read_3ubyte_unaligned_inc(Dbg, Addr) \
+ ({ uint32_t t_ = read_2ubyte_unaligned (Dbg, Addr); \
+ Addr = (__typeof (Addr)) (((uintptr_t) (Addr)) + 3); \
+ t_; })
+
#define read_addr_unaligned_inc(Nbytes, Dbg, Addr) \
(assert ((Nbytes) == 4 || (Nbytes) == 8), \
((Nbytes) == 4 ? read_4ubyte_unaligned_inc (Dbg, Addr) \