[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libunwind] dwarf sign bug
From: |
Richard Henderson |
Subject: |
[libunwind] dwarf sign bug |
Date: |
Tue, 9 May 2006 09:30:35 -0700 |
User-agent: |
Mutt/1.4.2.1i |
The sword function in Gexpr.c doesn't do what's intended.
Yes, it casts to sign, but then converts right back to
unsigned via the return type. Fixed thus.
r~
diff -r 0beadca8cd68 include/libunwind-hppa.h
--- a/include/libunwind-hppa.h Mon May 08 17:40:23 2006 -0700
+++ b/include/libunwind-hppa.h Mon May 08 17:47:06 2006 -0700
@@ -45,6 +45,7 @@ extern "C" {
#define UNW_TDEP_CURSOR_LEN 511
typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
typedef union
{
diff -r 0beadca8cd68 include/libunwind-ia64.h
--- a/include/libunwind-ia64.h Mon May 08 17:40:23 2006 -0700
+++ b/include/libunwind-ia64.h Mon May 08 17:47:06 2006 -0700
@@ -67,6 +67,7 @@ extern "C" {
#define UNW_PI_FLAG_IA64_RBS_SWITCH (1 << UNW_PI_FLAG_IA64_RBS_SWITCH_BIT)
typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
/* On IA-64, we want to access the contents of floating-point
registers as a pair of "words", but to ensure 16-byte alignment, we
diff -r 0beadca8cd68 include/libunwind-x86.h
--- a/include/libunwind-x86.h Mon May 08 17:40:23 2006 -0700
+++ b/include/libunwind-x86.h Mon May 08 17:47:06 2006 -0700
@@ -46,6 +46,7 @@ extern "C" {
#define UNW_TDEP_CURSOR_LEN 127
typedef uint32_t unw_word_t;
+typedef int32_t unw_sword_t;
typedef long double unw_tdep_fpreg_t;
diff -r 0beadca8cd68 include/libunwind-x86_64.h
--- a/include/libunwind-x86_64.h Mon May 08 17:40:23 2006 -0700
+++ b/include/libunwind-x86_64.h Mon May 08 17:47:06 2006 -0700
@@ -48,6 +48,7 @@ extern "C" {
#define UNW_TDEP_CURSOR_LEN 127
typedef uint64_t unw_word_t;
+typedef int64_t unw_sword_t;
typedef long double unw_tdep_fpreg_t;
diff -r 0beadca8cd68 src/dwarf/Gexpr.c
--- a/src/dwarf/Gexpr.c Mon May 08 17:40:23 2006 -0700
+++ b/src/dwarf/Gexpr.c Mon May 08 17:47:06 2006 -0700
@@ -106,18 +106,7 @@ static uint8_t operands[256] =
[DW_OP_call_ref] = OPND1 (OFFSET)
};
-static inline unw_word_t
-sword (unw_word_t val)
-{
- switch (sizeof (unw_word_t))
- {
- case 1: return (int8_t) val;
- case 2: return (int16_t) val;
- case 4: return (int32_t) val;
- case 8: return (int64_t) val;
- default: abort ();
- }
-}
+#define sword(X) ((unw_sword_t) (X))
static inline unw_word_t
read_operand (unw_addr_space_t as, unw_accessors_t *a,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libunwind] dwarf sign bug,
Richard Henderson <=