summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--3rdparty/bgfx/3rdparty/tinyexr/tinyexr.h1
-rw-r--r--src/emu/debug/express.cpp65
2 files changed, 44 insertions, 22 deletions
diff --git a/3rdparty/bgfx/3rdparty/tinyexr/tinyexr.h b/3rdparty/bgfx/3rdparty/tinyexr/tinyexr.h
index c0b84ef1b13..4482b82602f 100644
--- a/3rdparty/bgfx/3rdparty/tinyexr/tinyexr.h
+++ b/3rdparty/bgfx/3rdparty/tinyexr/tinyexr.h
@@ -7076,6 +7076,7 @@ static const char *ReadString(std::string *s, const char *ptr) {
static bool ReadAttribute(std::string *name, std::string *type,
std::vector<unsigned char> *data, size_t *marker_size,
const char *marker, size_t size) {
+ using namespace bx;
size_t name_len = strnlen(marker, size);
if (name_len == size) {
// String does not have a terminating character.
diff --git a/src/emu/debug/express.cpp b/src/emu/debug/express.cpp
index 16d69411179..a9f9e38816f 100644
--- a/src/emu/debug/express.cpp
+++ b/src/emu/debug/express.cpp
@@ -925,38 +925,59 @@ void parsed_expression::parse_symbol_or_number(parse_token &token, const char *&
if (buffer.compare("rshift") == 0)
{ token.configure_operator(TVL_RSHIFT, 5); return; }
- // if we have an 0x prefix, we must be a hex value
- if (buffer[0] == '0' && buffer[1] == 'x')
- return parse_number(token, buffer.c_str() + 2, 16, expression_error::INVALID_NUMBER);
- // if we have an 0 prefix, we must be an octal value
- else if (buffer[0] == '0')
- return parse_number(token, buffer.c_str() + 1, 8, expression_error::INVALID_NUMBER);
-
+ switch (buffer[0])
+ {
// if we have a # prefix, we must be a decimal value
- if (buffer[0] == '#')
+ case '#':
return parse_number(token, buffer.c_str() + 1, 10, expression_error::INVALID_NUMBER);
// if we have a $ prefix, we are a hex value
- if (buffer[0] == '$')
+ case '$':
return parse_number(token, buffer.c_str() + 1, 16, expression_error::INVALID_NUMBER);
- // check for a symbol match
- symbol_entry *symbol = m_symtable->find_deep(buffer.c_str());
- if (symbol != nullptr)
- {
- token.configure_symbol(*symbol);
+ case '0':
+ switch (buffer[1])
+ {
+ // if we have an 0x prefix, we must be a hex value
+ case 'x':
+ case 'X':
+ return parse_number(token, buffer.c_str() + 2, 16, expression_error::INVALID_NUMBER);
+
+ // if we have an 0o prefix, we must be an octal value
+ case 'o':
+ case 'O':
+ return parse_number(token, buffer.c_str() + 2, 8, expression_error::INVALID_NUMBER);
+
+ // if we have an 0b prefix, we must be a binary value
+ case 'b':
+ case 'B':
+ return parse_number(token, buffer.c_str() + 2, 2, expression_error::INVALID_NUMBER);
+
+ // TODO: for octal address spaces, treat 0123 as octal
+ default:
+ ; // fall through
+ }
+ // fall through
- // if this is a function symbol, synthesize an execute function operator
- if (symbol->is_function())
+ default:
+ // check for a symbol match
+ symbol_entry *symbol = m_symtable->find_deep(buffer.c_str());
+ if (symbol != nullptr)
{
- parse_token &newtoken = m_tokenlist.append(*global_alloc(parse_token(string - stringstart)));
- newtoken.configure_operator(TVL_EXECUTEFUNC, 0);
+ token.configure_symbol(*symbol);
+
+ // if this is a function symbol, synthesize an execute function operator
+ if (symbol->is_function())
+ {
+ parse_token &newtoken = m_tokenlist.append(*global_alloc(parse_token(string - stringstart)));
+ newtoken.configure_operator(TVL_EXECUTEFUNC, 0);
+ }
+ return;
}
- return;
- }
- // attempt to parse as a number in the default base
- parse_number(token, buffer.c_str(), DEFAULT_BASE, expression_error::UNKNOWN_SYMBOL);
+ // attempt to parse as a number in the default base
+ parse_number(token, buffer.c_str(), DEFAULT_BASE, expression_error::UNKNOWN_SYMBOL);
+ }
}