DBG+GUI: small changes to stringformat
This commit is contained in:
parent
1a8781aa45
commit
d584ba10a5
|
@ -397,6 +397,7 @@ void DebugUpdateStack(duint dumpAddr, duint csp, bool forceDump)
|
|||
dumpAddr = selection.start;
|
||||
}
|
||||
GuiStackDumpAt(dumpAddr, csp);
|
||||
GuiUpdateArgumentWidget();
|
||||
}
|
||||
|
||||
static void printSoftBpInfo(const BREAKPOINT & bp)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "stringformat.h"
|
||||
#include "value.h"
|
||||
#include "symbolinfo.h"
|
||||
#include "module.h"
|
||||
|
||||
namespace ValueType
|
||||
{
|
||||
|
@ -12,7 +13,8 @@ namespace ValueType
|
|||
Hex,
|
||||
Pointer,
|
||||
String,
|
||||
AddrInfo
|
||||
AddrInfo,
|
||||
Module
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -46,11 +48,19 @@ static String printValue(FormatValueType value, ValueType::ValueType type)
|
|||
case ValueType::AddrInfo:
|
||||
{
|
||||
auto symbolic = SymGetSymbolicName(valuint);
|
||||
result = StringUtils::sprintf(fhex, valuint);
|
||||
if(DbgGetStringAt(valuint, string))
|
||||
result += " " + String(string);
|
||||
result = string;
|
||||
else if(symbolic.length())
|
||||
result += " " + symbolic;
|
||||
result = symbolic;
|
||||
else
|
||||
result.clear();
|
||||
}
|
||||
break;
|
||||
case ValueType::Module:
|
||||
{
|
||||
char mod[MAX_MODULE_SIZE] = "";
|
||||
ModNameFromAddr(valuint, mod, true);
|
||||
result = mod;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -86,6 +96,9 @@ static const char* getArgExpressionType(const String & formatString, ValueType::
|
|||
case 'a':
|
||||
type = ValueType::AddrInfo;
|
||||
break;
|
||||
case 'm':
|
||||
type = ValueType::Module;
|
||||
break;
|
||||
default: //invalid format
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
{
|
||||
if(format.length())
|
||||
return format;
|
||||
return QString("%1 {a:%1}").arg(expression);
|
||||
return QString("%1 {p:%1} {a:%1}").arg(expression).trimmed();
|
||||
}
|
||||
|
||||
static QString defaultArgName(const QString & name, int argN)
|
||||
|
|
Loading…
Reference in New Issue