===========================================================================
| 312 | |
| 313 | //=========================================================================== |
| 314 | Update_t CmdSymbolsInfo (int nArgs) |
| 315 | { |
| 316 | int bDisplaySymbolTables = 0; |
| 317 | |
| 318 | if (! nArgs) |
| 319 | { |
| 320 | // default to all tables |
| 321 | bDisplaySymbolTables = (1 << NUM_SYMBOL_TABLES) - 1; |
| 322 | } |
| 323 | else |
| 324 | { // Convert Command Index to parameter |
| 325 | int iWhichTable = GetSymbolTableFromCommand(); |
| 326 | if ((iWhichTable < 0) || (iWhichTable >= NUM_SYMBOL_TABLES)) |
| 327 | { |
| 328 | return _PrintSymbolInvalidTable(); |
| 329 | } |
| 330 | |
| 331 | bDisplaySymbolTables = (1 << iWhichTable); |
| 332 | } |
| 333 | |
| 334 | //sprintf( sText, " Symbols Main: %s%d%s User: %s%d%s Source: %s%d%s" |
| 335 | // "Main:# Basic:# Asm:# User1:# User2:# Src1:# Src2:# Dos:# Prodos:# |
| 336 | |
| 337 | std::string const sIndent = " "; |
| 338 | std::string sText = sIndent; // Indent new line |
| 339 | |
| 340 | for ( int iTable = 0, bTable = 1; bTable <= bDisplaySymbolTables; iTable++, bTable <<= 1 ) |
| 341 | { |
| 342 | if ( !!(bDisplaySymbolTables & bTable) ) |
| 343 | { |
| 344 | std::string hdr = _CmdSymbolsInfoHeader( iTable ); // 15 chars per table |
| 345 | |
| 346 | // 2.8.0.4 BUGFIX: Check for buffer overflow and wrap text |
| 347 | int nLen = ConsoleColor_StringLength( hdr.c_str() ); |
| 348 | int nDst = ConsoleColor_StringLength( sText.c_str() ); |
| 349 | if ( (nDst + nLen) > CONSOLE_WIDTH ) |
| 350 | { |
| 351 | ConsolePrint( sText.c_str() ); |
| 352 | sText = sIndent; // Indent new line |
| 353 | } |
| 354 | sText += hdr; |
| 355 | } |
| 356 | } |
| 357 | ConsolePrint( sText.c_str() ); |
| 358 | |
| 359 | return ConsoleUpdate(); |
| 360 | } |
| 361 | |
| 362 | //=========================================================================== |
| 363 | void _CmdPrintSymbol( LPCTSTR pSymbol, WORD nAddress, int iTable ) |
no test coverage detected