]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add read_Addr and use it so that we work on systems where an address
authorTom Hughes <tom@compton.nu>
Sun, 2 Oct 2011 12:12:38 +0000 (12:12 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 2 Oct 2011 12:12:38 +0000 (12:12 +0000)
is bigger that an int.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12084

coregrind/m_debuginfo/misc.c
coregrind/m_debuginfo/priv_misc.h
coregrind/m_debuginfo/readdwarf.c

index 3f3def88919024a6e8b795a5f700fa43f6a6b886..be60ffc38af75ee5a45b2c558b3952f972c46061 100644 (file)
@@ -180,6 +180,16 @@ UChar ML_(read_UChar) ( UChar* data ) {
    return data[0];
 }
 
+Addr ML_(read_Addr) ( UChar* data ) {
+   if (sizeof(Addr) == sizeof(UInt)) {
+      return ML_(read_UInt)(data);
+   } else if  (sizeof(Addr) == sizeof(ULong)) {
+      return ML_(read_ULong)(data);
+   } else {
+      vg_assert(0);
+   }
+}
+
 
 /*--------------------------------------------------------------------*/
 /*--- end                                                   misc.c ---*/
index 0070bc7ca1f30ebdcbb5d07a8c564e6b2941317e..51a30c96eb8723fe7358f212aea291bf71e77c3c 100644 (file)
@@ -51,6 +51,7 @@ UShort ML_(read_UShort)( UChar* data );
 UInt ML_(read_UInt)( UChar* data );
 ULong ML_(read_ULong)( UChar* data );
 UChar ML_(read_UChar)( UChar* data );
+Addr ML_(read_Addr)( UChar* data );
 
 /* A handy type, a la Haskell's Maybe type.  Yes, I know, C sucks.
    Been there.  Done that.  Seen the movie.  Got the T-shirt.  Etc. */
index 8b70af38931a90e1598f3d377835c2a120490363..02d8528aec5bfef0ebef49287107d8fb9283c812 100644 (file)
@@ -393,7 +393,7 @@ Word process_extended_line_op( struct _DebugInfo* di,
          break;
 
       case DW_LNE_set_address:
-         adr = ML_(read_UInt)(data);  // FIXME: read_encoded_Addr ??
+         adr = ML_(read_Addr)(data);
          state_machine_regs.address = adr;
          if (di->ddump_line)
             VG_(printf)("  Extended opcode %d: set Address to 0x%lx\n",