For a few of the supported architectures we can use one-to-one mapping
from the dwarf to the libunwind register numbers. Allow the
architectures to define their own dwarf_to_unw_regnum() macro to do this
easily.
---
 include/dwarf_i.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/dwarf_i.h b/include/dwarf_i.h
index d01eab8..77f52fe 100644
--- a/include/dwarf_i.h
+++ b/include/dwarf_i.h
@@ -15,13 +15,13 @@
 # define dwarf_addr_size(as) (sizeof (unw_word_t))
 #endif
 
-#define dwarf_to_unw_regnum_map                UNW_OBJ 
(dwarf_to_unw_regnum_map)
-
+#ifndef dwarf_to_unw_regnum
+# define dwarf_to_unw_regnum_map               UNW_OBJ 
(dwarf_to_unw_regnum_map)
 extern uint8_t dwarf_to_unw_regnum_map[DWARF_REGNUM_MAP_LENGTH];
-
 /* REG is evaluated multiple times; it better be side-effects free!  */
-#define dwarf_to_unw_regnum(reg)                                         \
+# define dwarf_to_unw_regnum(reg)                                        \
   (((reg) <= DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
+#endif
 
 #ifdef UNW_LOCAL_ONLY
 
-- 
1.7.9.5


_______________________________________________
Libunwind-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to