MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / FindSourceLine

Function FindSourceLine

source/Debugger/Debug.cpp:6834–6874  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

6832
6833//===========================================================================
6834int FindSourceLine ( WORD nAddress )
6835{
6836 int iAddress = 0;
6837 int iLine = 0;
6838 int iSourceLine = NO_SOURCE_LINE;
6839
6840// iterate of <address,line>
6841// probably should be sorted by address
6842// then can do binary search
6843// iSourceLine = g_aSourceDebug.find( nAddress );
6844#if 0 // _DEBUG
6845 {
6846 for (int i = 0; i < g_vSourceLines.size(); i++ )
6847 {
6848 LogOutput( "%d: %s\n", i, g_vSourceLines[ i ] );
6849 }
6850 }
6851#endif
6852
6853 SourceAssembly_t::iterator iSource = g_aSourceDebug.begin();
6854 while (iSource != g_aSourceDebug.end() )
6855 {
6856 iAddress = iSource->first;
6857 iLine = iSource->second;
6858
6859#if 0 // _DEBUG
6860 LogOutput( "%04X -> %d line\n", iAddress, iLine );
6861#endif
6862
6863 if (iAddress == nAddress)
6864 {
6865 iSourceLine = iLine;
6866 break;
6867 }
6868
6869 iSource++;
6870 }
6871 // not found
6872
6873 return iSourceLine;
6874}
6875
6876//===========================================================================
6877bool ParseAssemblyListing ( bool bBytesToMemory, bool bAddSymbols )

Callers 1

DrawSubWindow_Source2Function · 0.85

Calls 1

LogOutputFunction · 0.85

Tested by

no test coverage detected