summaryrefslogtreecommitdiffstats
path: root/src/emu/debug/express.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/debug/express.cpp')
-rw-r--r--src/emu/debug/express.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/src/emu/debug/express.cpp b/src/emu/debug/express.cpp
index 000ff270937..7c3cc74b3d0 100644
--- a/src/emu/debug/express.cpp
+++ b/src/emu/debug/express.cpp
@@ -112,24 +112,24 @@ class integer_symbol_entry : public symbol_entry
{
public:
// construction/destruction
- integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, UINT64 *ptr = nullptr);
- integer_symbol_entry(symbol_table &table, const char *name, UINT64 constval);
+ integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, uint64_t *ptr = nullptr);
+ integer_symbol_entry(symbol_table &table, const char *name, uint64_t constval);
integer_symbol_entry(symbol_table &table, const char *name, void *ref, symbol_table::getter_func getter, symbol_table::setter_func setter);
// symbol access
virtual bool is_lval() const override;
- virtual UINT64 value() const override;
- virtual void set_value(UINT64 newvalue) override;
+ virtual uint64_t value() const override;
+ virtual void set_value(uint64_t newvalue) override;
private:
// internal helpers
- static UINT64 internal_getter(symbol_table &table, void *symref);
- static void internal_setter(symbol_table &table, void *symref, UINT64 value);
+ static uint64_t internal_getter(symbol_table &table, void *symref);
+ static void internal_setter(symbol_table &table, void *symref, uint64_t value);
// internal state
symbol_table::getter_func m_getter;
symbol_table::setter_func m_setter;
- UINT64 m_value;
+ uint64_t m_value;
};
@@ -142,16 +142,16 @@ public:
// symbol access
virtual bool is_lval() const override;
- virtual UINT64 value() const override;
- virtual void set_value(UINT64 newvalue) override;
+ virtual uint64_t value() const override;
+ virtual void set_value(uint64_t newvalue) override;
// execution helper
- virtual UINT64 execute(int numparams, const UINT64 *paramlist);
+ virtual uint64_t execute(int numparams, const uint64_t *paramlist);
private:
// internal state
- UINT16 m_minparams;
- UINT16 m_maxparams;
+ uint16_t m_minparams;
+ uint16_t m_maxparams;
symbol_table::execute_func m_execute;
};
@@ -231,7 +231,7 @@ symbol_entry::~symbol_entry()
// integer_symbol_entry - constructor
//-------------------------------------------------
-integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, UINT64 *ptr)
+integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, symbol_table::read_write rw, uint64_t *ptr)
: symbol_entry(table, SMT_INTEGER, name, (ptr == nullptr) ? &m_value : ptr),
m_getter(internal_getter),
m_setter((rw == symbol_table::READ_ONLY) ? nullptr : internal_setter),
@@ -240,7 +240,7 @@ integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name
}
-integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, UINT64 constval)
+integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, uint64_t constval)
: symbol_entry(table, SMT_INTEGER, name, &m_value),
m_getter(internal_getter),
m_setter(nullptr),
@@ -272,7 +272,7 @@ bool integer_symbol_entry::is_lval() const
// value - return the value of this symbol
//-------------------------------------------------
-UINT64 integer_symbol_entry::value() const
+uint64_t integer_symbol_entry::value() const
{
return m_getter(m_table, m_ref);
}
@@ -282,7 +282,7 @@ UINT64 integer_symbol_entry::value() const
// set_value - set the value of this symbol
//-------------------------------------------------
-void integer_symbol_entry::set_value(UINT64 newvalue)
+void integer_symbol_entry::set_value(uint64_t newvalue)
{
if (m_setter != nullptr)
m_setter(m_table, m_ref, newvalue);
@@ -296,9 +296,9 @@ void integer_symbol_entry::set_value(UINT64 newvalue)
// returning the value of a variable
//-------------------------------------------------
-UINT64 integer_symbol_entry::internal_getter(symbol_table &table, void *symref)
+uint64_t integer_symbol_entry::internal_getter(symbol_table &table, void *symref)
{
- return *(UINT64 *)symref;
+ return *(uint64_t *)symref;
}
@@ -307,9 +307,9 @@ UINT64 integer_symbol_entry::internal_getter(symbol_table &table, void *symref)
// the value of a variable
//-------------------------------------------------
-void integer_symbol_entry::internal_setter(symbol_table &table, void *symref, UINT64 value)
+void integer_symbol_entry::internal_setter(symbol_table &table, void *symref, uint64_t value)
{
- *(UINT64 *)symref = value;
+ *(uint64_t *)symref = value;
}
@@ -345,7 +345,7 @@ bool function_symbol_entry::is_lval() const
// value - return the value of this symbol
//-------------------------------------------------
-UINT64 function_symbol_entry::value() const
+uint64_t function_symbol_entry::value() const
{
throw emu_fatalerror("Symbol '%s' is a function and cannot be used in this context", m_name.c_str());
}
@@ -355,7 +355,7 @@ UINT64 function_symbol_entry::value() const
// set_value - set the value of this symbol
//-------------------------------------------------
-void function_symbol_entry::set_value(UINT64 newvalue)
+void function_symbol_entry::set_value(uint64_t newvalue)
{
throw emu_fatalerror("Symbol '%s' is a function and cannot be written", m_name.c_str());
}
@@ -365,7 +365,7 @@ void function_symbol_entry::set_value(UINT64 newvalue)
// execute - execute the function
//-------------------------------------------------
-UINT64 function_symbol_entry::execute(int numparams, const UINT64 *paramlist)
+uint64_t function_symbol_entry::execute(int numparams, const uint64_t *paramlist)
{
if (numparams < m_minparams)
throw emu_fatalerror("Function '%s' requires at least %d parameters", m_name.c_str(), m_minparams);
@@ -396,7 +396,7 @@ symbol_table::symbol_table(void *globalref, symbol_table *parent)
//-------------------------------------------------
-// add - add a new UINT64 pointer symbol
+// add - add a new uint64_t pointer symbol
//-------------------------------------------------
void symbol_table::configure_memory(void *param, valid_func valid, read_func read, write_func write)
@@ -409,10 +409,10 @@ void symbol_table::configure_memory(void *param, valid_func valid, read_func rea
//-------------------------------------------------
-// add - add a new UINT64 pointer symbol
+// add - add a new uint64_t pointer symbol
//-------------------------------------------------
-void symbol_table::add(const char *name, read_write rw, UINT64 *ptr)
+void symbol_table::add(const char *name, read_write rw, uint64_t *ptr)
{
m_symlist.erase(name);
m_symlist.emplace(name, std::make_unique<integer_symbol_entry>(*this, name, rw, ptr));
@@ -423,7 +423,7 @@ void symbol_table::add(const char *name, read_write rw, UINT64 *ptr)
// add - add a new value symbol
//-------------------------------------------------
-void symbol_table::add(const char *name, UINT64 value)
+void symbol_table::add(const char *name, uint64_t value)
{
m_symlist.erase(name);
m_symlist.emplace(name, std::make_unique<integer_symbol_entry>(*this, name, value));
@@ -474,7 +474,7 @@ symbol_entry *symbol_table::find_deep(const char *symbol)
// value - return the value of a symbol
//-------------------------------------------------
-UINT64 symbol_table::value(const char *symbol)
+uint64_t symbol_table::value(const char *symbol)
{
symbol_entry *entry = find_deep(symbol);
return (entry != nullptr) ? entry->value() : 0;
@@ -485,7 +485,7 @@ UINT64 symbol_table::value(const char *symbol)
// set_value - set the value of a symbol
//-------------------------------------------------
-void symbol_table::set_value(const char *symbol, UINT64 value)
+void symbol_table::set_value(const char *symbol, uint64_t value)
{
symbol_entry *entry = find_deep(symbol);
if (entry != nullptr)
@@ -516,7 +516,7 @@ expression_error::error_code symbol_table::memory_valid(const char *name, expres
// memory_value - return a value read from memory
//-------------------------------------------------
-UINT64 symbol_table::memory_value(const char *name, expression_space space, UINT32 offset, int size)
+uint64_t symbol_table::memory_value(const char *name, expression_space space, uint32_t offset, int size)
{
// walk up the table hierarchy to find the owner
for (symbol_table *symtable = this; symtable != nullptr; symtable = symtable->m_parent)
@@ -535,7 +535,7 @@ UINT64 symbol_table::memory_value(const char *name, expression_space space, UINT
// set_memory_value - write a value to memory
//-------------------------------------------------
-void symbol_table::set_memory_value(const char *name, expression_space space, UINT32 offset, int size, UINT64 value)
+void symbol_table::set_memory_value(const char *name, expression_space space, uint32_t offset, int size, uint64_t value)
{
// walk up the table hierarchy to find the owner
for (symbol_table *symtable = this; symtable != nullptr; symtable = symtable->m_parent)
@@ -558,7 +558,7 @@ void symbol_table::set_memory_value(const char *name, expression_space space, UI
// parsed_expression - constructor
//-------------------------------------------------
-parsed_expression::parsed_expression(symbol_table *symtable, const char *expression, UINT64 *result)
+parsed_expression::parsed_expression(symbol_table *symtable, const char *expression, uint64_t *result)
: m_symtable(symtable),
m_token_stack_ptr(0)
{
@@ -627,7 +627,7 @@ void parsed_expression::print_tokens(FILE *out)
break;
case parse_token::NUMBER:
- fprintf(out, "NUMBER: %08X%08X\n", (UINT32)(token->value.i >> 32), (UINT32)token->value.i);
+ fprintf(out, "NUMBER: %08X%08X\n", (uint32_t)(token->value.i >> 32), (uint32_t)token->value.i);
break;
case parse_token::STRING:
@@ -635,7 +635,7 @@ void parsed_expression::print_tokens(FILE *out)
break;
case parse_token::SYMBOL:
- fprintf(out, "SYMBOL: %08X%08X\n", (UINT32)(token->value.i >> 32), (UINT32)token->value.i);
+ fprintf(out, "SYMBOL: %08X%08X\n", (uint32_t)(token->value.i >> 32), (uint32_t)token->value.i);
break;
case parse_token::OPERATOR:
@@ -708,7 +708,7 @@ void parsed_expression::parse_string_into_tokens()
while (string[0] != 0)
{
// ignore any whitespace
- while (string[0] != 0 && isspace((UINT8)string[0]))
+ while (string[0] != 0 && isspace((uint8_t)string[0]))
string++;
if (string[0] == 0)
break;
@@ -717,7 +717,7 @@ void parsed_expression::parse_string_into_tokens()
parse_token &token = m_tokenlist.append(*global_alloc(parse_token(string - stringstart)));
// switch off the first character
- switch (tolower((UINT8)string[0]))
+ switch (tolower((uint8_t)string[0]))
{
case '(':
string += 1, token.configure_operator(TVL_LPAREN, 0);
@@ -865,7 +865,7 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *&
while (1)
{
static const char valid[] = "abcdefghijklmnopqrstuvwxyz0123456789_$#.:";
- char val = tolower((UINT8)string[0]);
+ char val = tolower((uint8_t)string[0]);
if (val == 0 || strchr(valid, val) == nullptr)
break;
buffer.append(&val, 1);
@@ -965,12 +965,12 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *&
void parsed_expression::parse_number(parse_token &token, const char *string, int base, expression_error::error_code errcode)
{
// parse the actual value
- UINT64 value = 0;
+ uint64_t value = 0;
while (*string != 0)
{
// look up the number's value, stopping if not valid
static const char numbers[] = "0123456789abcdef";
- const char *ptr = strchr(numbers, tolower((UINT8)*string));
+ const char *ptr = strchr(numbers, tolower((uint8_t)*string));
if (ptr == nullptr)
break;
@@ -980,7 +980,7 @@ void parsed_expression::parse_number(parse_token &token, const char *string, int
break;
// shift previous digits up and add in new digit
- value = (value * (UINT64)base) + digit;
+ value = (value * (uint64_t)base) + digit;
string++;
}
@@ -1001,7 +1001,7 @@ void parsed_expression::parse_quoted_char(parse_token &token, const char *&strin
{
// accumulate the value of the character token
string++;
- UINT64 value = 0;
+ uint64_t value = 0;
while (string[0] != 0)
{
// allow '' to mean a nested single quote
@@ -1011,7 +1011,7 @@ void parsed_expression::parse_quoted_char(parse_token &token, const char *&strin
break;
string++;
}
- value = (value << 8) | (UINT8)*string++;
+ value = (value << 8) | (uint8_t)*string++;
}
// if we didn't find the ending quote, report an error
@@ -1388,7 +1388,7 @@ inline void parsed_expression::pop_token_rval(parse_token &token)
// of tokens
//-------------------------------------------------
-UINT64 parsed_expression::execute_tokens()
+uint64_t parsed_expression::execute_tokens()
{
// reset the token stack
m_token_stack_ptr = 0;
@@ -1674,7 +1674,7 @@ parsed_expression::parse_token::parse_token(int offset)
// for a SYMBOL token
//-------------------------------------------------
-UINT64 parsed_expression::parse_token::get_lval_value(symbol_table *table)
+uint64_t parsed_expression::parse_token::get_lval_value(symbol_table *table)
{
// get the value of a symbol
if (is_symbol())
@@ -1693,7 +1693,7 @@ UINT64 parsed_expression::parse_token::get_lval_value(symbol_table *table)
// for a SYMBOL token
//-------------------------------------------------
-inline void parsed_expression::parse_token::set_lval_value(symbol_table *table, UINT64 value)
+inline void parsed_expression::parse_token::set_lval_value(symbol_table *table, uint64_t value)
{
// set the value of a symbol
if (is_symbol())
@@ -1713,7 +1713,7 @@ inline void parsed_expression::parse_token::set_lval_value(symbol_table *table,
void parsed_expression::execute_function(parse_token &token)
{
// pop off all pushed parameters
- UINT64 funcparams[MAX_FUNCTION_PARAMS];
+ uint64_t funcparams[MAX_FUNCTION_PARAMS];
symbol_entry *symbol = nullptr;
int paramcount = 0;
while (paramcount < MAX_FUNCTION_PARAMS)