Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
b2387fdd
Commit
b2387fdd
authored
Feb 13, 2009
by
hjk
Browse files
Fixes: debugger: load modules list early
Details: feels better
parent
5f33b124
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggerrunner.cpp
View file @
b2387fdd
...
...
@@ -107,11 +107,14 @@ DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager,
:
RunControl
(
runConfiguration
),
m_manager
(
manager
),
m_running
(
false
)
{
connect
(
m_manager
,
SIGNAL
(
debuggingFinished
()),
this
,
SLOT
(
debuggingFinished
()));
this
,
SLOT
(
debuggingFinished
()),
Qt
::
QueuedConnection
);
connect
(
m_manager
,
SIGNAL
(
applicationOutputAvailable
(
QString
)),
this
,
SLOT
(
slotAddToOutputWindowInline
(
QString
)));
this
,
SLOT
(
slotAddToOutputWindowInline
(
QString
)),
Qt
::
QueuedConnection
);
connect
(
m_manager
,
SIGNAL
(
inferiorPidChanged
(
qint64
)),
this
,
SLOT
(
bringApplicationToForeground
(
qint64
)));
this
,
SLOT
(
bringApplicationToForeground
(
qint64
)),
Qt
::
QueuedConnection
);
}
void
DebuggerRunControl
::
start
()
...
...
src/plugins/debugger/gdbengine.cpp
View file @
b2387fdd
...
...
@@ -250,23 +250,16 @@ GdbEngine::GdbEngine(DebuggerManager *parent)
{
q
=
parent
;
qq
=
parent
->
engineInterface
();
init
();
initializeVariables
();
initializeConnections
();
}
GdbEngine
::~
GdbEngine
()
{
}
void
GdbEngine
::
init
()
void
GdbEngine
::
init
ializeConnections
()
{
m_pendingRequests
=
0
;
m_waitingForBreakpointSynchronizationToContinue
=
false
;
m_gdbVersion
=
100
;
m_outputCodec
=
QTextCodec
::
codecForLocale
();
m_dataDumperState
=
DataDumperUninitialized
;
m_oldestAcceptableToken
=
-
1
;
// Gdb Process interaction
connect
(
&
m_gdbProc
,
SIGNAL
(
error
(
QProcess
::
ProcessError
)),
this
,
SLOT
(
gdbProcError
(
QProcess
::
ProcessError
)));
...
...
@@ -294,6 +287,22 @@ void GdbEngine::init()
Qt
::
QueuedConnection
);
}
void
GdbEngine
::
initializeVariables
()
{
m_dataDumperState
=
DataDumperUninitialized
;
m_gdbVersion
=
100
;
m_fullToShortName
.
clear
();
m_shortToFullName
.
clear
();
m_varToType
.
clear
();
m_modulesListOutdated
=
true
;
m_oldestAcceptableToken
=
-
1
;
m_outputCodec
=
QTextCodec
::
codecForLocale
();
m_pendingRequests
=
0
;
m_waitingForBreakpointSynchronizationToContinue
=
false
;
}
void
GdbEngine
::
gdbProcError
(
QProcess
::
ProcessError
error
)
{
QString
msg
;
...
...
@@ -1109,6 +1118,8 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
sendCommand
(
"set auto-solib-add off"
);
sendCommand
(
"set stop-on-solib-events 0"
);
}
// nicer to see a bit of the world we live in
reloadModules
();
// this will "continue" if done
m_waitingForBreakpointSynchronizationToContinue
=
true
;
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
attemptBreakpointSynchronization
()));
...
...
@@ -1118,7 +1129,6 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
// fall through
}
static
bool
modulesDirty
=
false
;
if
(
msg
.
contains
(
"Stopped due to shared library event"
)
||
reason
.
isEmpty
())
{
if
(
qq
->
wantsSelectedPluginBreakpoints
())
{
qDebug
()
<<
"SHARED LIBRARY EVENT "
<<
data
.
toString
();
...
...
@@ -1128,7 +1138,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
q
->
showStatusMessage
(
tr
(
"Loading %1..."
).
arg
(
QString
(
data
.
toString
())));
return
;
}
modules
Dirty
=
true
;
m_
modules
ListOutdated
=
true
;
// fall through
}
...
...
@@ -1183,11 +1193,11 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
}
if
(
isStoppedReason
(
reason
)
||
reason
.
isEmpty
())
{
if
(
modules
Dirty
)
{
if
(
m_
modules
ListOutdated
)
{
sendCommand
(
"-file-list-exec-source-files"
,
GdbQuerySources
);
sendCommand
(
"-break-list"
,
BreakList
);
reloadModules
();
modules
Dirty
=
false
;
m_
modules
ListOutdated
=
false
;
}
// Need another round trip
if
(
reason
==
"breakpoint-hit"
)
{
...
...
@@ -1345,7 +1355,6 @@ void GdbEngine::handleExecRun(const GdbResultRecord &response)
if
(
response
.
resultClass
==
GdbResultRunning
)
{
qq
->
notifyInferiorRunning
();
q
->
showStatusMessage
(
tr
(
"Running..."
));
//reloadModules();
}
else
if
(
response
.
resultClass
==
GdbResultError
)
{
QString
msg
=
response
.
data
.
findChild
(
"msg"
).
data
();
if
(
msg
==
"Cannot find bounds of current function"
)
{
...
...
@@ -1433,11 +1442,8 @@ void GdbEngine::exitDebugger()
if
(
m_gdbProc
.
state
()
!=
QProcess
::
NotRunning
)
qDebug
()
<<
"PROBLEM STOPPING DEBUGGER"
;
m_shortToFullName
.
clear
();
m_fullToShortName
.
clear
();
m_varToType
.
clear
();
m_dataDumperState
=
DataDumperUninitialized
;
m_outputCollector
.
shutdown
();
initializeVariables
();
//q->settings()->m_debugDumpers = false;
}
...
...
src/plugins/debugger/gdbengine.h
View file @
b2387fdd
...
...
@@ -144,7 +144,8 @@ private:
bool
supportsThreads
()
const
;
void
init
();
// called by destructor
void
initializeConnections
();
void
initializeVariables
();
void
queryFullName
(
const
QString
&
fileName
,
QString
*
fullName
);
QString
fullName
(
const
QString
&
fileName
);
QString
shortName
(
const
QString
&
fullName
);
...
...
@@ -329,6 +330,7 @@ private:
QMap
<
QString
,
QString
>
m_varToType
;
bool
m_waitingForBreakpointSynchronizationToContinue
;
bool
m_modulesListOutdated
;
DebuggerManager
*
q
;
IDebuggerManagerAccessForEngines
*
qq
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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