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);
|
||||
WatchData derefedWd;
|
||||
derefedWd.setType(type);
|
||||
derefedWd.setAddress(hexAddrS);
|
||||
derefedWd.setAddress(hexAddrS.toLatin1());
|
||||
derefedWd.name = QString(QLatin1Char('*'));
|
||||
derefedWd.iname = wd.iname + ".*";
|
||||
derefedWd.source = OwnerDumper | CdbSymbolGroupContext::ChildrenKnownBit;
|
||||
@@ -376,7 +376,7 @@ unsigned CdbSymbolGroupContext::watchDataAt(unsigned long index, WatchData *wd)
|
||||
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->setValue(fixValue(value, type));
|
||||
if (rc & OutOfScope) {
|
||||
|
||||
@@ -1055,7 +1055,8 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp)
|
||||
d->m_engine = debuggerEngineForExecutable(d->m_startParameters->executable, &errorMessage, &settingsIdHint);
|
||||
|
||||
if (d->m_engine == 0
|
||||
&& (startMode == AttachExternal || startMode == AttachCrashedExternal))
|
||||
&& (startMode == AttachExternal || startMode == AttachCrashedExternal
|
||||
|| startMode == AttachCore))
|
||||
d->m_engine = debuggerEngineForAttach(&errorMessage);
|
||||
|
||||
if (!d->m_engine) {
|
||||
|
||||
@@ -35,18 +35,15 @@
|
||||
#include <windows.h>
|
||||
#include <tlhelp32.h>
|
||||
#include <psapi.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
# include <QtCore/QLibrary>
|
||||
#endif
|
||||
#include <QtCore/QLibrary>
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
#ifdef __GNUC__
|
||||
// Resolve QueryFullProcessImageNameW out of kernel32.dll due
|
||||
// to incomplete MinGW import libs.
|
||||
static inline BOOL minGW_QueryFullProcessImageName(HANDLE h,
|
||||
// to incomplete MinGW import libs and it not being present
|
||||
// on Windows XP.
|
||||
static inline BOOL queryFullProcessImageName(HANDLE h,
|
||||
DWORD flags,
|
||||
LPWSTR buffer,
|
||||
DWORD *size)
|
||||
@@ -65,7 +62,6 @@ static inline BOOL minGW_QueryFullProcessImageName(HANDLE h,
|
||||
// Read out process
|
||||
return (*queryFullProcessImageNameW)(h, flags, buffer, size);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline QString imageName(DWORD processId)
|
||||
{
|
||||
@@ -75,13 +71,8 @@ static inline QString imageName(DWORD processId)
|
||||
return rc;
|
||||
WCHAR buffer[MAX_PATH];
|
||||
DWORD bufSize = MAX_PATH;
|
||||
#ifdef __GNUC__
|
||||
if (minGW_QueryFullProcessImageName(handle, 0, buffer, &bufSize))
|
||||
if (queryFullProcessImageName(handle, 0, buffer, &bufSize))
|
||||
rc = QString::fromUtf16(reinterpret_cast<const ushort*>(buffer));
|
||||
#else
|
||||
if (QueryFullProcessImageNameW(handle, 0, buffer, &bufSize))
|
||||
rc = QString::fromUtf16(buffer);
|
||||
#endif
|
||||
CloseHandle(handle);
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user