forked from qt-creator/qt-creator
Debugger: Consolidate memoryToHex{W,} in CDB helpers
Only one is really needed. Change-Id: I43eb36336faa1f73a93f685fa60e518ee9225abb Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -592,17 +592,6 @@ std::string memoryToHex(CIDebugDataSpaces *ds, ULONG64 address, ULONG length,
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::wstring memoryToHexW(CIDebugDataSpaces *ds, ULONG64 address, ULONG length,
|
||||
std::string *errorMessage /* = 0 */)
|
||||
{
|
||||
if (const unsigned char *buffer = SymbolGroupValue::readMemory(ds, address, length, errorMessage)) {
|
||||
const std::wstring hex = dataToHexW(buffer, buffer + length);
|
||||
delete [] buffer;
|
||||
return hex;
|
||||
}
|
||||
return std::wstring();
|
||||
}
|
||||
|
||||
// Format stack as GDBMI
|
||||
static StackFrames getStackTrace(CIDebugControl *debugControl,
|
||||
CIDebugSymbols *debugSymbols,
|
||||
@@ -789,9 +778,9 @@ static bool gdbmiFormatBreakpoint(std::ostream &str,
|
||||
// Report the memory of watchpoints for comparing bitfields
|
||||
if (dataSpaces && memoryRange.second > 0) {
|
||||
str << ",size=\"" << memoryRange.second << '"';
|
||||
const std::wstring memoryHex = memoryToHexW(dataSpaces, memoryRange.first, memoryRange.second);
|
||||
const std::string memoryHex = memoryToHex(dataSpaces, memoryRange.first, memoryRange.second);
|
||||
if (!memoryHex.empty())
|
||||
str << ",memory=\"" << gdbmiWStringFormat(memoryHex) << '"';
|
||||
str << ",memory=\"" << gdbmiStringFormat(memoryHex) << '"';
|
||||
}
|
||||
} // Got address
|
||||
} // !deferred
|
||||
|
||||
Reference in New Issue
Block a user