public string SymbolNameByAddress(long aAddress) { string ret = string.Empty; SymbolLib.Generics.GenericSymbol symbol = EntryByAddress(aAddress); if (symbol != null) { ret = symbol.Symbol; } return(ret); }
public GenericSymbol EntryByAddress(long aAddress, ref GenericSymbolCollection aCollection) { GenericSymbol symbol = null; aCollection = null; // lock (this) { // Debugging code int debug = 0; if (debug != 0) { int count = NumberOfCollections; for (int i = 0; i < count; i++) { GenericSymbolCollection collection = this[i]; string line = string.Empty; if (collection.AddressFallsWithinRange(aAddress)) { line = i.ToString("d8") + " * [" + collection.AddressRangeStart.ToString("x8") + " - " + collection.AddressRangeEnd.ToString("x8") + "] " + " [" + (collection.HostBinaryExists ? "Exists] " : "Notfnd] ") + collection.HostBinaryFileName; } else { line = i.ToString("d8") + " [" + collection.AddressRangeStart.ToString("x8") + " - " + collection.AddressRangeEnd.ToString("x8") + "] " + " [" + (collection.HostBinaryExists ? "Exists] " : "Notfnd] ") + collection.HostBinaryFileName; } System.Diagnostics.Debug.WriteLine(line); } } // Production search code if (Range.Contains(aAddress)) { // Search for a suitable symbol entry that matches aAddress int count = NumberOfCollections; for (int i = 0; i < count; i++) { GenericSymbolCollection collection = this[i]; if (collection.AddressFallsWithinRange(aAddress)) { // Should be able to locate a symbol within this collection... symbol = collection.SymbolForAddress(aAddress); aCollection = collection; aCollection.Tagged = true; break; } } } } // return(symbol); }