Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
bb146f4d
Commit
bb146f4d
authored
Feb 09, 2009
by
hjk
Browse files
Fixes: cdbdebugger: some cosmetics
parent
95d8b844
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/
msvc
debugengine.cpp
→
src/plugins/debugger/
cdb
debugengine.cpp
View file @
bb146f4d
#include
"
msvc
debugengine.h"
#include
"
cdb
debugengine.h"
#include
"assert.h"
#include
"debuggermanager.h"
...
...
@@ -16,8 +16,8 @@ using namespace Debugger;
using
namespace
Debugger
::
Internal
;
MSVC
DebugEngine
::
MSVC
DebugEngine
(
DebuggerManager
*
parent
)
:
IDebuggerEngine
(
parent
),
Cdb
DebugEngine
::
Cdb
DebugEngine
(
DebuggerManager
*
parent
)
:
IDebuggerEngine
(
parent
),
m_hDebuggeeProcess
(
0
),
m_hDebuggeeThread
(
0
),
//m_hDebuggeeImage(0),
...
...
@@ -50,7 +50,7 @@ MSVCDebugEngine::MSVCDebugEngine(DebuggerManager *parent)
}
}
MSVC
DebugEngine
::~
MSVC
DebugEngine
()
Cdb
DebugEngine
::~
Cdb
DebugEngine
()
{
if
(
m_pDebugClient
)
m_pDebugClient
->
Release
();
...
...
@@ -64,13 +64,13 @@ MSVCDebugEngine::~MSVCDebugEngine()
m_pDebugRegisters
->
Release
();
}
void
MSVC
DebugEngine
::
startWatchTimer
()
void
Cdb
DebugEngine
::
startWatchTimer
()
{
if
(
m_watchTimer
==
-
1
)
m_watchTimer
=
startTimer
(
0
);
}
void
MSVC
DebugEngine
::
killWatchTimer
()
void
Cdb
DebugEngine
::
killWatchTimer
()
{
if
(
m_watchTimer
!=
-
1
)
{
killTimer
(
m_watchTimer
);
...
...
@@ -78,16 +78,16 @@ void MSVCDebugEngine::killWatchTimer()
}
}
void
MSVC
DebugEngine
::
shutdown
()
void
Cdb
DebugEngine
::
shutdown
()
{
exitDebugger
();
}
void
MSVC
DebugEngine
::
setToolTipExpression
(
const
QPoint
&
pos
,
const
QString
&
exp
)
void
Cdb
DebugEngine
::
setToolTipExpression
(
const
QPoint
&
pos
,
const
QString
&
exp
)
{
}
bool
MSVC
DebugEngine
::
startDebugger
()
bool
Cdb
DebugEngine
::
startDebugger
()
{
q
->
showStatusMessage
(
"Starting Debugger"
,
-
1
);
...
...
@@ -110,7 +110,7 @@ bool MSVCDebugEngine::startDebugger()
//m_pDebugSymbols->AddSymbolOptions(SYMOPT_CASE_INSENSITIVE | SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS | SYMOPT_DEBUG | SYMOPT_LOAD_LINES | SYMOPT_OMAP_FIND_NEAREST | SYMOPT_AUTO_PUBLICS | SYMOPT_NO_IMAGE_SEARCH);
if
(
q
->
startMode
()
==
q
->
attachExternal
)
{
qWarning
(
"
MSVC
DebugEngine: attach to process not yet implemented!"
);
qWarning
(
"
Cdb
DebugEngine: attach to process not yet implemented!"
);
}
else
{
hr
=
m_pDebugClient
->
CreateProcess2Wide
(
NULL
,
const_cast
<
PWSTR
>
(
filename
.
utf16
()),
...
...
@@ -130,19 +130,19 @@ bool MSVCDebugEngine::startDebugger()
return
true
;
}
void
MSVC
DebugEngine
::
exitDebugger
()
void
Cdb
DebugEngine
::
exitDebugger
()
{
m_pDebugClient
->
TerminateCurrentProcess
();
killWatchTimer
();
}
void
MSVC
DebugEngine
::
updateWatchModel
()
void
Cdb
DebugEngine
::
updateWatchModel
()
{
}
void
MSVC
DebugEngine
::
stepExec
()
void
Cdb
DebugEngine
::
stepExec
()
{
//qDebug() << "
MSVC
DebugEngine::stepExec()";
//qDebug() << "
Cdb
DebugEngine::stepExec()";
//m_pDebugControl->Execute(DEBUG_OUTCTL_THIS_CLIENT, "p", 0);
HRESULT
hr
;
hr
=
m_pDebugControl
->
SetExecutionStatus
(
DEBUG_STATUS_STEP_INTO
);
...
...
@@ -150,9 +150,9 @@ void MSVCDebugEngine::stepExec()
startWatchTimer
();
}
void
MSVC
DebugEngine
::
stepOutExec
()
void
Cdb
DebugEngine
::
stepOutExec
()
{
//qDebug() << "
MSVC
DebugEngine::stepOutExec()";
//qDebug() << "
Cdb
DebugEngine::stepOutExec()";
StackHandler
*
sh
=
qq
->
stackHandler
();
const
int
idx
=
sh
->
currentIndex
()
+
1
;
QList
<
StackFrame
>
stackframes
=
sh
->
frames
();
...
...
@@ -191,26 +191,26 @@ void MSVCDebugEngine::stepOutExec()
continueInferior
();
}
void
MSVC
DebugEngine
::
nextExec
()
void
Cdb
DebugEngine
::
nextExec
()
{
//qDebug() << "
MSVC
DebugEngine::nextExec()";
//qDebug() << "
Cdb
DebugEngine::nextExec()";
HRESULT
hr
;
hr
=
m_pDebugControl
->
SetExecutionStatus
(
DEBUG_STATUS_STEP_OVER
);
startWatchTimer
();
}
void
MSVC
DebugEngine
::
stepIExec
()
void
Cdb
DebugEngine
::
stepIExec
()
{
qWarning
(
"
MSVC
DebugEngine::stepIExec() not implemented"
);
qWarning
(
"
Cdb
DebugEngine::stepIExec() not implemented"
);
}
void
MSVC
DebugEngine
::
nextIExec
()
void
Cdb
DebugEngine
::
nextIExec
()
{
m_pDebugControl
->
Execute
(
DEBUG_OUTCTL_THIS_CLIENT
,
"p"
,
0
);
startWatchTimer
();
}
void
MSVC
DebugEngine
::
continueInferior
()
void
Cdb
DebugEngine
::
continueInferior
()
{
killWatchTimer
();
q
->
resetLocation
();
...
...
@@ -224,12 +224,12 @@ void MSVCDebugEngine::continueInferior()
qq
->
notifyInferiorRunning
();
}
void
MSVC
DebugEngine
::
runInferior
()
void
Cdb
DebugEngine
::
runInferior
()
{
continueInferior
();
}
void
MSVC
DebugEngine
::
interruptInferior
()
void
Cdb
DebugEngine
::
interruptInferior
()
{
//TODO: better use IDebugControl::SetInterrupt?
if
(
!
m_hDebuggeeProcess
)
...
...
@@ -241,27 +241,27 @@ void MSVCDebugEngine::interruptInferior()
qq
->
notifyInferiorStopped
();
}
void
MSVC
DebugEngine
::
runToLineExec
(
const
QString
&
fileName
,
int
lineNumber
)
void
Cdb
DebugEngine
::
runToLineExec
(
const
QString
&
fileName
,
int
lineNumber
)
{
}
void
MSVC
DebugEngine
::
runToFunctionExec
(
const
QString
&
functionName
)
void
Cdb
DebugEngine
::
runToFunctionExec
(
const
QString
&
functionName
)
{
}
void
MSVC
DebugEngine
::
jumpToLineExec
(
const
QString
&
fileName
,
int
lineNumber
)
void
Cdb
DebugEngine
::
jumpToLineExec
(
const
QString
&
fileName
,
int
lineNumber
)
{
}
void
MSVC
DebugEngine
::
assignValueInDebugger
(
const
QString
&
expr
,
const
QString
&
value
)
void
Cdb
DebugEngine
::
assignValueInDebugger
(
const
QString
&
expr
,
const
QString
&
value
)
{
}
void
MSVC
DebugEngine
::
executeDebuggerCommand
(
const
QString
&
/*command*/
)
void
Cdb
DebugEngine
::
executeDebuggerCommand
(
const
QString
&
/*command*/
)
{
}
void
MSVC
DebugEngine
::
activateFrame
(
int
frameIndex
)
void
Cdb
DebugEngine
::
activateFrame
(
int
frameIndex
)
{
if
(
q
->
status
()
!=
DebuggerInferiorStopped
)
return
;
...
...
@@ -287,7 +287,7 @@ void MSVCDebugEngine::activateFrame(int frameIndex)
qDebug
()
<<
"FULL NAME NOT USABLE: "
<<
frame
.
file
;
}
void
MSVC
DebugEngine
::
selectThread
(
int
index
)
void
Cdb
DebugEngine
::
selectThread
(
int
index
)
{
//reset location arrow
q
->
resetLocation
();
...
...
@@ -298,7 +298,7 @@ void MSVCDebugEngine::selectThread(int index)
updateStackTrace
();
}
void
MSVC
DebugEngine
::
attemptBreakpointSynchronization
()
void
Cdb
DebugEngine
::
attemptBreakpointSynchronization
()
{
BreakHandler
*
handler
=
qq
->
breakHandler
();
//qDebug() << "attemptBreakpointSynchronization";
...
...
@@ -333,35 +333,35 @@ void MSVCDebugEngine::attemptBreakpointSynchronization()
}
}
void
MSVC
DebugEngine
::
loadSessionData
()
void
Cdb
DebugEngine
::
loadSessionData
()
{
}
void
MSVC
DebugEngine
::
saveSessionData
()
void
Cdb
DebugEngine
::
saveSessionData
()
{
}
void
MSVC
DebugEngine
::
reloadDisassembler
()
void
Cdb
DebugEngine
::
reloadDisassembler
()
{
}
void
MSVC
DebugEngine
::
reloadModules
()
void
Cdb
DebugEngine
::
reloadModules
()
{
}
void
MSVC
DebugEngine
::
loadSymbols
(
const
QString
&
moduleName
)
void
Cdb
DebugEngine
::
loadSymbols
(
const
QString
&
moduleName
)
{
}
void
MSVC
DebugEngine
::
loadAllSymbols
()
void
Cdb
DebugEngine
::
loadAllSymbols
()
{
}
void
MSVC
DebugEngine
::
reloadRegisters
()
void
Cdb
DebugEngine
::
reloadRegisters
()
{
}
void
MSVC
DebugEngine
::
timerEvent
(
QTimerEvent
*
te
)
void
Cdb
DebugEngine
::
timerEvent
(
QTimerEvent
*
te
)
{
if
(
te
->
timerId
()
!=
m_watchTimer
)
return
;
...
...
@@ -391,7 +391,7 @@ void MSVCDebugEngine::timerEvent(QTimerEvent* te)
}
}
void
MSVC
DebugEngine
::
handleDebugEvent
()
void
Cdb
DebugEngine
::
handleDebugEvent
()
{
if
(
m_bIgnoreNextDebugEvent
)
{
startWatchTimer
();
...
...
@@ -414,7 +414,7 @@ void MSVCDebugEngine::handleDebugEvent()
//}
}
void
MSVC
DebugEngine
::
updateThreadList
()
void
Cdb
DebugEngine
::
updateThreadList
()
{
ThreadsHandler
*
th
=
qq
->
threadsHandler
();
QList
<
ThreadData
>
threads
;
...
...
@@ -435,7 +435,7 @@ void MSVCDebugEngine::updateThreadList()
th
->
setThreads
(
threads
);
}
void
MSVC
DebugEngine
::
updateStackTrace
()
void
Cdb
DebugEngine
::
updateStackTrace
()
{
//qDebug() << "updateStackTrace()";
HRESULT
hr
;
...
...
@@ -503,17 +503,17 @@ void MSVCDebugEngine::updateStackTrace()
//m_pDebugControl->OutputStackTrace(DEBUG_OUTCTL_THIS_CLIENT, frames, numFramesFilled, DEBUG_STACK_SOURCE_LINE);
}
void
MSVC
DebugEngine
::
handleDebugOutput
(
const
char
*
szOutputString
)
void
Cdb
DebugEngine
::
handleDebugOutput
(
const
char
*
szOutputString
)
{
qq
->
showApplicationOutput
(
"app-dbgoutput"
,
QString
::
fromLocal8Bit
(
szOutputString
));
}
void
MSVC
DebugEngine
::
handleBreakpointEvent
(
PDEBUG_BREAKPOINT
pBP
)
void
Cdb
DebugEngine
::
handleBreakpointEvent
(
PDEBUG_BREAKPOINT
pBP
)
{
qDebug
()
<<
"
MSVC
DebugEngine::handleBreakpointEvent()"
;
qDebug
()
<<
"
Cdb
DebugEngine::handleBreakpointEvent()"
;
}
IDebuggerEngine
*
createWinEngine
(
DebuggerManager
*
parent
)
{
return
new
MSVC
DebugEngine
(
parent
);
return
new
Cdb
DebugEngine
(
parent
);
}
src/plugins/debugger/
msvc
debugengine.h
→
src/plugins/debugger/
cdb
debugengine.h
View file @
bb146f4d
#ifndef
__MSVCDEBUG
ENGINE_H
__
#define
__MSVCDEBUG
ENGINE_H
__
#ifndef
DEBUGGER_CDB
ENGINE_H
#define
DEBUGGER_CDB
ENGINE_H
#include
"idebuggerengine.h"
#include
"msvcdebugeventcallback.h"
#include
"msvcdebugoutput.h"
#include
"cdbdebugeventcallback.h"
#include
"cdbdebugoutput.h"
#include
<windows.h>
namespace
Debugger
{
...
...
@@ -12,12 +13,12 @@ namespace Internal {
class
DebuggerManager
;
class
IDebuggerManagerAccessForEngines
;
class
MSVC
DebugEngine
:
public
IDebuggerEngine
class
Cdb
DebugEngine
:
public
IDebuggerEngine
{
Q_OBJECT
public:
MSVC
DebugEngine
(
DebuggerManager
*
parent
);
~
MSVC
DebugEngine
();
Cdb
DebugEngine
(
DebuggerManager
*
parent
);
~
Cdb
DebugEngine
();
virtual
void
shutdown
();
virtual
void
setToolTipExpression
(
const
QPoint
&
pos
,
const
QString
&
exp
);
...
...
@@ -63,7 +64,7 @@ protected:
private:
void
startWatchTimer
();
void
killWatchTimer
();
bool
isDebuggeeRunning
()
{
return
m_watchTimer
!=
-
1
;
}
bool
isDebuggeeRunning
()
const
{
return
m_watchTimer
!=
-
1
;
}
void
handleDebugEvent
();
void
updateThreadList
();
void
updateStackTrace
();
...
...
@@ -82,17 +83,17 @@ private:
IDebugSystemObjects4
*
m_pDebugSystemObjects
;
IDebugSymbols3
*
m_pDebugSymbols
;
IDebugRegisters2
*
m_pDebugRegisters
;
MSVC
DebugEventCallback
m_debugEventCallBack
;
MSVC
DebugOutput
m_debugOutputCallBack
;
Cdb
DebugEventCallback
m_debugEventCallBack
;
Cdb
DebugOutput
m_debugOutputCallBack
;
DebuggerManager
*
q
;
IDebuggerManagerAccessForEngines
*
qq
;
friend
class
MSVC
DebugEventCallback
;
friend
class
MSVC
DebugOutput
;
friend
class
Cdb
DebugEventCallback
;
friend
class
Cdb
DebugOutput
;
};
}
// namespace Internal
}
// namespace Debugger
#endif
#endif
// DEBUGGER_CDBENGINE_H
src/plugins/debugger/
msvc
debugeventcallback.cpp
→
src/plugins/debugger/
cdb
debugeventcallback.cpp
View file @
bb146f4d
#include
"
msvc
debugeventcallback.h"
#include
"
msv
cdebugengine.h"
#include
"
cdb
debugeventcallback.h"
#include
"
cdb
cdebugengine.h"
#include
"debuggermanager.h"
#include
<QDebug>
#include
<
QtCore/
QDebug>
namespace
Debugger
{
namespace
Internal
{
STDMETHODIMP
MSVCDebugEventCallback
::
QueryInterface
(
STDMETHODIMP
MSVCDebugEventCallback
::
QueryInterface
(
THIS_
IN
REFIID
InterfaceId
,
OUT
PVOID
*
Interface
)
OUT
PVOID
*
Interface
)
{
*
Interface
=
NULL
;
...
...
@@ -29,30 +27,21 @@ MSVCDebugEventCallback::QueryInterface(
}
}
STDMETHODIMP_
(
ULONG
)
MSVCDebugEventCallback
::
AddRef
(
THIS
)
STDMETHODIMP_
(
ULONG
)
MSVCDebugEventCallback
::
AddRef
(
THIS
)
{
// This class is designed to be static so
// there's no true refcount.
return
1
;
}
STDMETHODIMP_
(
ULONG
)
MSVCDebugEventCallback
::
Release
(
THIS
)
STDMETHODIMP_
(
ULONG
)
MSVCDebugEventCallback
::
Release
(
THIS
)
{
// This class is designed to be static so
// there's no true refcount.
return
0
;
}
STDMETHODIMP
MSVCDebugEventCallback
::
GetInterestMask
(
THIS_
__out
PULONG
mask
)
STDMETHODIMP
MSVCDebugEventCallback
::
GetInterestMask
(
THIS_
__out
PULONG
mask
)
{
*
mask
=
DEBUG_EVENT_CREATE_PROCESS
|
DEBUG_EVENT_EXIT_PROCESS
//| DEBUG_EVENT_CREATE_THREAD | DEBUG_EVENT_EXIT_THREAD
...
...
@@ -62,10 +51,7 @@ STDMETHODIMP MSVCDebugEventCallback::GetInterestMask(
return
S_OK
;
}
STDMETHODIMP
MSVCDebugEventCallback
::
Breakpoint
(
THIS_
__in
PDEBUG_BREAKPOINT
Bp
)
STDMETHODIMP
MSVCDebugEventCallback
::
Breakpoint
(
THIS_
__in
PDEBUG_BREAKPOINT
Bp
)
{
qDebug
()
<<
"MSVCDebugEventCallback::Breakpoint"
;
m_pEngine
->
handleBreakpointEvent
(
Bp
);
...
...
src/plugins/debugger/
msvc
debugeventcallback.h
→
src/plugins/debugger/
cdb
debugeventcallback.h
View file @
bb146f4d
#pragma once
#ifndef DEBUGGER_CDBDEBUGEVENTCALLBACK_H
#define DEBUGGER_CDBDEBUGEVENTCALLBACK_H
#include
<windows.h>
#include
<dbgeng.h>
...
...
@@ -6,12 +7,12 @@
namespace
Debugger
{
namespace
Internal
{
class
MSVC
DebugEngine
;
class
Cdb
DebugEngine
;
class
MSVC
DebugEventCallback
:
public
IDebugEventCallbacks
class
Cdb
DebugEventCallback
:
public
IDebugEventCallbacks
{
public:
MSVC
DebugEventCallback
(
MSVC
DebugEngine
*
dbg
)
Cdb
DebugEventCallback
(
Cdb
DebugEngine
*
dbg
)
:
m_pEngine
(
dbg
)
{}
...
...
@@ -124,8 +125,10 @@ public:
);
private:
MSVC
DebugEngine
*
m_pEngine
;
Cdb
DebugEngine
*
m_pEngine
;
};
}
// namespace Internal
}
// namespace Debugger
#endif // DEBUGGER_CDBDEBUGEVENTCALLBACK_H
src/plugins/debugger/
msvc
debugoutput.cpp
→
src/plugins/debugger/
cdb
debugoutput.cpp
View file @
bb146f4d
#include
<windows.h>
#include
<dbgeng.h>
#include
"
msvc
debugoutput.h"
#include
"
msvc
debugengine.h"
#include
"
cdb
debugoutput.h"
#include
"
cdb
debugengine.h"
namespace
Debugger
{
namespace
Internal
{
STDMETHODIMP
MSVCDebugOutput
::
QueryInterface
(
STDMETHODIMP
MSVCDebugOutput
::
QueryInterface
(
THIS_
IN
REFIID
InterfaceId
,
OUT
PVOID
*
Interface
...
...
@@ -29,28 +28,21 @@ MSVCDebugOutput::QueryInterface(
}
}
STDMETHODIMP_
(
ULONG
)
MSVCDebugOutput
::
AddRef
(
THIS
)
STDMETHODIMP_
(
ULONG
)
MSVCDebugOutput
::
AddRef
(
THIS
)
{
// This class is designed to be static so
// there's no true refcount.
return
1
;
}
STDMETHODIMP_
(
ULONG
)
MSVCDebugOutput
::
Release
(
THIS
)
STDMETHODIMP_
(
ULONG
)
MSVCDebugOutput
::
Release
(
THIS
)
{
// This class is designed to be static so
// there's no true refcount.
return
0
;
}
STDMETHODIMP
MSVCDebugOutput
::
Output
(
STDMETHODIMP
MSVCDebugOutput
::
Output
(
THIS_
IN
ULONG
mask
,
IN
PCSTR
text
...
...
src/plugins/debugger/
msvc
debugoutput.h
→
src/plugins/debugger/
cdb
debugoutput.h
View file @
bb146f4d
#ifndef
__MSVCDEBUG
OUTPUT_H
__
#define
__MSVCDEBUG
OUTPUT_H
__
#ifndef
DEBUGGER_CDB
OUTPUT_H
#define
DEBUGGER_CDB
OUTPUT_H
namespace
Debugger
{
namespace
Internal
{
class
MSVC
DebugEngine
;
class
Cdb
DebugEngine
;
class
MSVC
DebugOutput
:
public
IDebugOutputCallbacks
class
Cdb
DebugOutput
:
public
IDebugOutputCallbacks
{
public:
MSVC
DebugOutput
(
MSVC
DebugEngine
*
engine
)
Cdb
DebugOutput
(
Cdb
DebugEngine
*
engine
)
:
m_pEngine
(
engine
)
{}
...
...
@@ -34,10 +34,10 @@ public:
);
private:
MSVC
DebugEngine
*
m_pEngine
;
Cdb
DebugEngine
*
m_pEngine
;
};
}
// namespace Internal
}
// namespace Debugger
#endif //
#ifndef __MSVCDEBUG
OUTPUT_H
__
#endif //
DEBUGGER_CDB
OUTPUT_H
src/plugins/debugger/debugger.pro
View file @
bb146f4d
...
...
@@ -84,13 +84,19 @@ HEADERS += $$PWD/modeltest.h
DEFINES
+=
USE_MODEL_TEST
=
1
}
false
{
HEADERS
+=
msvcdebugengine
.
h
\
msvcdebugeventcallback
.
h
\
msvcdebugoutput
.
h
SOURCES
+=
msvcdebugengine
.
cpp
\
msvcdebugeventcallback
.
cpp
\
msvcdebugoutput
.
cpp
LIBS
+=
dbgeng
.
lib
win32
{
HEADERS
+=
\
cdbdebugengine
.
h
\
cdbdebugeventcallback
.
h
\
cdbdebugoutput
.
h
SOURCES
+=
\
cdbdebugengine
.
cpp
\
cdbdebugeventcallback
.
cpp
\
cdbdebugoutput
.
cpp
LIBS
+=
dbgeng
.
lib
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment