1
0
Fork 0

DBG+GUI: small changes to stringformat

This commit is contained in:
mrexodia 2016-07-19 16:50:06 +02:00
parent 1a8781aa45
commit d584ba10a5
No known key found for this signature in database
GPG Key ID: D72F9A4FAA0073B4
3 changed files with 19 additions and 5 deletions

View File

@ -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)

View File

@ -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;
}

View File

@ -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)