Syntax: sym ! sym ~ sym = sym @ = NOTE: Listing of the symbols is handled via returning UPDATE_NOTHING which is triggered by: sym ===========================================================================
| 977 | // sym * |
| 978 | //=========================================================================== |
| 979 | Update_t _CmdSymbolsUpdate( int nArgs, int bSymbolTables ) |
| 980 | { |
| 981 | bool bRemoveSymbol = false; |
| 982 | bool bUpdateSymbol = false; |
| 983 | |
| 984 | char *pSymbolName = g_aArgs[1].sArg; |
| 985 | WORD nAddress = g_aArgs[3].nValue; |
| 986 | |
| 987 | if ((nArgs == 2) |
| 988 | && ((g_aArgs[ 1 ].eToken == TOKEN_EXCLAMATION) || (g_aArgs[1].eToken == TOKEN_TILDE)) ) |
| 989 | bRemoveSymbol = true; |
| 990 | |
| 991 | if ((nArgs == 3) && (g_aArgs[ 2 ].eToken == TOKEN_EQUAL )) |
| 992 | bUpdateSymbol = true; |
| 993 | |
| 994 | // 2.9.1.7 Added: QoL for automatic symbol names |
| 995 | if ((nArgs == 2) |
| 996 | && (g_aArgRaw[ 1 ].eToken == TOKEN_AT ) // NOTE: @ is parsed and evaluated and NOT in the cooked args |
| 997 | && (g_aArgs [ 1 ].eToken == TOKEN_EQUAL)) |
| 998 | { |
| 999 | if (bSymbolTables == SYMBOL_TABLE_USER_1) |
| 1000 | bSymbolTables = SYMBOL_TABLE_USER_2; // Autogenerated symbol names go in table 2 for organization when reverse engineering. Table 1 = known, Table 2 = unknown. |
| 1001 | |
| 1002 | nAddress = g_aArgs[2].nValue; |
| 1003 | strncpy_s( g_aArgs[1].sArg, StrFormat("_%04X", nAddress).c_str(), _TRUNCATE ); // Autogenerated symbol name |
| 1004 | |
| 1005 | bUpdateSymbol = true; |
| 1006 | } |
| 1007 | |
| 1008 | if (bRemoveSymbol || bUpdateSymbol) |
| 1009 | { |
| 1010 | int iTable = _GetSymbolTableFromFlag( bSymbolTables ); |
| 1011 | SymbolUpdate( (SymbolTable_Index_e) iTable, pSymbolName, nAddress, bRemoveSymbol, bUpdateSymbol ); |
| 1012 | return ConsoleUpdate(); |
| 1013 | } |
| 1014 | |
| 1015 | return UPDATE_NOTHING; |
| 1016 | } |
| 1017 | |
| 1018 | |
| 1019 | //=========================================================================== |
no test coverage detected