summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2017-03-29 16:20:32 -0400
committer GitHub <noreply@github.com>2017-03-29 16:20:32 -0400
commitd287a4acbfab7008325412c562ac75f391b4b56a (patch)
treeaba5e3fda5a6cb35291a68049ebae191e8f11d6e
parenta966199cde9ca11d2678b1f44228948d265be47f (diff)
parent1a65879da193bdf85eabc42f35a6a7f657086cc4 (diff)
Merge pull request #2168 from Happy-yappH/dasm_virtual_space
Make debugger 'dasm' command able to traverse virtual spaces with
-rw-r--r--src/emu/debug/debugcmd.cpp43
1 files changed, 25 insertions, 18 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index 426d5a86670..ce017a27277 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -2460,29 +2460,36 @@ void debugger_commands::execute_dasm(int ref, const std::vector<std::string> &pa
tempaddr = pcbyte;
if (space->device().memory().translate(space->spacenum(), TRANSLATE_FETCH_DEBUG, tempaddr))
{
- u8 opbuf[64], argbuf[64];
-
- /* fetch the bytes up to the maximum */
- for (numbytes = 0; numbytes < maxbytes; numbytes++)
{
- opbuf[numbytes] = m_cpu.read_opcode(*decrypted_space, pcbyte + numbytes, 1);
- argbuf[numbytes] = m_cpu.read_opcode(*space, pcbyte + numbytes, 1);
+ u8 opbuf[64], argbuf[64];
+
+ /* fetch the bytes up to the maximum */
+ for (numbytes = 0; numbytes < maxbytes; numbytes++)
+ {
+ opbuf[numbytes] = m_cpu.read_opcode(*decrypted_space, pcbyte + numbytes, 1);
+ argbuf[numbytes] = m_cpu.read_opcode(*space, pcbyte + numbytes, 1);
+ }
+
+ /* disassemble the result */
+ i += numbytes = dasmintf->disassemble(disasm, offset + i, opbuf, argbuf) & DASMFLAG_LENGTHMASK;
}
- /* disassemble the result */
- i += numbytes = dasmintf->disassemble(disasm, offset + i, opbuf, argbuf) & DASMFLAG_LENGTHMASK;
+ /* print the bytes */
+ if (bytes)
+ {
+ auto const startdex = output.tellp();
+ numbytes = space->address_to_byte(numbytes);
+ for (j = 0; j < numbytes; j += minbytes)
+ stream_format(output, "%0*X ", minbytes * 2, m_cpu.read_opcode(*decrypted_space, pcbyte + j, minbytes));
+ if ((output.tellp() - startdex) < byteswidth)
+ stream_format(output, "%*s", byteswidth - (output.tellp() - startdex), "");
+ stream_format(output, " ");
+ }
}
-
- /* print the bytes */
- if (bytes)
+ else
{
- auto const startdex = output.tellp();
- numbytes = space->address_to_byte(numbytes);
- for (j = 0; j < numbytes; j += minbytes)
- stream_format(output, "%0*X ", minbytes * 2, m_cpu.read_opcode(*decrypted_space, pcbyte + j, minbytes));
- if ((output.tellp() - startdex) < byteswidth)
- stream_format(output, "%*s", byteswidth - (output.tellp() - startdex), "");
- stream_format(output, " ");
+ disasm << "<unmapped>";
+ i += minbytes;
}
/* add the disassembly */