===========================================================================
| 6832 | |
| 6833 | //=========================================================================== |
| 6834 | int 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 | //=========================================================================== |
| 6877 | bool ParseAssemblyListing ( bool bBytesToMemory, bool bAddSymbols ) |
no test coverage detected