diff options
author | hjk <qtc-committer@nokia.com> | 2010-06-14 10:00:47 +0200 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2010-06-14 10:45:11 +0200 |
commit | 9c7371af6a3097219492ba21f0250bcd5a7c238c (patch) | |
tree | c67217e4145eda5a566a8015a950d9936eb07456 | |
parent | 97edcb7977ecea95613bf0c0e6030083549ca5f4 (diff) | |
download | qt-creator-9c7371af6a3097219492ba21f0250bcd5a7c238c.tar.gz |
debugger: enable compiling parts of cdb for testing purposes on non-Windows
-rw-r--r-- | src/plugins/debugger/cdb/cdb.pri | 41 | ||||
-rw-r--r-- | src/plugins/debugger/cdb/cdbcom.h | 8 | ||||
-rw-r--r-- | src/plugins/debugger/cdb/cdbcomstub.h | 107 | ||||
-rw-r--r-- | src/plugins/debugger/cdb/cdbdebugoutput.cpp | 4 |
4 files changed, 157 insertions, 3 deletions
diff --git a/src/plugins/debugger/cdb/cdb.pri b/src/plugins/debugger/cdb/cdb.pri index fa0b173331..348ce14e6e 100644 --- a/src/plugins/debugger/cdb/cdb.pri +++ b/src/plugins/debugger/cdb/cdb.pri @@ -36,3 +36,44 @@ SOURCES += \ FORMS += $$PWD/cdboptionspagewidget.ui } + + +# Compile test on non-Windows platforms +isEmpty(CDB_PATH) { +false { +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 + +SOURCES += \ +# $$PWD/cdbdebugengine.cpp \ +# $$PWD/cdbdebugeventcallback.cpp \ + $$PWD/cdbdebugoutput.cpp \ +# $$PWD/cdbsymbolgroupcontext.cpp \ +# $$PWD/cdbstacktracecontext.cpp \ +# $$PWD/cdbbreakpoint.cpp \ +# $$PWD/cdbmodules.cpp \ +# $$PWD/cdbassembler.cpp \ +# $$PWD/cdboptions.cpp \ +# $$PWD/cdboptionspage.cpp \ +# $$PWD/cdbdumperhelper.cpp \ +# $$PWD/cdbsymbolpathlisteditor.cpp \ +# $$PWD/cdbexceptionutils.cpp + +FORMS += $$PWD/cdboptionspagewidget.ui +} +} + diff --git a/src/plugins/debugger/cdb/cdbcom.h b/src/plugins/debugger/cdb/cdbcom.h index 924c567c79..5459d6a7de 100644 --- a/src/plugins/debugger/cdb/cdbcom.h +++ b/src/plugins/debugger/cdb/cdbcom.h @@ -30,6 +30,8 @@ #ifndef CDBCOM_H #define CDBCOM_H +#ifdef Q_OS_WINDOWS + #include <windows.h> #include <inc/dbgeng.h> @@ -44,4 +46,10 @@ typedef IDebugDataSpaces4 CIDebugDataSpaces; typedef IDebugSymbolGroup2 CIDebugSymbolGroup; typedef IDebugBreakpoint2 CIDebugBreakpoint; +#else + +#include "cdbcomstub.h" + +#endif // Q_OS_WINDOWS + #endif // CDBCOM_H diff --git a/src/plugins/debugger/cdb/cdbcomstub.h b/src/plugins/debugger/cdb/cdbcomstub.h new file mode 100644 index 0000000000..9ef7d56223 --- /dev/null +++ b/src/plugins/debugger/cdb/cdbcomstub.h @@ -0,0 +1,107 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef CDBCOMSTUB_H +#define CDBCOMSTUB_H + +// Stubs to make it partially compile for test purposes on non-Windows. + +typedef unsigned long ULONG; +typedef unsigned long long ULONG64; +typedef void *PVOID; +typedef unsigned short *PCWSTR; +typedef void *HANDLE; +typedef int HRESULT; +typedef int DEBUG_VALUE; +typedef int PDEBUG_BREAKPOINT2; + +enum +{ + DEBUG_OUTPUT_PROMPT_REGISTERS = 1, + DEBUG_OUTPUT_EXTENSION_WARNING = 2, + DEBUG_OUTPUT_WARNING = 4, + DEBUG_OUTPUT_ERROR = 8, + DEBUG_OUTPUT_DEBUGGEE = 16, + DEBUG_OUTPUT_DEBUGGEE_PROMPT = 32, + DEBUG_OUTPUT_PROMPT = 64, +}; + +#define IN +#define OUT +#define THIS +#define THIS_ +#define REFIID void * +#define THIS_ +#define STDMETHOD(x) void x +#define STDMETHOD_(x, y) x y + +struct IUnknown +{ + virtual ~IUnknown(); + virtual STDMETHOD_(ULONG, AddRef)(THIS) { return 1; } + virtual STDMETHOD_(ULONG, Release)(THIS) { return 1; } +}; + +struct IDebugOutputCallbacksWide : IUnknown +{ +}; + +struct CIDebugClient +{ +}; + +struct CIDebugControl +{ +}; + +struct CIDebugSystemObjects +{ +}; + +struct CIDebugSymbols +{ +}; + +struct CIDebugRegisters +{ +}; + +struct CIDebugDataSpaces +{ +}; + +struct CIDebugSymbolGroup +{ +}; + +struct CIDebugBreakpoint +{ +}; + +#endif // Q_OS_WINDOWS diff --git a/src/plugins/debugger/cdb/cdbdebugoutput.cpp b/src/plugins/debugger/cdb/cdbdebugoutput.cpp index 0b7dd4eb71..6d55d3326c 100644 --- a/src/plugins/debugger/cdb/cdbdebugoutput.cpp +++ b/src/plugins/debugger/cdb/cdbdebugoutput.cpp @@ -30,9 +30,7 @@ #include "cdbdebugoutput.h" #include "cdbdebugengine.h" #include "cdbdebugengine_p.h" - -#include <windows.h> -#include <inc/dbgeng.h> +#include "cdbcom.h" namespace Debugger { namespace Internal { |