summaryrefslogtreecommitdiff
path: root/libdw
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-01-06 00:30:01 -0800
committerUlrich Drepper <drepper@redhat.com>2009-01-06 00:30:01 -0800
commitac194d052517be32d1e3dab62782d5f734994dca (patch)
treedb782c697b61fc7d6e5f6b8b10b899b59a5d4025 /libdw
parent92287fdf5b21438a3aa3d7094527b5cf870d1af6 (diff)
downloadelfutils-ac194d052517be32d1e3dab62782d5f734994dca.tar.gz
Implement call frame information dumping.
Diffstat (limited to 'libdw')
-rw-r--r--libdw/ChangeLog7
-rw-r--r--libdw/dwarf.h34
-rw-r--r--libdw/memory-access.h24
3 files changed, 64 insertions, 1 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 235fac01..eaaab2dd 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-06 Ulrich Drepper <drepper@redhat.com>
+
+ * libdw.h: Add definition for unwind and call frame information.
+
+ * memory-access.h: Define read_ubyte_unaligned, read_sbyte_unaligned,
+ read_ubyte_unaligned_inc, and read_sbyte_unaligned_inc.
+
2008-08-15 Roland McGrath <roland@redhat.com>
* libdw.map (ELFUTILS_0.136): New version set, inherits from
diff --git a/libdw/dwarf.h b/libdw/dwarf.h
index f1261c36..091519c5 100644
--- a/libdw/dwarf.h
+++ b/libdw/dwarf.h
@@ -668,6 +668,40 @@ enum
DW_CFA_high_user = 0x3f
};
+/* ID indicating CIE as opposed to FDE in .debug_frame. */
+enum
+ {
+ DW_CIE_ID = 0xffffffff
+ };
+
+
+/* Information for GNU unwind information. */
+enum
+ {
+ DW_EH_PE_absptr = 0x00,
+ DW_EH_PE_omit = 0xff,
+
+ /* FDE data encoding. */
+ DW_EH_PE_uleb128 = 0x01,
+ DW_EH_PE_udata2 = 0x02,
+ DW_EH_PE_udata4 = 0x03,
+ DW_EH_PE_udata8 = 0x04,
+ DW_EH_PE_sleb128 = 0x09,
+ DW_EH_PE_sdata2 = 0x0a,
+ DW_EH_PE_sdata4 = 0x0b,
+ DW_EH_PE_sdata8 = 0x0c,
+ DW_EH_PE_signed = 0x08,
+
+ /* FDE flags. */
+ DW_EH_PE_pcrel = 0x10,
+ DW_EH_PE_textrel = 0x20,
+ DW_EH_PE_datarel = 0x30,
+ DW_EH_PE_funcrel = 0x40,
+ DW_EH_PE_aligned = 0x50,
+
+ DW_EH_PE_indirect = 0x80
+ };
+
/* DWARF XXX. */
#define DW_ADDR_none 0
diff --git a/libdw/memory-access.h b/libdw/memory-access.h
index 52b41b5b..74054f95 100644
--- a/libdw/memory-access.h
+++ b/libdw/memory-access.h
@@ -1,5 +1,5 @@
/* Unaligned memory access functionality.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -246,6 +246,17 @@ read_8sbyte_unaligned (Dwarf *dbg, const void *p)
#endif /* allow unaligned */
+#define read_ubyte_unaligned(Nbytes, Dbg, Addr) \
+ ((Nbytes) == 2 ? read_2ubyte_unaligned (Dbg, Addr) \
+ : (Nbytes) == 4 ? read_4ubyte_unaligned (Dbg, Addr) \
+ : read_8ubyte_unaligned (Dbg, Addr))
+
+#define read_sbyte_unaligned(Nbytes, Dbg, Addr) \
+ ((Nbytes) == 2 ? read_2sbyte_unaligned (Dbg, Addr) \
+ : (Nbytes) == 4 ? read_4sbyte_unaligned (Dbg, Addr) \
+ : read_8sbyte_unaligned (Dbg, Addr))
+
+
#define read_2ubyte_unaligned_inc(Dbg, Addr) \
({ uint16_t t_ = read_2ubyte_unaligned (Dbg, Addr); \
Addr = (__typeof (Addr)) (((uintptr_t) (Addr)) + 2); \
@@ -273,4 +284,15 @@ read_8sbyte_unaligned (Dwarf *dbg, const void *p)
Addr = (__typeof (Addr)) (((uintptr_t) (Addr)) + 8); \
t_; })
+
+#define read_ubyte_unaligned_inc(Nbytes, Dbg, Addr) \
+ ((Nbytes) == 2 ? read_2ubyte_unaligned_inc (Dbg, Addr) \
+ : (Nbytes) == 4 ? read_4ubyte_unaligned_inc (Dbg, Addr) \
+ : read_8ubyte_unaligned_inc (Dbg, Addr))
+
+#define read_sbyte_unaligned_inc(Nbytes, Dbg, Addr) \
+ ((Nbytes) == 2 ? read_2sbyte_unaligned_inc (Dbg, Addr) \
+ : (Nbytes) == 4 ? read_4sbyte_unaligned_inc (Dbg, Addr) \
+ : read_8sbyte_unaligned_inc (Dbg, Addr))
+
#endif /* memory-access.h */