summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author dave-br <dave-br@users.noreply.github.com>2025-05-07 13:34:07 -0700
committer GitHub <noreply@github.com>2025-05-07 16:34:07 -0400
commitf17cf5475a8ea83c77f90be24beaca3ea18cc2b8 (patch)
treeddd21978ca9d49460b30ad1de9b5f59ada9f0dcb
parent5f17711c85571cb7186843c2d79f2ac31334c795 (diff)
[win] debugger crash: Add fallback to "0" if address evaluation fails (#13686)
Memory window address field: If address string evaluation fails, we'd fall back to the last-known-working string. This works great if the failure is due to the user changing the string. But if the user changes the source, that also can cause failures (different symbol table used for evaluation), and this fallback does not help. The fix is to add a second fallback: Use "0" as the address string when all else fails.
-rw-r--r--src/emu/debug/debugvw.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/emu/debug/debugvw.cpp b/src/emu/debug/debugvw.cpp
index 7412ddd2f60..2cae08f733d 100644
--- a/src/emu/debug/debugvw.cpp
+++ b/src/emu/debug/debugvw.cpp
@@ -511,7 +511,19 @@ bool debug_view_expression::recompute()
}
catch (expression_error &)
{
- m_parsed.parse(oldstring);
+ try
+ {
+ // If we got here because the user typed in a new expression,
+ // then going back to the previous expression should work
+ m_parsed.parse(oldstring);
+ }
+ catch (expression_error &)
+ {
+ // If that didn't work, perhaps the user switched sources
+ // and the previous expression doesn't evaluate with the
+ // new symbol table. Try "0" as last resort
+ m_parsed.parse("0");
+ }
}
}