summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2010-06-14 11:28:34 +0200
committerhjk <qtc-committer@nokia.com>2010-06-14 11:31:27 +0200
commit8a26bc5aec6d312bfd5fe3e8f3290076fc9f3219 (patch)
tree4bba765758f6d635f7d92f567af7785104bd3839
parenteffa8a38da7cedb868391ecbf34bfdb0eb1e0198 (diff)
downloadqt-creator-8a26bc5aec6d312bfd5fe3e8f3290076fc9f3219.tar.gz
debugger: make more of cdb compilable on non-Windows
-rw-r--r--src/plugins/debugger/cdb/breakpoint.cpp8
-rw-r--r--src/plugins/debugger/cdb/breakpoint.h6
-rw-r--r--src/plugins/debugger/cdb/cdb.pri62
-rw-r--r--src/plugins/debugger/cdb/cdbcomstub.h46
-rw-r--r--src/plugins/debugger/cdb/stacktracecontext.cpp2
5 files changed, 85 insertions, 39 deletions
diff --git a/src/plugins/debugger/cdb/breakpoint.cpp b/src/plugins/debugger/cdb/breakpoint.cpp
index 13aacaf8cf..49a6550990 100644
--- a/src/plugins/debugger/cdb/breakpoint.cpp
+++ b/src/plugins/debugger/cdb/breakpoint.cpp
@@ -206,7 +206,7 @@ bool BreakPoint::add(CIDebugControl* debugControl,
unsigned long *id,
quint64 *address) const
{
- IDebugBreakpoint2* ibp = 0;
+ CIDebugBreakpoint* ibp = 0;
if (address)
*address = 0;
if (id)
@@ -473,8 +473,8 @@ bool BreakPoint::getBreakPoints(CIDebugControl* debugControl, QList<BreakPoint>
if (!getBreakPointCount(debugControl, &count, errorMessage))
return false;
// retrieve one by one and parse
- for (ULONG b= 0; b < count; b++) {
- IDebugBreakpoint2 *ibp = 0;
+ for (ULONG b = 0; b < count; b++) {
+ CIDebugBreakpoint *ibp = 0;
const HRESULT hr = debugControl->GetBreakpointByIndex2(b, &ibp);
if (FAILED(hr)) {
*errorMessage = QString::fromLatin1("Cannot retrieve breakpoint %1: %2").
@@ -495,7 +495,7 @@ static inline QString msgNoBreakPointWithId(unsigned long id, const QString &why
return QString::fromLatin1("Unable to find breakpoint with id %1: %2").arg(id).arg(why);
}
-IDebugBreakpoint2 *BreakPoint::breakPointById(CIDebugControl *ctl, unsigned long id, QString *errorMessage)
+CIDebugBreakpoint *BreakPoint::breakPointById(CIDebugControl *ctl, unsigned long id, QString *errorMessage)
{
CIDebugBreakpoint *ibp = 0;
const HRESULT hr = ctl->GetBreakpointById2(id, &ibp);
diff --git a/src/plugins/debugger/cdb/breakpoint.h b/src/plugins/debugger/cdb/breakpoint.h
index 515243ccc9..38b31d3411 100644
--- a/src/plugins/debugger/cdb/breakpoint.h
+++ b/src/plugins/debugger/cdb/breakpoint.h
@@ -62,7 +62,7 @@ struct BreakPoint
// Apply parameters (with the exception of type, which is
// passed as a parameter to IDebugControl within add().
- bool apply(IDebugBreakpoint2 *ibp, QString *errorMessage) const;
+ bool apply(CIDebugBreakpoint *ibp, QString *errorMessage) const;
// Convenience to add to a IDebugControl4.
bool add(CIDebugControl* debugControl,
QString *errorMessage,
@@ -70,13 +70,13 @@ struct BreakPoint
quint64 *address = 0) const;
// Retrieve/parse breakpoints from the interfaces
- bool retrieve(IDebugBreakpoint2 *ibp, QString *errorMessage);
+ bool retrieve(CIDebugBreakpoint *ibp, QString *errorMessage);
bool parseExpression(const QString &expr);
// Retrieve all breakpoints from the engine
static bool getBreakPointCount(CIDebugControl* debugControl, ULONG *count, QString *errorMessage = 0);
static bool getBreakPoints(CIDebugControl* debugControl, QList<BreakPoint> *bps, QString *errorMessage);
// Control helpers
- static IDebugBreakpoint2 *breakPointById(CIDebugControl *ctl, unsigned long id, QString *errorMessage);
+ static CIDebugBreakpoint *breakPointById(CIDebugControl *ctl, unsigned long id, QString *errorMessage);
static bool removeBreakPointById(CIDebugControl *ctl, unsigned long id, QString *errorMessage);
static bool setBreakPointEnabledById(CIDebugControl *ctl, unsigned long id, bool enabled, QString *errorMessage);
static bool setBreakPointThreadById(CIDebugControl *ctl, unsigned long id, int threadId, QString *errorMessage);
diff --git a/src/plugins/debugger/cdb/cdb.pri b/src/plugins/debugger/cdb/cdb.pri
index 348ce14e6e..d0e6a84e3d 100644
--- a/src/plugins/debugger/cdb/cdb.pri
+++ b/src/plugins/debugger/cdb/cdb.pri
@@ -41,39 +41,59 @@ FORMS += $$PWD/cdboptionspagewidget.ui
# Compile test on non-Windows platforms
isEmpty(CDB_PATH) {
false {
+
+HEADERS += \
+ $$PWD/cdbcom.h \
+ $$PWD/coreengine.h \
+ $$PWD/debugoutputbase.h \
+ $$PWD/debugeventcallbackbase.h \
+ $$PWD/symbolgroupcontext.h \
+ $$PWD/stacktracecontext.h \
+ $$PWD/breakpoint.h
+
HEADERS += \
-# $$PWD/cdbdebugengine.h \
-# $$PWD/cdbdebugengine_p.h \
-# $$PWD/cdbdebugeventcallback.h \
-# $$PWD/cdbdebugoutput.h \
-# $$PWD/cdbsymbolgroupcontext.h \
-# $$PWD/cdbsymbolgroupcontext_tpl.h \
-# $$PWD/cdbstacktracecontext.h \
-# $$PWD/cdbbreakpoint.h \
-# $$PWD/cdbmodules.h \
-# $$PWD/cdbassembler.h \
-# $$PWD/cdboptions.h \
-# $$PWD/cdboptionspage.h \
-# $$PWD/cdbdumperhelper.h \
-# $$PWD/cdbsymbolpathlisteditor.h \
-# $$PWD/cdbexceptionutils.h
+ $$PWD/cdbdebugengine.h \
+ $$PWD/cdbdebugengine_p.h \
+ $$PWD/cdbdebugeventcallback.h \
+ $$PWD/cdbdebugoutput.h \
+ $$PWD/cdbsymbolgroupcontext.h \
+ $$PWD/cdbsymbolgroupcontext_tpl.h \
+ $$PWD/cdbstacktracecontext.h \
+ $$PWD/cdbbreakpoint.h \
+ $$PWD/cdbmodules.h \
+ $$PWD/cdbassembler.h \
+ $$PWD/cdboptions.h \
+ $$PWD/cdboptionspage.h \
+ $$PWD/cdbdumperhelper.h \
+ $$PWD/cdbsymbolpathlisteditor.h \
+ $$PWD/cdbexceptionutils.h
+
+SOURCES += \
+# $$PWD/coreengine.cpp \
+# $$PWD/debugoutputbase.cpp \
+# $$PWD/debugeventcallbackbase.cpp \
+# $$PWD/symbolgroupcontext.cpp \
+# $$PWD/stacktracecontext.cpp \
+# $$PWD/breakpoint.cpp
SOURCES += \
# $$PWD/cdbdebugengine.cpp \
# $$PWD/cdbdebugeventcallback.cpp \
$$PWD/cdbdebugoutput.cpp \
# $$PWD/cdbsymbolgroupcontext.cpp \
-# $$PWD/cdbstacktracecontext.cpp \
-# $$PWD/cdbbreakpoint.cpp \
+ $$PWD/cdbstacktracecontext.cpp \
+ $$PWD/cdbbreakpoint.cpp \
# $$PWD/cdbmodules.cpp \
-# $$PWD/cdbassembler.cpp \
-# $$PWD/cdboptions.cpp \
-# $$PWD/cdboptionspage.cpp \
+ $$PWD/cdbassembler.cpp \
+ $$PWD/cdboptions.cpp \
+ $$PWD/cdboptionspage.cpp \
# $$PWD/cdbdumperhelper.cpp \
-# $$PWD/cdbsymbolpathlisteditor.cpp \
+ $$PWD/cdbsymbolpathlisteditor.cpp \
# $$PWD/cdbexceptionutils.cpp
FORMS += $$PWD/cdboptionspagewidget.ui
+INCLUDEPATH*=$$PWD
+DEPENDPATH*=$$PWD
}
}
diff --git a/src/plugins/debugger/cdb/cdbcomstub.h b/src/plugins/debugger/cdb/cdbcomstub.h
index 9ef7d56223..049f16d919 100644
--- a/src/plugins/debugger/cdb/cdbcomstub.h
+++ b/src/plugins/debugger/cdb/cdbcomstub.h
@@ -32,6 +32,9 @@
// Stubs to make it partially compile for test purposes on non-Windows.
+// FIXME: Make everything more Windows-like instead of choosing arbitrary
+// values to make it compile.
+
typedef unsigned long ULONG;
typedef unsigned long long ULONG64;
typedef void *PVOID;
@@ -40,6 +43,9 @@ typedef void *HANDLE;
typedef int HRESULT;
typedef int DEBUG_VALUE;
typedef int PDEBUG_BREAKPOINT2;
+const int MAX_PATH = 1024;
+
+inline bool FAILED(HRESULT) { return false; }
enum
{
@@ -58,7 +64,7 @@ enum
#define THIS_
#define REFIID void *
#define THIS_
-#define STDMETHOD(x) void x
+#define STDMETHOD(x) HRESULT x
#define STDMETHOD_(x, y) x y
struct IUnknown
@@ -72,36 +78,56 @@ struct IDebugOutputCallbacksWide : IUnknown
{
};
-struct CIDebugClient
+struct CIDebugClient : IUnknown
+{
+};
+
+struct CIDebugControl : IUnknown
+{
+};
+
+struct CIDebugSystemObjects : IUnknown
+{
+};
+
+struct CIDebugSymbols : IUnknown
{
};
-struct CIDebugControl
+struct CIDebugRegisters : IUnknown
{
+ HRESULT GetNumberRegisters(ULONG *) const { return 0; }
+ HRESULT GetDescription(ULONG, char *, int, int, int) const { return 0; }
+ HRESULT GetValues(ULONG, int, int, DEBUG_VALUE *) const { return 0; }
};
-struct CIDebugSystemObjects
+struct CIDebugDataSpaces : IUnknown
{
};
-struct CIDebugSymbols
+struct CIDebugSymbolGroup : IUnknown
{
};
-struct CIDebugRegisters
+struct CIDebugBreakpoint : IUnknown
{
};
-struct CIDebugDataSpaces
+enum DebugSymbolFlags
{
+ DEBUG_SYMBOL_IS_LOCAL = 1,
+ DEBUG_SYMBOL_IS_ARGUMENT = 2,
+ DEBUG_SYMBOL_READ_ONLY = 4
};
-struct CIDebugSymbolGroup
+struct DEBUG_SYMBOL_PARAMETERS
{
+ DebugSymbolFlags Flags;
+ unsigned long ParentSymbol;
};
-struct CIDebugBreakpoint
+struct DEBUG_STACK_FRAME
{
};
-#endif // Q_OS_WINDOWS
+#endif // Q_OS_WIN
diff --git a/src/plugins/debugger/cdb/stacktracecontext.cpp b/src/plugins/debugger/cdb/stacktracecontext.cpp
index 8a6b753ecc..7e159c2765 100644
--- a/src/plugins/debugger/cdb/stacktracecontext.cpp
+++ b/src/plugins/debugger/cdb/stacktracecontext.cpp
@@ -41,7 +41,7 @@ enum { debug = 0 };
namespace CdbCore {
StackFrame::StackFrame() :
- line(0),address(0)
+ line(0), address(0)
{
}