|
From: <sv...@va...> - 2011-10-02 12:17:24
|
Author: tom
Date: 2011-10-02 13:12:38 +0100 (Sun, 02 Oct 2011)
New Revision: 12084
Log:
Add read_Addr and use it so that we work on systems where an address
is bigger that an int.
Modified:
trunk/coregrind/m_debuginfo/misc.c
trunk/coregrind/m_debuginfo/priv_misc.h
trunk/coregrind/m_debuginfo/readdwarf.c
Modified: trunk/coregrind/m_debuginfo/misc.c
===================================================================
--- trunk/coregrind/m_debuginfo/misc.c 2011-10-02 10:49:35 UTC (rev 12083)
+++ trunk/coregrind/m_debuginfo/misc.c 2011-10-02 12:12:38 UTC (rev 12084)
@@ -180,7 +180,17 @@
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 ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_debuginfo/priv_misc.h
===================================================================
--- trunk/coregrind/m_debuginfo/priv_misc.h 2011-10-02 10:49:35 UTC (rev 12083)
+++ trunk/coregrind/m_debuginfo/priv_misc.h 2011-10-02 12:12:38 UTC (rev 12084)
@@ -51,6 +51,7 @@
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. */
Modified: trunk/coregrind/m_debuginfo/readdwarf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf.c 2011-10-02 10:49:35 UTC (rev 12083)
+++ trunk/coregrind/m_debuginfo/readdwarf.c 2011-10-02 12:12:38 UTC (rev 12084)
@@ -393,7 +393,7 @@
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",
|
|
From: Christian B. <bor...@de...> - 2011-10-02 12:19:18
|
On 02/10/11 14:12, sv...@va... wrote: > Author: tom > Date: 2011-10-02 13:12:38 +0100 (Sun, 02 Oct 2011) > New Revision: 12084 > > Log: > Add read_Addr and use it so that we work on systems where an address > is bigger that an int. Looks good. thanks |
|
From: John R. <jr...@bi...> - 2011-10-03 16:53:20
Attachments:
diffs.out
|
>> New Revision: 12084 >> Add read_Addr and use it so that we work on systems where an address >> is bigger that an int. There is another read_UInt that should be read_Addr; patch attached. -- |