1
0
mirror of https://github.com/fadden/6502bench.git synced 2025-07-02 16:24:09 +00:00

Expand "apply platform symbols" feature

This experimental feature applied platform symbols to the project,
setting labels where the platform symbol's address matched an internal
address.  The feature now applies project symbols as well, and has
been renamed to "apply external symbols".

We now report the number of labels set.
This commit is contained in:
Andy McFadden
2020-07-28 10:56:07 -07:00
parent c380b001b7
commit 94d7a30a09
5 changed files with 28 additions and 14 deletions

View File

@ -828,6 +828,7 @@ namespace SourceGen {
private void ApplyUndoableChanges(ChangeSet cs) {
if (cs.Count == 0) {
Debug.WriteLine("ApplyUndoableChanges: change set is empty");
// Apply anyway to create an undoable non-event?
}
ApplyChanges(cs, false);
mProject.PushChangeSet(cs);
@ -4466,11 +4467,12 @@ namespace SourceGen {
}
// Disable "analyze uncategorized data" for best results.
public void Debug_ApplyPlatformSymbols() {
public void Debug_ApplyExternalSymbols() {
ChangeSet cs = new ChangeSet(1);
foreach (Symbol sym in mProject.SymbolTable) {
if (sym.SymbolSource != Symbol.Source.Platform) {
if (sym.SymbolSource != Symbol.Source.Platform &&
sym.SymbolSource != Symbol.Source.Project) {
continue;
}
DefSymbol defSym = (DefSymbol)sym;
@ -4508,7 +4510,12 @@ namespace SourceGen {
cs.Add(uc);
}
ApplyUndoableChanges(cs);
if (cs.Count == 0) {
MessageBox.Show("No changes made.");
} else {
ApplyUndoableChanges(cs);
MessageBox.Show("Set " + cs.Count + " labels.");
}
}
public void Debug_RebootSecuritySandbox() {