Mame DEBUG调试命令详细指令速查大全
General Debugger Commands
do – evaluates the given expression
symlist – lists registered symbols
softreset – executes a soft reset
hardreset – executes a hard reset
print – prints one or more s to the console
printf – prints one or more s to the console using
logerror – outputs one or more s to the error.log
tracelog – outputs one or more s to the trace file using
tracesym – outputs one or more s to the trace file
history – outputs a brief history of visited opcodes (to fix: help missing for this command)
trackpc – visually track visited opcodes [boolean to turn on and off, for the given CPU, clear]
trackmem – record which PC writes to each memory address [boolean to turn on and off, clear]
pcatmem – query which PC wrote to a given memory address for the current CPU
rewind – go back in time by loading the most recent rewind state
statesave – save a state file for the current driver
stateload – load a state file for the current driver
snap – save a screen snapshot.
source – reads commands from and executes them one by one
quit – exits MAME and the debugger
do
symlist []
softreset
hardreset
print [,…]
printf [,[,…]]
logerror [,[,…]]
tracelog [,[,…]]
tracesym [,…]
trackpc [,,]
trackmem [,,]
pcatmem(p/d/i)
[,]rewind[rw]
statesave[ss]
stateload[sl]
snap [[], ]
source
quit
Memory Debugger Commands
dasm – disassemble to the given file
find – search program memory, data memory, or I/O memory for data
dump – dump program memory, data memory, or I/O memory as text
save – save binary program, data, or I/O memory to the given file
load – load binary program memory, data memory, or I/O memory from the given file
map – map logical program, data, or I/O address to physical address and bank
dasm ,
,[,[,]]f[ind][{d|i}]
,[,[,…]]dump[{d|i}] ,
,[,[,[,]]]save[{d|i}] ,
,[,]load[{d|i}] ,
[,,]map[{d|i}]
Breakpoint Debugger Commands
bpset – sets breakpoint at
bpclear – clears a given breakpoint or all if no specified
bpdisable – disables a given breakpoint or all if no specified
bpenable – enables a given breakpoint or all if no specified
bplist – lists all the breakpoints
bp[set]
[,[,]]bp 45678,a0==100,{a0 = ff; g}
bp 3456,1,{printf “A0=%08X\n”,a0; g}
temp0 = 0; bp 567890,++temp0 >= 10
Watchpoint Debugger Commands
wpset – sets program, data, or I/O space watchpoint
wpclear – clears a given watchpoint or all if no specified
wpdisable – disables a given watchpoint or all if no specified
wpenable – enables a given watchpoint or all if no specified
wplist – lists all the watchpoints
wp[{d|i}][set]
,,[,[,]]wp 23456,a,w,wpdata == 1
Registerpoints Debugger Commands
rpset – sets a registerpoint to trigger on
rpclear – clears a given registerpoint or all if no specified
rpdisable – disabled a given registerpoint or all if no specified
rpenable – enables a given registerpoint or all if no specified
rplist – lists all the registerpoints
rp[set] {}[,]]
rp {PC==0150},{temp0++; g}
Execution Debugger Commands
step – single steps for instructions (F11)
over – single steps over instructions (F10)
out – single steps until the current subroutine/exception handler is exited (Shift-F11)
go – resumes execution, sets temp breakpoint at
(F5)gint – resumes execution, setting temp breakpoint if is taken (F7)
gtime – resumes execution until the given delay has elapsed
gvblank – resumes execution, setting temp breakpoint on the next VBLANK (F8)
next – executes until the next CPU switch (F6)
focus – focuses debugger only on
ignore – stops debugging on
observe – resumes debugging on
trace – trace the given CPU to a file (defaults to active CPU)
traceover – trace the given CPU to a file, but skip subroutines (defaults to active CPU)
traceflush – flushes all open trace files.
s[tep] [=1]
o[ver] [=1]
out
g[o] [
]gv[blank]
gi[nt] []
gt[ime]
n[ext]
focus
ignore [[,[,…]]]
observe [[,[,…]]]
trace {|OFF}[,[,[noloop|logerror][,]]]
traceover {|OFF}[,[,[,]]]
traceflush
Debugger Expressions Guide
Numbers
Numbers are prefixed according to their bases:
Hexadecimal (base-16) numbers are prefixed with $ or 0x.
Decimal (base-10) numbers are prefixed with #.
Octal (base-8) numbers are prefixed with 0o.
Binary (base-2) numbers are prefixed with 0b.
Unprefixed numbers are hexadecimal (base-16).
( ) : standard parentheses
++ – : postfix increment/decrement
++ – ~ ! - + b@ w@ d@ q@ : prefix inc/dec, binary NOT, logical NOT, unary +/-, memory access
* / % : multiply, divide, modulus
+ - : add, subtract
<< >> : shift left/right
< <= > >= : less than, less than or equal, greater than, greater than or equal
== != : equal, not equal
& : binary AND
^ : binary XOR
| : binary OR
&& : logical AND
|| : logical OR
= *= /= %= += -= <<= >>= &= |= ^= : assignment
, : separate terms, function parameters
https://docs.mamedev.org/debugger/index.html