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

Expand set of things that work with double-click on opcode

If you double-click on the opcode of "JSR label", the code view
selection jumps to the label.  This now works for partial operands,
e.g. "LDA #<label".

Some changes to the find-label-offset code affected the cc65 "is it
a forward reference to a direct-page label" logic.  The regression
test now correctly identifies an instruction that refers to itself
as not being a forward reference.
This commit is contained in:
Andy McFadden
2018-11-03 15:03:25 -07:00
parent a7e6b101c4
commit 2f74fce80b
7 changed files with 27 additions and 39 deletions

View File

@@ -1584,7 +1584,7 @@ namespace SourceGen {
/// </summary>
/// <param name="name">Label to find.</param>
/// <returns>File offset associated with label, or -1 if not found.</returns>
public int FindLabelByName(string name) {
public int FindLabelOffsetByName(string name) {
// We're interested in user labels and auto-generated labels. Do a lookup in
// SymbolTable to find the symbol, then if it's user or auto, we do a second
// search to find the file offset it's associated with. The second search
@@ -1593,10 +1593,11 @@ namespace SourceGen {
//
// This will not find "hidden" labels, i.e. labels that are in the middle of an
// instruction or multi-byte data area, because those are removed from SymbolTable.
if (!SymbolTable.TryGetValue(name, out Symbol sym)) {
return -1;
}
if (sym.SymbolSource != Symbol.Source.Auto && sym.SymbolSource != Symbol.Source.User) {
if (!sym.IsInternalLabel) {
return -1;
}
for (int i = 0; i < mAnattribs.Length; i++) {