mirror of
https://github.com/ksherlock/mpw.git
synced 2025-01-09 13:30:34 +00:00
--trace-globals - show current value when reading.
This commit is contained in:
parent
9aaf997fe3
commit
6eb07f173a
@ -399,9 +399,26 @@ void MemoryLogger(uint32_t address, int size, int readWrite, uint32_t value)
|
|||||||
if (!name) name = "unknown";
|
if (!name) name = "unknown";
|
||||||
|
|
||||||
fprintf(stderr, "%-20s %08x - ", name, address);
|
fprintf(stderr, "%-20s %08x - ", name, address);
|
||||||
if (readWrite)
|
|
||||||
|
if (!readWrite)
|
||||||
{
|
{
|
||||||
fprintf(stderr, " write %d bytes", size);
|
switch(size)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
value = ReadByte(Memory, address);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
value = ReadWord(Memory, address);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
value = ReadLong(Memory, address);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// todo -- for write, display previous value?
|
||||||
|
fprintf(stderr, " %s %d bytes", readWrite ? "write" : "read ", size);
|
||||||
switch(size)
|
switch(size)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
@ -420,11 +437,6 @@ void MemoryLogger(uint32_t address, int size, int readWrite, uint32_t value)
|
|||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fprintf(stderr, " read %d bytes\n", size);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user