Fix Qt Creator build with Clang

Change-Id: Id607170961db5b1919b316293a96ae3330216377
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-06-20 13:15:24 +02:00
parent 3c0f61ef0b
commit 50fb1b4972
4 changed files with 19 additions and 12 deletions

View File

@@ -700,7 +700,8 @@ static std::string dumplocalHelper(ExtensionCommandContext &exc,PCSTR args, int
return std::string();
}
std::wstring value;
if (!dumpSimpleType(n->asSymbolGroupNode(), SymbolGroupValueContext(exc.dataSpaces(), exc.symbols()), &value, &std::string())) {
std::string tmp;
if (!dumpSimpleType(n->asSymbolGroupNode(), SymbolGroupValueContext(exc.dataSpaces(), exc.symbols()), &value, &tmp)) {
*errorMessage = "Cannot dump " + iname;
return std::string();
}

View File

@@ -228,8 +228,9 @@ SymbolAncestorInfo SymbolGroupValue::infoOfAncestor(const std::string &name) con
SymbolGroupValue SymbolGroupValue::addSymbol(const ULONG64 address, const std::string &type) const
{
const std::string &pointerToType = pointedToSymbolName(address, type);
std::string tmp;
if (SymbolGroupNode *ancestorNode =
node()->symbolGroup()->addSymbol(module(), pointerToType, "", "", &std::string())) {
node()->symbolGroup()->addSymbol(module(), pointerToType, "", "", &tmp)) {
return SymbolGroupValue(ancestorNode, m_context);
}
if (isValid() && SymbolGroupValue::verbose) { // Do not report subsequent errors
@@ -2064,8 +2065,9 @@ static inline bool dumpQRegion(const SymbolGroupValue &v, std::wostream &str, vo
namestr << "(" << info.prependQtGuiModule("QRegionPrivate *") << ")("
<< std::showbase << std::hex << d.pointerValue() << ')';
std::string tmp;
SymbolGroupNode *qRegionPrivateNode
= v.node()->symbolGroup()->addSymbol(v.module(), namestr.str(), std::string(), &std::string());
= v.node()->symbolGroup()->addSymbol(v.module(), namestr.str(), std::string(), &tmp);
if (!qRegionPrivateNode)
return false;
@@ -2128,14 +2130,15 @@ static inline bool dumpQHostAddress(const SymbolGroupValue &v, std::wostream &st
std::ostringstream namestr;
namestr << '(' << info.prependQtNetworkModule("QHostAddressPrivate *") << ")("
<< std::showbase << std::hex << d.pointerValue() << ')';
std::string tmp;
SymbolGroupNode *qHostAddressPrivateNode
= v.node()->symbolGroup()->addSymbol(v.module(), namestr.str(), std::string(), &std::string());
= v.node()->symbolGroup()->addSymbol(v.module(), namestr.str(), std::string(), &tmp);
if (!qHostAddressPrivateNode)
return false;
const SymbolGroupValue qHostAddressPrivateValue = SymbolGroupValue(qHostAddressPrivateNode, v.context());
const bool parsed = readPODFromMemory<bool>(qHostAddressPrivateValue.context().dataspaces,
qHostAddressPrivateValue["isParsed"].address(),
sizeof(bool), false, &std::string());
sizeof(bool), false, &tmp);
if (parsed) {
const int protocol = qHostAddressPrivateValue["protocol"].intValue(-1);
if (protocol < 0) {
@@ -2888,7 +2891,8 @@ static bool dumpQVariant(const SymbolGroupValue &v, std::wostream &str, std::str
if (const SymbolGroupValue mv = dataV.typeCast(vmType.c_str())) {
SymbolGroupNode *mapNode = mv.node();
std::wstring value;
if (dumpSimpleType(mapNode, dataV.context(), &value, &std::string())
std::string tmp;
if (dumpSimpleType(mapNode, dataV.context(), &value, &tmp)
== SymbolGroupNode::SimpleDumperOk) {
str << value;
if (specialInfoIn)
@@ -2903,7 +2907,8 @@ static bool dumpQVariant(const SymbolGroupValue &v, std::wostream &str, std::str
if (const SymbolGroupValue vl = dataV.typeCast(vLType.c_str())) {
SymbolGroupNode *vListNode = vl.node();
std::wstring value;
if (dumpSimpleType(vListNode, dataV.context(), &value, &std::string())
std::string tmp;
if (dumpSimpleType(vListNode, dataV.context(), &value, &tmp)
== SymbolGroupNode::SimpleDumperOk) {
str << value;
if (specialInfoIn)
@@ -2929,7 +2934,8 @@ static bool dumpQVariant(const SymbolGroupValue &v, std::wostream &str, std::str
if (const SymbolGroupValue sl = dataV.typeCast(qtInfo.prependQtCoreModule("QStringList *").c_str())) {
SymbolGroupNode *listNode = sl.node();
std::wstring value;
if (dumpSimpleType(listNode, dataV.context(), &value, &std::string())
std::string tmp;
if (dumpSimpleType(listNode, dataV.context(), &value, &tmp)
== SymbolGroupNode::SimpleDumperOk) {
str << value;
if (specialInfoIn)

View File

@@ -193,7 +193,7 @@ bool isDebuggerWinException(unsigned long code)
return code == EXCEPTION_BREAKPOINT || code == EXCEPTION_SINGLE_STEP;
}
bool isFatalWinException(long code)
bool isFatalWinException(unsigned long code)
{
switch (code) {
case EXCEPTION_BREAKPOINT:
@@ -217,7 +217,7 @@ bool winResumeThread(unsigned long, QString *) { return false; }
bool isWinProcessBeingDebugged(unsigned long) { return false; }
void formatWindowsException(unsigned long , quint64, unsigned long,
quint64, quint64, QTextStream &) { }
bool isFatalWinException(long) { return false; }
bool isFatalWinException(unsigned long) { return false; }
bool isDebuggerWinException(unsigned long) { return false; }
#endif // !Q_OS_WIN

View File

@@ -40,7 +40,7 @@ bool winResumeThread(unsigned long dwThreadId, QString *errorMessage);
bool isWinProcessBeingDebugged(unsigned long pid);
// Special exception codes.
enum
enum : unsigned long
{
winExceptionCppException = 0xe06d7363,
winExceptionSetThreadName = 0x406d1388,
@@ -60,7 +60,7 @@ void formatWindowsException(unsigned long code, quint64 address,
unsigned long flags, quint64 info1, quint64 info2,
QTextStream &str);
// Check for access violation, etc.
bool isFatalWinException(long code);
bool isFatalWinException(unsigned long code);
// Check for EXCEPTION_BREAKPOINT, EXCEPTION_SINGLE_STEP
bool isDebuggerWinException(unsigned long code);