summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/debug/debugcmd.c')
-rw-r--r--src/emu/debug/debugcmd.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index 37383915e4c..50155dacbe0 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -1026,7 +1026,7 @@ static void execute_ignore(running_machine &machine, int ref, int params, const
/* if there are no parameters, dump the ignore list */
if (params == 0)
{
- astring buffer;
+ std::string buffer;
/* loop over all executable devices */
execute_interface_iterator iter(machine.root_device());
@@ -1035,15 +1035,15 @@ static void execute_ignore(running_machine &machine, int ref, int params, const
/* build up a comma-separated list */
if (!exec->device().debug()->observing())
{
- if (!buffer)
- buffer.printf("Currently ignoring device '%s'", exec->device().tag());
+ if (buffer.empty())
+ strprintf(buffer, "Currently ignoring device '%s'", exec->device().tag());
else
- buffer.catprintf(", '%s'", exec->device().tag());
+ strcatprintf(buffer, ", '%s'", exec->device().tag());
}
/* special message for none */
- if (!buffer)
- buffer.printf("Not currently ignoring any devices");
+ if (buffer.empty())
+ strprintf(buffer, "Not currently ignoring any devices");
debug_console_printf(machine, "%s\n", buffer.c_str());
}
@@ -1091,7 +1091,7 @@ static void execute_observe(running_machine &machine, int ref, int params, const
/* if there are no parameters, dump the ignore list */
if (params == 0)
{
- astring buffer;
+ std::string buffer;
/* loop over all executable devices */
execute_interface_iterator iter(machine.root_device());
@@ -1100,15 +1100,15 @@ static void execute_observe(running_machine &machine, int ref, int params, const
/* build up a comma-separated list */
if (exec->device().debug()->observing())
{
- if (!buffer)
- buffer.printf("Currently observing CPU '%s'", exec->device().tag());
+ if (buffer.empty())
+ strprintf(buffer, "Currently observing CPU '%s'", exec->device().tag());
else
- buffer.catprintf(", '%s'", exec->device().tag());
+ strcatprintf(buffer, ", '%s'", exec->device().tag());
}
/* special message for none */
- if (!buffer)
- buffer.printf("Not currently observing any devices");
+ if (buffer.empty())
+ strprintf(buffer, "Not currently observing any devices");
debug_console_printf(machine, "%s\n", buffer.c_str());
}
@@ -1315,7 +1315,7 @@ static void execute_bpdisenable(running_machine &machine, int ref, int params, c
static void execute_bplist(running_machine &machine, int ref, int params, const char *param[])
{
int printed = 0;
- astring buffer;
+ std::string buffer;
/* loop over all CPUs */
device_iterator iter(machine.root_device());
@@ -1327,11 +1327,11 @@ static void execute_bplist(running_machine &machine, int ref, int params, const
/* loop over the breakpoints */
for (device_debug::breakpoint *bp = device->debug()->breakpoint_first(); bp != NULL; bp = bp->next())
{
- buffer.printf("%c%4X @ %s", bp->enabled() ? ' ' : 'D', bp->index(), core_i64_hex_format(bp->address(), device->debug()->logaddrchars()));
- if (astring(bp->condition()) != astring("1"))
- buffer.catprintf(" if %s", bp->condition());
- if (astring(bp->action()) != astring(""))
- buffer.catprintf(" do %s", bp->action());
+ strprintf(buffer, "%c%4X @ %s", bp->enabled() ? ' ' : 'D', bp->index(), core_i64_hex_format(bp->address(), device->debug()->logaddrchars()));
+ if (std::string(bp->condition()).compare("1") != 0)
+ strcatprintf(buffer, " if %s", bp->condition());
+ if (std::string(bp->action()).compare("") != 0)
+ strcatprintf(buffer, " do %s", bp->action());
debug_console_printf(machine, "%s\n", buffer.c_str());
printed++;
}
@@ -1478,7 +1478,7 @@ static void execute_wpdisenable(running_machine &machine, int ref, int params, c
static void execute_wplist(running_machine &machine, int ref, int params, const char *param[])
{
int printed = 0;
- astring buffer;
+ std::string buffer;
/* loop over all CPUs */
device_iterator iter(machine.root_device());
@@ -1494,14 +1494,14 @@ static void execute_wplist(running_machine &machine, int ref, int params, const
/* loop over the watchpoints */
for (device_debug::watchpoint *wp = device->debug()->watchpoint_first(spacenum); wp != NULL; wp = wp->next())
{
- buffer.printf("%c%4X @ %s-%s %s", wp->enabled() ? ' ' : 'D', wp->index(),
+ strprintf(buffer, "%c%4X @ %s-%s %s", wp->enabled() ? ' ' : 'D', wp->index(),
core_i64_hex_format(wp->space().byte_to_address(wp->address()), wp->space().addrchars()),
core_i64_hex_format(wp->space().byte_to_address_end(wp->address() + wp->length()) - 1, wp->space().addrchars()),
types[wp->type() & 3]);
- if (astring(wp->condition()) != astring("1"))
- buffer.catprintf(" if %s", wp->condition());
- if (astring(wp->action()) != astring(""))
- buffer.catprintf(" do %s", wp->action());
+ if (std::string(wp->condition()).compare("1") != 0)
+ strcatprintf(buffer, " if %s", wp->condition());
+ if (std::string(wp->action()).compare("") != 0)
+ strcatprintf(buffer, " do %s", wp->action());
debug_console_printf(machine, "%s\n", buffer.c_str());
printed++;
}
@@ -1625,7 +1625,7 @@ static void execute_rpdisenable(running_machine &machine, int ref, int params, c
static void execute_rplist(running_machine &machine, int ref, int params, const char *param[])
{
int printed = 0;
- astring buffer;
+ std::string buffer;
/* loop over all CPUs */
device_iterator iter(machine.root_device());
@@ -1637,10 +1637,10 @@ static void execute_rplist(running_machine &machine, int ref, int params, const
/* loop over the breakpoints */
for (device_debug::registerpoint *rp = device->debug()->registerpoint_first(); rp != NULL; rp = rp->next())
{
- buffer.printf("%c%4X ", rp->enabled() ? ' ' : 'D', rp->index());
- buffer.catprintf("if %s", rp->condition());
+ strprintf(buffer, "%c%4X ", rp->enabled() ? ' ' : 'D', rp->index());
+ strcatprintf(buffer, "if %s", rp->condition());
if (rp->action() != NULL)
- buffer.catprintf(" do %s", rp->action());
+ strcatprintf(buffer, " do %s", rp->action());
debug_console_printf(machine, "%s\n", buffer.c_str());
printed++;
}
@@ -1701,7 +1701,7 @@ static void execute_hotspot(running_machine &machine, int ref, int params, const
static void execute_statesave(running_machine &machine, int ref, int params, const char *param[])
{
- astring filename(param[0]);
+ std::string filename(param[0]);
machine.immediate_save(filename.c_str());
debug_console_printf(machine, "State save attempted. Please refer to window message popup for results.\n");
}
@@ -1713,7 +1713,7 @@ static void execute_statesave(running_machine &machine, int ref, int params, con
static void execute_stateload(running_machine &machine, int ref, int params, const char *param[])
{
- astring filename(param[0]);
+ std::string filename(param[0]);
machine.immediate_load(filename.c_str());
// Clear all PC & memory tracks
@@ -2571,10 +2571,10 @@ static void execute_trace_internal(running_machine &machine, int ref, int params
device_t *cpu;
FILE *f = NULL;
const char *mode;
- astring filename = param[0];
+ std::string filename = param[0];
/* replace macros */
- filename.replace("{game}", machine.basename());
+ strreplace(filename, "{game}", machine.basename());
/* validate parameters */
if (!debug_command_parameter_cpu(machine, (params > 1) ? param[1] : NULL, &cpu))
@@ -2831,9 +2831,9 @@ static void execute_snap(running_machine &machine, int ref, int params, const ch
return;
}
- astring fname(filename);
- if (fname.find(0, ".png") == -1)
- fname.cat(".png");
+ std::string fname(filename);
+ if (fname.find(".png") == -1)
+ fname.append(".png");
emu_file file(machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open(fname.c_str());
@@ -3096,7 +3096,7 @@ static void execute_dumpkbd(running_machine &machine, int ref, int params, const
}
// loop through all codes
- astring buffer = machine.ioport().natkeyboard().dump();
+ std::string buffer = machine.ioport().natkeyboard().dump();
// and output it as appropriate
if (file != NULL)