trunk/src/emu/debug/debugcmd.c
| r248378 | r248379 | |
| 93 | 93 | static UINT64 global_get(symbol_table &table, void *ref); |
| 94 | 94 | static void global_set(symbol_table &table, void *ref, UINT64 value); |
| 95 | 95 | |
| 96 | | static void execute_show(running_machine &machine, int ref, int params, const char **param); |
| 97 | 96 | static void execute_help(running_machine &machine, int ref, int params, const char **param); |
| 98 | 97 | static void execute_print(running_machine &machine, int ref, int params, const char **param); |
| 99 | 98 | static void execute_printf(running_machine &machine, int ref, int params, const char **param); |
| r248378 | r248379 | |
| 268 | 267 | } |
| 269 | 268 | |
| 270 | 269 | /* add all the commands */ |
| 271 | | debug_console_register_command(machine, "show", CMDFLAG_NONE, 0, 0, 1, execute_show); |
| 272 | 270 | debug_console_register_command(machine, "help", CMDFLAG_NONE, 0, 0, 1, execute_help); |
| 273 | 271 | debug_console_register_command(machine, "print", CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_print); |
| 274 | 272 | debug_console_register_command(machine, "printf", CMDFLAG_NONE, 0, 1, MAX_COMMAND_PARAMS, execute_printf); |
| r248378 | r248379 | |
| 672 | 670 | ***************************************************************************/ |
| 673 | 671 | |
| 674 | 672 | /*------------------------------------------------- |
| 675 | | show infos of various kind |
| 676 | | -------------------------------------------------*/ |
| 677 | | |
| 678 | | static void execute_show(running_machine &machine, int ref, int params, const char *param[]) |
| 679 | | { |
| 680 | | class cpu_device *cpu; |
| 681 | | static long long unsigned int last = 0uLL; |
| 682 | | |
| 683 | | /* CPU is implicit */ |
| 684 | | if (!debug_command_parameter_cpu(machine, NULL, (device_t **) &cpu)) |
| 685 | | return; |
| 686 | | |
| 687 | | if (params == 0) |
| 688 | | { |
| 689 | | debug_console_printf(machine, "Show what?\n"); |
| 690 | | } |
| 691 | | else if (params == 1) |
| 692 | | { |
| 693 | | if (!strcmp(param[0], "clock")) |
| 694 | | { |
| 695 | | debug_console_printf(machine, "The clock is: %lld(0x%llx) and that is %lld(0x%llx) CPU clock cycles since last 'show clock' command\n", |
| 696 | | cpu->total_cycles(), cpu->total_cycles(), cpu->total_cycles() - last, cpu->total_cycles() - last); |
| 697 | | last = cpu->total_cycles(); |
| 698 | | } |
| 699 | | else |
| 700 | | { |
| 701 | | debug_console_printf(machine, "Unknown property %s. ", param[0]); |
| 702 | | debug_console_printf(machine, "Valid properties are: 'clock'\n"); |
| 703 | | } |
| 704 | | } |
| 705 | | } |
| 706 | | |
| 707 | | /*------------------------------------------------- |
| 708 | 673 | execute_help - execute the help command |
| 709 | 674 | -------------------------------------------------*/ |
| 710 | 675 | |