Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
65212f11
Commit
65212f11
authored
16 years ago
by
hjk
Browse files
Options
Downloads
Patches
Plain Diff
Fixes: debugger: make shutdown a bit more robust
parent
24479744
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/debugger/debuggermanager.cpp
+96
-42
96 additions, 42 deletions
src/plugins/debugger/debuggermanager.cpp
src/plugins/debugger/debuggermanager.h
+2
-0
2 additions, 0 deletions
src/plugins/debugger/debuggermanager.h
with
98 additions
and
42 deletions
src/plugins/debugger/debuggermanager.cpp
+
96
−
42
View file @
65212f11
...
...
@@ -33,7 +33,6 @@
#include
"debuggermanager.h"
#include
"assert.h"
#include
"debuggerconstants.h"
#include
"idebuggerengine.h"
...
...
@@ -58,6 +57,8 @@
#include
"startexternaldialog.h"
#include
"attachexternaldialog.h"
#include
<utils/qtcassert.h>
#include
<QtCore/QDebug>
#include
<QtCore/QDir>
#include
<QtCore/QFileInfo>
...
...
@@ -149,6 +150,7 @@ void DebuggerManager::init()
{
m_status
=
-
1
;
m_busy
=
false
;
m_shutdown
=
false
;
m_attachedPID
=
0
;
m_startMode
=
startInternal
;
...
...
@@ -588,7 +590,18 @@ void DebuggerManager::showApplicationOutput(const QString &str)
void
DebuggerManager
::
shutdown
()
{
//qDebug() << "DEBUGGER_MANAGER SHUTDOWN START";
engine
()
->
shutdown
();
m_shutdown
=
true
;
if
(
m_engine
)
m_engine
->
shutdown
();
m_engine
=
0
;
delete
scriptEngine
;
scriptEngine
=
0
;
delete
gdbEngine
;
gdbEngine
=
0
;
delete
winEngine
;
winEngine
=
0
;
// Delete these manually before deleting the manager
// (who will delete the models for most views)
delete
m_breakWindow
;
...
...
@@ -642,41 +655,49 @@ void DebuggerManager::toggleBreakpoint()
void
DebuggerManager
::
toggleBreakpoint
(
const
QString
&
fileName
,
int
lineNumber
)
{
QTC_ASSERT
(
m_engine
,
return
);
QTC_ASSERT
(
m_breakHandler
,
return
);
int
index
=
m_breakHandler
->
indexOf
(
fileName
,
lineNumber
);
if
(
index
==
-
1
)
breakHandler
()
->
setBreakpoint
(
fileName
,
lineNumber
);
m_
breakHandler
->
setBreakpoint
(
fileName
,
lineNumber
);
else
breakHandler
()
->
removeBreakpoint
(
index
);
engine
()
->
attemptBreakpointSynchronization
();
m_
breakHandler
->
removeBreakpoint
(
index
);
m_
engine
->
attemptBreakpointSynchronization
();
}
void
DebuggerManager
::
setToolTipExpression
(
const
QPoint
&
pos
,
const
QString
&
exp
)
{
engine
()
->
setToolTipExpression
(
pos
,
exp
);
QTC_ASSERT
(
m_engine
,
return
);
m_engine
->
setToolTipExpression
(
pos
,
exp
);
}
void
DebuggerManager
::
updateWatchModel
()
{
engine
()
->
updateWatchModel
();
QTC_ASSERT
(
m_engine
,
return
);
m_engine
->
updateWatchModel
();
}
void
DebuggerManager
::
expandChildren
(
const
QModelIndex
&
idx
)
{
watchHandler
()
->
expandChildren
(
idx
);
QTC_ASSERT
(
m_watchHandler
,
return
);
m_watchHandler
->
expandChildren
(
idx
);
}
void
DebuggerManager
::
collapseChildren
(
const
QModelIndex
&
idx
)
{
watchHandler
()
->
collapseChildren
(
idx
);
QTC_ASSERT
(
m_watchHandler
,
return
);
m_watchHandler
->
collapseChildren
(
idx
);
}
void
DebuggerManager
::
removeWatchExpression
(
const
QString
&
exp
)
{
watchHandler
()
->
removeWatchExpression
(
exp
);
QTC_ASSERT
(
m_watchHandler
,
return
);
m_watchHandler
->
removeWatchExpression
(
exp
);
}
QVariant
DebuggerManager
::
sessionValue
(
const
QString
&
name
)
{
// this is answered by the plugin
QVariant
value
;
emit
sessionValueRequested
(
name
,
&
value
);
return
value
;
...
...
@@ -684,16 +705,19 @@ QVariant DebuggerManager::sessionValue(const QString &name)
void
DebuggerManager
::
querySessionValue
(
const
QString
&
name
,
QVariant
*
value
)
{
// this is answered by the plugin
emit
sessionValueRequested
(
name
,
value
);
}
void
DebuggerManager
::
setSessionValue
(
const
QString
&
name
,
const
QVariant
&
value
)
{
// this is answered by the plugin
emit
setSessionValueRequested
(
name
,
value
);
}
QVariant
DebuggerManager
::
configValue
(
const
QString
&
name
)
{
// this is answered by the plugin
QVariant
value
;
emit
configValueRequested
(
name
,
&
value
);
return
value
;
...
...
@@ -701,11 +725,13 @@ QVariant DebuggerManager::configValue(const QString &name)
void
DebuggerManager
::
queryConfigValue
(
const
QString
&
name
,
QVariant
*
value
)
{
// this is answered by the plugin
emit
configValueRequested
(
name
,
value
);
}
void
DebuggerManager
::
setConfigValue
(
const
QString
&
name
,
const
QVariant
&
value
)
{
// this is answered by the plugin
emit
setConfigValueRequested
(
name
,
value
);
}
...
...
@@ -788,7 +814,7 @@ bool DebuggerManager::startNewDebugger(StartMode mode)
else
setDebuggerType
(
GdbDebugger
);
if
(
!
engine
()
->
startDebugger
())
if
(
!
m_
engine
->
startDebugger
())
return
false
;
m_busy
=
false
;
...
...
@@ -809,7 +835,10 @@ void DebuggerManager::cleanupViews()
void
DebuggerManager
::
exitDebugger
()
{
engine
()
->
exitDebugger
();
if
(
m_shutdown
)
return
;
QTC_ASSERT
(
m_engine
,
return
);
m_engine
->
exitDebugger
();
cleanupViews
();
setStatus
(
DebuggerProcessNotReady
);
setBusyCursor
(
false
);
...
...
@@ -818,62 +847,73 @@ void DebuggerManager::exitDebugger()
void
DebuggerManager
::
assignValueInDebugger
(
const
QString
&
expr
,
const
QString
&
value
)
{
engine
()
->
assignValueInDebugger
(
expr
,
value
);
QTC_ASSERT
(
m_engine
,
return
);
m_engine
->
assignValueInDebugger
(
expr
,
value
);
}
void
DebuggerManager
::
activateFrame
(
int
index
)
{
engine
()
->
activateFrame
(
index
);
QTC_ASSERT
(
m_engine
,
return
);
m_engine
->
activateFrame
(
index
);
}
void
DebuggerManager
::
selectThread
(
int
index
)
{
engine
()
->
selectThread
(
index
);
QTC_ASSERT
(
m_engine
,
return
);
m_engine
->
selectThread
(
index
);
}
void
DebuggerManager
::
loadAllSymbols
()
{
engine
()
->
loadAllSymbols
();
QTC_ASSERT
(
m_engine
,
return
);
m_engine
->
loadAllSymbols
();
}
void
DebuggerManager
::
loadSymbols
(
const
QString
&
module
)
{
engine
()
->
loadSymbols
(
module
);
QTC_ASSERT
(
m_engine
,
return
);
m_engine
->
loadSymbols
(
module
);
}
void
DebuggerManager
::
stepExec
()
{
QTC_ASSERT
(
m_engine
,
return
);
resetLocation
();
engine
()
->
stepExec
();
m_
engine
->
stepExec
();
}
void
DebuggerManager
::
stepOutExec
()
{
QTC_ASSERT
(
m_engine
,
return
);
resetLocation
();
engine
()
->
stepOutExec
();
m_
engine
->
stepOutExec
();
}
void
DebuggerManager
::
nextExec
()
{
QTC_ASSERT
(
m_engine
,
return
);
resetLocation
();
engine
()
->
nextExec
();
m_
engine
->
nextExec
();
}
void
DebuggerManager
::
stepIExec
()
{
QTC_ASSERT
(
m_engine
,
return
);
resetLocation
();
engine
()
->
stepIExec
();
m_
engine
->
stepIExec
();
}
void
DebuggerManager
::
nextIExec
()
{
QTC_ASSERT
(
m_engine
,
return
);
resetLocation
();
engine
()
->
nextIExec
();
m_
engine
->
nextIExec
();
}
void
DebuggerManager
::
executeDebuggerCommand
(
const
QString
&
command
)
{
engine
()
->
executeDebuggerCommand
(
command
);
QTC_ASSERT
(
m_engine
,
return
);
m_engine
->
executeDebuggerCommand
(
command
);
}
void
DebuggerManager
::
sessionLoaded
()
...
...
@@ -891,16 +931,18 @@ void DebuggerManager::aboutToSaveSession()
void
DebuggerManager
::
loadSessionData
()
{
QTC_ASSERT
(
m_engine
,
return
);
m_breakHandler
->
loadSessionData
();
m_watchHandler
->
loadSessionData
();
engine
()
->
loadSessionData
();
m_
engine
->
loadSessionData
();
}
void
DebuggerManager
::
saveSessionData
()
{
QTC_ASSERT
(
m_engine
,
return
);
m_breakHandler
->
saveSessionData
();
m_watchHandler
->
saveSessionData
();
engine
()
->
saveSessionData
();
m_
engine
->
saveSessionData
();
}
void
DebuggerManager
::
dumpLog
()
...
...
@@ -959,19 +1001,24 @@ void DebuggerManager::addToWatchWindow()
void
DebuggerManager
::
watchExpression
(
const
QString
&
expression
)
{
watchHandler
()
->
watchExpression
(
expression
);
QTC_ASSERT
(
m_watchHandler
,
return
);
m_watchHandler
->
watchExpression
(
expression
);
}
void
DebuggerManager
::
setBreakpoint
(
const
QString
&
fileName
,
int
lineNumber
)
{
breakHandler
()
->
setBreakpoint
(
fileName
,
lineNumber
);
engine
()
->
attemptBreakpointSynchronization
();
QTC_ASSERT
(
m_breakHandler
,
return
);
QTC_ASSERT
(
m_engine
,
return
);
m_breakHandler
->
setBreakpoint
(
fileName
,
lineNumber
);
m_engine
->
attemptBreakpointSynchronization
();
}
void
DebuggerManager
::
breakByFunction
(
const
QString
&
functionName
)
{
breakHandler
()
->
breakByFunction
(
functionName
);
engine
()
->
attemptBreakpointSynchronization
();
QTC_ASSERT
(
m_breakHandler
,
return
);
QTC_ASSERT
(
m_engine
,
return
);
m_breakHandler
->
breakByFunction
(
functionName
);
m_engine
->
attemptBreakpointSynchronization
();
}
void
DebuggerManager
::
breakByFunction
()
...
...
@@ -1081,14 +1128,16 @@ bool DebuggerManager::useCustomDumpers() const
void
DebuggerManager
::
setUseCustomDumpers
(
bool
on
)
{
QTC_ASSERT
(
m_engine
,
return
);
m_settings
.
m_useCustomDumpers
=
on
;
engine
()
->
setUseCustomDumpers
(
on
);
m_
engine
->
setUseCustomDumpers
(
on
);
}
void
DebuggerManager
::
setDebugDumpers
(
bool
on
)
{
QTC_ASSERT
(
m_engine
,
return
);
m_settings
.
m_debugDumpers
=
on
;
engine
()
->
setDebugDumpers
(
on
);
m_
engine
->
setDebugDumpers
(
on
);
}
void
DebuggerManager
::
setSkipKnownFrames
(
bool
on
)
...
...
@@ -1104,29 +1153,31 @@ void DebuggerManager::queryCurrentTextEditor(QString *fileName, int *lineNumber,
void
DebuggerManager
::
continueExec
()
{
engine
()
->
continueInferior
();
m_
engine
->
continueInferior
();
}
void
DebuggerManager
::
interruptDebuggingRequest
()
{
QTC_ASSERT
(
m_engine
,
return
);
//qDebug() << "INTERRUPTING AT" << status();
bool
interruptIsExit
=
(
status
()
!=
DebuggerInferiorRunning
);
if
(
interruptIsExit
)
exitDebugger
();
else
{
setStatus
(
DebuggerInferiorStopRequested
);
engine
()
->
interruptInferior
();
m_
engine
->
interruptInferior
();
}
}
void
DebuggerManager
::
runToLineExec
()
{
QTC_ASSERT
(
m_engine
,
return
);
QString
fileName
;
int
lineNumber
=
-
1
;
emit
currentTextEditorRequested
(
&
fileName
,
&
lineNumber
,
0
);
if
(
!
fileName
.
isEmpty
())
engine
()
->
runToLineExec
(
fileName
,
lineNumber
);
m_
engine
->
runToLineExec
(
fileName
,
lineNumber
);
}
void
DebuggerManager
::
runToFunctionExec
()
...
...
@@ -1158,7 +1209,7 @@ void DebuggerManager::runToFunctionExec()
}
//qDebug() << "RUN TO FUNCTION " << functionName;
if
(
!
functionName
.
isEmpty
())
engine
()
->
runToFunctionExec
(
functionName
);
m_
engine
->
runToFunctionExec
(
functionName
);
}
void
DebuggerManager
::
jumpToLineExec
()
...
...
@@ -1167,20 +1218,20 @@ void DebuggerManager::jumpToLineExec()
int
lineNumber
=
-
1
;
emit
currentTextEditorRequested
(
&
fileName
,
&
lineNumber
,
0
);
if
(
!
fileName
.
isEmpty
())
engine
()
->
jumpToLineExec
(
fileName
,
lineNumber
);
m_
engine
->
jumpToLineExec
(
fileName
,
lineNumber
);
}
void
DebuggerManager
::
resetLocation
()
{
//
m_watchHandler->removeMouseMoveCatcher(editor->widget());
//
connected to the plugin
emit
resetLocationRequested
();
}
void
DebuggerManager
::
gotoLocation
(
const
QString
&
fileName
,
int
line
,
bool
setMarker
)
{
// connected to the plugin
emit
gotoLocationRequested
(
fileName
,
line
,
setMarker
);
//m_watchHandler->installMouseMoveCatcher(editor->widget());
}
...
...
@@ -1192,9 +1243,10 @@ void DebuggerManager::gotoLocation(const QString &fileName, int line,
void
DebuggerManager
::
reloadDisassembler
()
{
QTC_ASSERT
(
m_engine
,
return
);
if
(
!
m_disassemblerDock
||
!
m_disassemblerDock
->
isVisible
())
return
;
engine
()
->
reloadDisassembler
();
m_
engine
->
reloadDisassembler
();
}
void
DebuggerManager
::
disassemblerDockToggled
(
bool
on
)
...
...
@@ -1214,7 +1266,7 @@ void DebuggerManager::reloadModules()
{
if
(
!
m_modulesDock
||
!
m_modulesDock
->
isVisible
())
return
;
engine
()
->
reloadModules
();
m_
engine
->
reloadModules
();
}
void
DebuggerManager
::
modulesDockToggled
(
bool
on
)
...
...
@@ -1232,11 +1284,13 @@ void DebuggerManager::modulesDockToggled(bool on)
void
DebuggerManager
::
showDebuggerOutput
(
const
QString
&
prefix
,
const
QString
&
msg
)
{
QTC_ASSERT
(
m_outputWindow
,
return
);
m_outputWindow
->
showOutput
(
prefix
,
msg
);
}
void
DebuggerManager
::
showDebuggerInput
(
const
QString
&
prefix
,
const
QString
&
msg
)
{
QTC_ASSERT
(
m_outputWindow
,
return
);
m_outputWindow
->
showInput
(
prefix
,
msg
);
}
...
...
@@ -1257,7 +1311,7 @@ void DebuggerManager::reloadRegisters()
{
if
(
!
m_registerDock
||
!
m_registerDock
->
isVisible
())
return
;
engine
()
->
reloadRegisters
();
m_
engine
->
reloadRegisters
();
}
...
...
This diff is collapsed.
Click to expand it.
src/plugins/debugger/debuggermanager.h
+
2
−
0
View file @
65212f11
...
...
@@ -466,6 +466,8 @@ private:
IDebuggerEngine
*
engine
();
IDebuggerEngine
*
m_engine
;
DebuggerSettings
m_settings
;
// set during application shutdown
bool
m_shutdown
;
};
}
// namespace Internal
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment