summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine
diff options
context:
space:
mode:
author Vas Crabb <cuavas@users.noreply.github.com>2021-10-01 05:26:11 +1000
committer GitHub <noreply@github.com>2021-10-01 05:26:11 +1000
commit360d3a5950f0649270822e2db1ea25028eabd18b (patch)
tree8019fee8da58f31e84889088935c09ff3eec4cd6 /src/mame/machine
parent6eee76c1a0c7e4f317bf55dde5ddb2d25356b6be (diff)
debugger: Extended target address syntax to include device/address space. (#8630)
Added a validity check to ensure address space names are tag-like and unique, since they're now used as identifiers in debugger commands. Extended the syntax for target addresses to allow them to be qualified with a colon followed by an optional device tag and/or address space name. If only the device needs to be specified, a debugger CPU number may also be used. This makes commands like bpset and wpset more flexible, as they can operate on CPUs other than the currently visible CPU. Commands like find, fill, dump and load are more flexible as they can access any space of any device. Removed now-redundant CPU parameters from many commands, and renamed pcatmemp to pcatmem for consistency with other commands. Extended region syntax for saver/loadr to support tags relative to the visible CPU (e.g. you can use "." for the region with the same name as the visible CPU, or "^sibling" syntax). Added an optional root device parameter to memdump. Changed interpretation of Boolean values to support numeric expressions as well as true/false strings and literal 1/0. Added checks that the specified device is CPU-like to various commands that require a CPU (e.g. focus). Previously these commands would crash or trigger an assertion failure if a tag for a non-CPU devices was specified. Fixed the cpunum symbol so it uses the same rules for determining what is or isn't a CPU as parameter parsing. Made device_t sanitise subtags better. Previously you could cause an assertion failure or crash MAME by giving it unexpected relative tags via Lua or the debugger. Added help topic alias support, and reworked the data structures to improve the performance of looking up debugger commands and help topics. Removed the "ref" parameter from debugger command functions (std::bind can hold extra argument values for you if you need them). Also added an error message if duplicate debugger commands are registered. Updated help for commands that changed syntax, and also updated summaries for some commands that had changed in the past without corresponding help updates.
Diffstat (limited to 'src/mame/machine')
-rw-r--r--src/mame/machine/6883sam.cpp14
-rw-r--r--src/mame/machine/dgn_beta.cpp8
-rw-r--r--src/mame/machine/hpc3.cpp20
-rw-r--r--src/mame/machine/model2.cpp16
-rw-r--r--src/mame/machine/rmnimbus.cpp4
-rw-r--r--src/mame/machine/xbox.cpp68
6 files changed, 65 insertions, 65 deletions
diff --git a/src/mame/machine/6883sam.cpp b/src/mame/machine/6883sam.cpp
index 8afe9271f72..9847442c553 100644
--- a/src/mame/machine/6883sam.cpp
+++ b/src/mame/machine/6883sam.cpp
@@ -93,13 +93,13 @@ sam6883_device::sam6883_device(const machine_config &mconfig, const char *tag, d
: device_t(mconfig, SAM6883, tag, owner, clock)
, device_memory_interface(mconfig, *this)
, sam6883_friend_device_interface(mconfig, *this, 4)
- , m_ram_config("RAM", ENDIANNESS_BIG, 8, 16, 0)
- , m_rom0_config("ROM0", ENDIANNESS_BIG, 8, 13, 0)
- , m_rom1_config("ROM1", ENDIANNESS_BIG, 8, 13, 0)
- , m_rom2_config("ROM2", ENDIANNESS_BIG, 8, 14, 0)
- , m_io0_config("I/O0", ENDIANNESS_BIG, 8, 5, 0)
- , m_io1_config("I/O1", ENDIANNESS_BIG, 8, 5, 0)
- , m_io2_config("I/O2", ENDIANNESS_BIG, 8, 5, 0)
+ , m_ram_config("ram", ENDIANNESS_BIG, 8, 16, 0)
+ , m_rom0_config("rom0", ENDIANNESS_BIG, 8, 13, 0)
+ , m_rom1_config("rom1", ENDIANNESS_BIG, 8, 13, 0)
+ , m_rom2_config("rom2", ENDIANNESS_BIG, 8, 14, 0)
+ , m_io0_config("io0", ENDIANNESS_BIG, 8, 5, 0)
+ , m_io1_config("io1", ENDIANNESS_BIG, 8, 5, 0)
+ , m_io2_config("io2", ENDIANNESS_BIG, 8, 5, 0)
, m_boot_config("boot", ENDIANNESS_BIG, 8, 7, 0)
{
}
diff --git a/src/mame/machine/dgn_beta.cpp b/src/mame/machine/dgn_beta.cpp
index 55f35179815..d8e1026f39b 100644
--- a/src/mame/machine/dgn_beta.cpp
+++ b/src/mame/machine/dgn_beta.cpp
@@ -807,8 +807,8 @@ void dgn_beta_state::machine_start()
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
{
using namespace std::placeholders;
- machine().debugger().console().register_command("beta_dat_log", CMDFLAG_NONE, 0, 0, 0, std::bind(&dgn_beta_state::execute_beta_dat_log, this, _1, _2));
- machine().debugger().console().register_command("beta_key_dump", CMDFLAG_NONE, 0, 0, 0, std::bind(&dgn_beta_state::execute_beta_key_dump, this, _1, _2));
+ machine().debugger().console().register_command("beta_dat_log", CMDFLAG_NONE, 0, 0, std::bind(&dgn_beta_state::execute_beta_dat_log, this, _1));
+ machine().debugger().console().register_command("beta_key_dump", CMDFLAG_NONE, 0, 0, std::bind(&dgn_beta_state::execute_beta_key_dump, this, _1));
}
m_LogDatWrites = false;
m_wd2797_written = 0;
@@ -824,14 +824,14 @@ offs_t dgn_beta_state::dgnbeta_dasm_override(std::ostream &stream, offs_t pc, co
return coco_state::os9_dasm_override(stream, pc, opcodes, params);
}
-void dgn_beta_state::execute_beta_dat_log(int ref, const std::vector<std::string> &params)
+void dgn_beta_state::execute_beta_dat_log(const std::vector<std::string> &params)
{
m_LogDatWrites = !m_LogDatWrites;
machine().debugger().console().printf("DAT register write info set : %d\n", m_LogDatWrites);
}
-void dgn_beta_state::execute_beta_key_dump(int ref, const std::vector<std::string> &params)
+void dgn_beta_state::execute_beta_key_dump(const std::vector<std::string> &params)
{
for (int idx = 0; idx < NoKeyrows; idx++)
{
diff --git a/src/mame/machine/hpc3.cpp b/src/mame/machine/hpc3.cpp
index 68f8e4d7a8c..4d2acb27b0c 100644
--- a/src/mame/machine/hpc3.cpp
+++ b/src/mame/machine/hpc3.cpp
@@ -28,16 +28,16 @@ hpc3_device::hpc3_device(const machine_config &mconfig, const char *tag, device_
: device_t(mconfig, SGI_HPC3, tag, owner, clock)
, device_memory_interface(mconfig, *this)
, m_pio_space_config{
- {"PIO channel 0", ENDIANNESS_LITTLE, 16, 8, -1},
- {"PIO channel 1", ENDIANNESS_LITTLE, 16, 8, -1},
- {"PIO channel 2", ENDIANNESS_LITTLE, 16, 8, -1},
- {"PIO channel 3", ENDIANNESS_LITTLE, 16, 8, -1},
- {"PIO channel 4", ENDIANNESS_LITTLE, 16, 8, -1},
- {"PIO channel 5", ENDIANNESS_LITTLE, 16, 8, -1},
- {"PIO channel 6", ENDIANNESS_LITTLE, 16, 8, -1},
- {"PIO channel 7", ENDIANNESS_LITTLE, 16, 8, -1},
- {"PIO channel 8", ENDIANNESS_LITTLE, 16, 8, -1},
- {"PIO channel 9", ENDIANNESS_LITTLE, 16, 8, -1}}
+ {"pio0", ENDIANNESS_LITTLE, 16, 8, -1},
+ {"pio1", ENDIANNESS_LITTLE, 16, 8, -1},
+ {"pio2", ENDIANNESS_LITTLE, 16, 8, -1},
+ {"pio3", ENDIANNESS_LITTLE, 16, 8, -1},
+ {"pio4", ENDIANNESS_LITTLE, 16, 8, -1},
+ {"pio5", ENDIANNESS_LITTLE, 16, 8, -1},
+ {"pio6", ENDIANNESS_LITTLE, 16, 8, -1},
+ {"pio7", ENDIANNESS_LITTLE, 16, 8, -1},
+ {"pio8", ENDIANNESS_LITTLE, 16, 8, -1},
+ {"pio9", ENDIANNESS_LITTLE, 16, 8, -1}}
, m_gio64_space(*this, finder_base::DUMMY_TAG, -1)
, m_hal2(*this, finder_base::DUMMY_TAG)
, m_enet(*this, finder_base::DUMMY_TAG)
diff --git a/src/mame/machine/model2.cpp b/src/mame/machine/model2.cpp
index 72ee81a81df..642642bef66 100644
--- a/src/mame/machine/model2.cpp
+++ b/src/mame/machine/model2.cpp
@@ -21,24 +21,24 @@ void model2_state::debug_init()
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
{
using namespace std::placeholders;
- machine().debugger().console().register_command("m2", CMDFLAG_CUSTOM_HELP, 0, 1, 2, std::bind(&model2_state::debug_commands, this, _1, _2));
+ machine().debugger().console().register_command("m2", CMDFLAG_CUSTOM_HELP, 1, 2, std::bind(&model2_state::debug_commands, this, _1));
}
}
-void model2_state::debug_commands(int ref, const std::vector<std::string> &params)
+void model2_state::debug_commands(const std::vector<std::string> &params)
{
if (params.size() < 1)
return;
if (params[0] == "geodasm")
- debug_geo_dasm_command(ref, params);
+ debug_geo_dasm_command(params);
else if(params[0] == "trilist")
- debug_tri_dump_command(ref, params);
+ debug_tri_dump_command(params);
else
- debug_help_command(ref, params);
+ debug_help_command(params);
}
-void model2_state::debug_help_command(int ref, const std::vector<std::string> &params)
+void model2_state::debug_help_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
@@ -54,7 +54,7 @@ void model2_state::debug_help_command(int ref, const std::vector<std::string> &p
*
****************************************/
-void model2_state::debug_geo_dasm_command(int ref, const std::vector<std::string> &params)
+void model2_state::debug_geo_dasm_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
@@ -264,7 +264,7 @@ void model2_state::debug_geo_dasm_command(int ref, const std::vector<std::string
*
****************************************/
-void model2_state::debug_tri_dump_command(int ref, const std::vector<std::string> &params)
+void model2_state::debug_tri_dump_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
FILE *f;
diff --git a/src/mame/machine/rmnimbus.cpp b/src/mame/machine/rmnimbus.cpp
index 660ab45e42c..0f8cab8c56a 100644
--- a/src/mame/machine/rmnimbus.cpp
+++ b/src/mame/machine/rmnimbus.cpp
@@ -217,7 +217,7 @@ void rmnimbus_state::machine_start()
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
{
using namespace std::placeholders;
- machine().debugger().console().register_command("nimbus_debug", CMDFLAG_NONE, 0, 0, 1, std::bind(&rmnimbus_state::debug_command, this, _1, _2));
+ machine().debugger().console().register_command("nimbus_debug", CMDFLAG_NONE, 0, 1, std::bind(&rmnimbus_state::debug_command, this, _1));
/* set up the instruction hook */
m_maincpu->debug()->set_instruction_hook(instruction_hook);
@@ -227,7 +227,7 @@ void rmnimbus_state::machine_start()
m_fdc->dden_w(0);
}
-void rmnimbus_state::debug_command(int ref, const std::vector<std::string> &params)
+void rmnimbus_state::debug_command(const std::vector<std::string> &params)
{
if (params.size() > 0)
{
diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp
index 9618cb2f36a..bc02ea60b26 100644
--- a/src/mame/machine/xbox.cpp
+++ b/src/mame/machine/xbox.cpp
@@ -82,7 +82,7 @@ void xbox_base_state::find_debug_params()
}
}
-void xbox_base_state::dump_string_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::dump_string_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
address_space &space = m_maincpu->space();
@@ -124,7 +124,7 @@ void xbox_base_state::dump_string_command(int ref, const std::vector<std::string
con.printf("\n");
}
-void xbox_base_state::dump_process_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::dump_process_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
address_space &space = m_maincpu->space();
@@ -154,7 +154,7 @@ void xbox_base_state::dump_process_command(int ref, const std::vector<std::strin
con.printf("_padding %d byte\n", space.read_byte(address + 27));
}
-void xbox_base_state::dump_list_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::dump_list_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
address_space &space = m_maincpu->space();
@@ -207,7 +207,7 @@ void xbox_base_state::dump_list_command(int ref, const std::vector<std::string>
}
}
-void xbox_base_state::dump_dpc_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::dump_dpc_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
address_space &space = m_maincpu->space();
@@ -236,7 +236,7 @@ void xbox_base_state::dump_dpc_command(int ref, const std::vector<std::string> &
con.printf("SystemArgument2 %08X dword\n", space.read_dword_unaligned(address + 24));
}
-void xbox_base_state::dump_timer_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::dump_timer_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
address_space &space = m_maincpu->space();
@@ -267,7 +267,7 @@ void xbox_base_state::dump_timer_command(int ref, const std::vector<std::string>
con.printf("Period %d dword\n", space.read_dword_unaligned(address + 36));
}
-void xbox_base_state::curthread_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::curthread_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
address_space &space = m_maincpu->space();
@@ -300,7 +300,7 @@ void xbox_base_state::curthread_command(int ref, const std::vector<std::string>
con.printf("Current thread function is %08X\n", space.read_dword_unaligned(address));
}
-void xbox_base_state::threadlist_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::threadlist_command(const std::vector<std::string> &params)
{
address_space &space = m_maincpu->space();
debugger_console &con = machine().debugger().console();
@@ -339,7 +339,7 @@ void xbox_base_state::threadlist_command(int ref, const std::vector<std::string>
}
}
-void xbox_base_state::generate_irq_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::generate_irq_command(const std::vector<std::string> &params)
{
uint64_t irq;
@@ -354,7 +354,7 @@ void xbox_base_state::generate_irq_command(int ref, const std::vector<std::strin
debug_generate_irq((int)irq, true);
}
-void xbox_base_state::nv2a_combiners_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::nv2a_combiners_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
bool en = nvidia_nv2a->toggle_register_combiners_usage();
@@ -364,7 +364,7 @@ void xbox_base_state::nv2a_combiners_command(int ref, const std::vector<std::str
con.printf("Register combiners disabled\n");
}
-void xbox_base_state::nv2a_wclipping_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::nv2a_wclipping_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
bool en = nvidia_nv2a->toggle_clipping_w_support();
@@ -374,7 +374,7 @@ void xbox_base_state::nv2a_wclipping_command(int ref, const std::vector<std::str
con.printf("W clipping disabled\n");
}
-void xbox_base_state::waitvblank_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::waitvblank_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
bool en = nvidia_nv2a->toggle_wait_vblank_support();
@@ -384,7 +384,7 @@ void xbox_base_state::waitvblank_command(int ref, const std::vector<std::string>
con.printf("Vblank method disabled\n");
}
-void xbox_base_state::grab_texture_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::grab_texture_command(const std::vector<std::string> &params)
{
uint64_t type;
@@ -397,7 +397,7 @@ void xbox_base_state::grab_texture_command(int ref, const std::vector<std::strin
nvidia_nv2a->debug_grab_texture((int)type, params[2].c_str());
}
-void xbox_base_state::grab_vprog_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::grab_vprog_command(const std::vector<std::string> &params)
{
uint32_t instruction[4];
FILE *fil;
@@ -416,7 +416,7 @@ void xbox_base_state::grab_vprog_command(int ref, const std::vector<std::string>
fclose(fil);
}
-void xbox_base_state::vprogdis_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::vprogdis_command(const std::vector<std::string> &params)
{
address_space &space = m_maincpu->space();
@@ -468,7 +468,7 @@ void xbox_base_state::vprogdis_command(int ref, const std::vector<std::string> &
}
}
-void xbox_base_state::vdeclaration_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::vdeclaration_command(const std::vector<std::string> &params)
{
address_space &space = m_maincpu->space();
@@ -549,7 +549,7 @@ void xbox_base_state::vdeclaration_command(int ref, const std::vector<std::strin
}
}
-void xbox_base_state::help_command(int ref, const std::vector<std::string> &params)
+void xbox_base_state::help_command(const std::vector<std::string> &params)
{
debugger_console &con = machine().debugger().console();
@@ -572,42 +572,42 @@ void xbox_base_state::help_command(int ref, const std::vector<std::string> &para
con.printf(" xbox help -- this list\n");
}
-void xbox_base_state::xbox_debug_commands(int ref, const std::vector<std::string> &params)
+void xbox_base_state::xbox_debug_commands(const std::vector<std::string> &params)
{
if (params.size() < 1)
return;
if (params[0] == "dump_string")
- dump_string_command(ref, params);
+ dump_string_command(params);
else if (params[0] == "dump_process")
- dump_process_command(ref, params);
+ dump_process_command(params);
else if (params[0] == "dump_list")
- dump_list_command(ref, params);
+ dump_list_command(params);
else if (params[0] == "dump_dpc")
- dump_dpc_command(ref, params);
+ dump_dpc_command(params);
else if (params[0] == "dump_timer")
- dump_timer_command(ref, params);
+ dump_timer_command(params);
else if (params[0] == "curthread")
- curthread_command(ref, params);
+ curthread_command(params);
else if (params[0] == "threadlist")
- threadlist_command(ref, params);
+ threadlist_command(params);
else if (params[0] == "irq")
- generate_irq_command(ref, params);
+ generate_irq_command(params);
else if (params[0] == "nv2a_combiners")
- nv2a_combiners_command(ref, params);
+ nv2a_combiners_command(params);
else if (params[0] == "nv2a_wclipping")
- nv2a_wclipping_command(ref, params);
+ nv2a_wclipping_command(params);
else if (params[0] == "waitvblank")
- waitvblank_command(ref, params);
+ waitvblank_command(params);
else if (params[0] == "grab_texture")
- grab_texture_command(ref, params);
+ grab_texture_command(params);
else if (params[0] == "grab_vprog")
- grab_vprog_command(ref, params);
+ grab_vprog_command(params);
else if (params[0] == "vprogdis")
- vprogdis_command(ref, params);
+ vprogdis_command(params);
else if (params[0] == "vdeclaration")
- vdeclaration_command(ref, params);
+ vdeclaration_command(params);
else
- help_command(ref, params);
+ help_command(params);
}
void xbox_base_state::debug_generate_irq(int irq, bool active)
@@ -905,7 +905,7 @@ void xbox_base_state::machine_start()
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
{
using namespace std::placeholders;
- machine().debugger().console().register_command("xbox", CMDFLAG_CUSTOM_HELP, 0, 1, 4, std::bind(&xbox_base_state::xbox_debug_commands, this, _1, _2));
+ machine().debugger().console().register_command("xbox", CMDFLAG_CUSTOM_HELP, 1, 4, std::bind(&xbox_base_state::xbox_debug_commands, this, _1));
}
subdevice<xbox_eeprom_device>("pci:01.1:154")->hack_eeprom =
[&](void)