forked from qt-creator/qt-creator
Debugger fixes: Attach core/Compile Windows/Run XP.
Retrieve QueryProcessImageFileNameW via QLIbrary/dlopen on all platforms due to it being not present on Windows XP.
This commit is contained in:
@@ -234,7 +234,7 @@ bool WatchHandleDumperInserter::expandPointerToDumpable(const WatchData &wd, QSt
|
|||||||
const QString type = stripPointerType(wd.type);
|
const QString type = stripPointerType(wd.type);
|
||||||
WatchData derefedWd;
|
WatchData derefedWd;
|
||||||
derefedWd.setType(type);
|
derefedWd.setType(type);
|
||||||
derefedWd.setAddress(hexAddrS);
|
derefedWd.setAddress(hexAddrS.toLatin1());
|
||||||
derefedWd.name = QString(QLatin1Char('*'));
|
derefedWd.name = QString(QLatin1Char('*'));
|
||||||
derefedWd.iname = wd.iname + ".*";
|
derefedWd.iname = wd.iname + ".*";
|
||||||
derefedWd.source = OwnerDumper | CdbSymbolGroupContext::ChildrenKnownBit;
|
derefedWd.source = OwnerDumper | CdbSymbolGroupContext::ChildrenKnownBit;
|
||||||
@@ -376,7 +376,7 @@ unsigned CdbSymbolGroupContext::watchDataAt(unsigned long index, WatchData *wd)
|
|||||||
wd->iname.remove(openingBracketPos, 1);
|
wd->iname.remove(openingBracketPos, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wd->setAddress(QString::fromLatin1("0x") + QString::number(address, 16));
|
wd->setAddress(("0x") + QByteArray::number(address, 16));
|
||||||
wd->setType(type, false);
|
wd->setType(type, false);
|
||||||
wd->setValue(fixValue(value, type));
|
wd->setValue(fixValue(value, type));
|
||||||
if (rc & OutOfScope) {
|
if (rc & OutOfScope) {
|
||||||
|
|||||||
@@ -1055,7 +1055,8 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp)
|
|||||||
d->m_engine = debuggerEngineForExecutable(d->m_startParameters->executable, &errorMessage, &settingsIdHint);
|
d->m_engine = debuggerEngineForExecutable(d->m_startParameters->executable, &errorMessage, &settingsIdHint);
|
||||||
|
|
||||||
if (d->m_engine == 0
|
if (d->m_engine == 0
|
||||||
&& (startMode == AttachExternal || startMode == AttachCrashedExternal))
|
&& (startMode == AttachExternal || startMode == AttachCrashedExternal
|
||||||
|
|| startMode == AttachCore))
|
||||||
d->m_engine = debuggerEngineForAttach(&errorMessage);
|
d->m_engine = debuggerEngineForAttach(&errorMessage);
|
||||||
|
|
||||||
if (!d->m_engine) {
|
if (!d->m_engine) {
|
||||||
|
|||||||
@@ -35,18 +35,15 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <tlhelp32.h>
|
#include <tlhelp32.h>
|
||||||
#include <psapi.h>
|
#include <psapi.h>
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#include <QtCore/QLibrary>
|
#include <QtCore/QLibrary>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
// Resolve QueryFullProcessImageNameW out of kernel32.dll due
|
// Resolve QueryFullProcessImageNameW out of kernel32.dll due
|
||||||
// to incomplete MinGW import libs.
|
// to incomplete MinGW import libs and it not being present
|
||||||
static inline BOOL minGW_QueryFullProcessImageName(HANDLE h,
|
// on Windows XP.
|
||||||
|
static inline BOOL queryFullProcessImageName(HANDLE h,
|
||||||
DWORD flags,
|
DWORD flags,
|
||||||
LPWSTR buffer,
|
LPWSTR buffer,
|
||||||
DWORD *size)
|
DWORD *size)
|
||||||
@@ -65,7 +62,6 @@ static inline BOOL minGW_QueryFullProcessImageName(HANDLE h,
|
|||||||
// Read out process
|
// Read out process
|
||||||
return (*queryFullProcessImageNameW)(h, flags, buffer, size);
|
return (*queryFullProcessImageNameW)(h, flags, buffer, size);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline QString imageName(DWORD processId)
|
static inline QString imageName(DWORD processId)
|
||||||
{
|
{
|
||||||
@@ -75,13 +71,8 @@ static inline QString imageName(DWORD processId)
|
|||||||
return rc;
|
return rc;
|
||||||
WCHAR buffer[MAX_PATH];
|
WCHAR buffer[MAX_PATH];
|
||||||
DWORD bufSize = MAX_PATH;
|
DWORD bufSize = MAX_PATH;
|
||||||
#ifdef __GNUC__
|
if (queryFullProcessImageName(handle, 0, buffer, &bufSize))
|
||||||
if (minGW_QueryFullProcessImageName(handle, 0, buffer, &bufSize))
|
|
||||||
rc = QString::fromUtf16(reinterpret_cast<const ushort*>(buffer));
|
rc = QString::fromUtf16(reinterpret_cast<const ushort*>(buffer));
|
||||||
#else
|
|
||||||
if (QueryFullProcessImageNameW(handle, 0, buffer, &bufSize))
|
|
||||||
rc = QString::fromUtf16(buffer);
|
|
||||||
#endif
|
|
||||||
CloseHandle(handle);
|
CloseHandle(handle);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user