Skip to content

debugger: more granular naming for symbol table types #13733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/emu/debug/debugcmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3930,7 +3930,7 @@ void debugger_commands::execute_symlist(const std::vector<std::string_view> &par
for (; symtable != nullptr; symtable = symtable->parent())
{
// Skip globals if user explicitly requested CPU
if (symtable->type() == symbol_table::BUILTIN_GLOBALS && !params.empty())
if (symtable->type() == symbol_table::DEBUGGER_GLOBALS && !params.empty())
continue;

if (symtable->entries().size() == 0)
Expand All @@ -3944,7 +3944,7 @@ void debugger_commands::execute_symlist(const std::vector<std::string_view> &par
case symbol_table::CPU_STATE:
m_console.printf("\n**** CPU '%s' symbols ****\n", cpu->tag());
break;
case symbol_table::BUILTIN_GLOBALS:
case symbol_table::DEBUGGER_GLOBALS:
m_console.printf("\n**** Global symbols ****\n");
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/emu/debug/debugcpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ debugger_cpu::debugger_cpu(running_machine &machine)
m_tempvar = make_unique_clear<u64[]>(NUM_TEMP_VARIABLES);

/* create a global symbol table */
m_symtable = std::make_unique<symbol_table>(machine, symbol_table::BUILTIN_GLOBALS);
m_symtable = std::make_unique<symbol_table>(machine, symbol_table::DEBUGGER_GLOBALS);
m_symtable->set_memory_modified_func([this]() { set_memory_modified(true); });

/* add "wpaddr", "wpdata", "wpsize" to the global symbol table */
Expand Down
6 changes: 4 additions & 2 deletions src/emu/debug/express.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ class symbol_table
enum table_type
{
CPU_STATE, // CPU registers, etc.
BUILTIN_GLOBALS, // Built-in MAME global symbols (e.g., beamx, beamy, frame, etc.)
// (also used for tables outside debugger: lua scripts, cheat engine)
DEBUGGER_GLOBALS, // Debugger global symbol table (e.g., beamx, beamy, frame, etc.)
CHEAT_ENTRY, // symbols used in cheat entry actions (argindex, temp variables)
CHEAT_MANAGER, // symbols from the cheat manager (frame value, from/tobcd functions)
LUA_SCRIPT, // custom symbols added by a LUA script for use from the LUA script
};

// construction/destruction
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/mame/cheat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ void cheat_script::script_entry::output_argument::save(util::core_file &cheatfil

cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, std::string const &filename, util::xml::data_node const &cheatnode)
: m_manager(manager)
, m_symbols(manager.machine(), symbol_table::BUILTIN_GLOBALS, &globaltable)
, m_symbols(manager.machine(), symbol_table::CHEAT_ENTRY, &globaltable)
, m_state(SCRIPT_STATE_OFF)
, m_numtemp(DEFAULT_TEMP_VARIABLES)
, m_argindex(0)
Expand Down Expand Up @@ -1065,7 +1065,7 @@ cheat_manager::cheat_manager(running_machine &machine)
, m_numlines(0)
, m_lastline(0)
, m_disabled(true)
, m_symtable(machine, symbol_table::BUILTIN_GLOBALS)
, m_symtable(machine, symbol_table::CHEAT_MANAGER)
{
// if the cheat engine is disabled, we're done
if (!machine.options().cheat())
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/luaengine_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class lua_engine::symbol_table_wrapper

symbol_table_wrapper(lua_engine &host, running_machine &machine, std::shared_ptr<symbol_table_wrapper> const &parent, device_t *device)
: m_host(host)
, m_table(machine, symbol_table::BUILTIN_GLOBALS, parent ? &parent->table() : nullptr, device)
, m_table(machine, symbol_table::LUA_SCRIPT, parent ? &parent->table() : nullptr, device)
, m_parent(parent)
{
}
Expand Down
Loading