summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/debugcmd.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2024-06-30 17:43:02 +1000
committer Vas Crabb <vas@vastheman.com>2024-06-30 17:43:02 +1000
commit9f6c0de566d7bd3fcc956809ae4c80acf128fb3d (patch)
tree00e8358495adfd84a323409cce46240bd8799781 /src/emu/debug/debugcmd.cpp
parentdb219fd88826cd8c4d1bafe449c6872bd34efa5d (diff)
Cleaned up various stuff.
* sony_news.xml: Added proper compatibility flags for different generations. * cpu/pic16x8x: This is very much a derivative work. * cpu/tms32025.cpp: Allow stack push/pop to be inlined. * tecmo/bombjack.cpp: Avoid needing to remove and replace devices in machine configuration. * Various other cleanup.
Diffstat (limited to 'src/emu/debug/debugcmd.cpp')
-rw-r--r--src/emu/debug/debugcmd.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index 724102cb8ec..a8c74f471d1 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -720,11 +720,11 @@ void debugger_commands::execute_tracelog(const std::vector<std::string_view> &pa
void debugger_commands::execute_tracesym(const std::vector<std::string_view> &params)
{
// build a format string appropriate for the parameters and validate them
- std::stringstream format;
+ std::ostringstream format;
for (int i = 0; i < params.size(); i++)
{
// find this symbol
- symbol_entry *sym = m_console.visible_symtable().find(strmakelower(params[i]).c_str());
+ symbol_entry *const sym = m_console.visible_symtable().find(strmakelower(params[i]).c_str());
if (!sym)
{
m_console.printf("Unknown symbol: %s\n", params[i]);
@@ -738,9 +738,11 @@ void debugger_commands::execute_tracesym(const std::vector<std::string_view> &pa
}
// build parameters for printf
- std::vector<std::string_view> printf_params(params);
- auto const format_str = format.str(); // HACK: workaround for pre-C++20 str()
- printf_params.insert(printf_params.begin(), format_str);
+ auto const format_str = std::move(format).str(); // need this to stay put as long as the string_view exists
+ std::vector<std::string_view> printf_params;
+ printf_params.reserve(params.size() + 1);
+ printf_params.emplace_back(format_str);
+ std::copy(params.begin(), params.end(), std::back_inserter(printf_params));
// then do a printf
std::ostringstream buffer;