trunk/src/emu/debug/debugcmd.c
r22815 | r22816 | |
129 | 129 | static void execute_rpdisenable(running_machine &machine, int ref, int params, const char **param); |
130 | 130 | static void execute_rplist(running_machine &machine, int ref, int params, const char **param); |
131 | 131 | static void execute_hotspot(running_machine &machine, int ref, int params, const char **param); |
| 132 | static void execute_statesave(running_machine &machine, int ref, int params, const char **param); |
| 133 | static void execute_stateload(running_machine &machine, int ref, int params, const char **param); |
132 | 134 | static void execute_save(running_machine &machine, int ref, int params, const char **param); |
133 | 135 | static void execute_load(running_machine &machine, int ref, int params, const char **param); |
134 | 136 | static void execute_dump(running_machine &machine, int ref, int params, const char **param); |
r22815 | r22816 | |
326 | 328 | |
327 | 329 | debug_console_register_command(machine, "hotspot", CMDFLAG_NONE, 0, 0, 3, execute_hotspot); |
328 | 330 | |
| 331 | debug_console_register_command(machine, "statesave", CMDFLAG_NONE, 0, 1, 1, execute_statesave); |
| 332 | debug_console_register_command(machine, "ss", CMDFLAG_NONE, 0, 1, 1, execute_statesave); |
| 333 | debug_console_register_command(machine, "stateload", CMDFLAG_NONE, 0, 1, 1, execute_stateload); |
| 334 | debug_console_register_command(machine, "sl", CMDFLAG_NONE, 0, 1, 1, execute_stateload); |
| 335 | |
329 | 336 | debug_console_register_command(machine, "save", CMDFLAG_NONE, AS_PROGRAM, 3, 4, execute_save); |
330 | 337 | debug_console_register_command(machine, "saved", CMDFLAG_NONE, AS_DATA, 3, 4, execute_save); |
331 | 338 | debug_console_register_command(machine, "savei", CMDFLAG_NONE, AS_IO, 3, 4, execute_save); |
r22815 | r22816 | |
380 | 387 | |
381 | 388 | debug_console_register_command(machine, "source", CMDFLAG_NONE, 0, 1, 1, execute_source); |
382 | 389 | |
383 | | debug_console_register_command(machine, "map", CMDFLAG_NONE, AS_PROGRAM, 1, 1, execute_map); |
384 | | debug_console_register_command(machine, "mapd", CMDFLAG_NONE, AS_DATA, 1, 1, execute_map); |
385 | | debug_console_register_command(machine, "mapi", CMDFLAG_NONE, AS_IO, 1, 1, execute_map); |
386 | | debug_console_register_command(machine, "memdump", CMDFLAG_NONE, 0, 0, 1, execute_memdump); |
| 390 | debug_console_register_command(machine, "map", CMDFLAG_NONE, AS_PROGRAM, 1, 1, execute_map); |
| 391 | debug_console_register_command(machine, "mapd", CMDFLAG_NONE, AS_DATA, 1, 1, execute_map); |
| 392 | debug_console_register_command(machine, "mapi", CMDFLAG_NONE, AS_IO, 1, 1, execute_map); |
| 393 | debug_console_register_command(machine, "memdump", CMDFLAG_NONE, 0, 0, 1, execute_memdump); |
387 | 394 | |
388 | | debug_console_register_command(machine, "symlist", CMDFLAG_NONE, 0, 0, 1, execute_symlist); |
| 395 | debug_console_register_command(machine, "symlist", CMDFLAG_NONE, 0, 0, 1, execute_symlist); |
389 | 396 | |
390 | | debug_console_register_command(machine, "softreset", CMDFLAG_NONE, 0, 0, 1, execute_softreset); |
391 | | debug_console_register_command(machine, "hardreset", CMDFLAG_NONE, 0, 0, 1, execute_hardreset); |
| 397 | debug_console_register_command(machine, "softreset", CMDFLAG_NONE, 0, 0, 1, execute_softreset); |
| 398 | debug_console_register_command(machine, "hardreset", CMDFLAG_NONE, 0, 0, 1, execute_hardreset); |
392 | 399 | |
393 | | debug_console_register_command(machine, "images", CMDFLAG_NONE, 0, 0, 0, execute_images); |
394 | | debug_console_register_command(machine, "mount", CMDFLAG_NONE, 0, 2, 2, execute_mount); |
395 | | debug_console_register_command(machine, "unmount", CMDFLAG_NONE, 0, 1, 1, execute_unmount); |
| 400 | debug_console_register_command(machine, "images", CMDFLAG_NONE, 0, 0, 0, execute_images); |
| 401 | debug_console_register_command(machine, "mount", CMDFLAG_NONE, 0, 2, 2, execute_mount); |
| 402 | debug_console_register_command(machine, "unmount", CMDFLAG_NONE, 0, 1, 1, execute_unmount); |
396 | 403 | |
397 | | debug_console_register_command(machine, "input", CMDFLAG_NONE, 0, 1, 1, execute_input); |
398 | | debug_console_register_command(machine, "dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd); |
| 404 | debug_console_register_command(machine, "input", CMDFLAG_NONE, 0, 1, 1, execute_input); |
| 405 | debug_console_register_command(machine, "dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd); |
399 | 406 | |
400 | 407 | machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(debug_command_exit), &machine)); |
401 | 408 | |
r22815 | r22816 | |
1695 | 1702 | |
1696 | 1703 | |
1697 | 1704 | /*------------------------------------------------- |
| 1705 | execute_statesave - execute the statesave command |
| 1706 | -------------------------------------------------*/ |
| 1707 | |
| 1708 | static void execute_statesave(running_machine &machine, int ref, int params, const char *param[]) |
| 1709 | { |
| 1710 | astring filename(param[0]); |
| 1711 | machine.immediate_save(filename); |
| 1712 | debug_console_printf(machine, "State save attempted. Please refer to window message popup for results.\n"); |
| 1713 | } |
| 1714 | |
| 1715 | |
| 1716 | /*------------------------------------------------- |
| 1717 | execute_stateload - execute the stateload command |
| 1718 | -------------------------------------------------*/ |
| 1719 | |
| 1720 | static void execute_stateload(running_machine &machine, int ref, int params, const char *param[]) |
| 1721 | { |
| 1722 | astring filename(param[0]); |
| 1723 | machine.immediate_load(filename); |
| 1724 | |
| 1725 | // Clear all PC & memory tracks |
| 1726 | device_iterator iter(machine.root_device()); |
| 1727 | for (device_t *device = iter.first(); device != NULL; device = iter.next()) |
| 1728 | { |
| 1729 | device->debug()->track_pc_data_clear(); |
| 1730 | device->debug()->track_mem_data_clear(); |
| 1731 | } |
| 1732 | debug_console_printf(machine, "State load attempted. Please refer to window message popup for results.\n"); |
| 1733 | } |
| 1734 | |
| 1735 | |
| 1736 | /*------------------------------------------------- |
1698 | 1737 | execute_save - execute the save command |
1699 | 1738 | -------------------------------------------------*/ |
1700 | 1739 | |
trunk/src/emu/debug/debughlp.c
r22815 | r22816 | |
87 | 87 | " printf <format>[,<item>[,...]] -- prints one or more <item>s to the console using <format>\n" |
88 | 88 | " logerror <format>[,<item>[,...]] -- outputs one or more <item>s to the error.log\n" |
89 | 89 | " tracelog <format>[,<item>[,...]] -- outputs one or more <item>s to the trace file using <format>\n" |
90 | | " history [<cpu>,<length>] -- outputs a brief history of visited opcodes.\n" |
91 | | " trackpc [<bool>,<cpu>,<bool>] -- visually track visited opcodes [boolean to turn on and off, for the given cpu, clear].\n" |
92 | | " trackmem [<bool>,<bool>] -- record which PC writes to each memory address [boolean to turn on and off, clear].\n" |
93 | | " pcatmemp <address>[,<cpu>] -- query which PC wrote to a given program memory address for the current CPU.\n" |
94 | | " pcatmemd <address>[,<cpu>] -- query which PC wrote to a given data memory address for the current CPU.\n" |
95 | | " pcatmemi <address>[,<cpu>] -- query which PC wrote to a given I/O memory address for the current CPU.\n" |
96 | | " (Note: you can also query this info by right clicking in a memory window.\n" |
97 | | " snap [<filename>] -- save a screen snapshot\n" |
| 90 | " history [<cpu>,<length>] -- outputs a brief history of visited opcodes\n" |
| 91 | " trackpc [<bool>,<cpu>,<bool>] -- visually track visited opcodes [boolean to turn on and off, for the given cpu, clear]\n" |
| 92 | " trackmem [<bool>,<bool>] -- record which PC writes to each memory address [boolean to turn on and off, clear]\n" |
| 93 | " pcatmemp <address>[,<cpu>] -- query which PC wrote to a given program memory address for the current CPU\n" |
| 94 | " pcatmemd <address>[,<cpu>] -- query which PC wrote to a given data memory address for the current CPU\n" |
| 95 | " pcatmemi <address>[,<cpu>] -- query which PC wrote to a given I/O memory address for the current CPU\n" |
| 96 | " (Note: you can also query this info by right clicking in a memory window\n" |
| 97 | " statesave[ss] <filename> -- save a state file for the current driver\n" |
| 98 | " stateload[sl] <filename> -- load a state file for the current driver\n" |
| 99 | " snap [<filename>] -- save a screen snapshot.\n" |
98 | 100 | " source <filename> -- reads commands from <filename> and executes them one by one\n" |
99 | 101 | " quit -- exits MAME and the debugger\n" |
100 | 102 | }, |
r22815 | r22816 | |
435 | 437 | " Print which PC wrote this CPU's memory location 0x400000.\n" |
436 | 438 | }, |
437 | 439 | { |
| 440 | "statesave[ss]", |
| 441 | "\n" |
| 442 | " statesave[ss] <filename>\n" |
| 443 | "\n" |
| 444 | "The statesave command creates a save state at this exact moment in time. " |
| 445 | "The given state file gets written to the standard state directory (sta), and gets .sta to it - " |
| 446 | "no file extension necessary. All output for this command is currently echoed into the " |
| 447 | "running machine window.\n" |
| 448 | "\n" |
| 449 | "Examples:\n" |
| 450 | "\n" |
| 451 | "statesave foo\n" |
| 452 | " Writes file 'foo.sta' in the default state save directory.\n" |
| 453 | }, |
| 454 | { |
| 455 | "stateload[sl]", |
| 456 | "\n" |
| 457 | " stateload[ss] <filename>\n" |
| 458 | "\n" |
| 459 | "The stateload command retrieves a save state from disk. " |
| 460 | "The given state file gets read from the standard state directory (sta), and gets .sta to it - " |
| 461 | "no file extension necessary. All output for this command is currently echoed into the " |
| 462 | "running machine window. Previous memory and PC tracking statistics are cleared.\n" |
| 463 | "\n" |
| 464 | "Examples:\n" |
| 465 | "\n" |
| 466 | "stateload foo\n" |
| 467 | " Reads file 'foo.sta' from the default state save directory.\n" |
| 468 | }, |
| 469 | { |
438 | 470 | "snap", |
439 | 471 | "\n" |
440 | 472 | " snap [[<filename>], <scrnum>]\n" |