mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
Add read_Addr and use it so that we work on systems where an address
is bigger that an int. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12084
This commit is contained in:
parent
8ecff4c133
commit
acc83cb540
@ -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 ---*/
|
||||
|
||||
@ -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. */
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user