Commit 8a26bc5a authored by hjk's avatar hjk
Browse files

debugger: make more of cdb compilable on non-Windows

parent effa8a38
......@@ -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);
......
......@@ -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);
......
......@@ -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
}
}
......@@ -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
......@@ -41,7 +41,7 @@ enum { debug = 0 };
namespace CdbCore {
StackFrame::StackFrame() :
line(0),address(0)
line(0), address(0)
{
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment