Debugger: replace prefix 'str' with 's' (PR #1082)
This commit is contained in:
parent
5b50d784d7
commit
6e003fd49f
|
@ -1697,8 +1697,8 @@ void _BWZ_List( const Breakpoint_t * aBreakWatchZero, const int iBWZ ) //, bool
|
|||
{
|
||||
static const char sFlags[] = "-*";
|
||||
|
||||
std::string strAddressBuf;
|
||||
std::string const& symbol = GetSymbol(aBreakWatchZero[iBWZ].nAddress, 2, strAddressBuf);
|
||||
std::string sAddressBuf;
|
||||
std::string const& sSymbol = GetSymbol(aBreakWatchZero[iBWZ].nAddress, 2, sAddressBuf);
|
||||
|
||||
char cBPM = aBreakWatchZero[iBWZ].eSource == BP_SRC_MEM_READ_ONLY ? 'R'
|
||||
: aBreakWatchZero[iBWZ].eSource == BP_SRC_MEM_WRITE_ONLY ? 'W'
|
||||
|
@ -1710,7 +1710,7 @@ void _BWZ_List( const Breakpoint_t * aBreakWatchZero, const int iBWZ ) //, bool
|
|||
sFlags[ aBreakWatchZero[ iBWZ ].bEnabled ? 1 : 0 ],
|
||||
aBreakWatchZero[ iBWZ ].nAddress,
|
||||
cBPM,
|
||||
symbol.c_str()
|
||||
sSymbol.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -2256,8 +2256,8 @@ void _CmdColorGet( const int iScheme, const int iColor )
|
|||
}
|
||||
else
|
||||
{
|
||||
std::string strText = StrFormat( "Color: %d\nOut of range!", iColor );
|
||||
GetFrame().FrameMessageBox(strText.c_str(), "ERROR", MB_OK);
|
||||
std::string sText = StrFormat( "Color: %d\nOut of range!", iColor );
|
||||
GetFrame().FrameMessageBox(sText.c_str(), "ERROR", MB_OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5776,27 +5776,27 @@ Update_t CmdOutputCalc (int nArgs)
|
|||
// CHC_NUM_DEC
|
||||
// CHC_ARG_
|
||||
// CHC_STRING
|
||||
std::string strText = StrFormat( "$%04X 0z%08X %5d '%c' ", nAddress, nBit, nAddress, c );
|
||||
std::string sText = StrFormat( "$%04X 0z%08X %5d '%c' ", nAddress, nBit, nAddress, c );
|
||||
|
||||
if (bParen)
|
||||
strText += '(';
|
||||
sText += '(';
|
||||
|
||||
if (bHi && bLo)
|
||||
strText += "High Ctrl";
|
||||
sText += "High Ctrl";
|
||||
else
|
||||
if (bHi)
|
||||
strText += "High";
|
||||
sText += "High";
|
||||
else
|
||||
if (bLo)
|
||||
strText += "Ctrl";
|
||||
sText += "Ctrl";
|
||||
|
||||
if (bParen)
|
||||
strText += ')';
|
||||
sText += ')';
|
||||
|
||||
ConsoleBufferPush( strText.c_str() );
|
||||
ConsoleBufferPush( sText.c_str() );
|
||||
|
||||
// If we colorize then w must also guard against character ouput $60
|
||||
// ConsolePrint( strText.c_str() );
|
||||
// ConsolePrint( sText.c_str() );
|
||||
|
||||
return ConsoleUpdate();
|
||||
}
|
||||
|
|
|
@ -273,7 +273,7 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
|
|||
|
||||
std::string const* pTarget = NULL;
|
||||
std::string const* pSymbol = FindSymbolFromAddress(nTarget, &line_.iTargetTable);
|
||||
std::string strAddressBuf;
|
||||
std::string sAddressBuf;
|
||||
|
||||
// Data Assembler
|
||||
if (pData && (!pData->bSymbolLookup))
|
||||
|
@ -322,8 +322,8 @@ int GetDisassemblyLine(WORD nBaseAddress, DisasmLine_t& line_)
|
|||
|
||||
if (!(bDisasmFormatFlags & DISASM_FORMAT_SYMBOL))
|
||||
{
|
||||
strAddressBuf = FormatAddress(nTarget, (iOpmode != AM_R) ? nOpbyte : 3); // GH#587: For Bcc opcodes, pretend it's a 3-byte opcode to print a 16-bit target addr
|
||||
pTarget = &strAddressBuf;
|
||||
sAddressBuf = FormatAddress(nTarget, (iOpmode != AM_R) ? nOpbyte : 3); // GH#587: For Bcc opcodes, pretend it's a 3-byte opcode to print a 16-bit target addr
|
||||
pTarget = &sAddressBuf;
|
||||
}
|
||||
|
||||
//sprintf( sTarget, g_aOpmodes[ iOpmode ]._sFormat, pTarget );
|
||||
|
|
|
@ -2941,13 +2941,13 @@ void DrawZeroPagePointers ( int line )
|
|||
BYTE nZPAddr1 = (g_aZeroPagePointers[iZP].nAddress ) & 0xFF; // +MJP missig: "& 0xFF", or "(BYTE) ..."
|
||||
BYTE nZPAddr2 = (g_aZeroPagePointers[iZP].nAddress+1) & 0xFF;
|
||||
|
||||
std::string strAddressBuf1;
|
||||
std::string strAddressBuf2;
|
||||
std::string const& symbol1 = GetSymbol(nZPAddr1, 2, strAddressBuf1); // 2:8-bit value (if symbol not found)
|
||||
std::string const& symbol2 = GetSymbol(nZPAddr2, 2, strAddressBuf2); // 2:8-bit value (if symbol not found)
|
||||
std::string sAddressBuf1;
|
||||
std::string sAddressBuf2;
|
||||
std::string const& sSymbol1 = GetSymbol(nZPAddr1, 2, sAddressBuf1); // 2:8-bit value (if symbol not found)
|
||||
std::string const& sSymbol2 = GetSymbol(nZPAddr2, 2, sAddressBuf2); // 2:8-bit value (if symbol not found)
|
||||
|
||||
// if ((symbol1.length() == 1) && (symbol2.length() == 1))
|
||||
// sprintf( sText, "%s%s", symbol1.c_str(), symbol2.c_str());
|
||||
// if ((sSymbol1.length() == 1) && (sSymbol2.length() == 1))
|
||||
// sprintf( sText, "%s%s", sSymbol1.c_str(), sSymbol2.c_str());
|
||||
|
||||
DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_ADDRESS ));
|
||||
|
||||
|
@ -2958,22 +2958,22 @@ void DrawZeroPagePointers ( int line )
|
|||
|
||||
sText[nMaxSymbolLen] = 0;
|
||||
|
||||
if (!symbol1.empty() && symbol1[0] == '$')
|
||||
if (!sSymbol1.empty() && sSymbol1[0] == '$')
|
||||
{
|
||||
// sprintf( sText, "%s%s", pSymbol1 );
|
||||
// sprintf( sText, "%s%s", sSymbol1 );
|
||||
// sprintf( sText, "%04X", nZPAddr1 );
|
||||
}
|
||||
else
|
||||
if (!symbol2.empty() && symbol2[0] == '$')
|
||||
if (!sSymbol2.empty() && sSymbol2[0] == '$')
|
||||
{
|
||||
// sprintf( sText, "%s%s", pSymbol2 );
|
||||
// sprintf( sText, "%s%s", sSymbol2 );
|
||||
// sprintf( sText, "%04X", nZPAddr2 );
|
||||
DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_ADDRESS ));
|
||||
}
|
||||
else
|
||||
{
|
||||
int nMin = MIN( symbol1.length(), nMaxSymbolLen );
|
||||
memcpy(sText, symbol1.c_str(), nMin);
|
||||
int nMin = MIN( sSymbol1.length(), nMaxSymbolLen );
|
||||
memcpy(sText, sSymbol1.c_str(), nMin);
|
||||
DebuggerSetColorFG( DebuggerGetColor( FG_DISASM_SYMBOL ) );
|
||||
}
|
||||
// DrawRegister( line+iZP, szZP, 2, nTarget16);
|
||||
|
@ -3252,13 +3252,13 @@ static void DrawVideoScannerValue(int line, int vert, int horz, bool isVisible)
|
|||
else PrintText("h:", rect);
|
||||
rect.left += nameWidth * nFontWidth;
|
||||
|
||||
std::string strValue = StrFormat((g_videoScannerDisplayInfo.isDecimal) ? "%03u" : "%03X", nValue);
|
||||
std::string sValue = StrFormat((g_videoScannerDisplayInfo.isDecimal) ? "%03u" : "%03X", nValue);
|
||||
|
||||
if (!isVisible)
|
||||
DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_INVISIBLE)); // yellow
|
||||
else
|
||||
DebuggerSetColorFG(DebuggerGetColor(FG_VIDEOSCANNER_VISIBLE)); // green
|
||||
PrintText(strValue.c_str(), rect);
|
||||
PrintText(sValue.c_str(), rect);
|
||||
rect.left += (numberWidth+gapWidth) * nFontWidth;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,13 +125,13 @@ Update_t _PrintSymbolInvalidTable()
|
|||
|
||||
|
||||
//===========================================================================
|
||||
std::string const& GetSymbol (WORD nAddress, int nBytes, std::string& strAddressBuf)
|
||||
std::string const& GetSymbol (WORD nAddress, int nBytes, std::string& sAddressBuf)
|
||||
{
|
||||
std::string const* pSymbol = FindSymbolFromAddress( nAddress );
|
||||
if (pSymbol)
|
||||
return *pSymbol;
|
||||
|
||||
return strAddressBuf = FormatAddress( nAddress, nBytes );
|
||||
return sAddressBuf = FormatAddress( nAddress, nBytes );
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -564,8 +564,8 @@ int ParseSymbolTable(const std::string & pPathFileName, SymbolTable_Index_e eSym
|
|||
if (pPathFileName.empty())
|
||||
return nSymbolsLoaded;
|
||||
|
||||
std::string strFormat1 = StrFormat( "%%x %%%ds", MAX_SYMBOLS_LEN ); // i.e. "%x %13s"
|
||||
std::string strFormat2 = StrFormat( "%%%ds %%x", MAX_SYMBOLS_LEN ); // i.e. "%13s %x"
|
||||
std::string sFormat1 = StrFormat( "%%x %%%ds", MAX_SYMBOLS_LEN ); // i.e. "%x %13s"
|
||||
std::string sFormat2 = StrFormat( "%%%ds %%x", MAX_SYMBOLS_LEN ); // i.e. "%13s %x"
|
||||
|
||||
FILE *hFile = fopen( pPathFileName.c_str(), "rt" );
|
||||
|
||||
|
@ -604,7 +604,7 @@ int ParseSymbolTable(const std::string & pPathFileName, SymbolTable_Index_e eSym
|
|||
|
||||
if (strstr(szLine, "$") == NULL)
|
||||
{
|
||||
sscanf(szLine, strFormat1.c_str(), &nAddress, sName);
|
||||
sscanf(szLine, sFormat1.c_str(), &nAddress, sName);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -623,7 +623,7 @@ int ParseSymbolTable(const std::string & pPathFileName, SymbolTable_Index_e eSym
|
|||
memset(&szLine[MAX_SYMBOLS_LEN], ' ', nLen - MAX_SYMBOLS_LEN); // sscanf fails for nAddress if string too long
|
||||
}
|
||||
}
|
||||
sscanf(szLine, strFormat2.c_str(), sName, &nAddress);
|
||||
sscanf(szLine, sFormat2.c_str(), sName, &nAddress);
|
||||
}
|
||||
|
||||
// SymbolOffset
|
||||
|
|
Loading…
Reference in New Issue