mirror of https://github.com/stella-emu/stella.git
Store and lookup system labels (aka, equates) in case-insensitive manner.
This fixes a bug in the debugger parser, where typing (for example) 'trap swchb' doesn't work but 'trap SWCHB' does.
This commit is contained in:
parent
087fccd29f
commit
d88969adcb
|
@ -46,6 +46,17 @@ CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem)
|
|||
myRWPortAddress(0),
|
||||
myLabelLength(8) // longest pre-defined label
|
||||
{
|
||||
// Add case sensitive compare for user labels
|
||||
// TODO - should user labels be case insensitive too?
|
||||
auto usrCmp = [](const string& a, const string& b) { return a < b; };
|
||||
myUserAddresses = LabelToAddr(usrCmp);
|
||||
|
||||
// Add case insensitive compare for system labels
|
||||
auto sysCmp = [](const string& a, const string& b) {
|
||||
return BSPF::compareIgnoreCase(a, b) < 0;
|
||||
};
|
||||
mySystemAddresses = LabelToAddr(sysCmp);
|
||||
|
||||
// Add Zero-page RAM addresses
|
||||
for(uInt32 i = 0x80; i <= 0xFF; ++i)
|
||||
{
|
||||
|
|
|
@ -271,7 +271,8 @@ class CartDebug : public DebuggerSystem
|
|||
|
||||
private:
|
||||
using AddrToLabel = std::map<uInt16, string>;
|
||||
using LabelToAddr = std::map<string, uInt16>;
|
||||
using LabelToAddr = std::map<string, uInt16,
|
||||
std::function<bool(const string&, const string&)>>;
|
||||
|
||||
struct DirectiveTag {
|
||||
DisasmType type;
|
||||
|
|
Loading…
Reference in New Issue