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
Marco Bubke
flatpak-qt-creator
Commits
140f34c5
Commit
140f34c5
authored
Feb 13, 2009
by
hjk
Browse files
Fixes: debugger: try fixing startup break on make
parent
70084675
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdbengine.cpp
View file @
140f34c5
...
...
@@ -301,6 +301,7 @@ void GdbEngine::initializeVariables()
m_outputCodec
=
QTextCodec
::
codecForLocale
();
m_pendingRequests
=
0
;
m_waitingForBreakpointSynchronizationToContinue
=
false
;
m_waitingForFirstBreakpointToBeHit
=
false
;
}
void
GdbEngine
::
gdbProcError
(
QProcess
::
ProcessError
error
)
...
...
@@ -1083,52 +1084,47 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
{
const
QString
reason
=
data
.
findChild
(
"reason"
).
data
();
QString
msg
=
data
.
findChild
(
"consolestreamoutput"
).
data
();
if
(
reason
.
isEmpty
())
{
GdbMi
frame
=
data
.
findChild
(
"frame"
);
if
(
frame
.
findChild
(
"func"
).
data
()
==
startSymbolName
())
{
//
// that's the "early stop"
//
frame
.
findChild
(
"func"
).
data
()
+
'%'
;
#if defined(Q_OS_WIN)
sendCommand
(
"info proc"
,
GdbInfoProc
);
#endif
#if defined(Q_OS_LINUX)
sendCommand
(
"info proc"
,
GdbInfoProc
);
#endif
#if defined(Q_OS_MAC)
sendCommand
(
"info pid"
,
GdbInfoProc
,
QVariant
(),
true
);
#endif
sendCommand
(
"-file-list-exec-source-files"
,
GdbQuerySources
);
tryLoadCustomDumpers
();
// intentionally after tryLoadCustomDumpers(),
// otherwise we'd interupt solib loading.
if
(
qq
->
wantsAllPluginBreakpoints
())
{
sendCommand
(
"set auto-solib-add on"
);
sendCommand
(
"set stop-on-solib-events 0"
);
sendCommand
(
"sharedlibrary .*"
);
}
else
if
(
qq
->
wantsSelectedPluginBreakpoints
())
{
sendCommand
(
"set auto-solib-add on"
);
sendCommand
(
"set stop-on-solib-events 1"
);
sendCommand
(
"sharedlibrary "
+
qq
->
selectedPluginBreakpointsPattern
());
}
else
if
(
qq
->
wantsNoPluginBreakpoints
())
{
// should be like that already
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
()));
return
;
bool
isFirstStop
=
data
.
findChild
(
"bkptno"
).
data
()
==
"1"
;
if
(
isFirstStop
&&
m_waitingForFirstBreakpointToBeHit
)
{
//
// that's the "early stop"
//
#if defined(Q_OS_WIN)
sendCommand
(
"info proc"
,
GdbInfoProc
);
#endif
#if defined(Q_OS_LINUX)
sendCommand
(
"info proc"
,
GdbInfoProc
);
#endif
#if defined(Q_OS_MAC)
sendCommand
(
"info pid"
,
GdbInfoProc
,
QVariant
(),
true
);
#endif
sendCommand
(
"-file-list-exec-source-files"
,
GdbQuerySources
);
tryLoadCustomDumpers
();
// intentionally after tryLoadCustomDumpers(),
// otherwise we'd interupt solib loading.
if
(
qq
->
wantsAllPluginBreakpoints
())
{
sendCommand
(
"set auto-solib-add on"
);
sendCommand
(
"set stop-on-solib-events 0"
);
sendCommand
(
"sharedlibrary .*"
);
}
else
if
(
qq
->
wantsSelectedPluginBreakpoints
())
{
sendCommand
(
"set auto-solib-add on"
);
sendCommand
(
"set stop-on-solib-events 1"
);
sendCommand
(
"sharedlibrary "
+
qq
->
selectedPluginBreakpointsPattern
());
}
else
if
(
qq
->
wantsNoPluginBreakpoints
())
{
// should be like that already
sendCommand
(
"set auto-solib-add off"
);
sendCommand
(
"set stop-on-solib-events 0"
);
}
qDebug
()
<<
"EMPTY REASON FOR STOPPED"
;
// fall through
// 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
()));
return
;
}
QString
msg
=
data
.
findChild
(
"consolestreamoutput"
).
data
();
if
(
msg
.
contains
(
"Stopped due to shared library event"
)
||
reason
.
isEmpty
())
{
if
(
qq
->
wantsSelectedPluginBreakpoints
())
{
qDebug
()
<<
"SHARED LIBRARY EVENT "
<<
data
.
toString
();
...
...
@@ -1142,6 +1138,17 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
// fall through
}
// seen on XP after removing a breakpoint while running
// stdout:945*stopped,reason="signal-received",signal-name="SIGTRAP",
// signal-meaning="Trace/breakpoint trap",thread-id="2",
// frame={addr="0x7c91120f",func="ntdll!DbgUiConnectToDbg",
// args=[],from="C:\\WINDOWS\\system32\\ntdll.dll"}
if
(
reason
==
"signal-received"
&&
data
.
findChild
(
"signal-name"
).
toString
()
==
"SIGTRAP"
)
{
continueInferior
();
return
;
}
if
(
isExitedReason
(
reason
))
{
qq
->
notifyInferiorExited
();
QString
msg
=
"Program exited normally"
;
...
...
@@ -1195,7 +1202,6 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
if
(
isStoppedReason
(
reason
)
||
reason
.
isEmpty
())
{
if
(
m_modulesListOutdated
)
{
reloadModules
();
QT_END_INCLUDE_NAMESPACE
m_modulesListOutdated
=
false
;
}
// Need another round trip
...
...
@@ -1613,6 +1619,7 @@ void GdbEngine::handleStart(const GdbResultRecord &response)
if
(
needle
.
indexIn
(
msg
)
!=
-
1
)
{
//qDebug() << "STREAM: " << msg << needle.cap(1);
sendCommand
(
"tbreak *0x"
+
needle
.
cap
(
1
));
m_waitingForFirstBreakpointToBeHit
=
true
;
sendCommand
(
"-exec-run"
);
qq
->
notifyInferiorRunningRequested
();
}
else
{
...
...
src/plugins/debugger/gdbengine.h
View file @
140f34c5
...
...
@@ -330,6 +330,7 @@ private:
QMap
<
QString
,
QString
>
m_varToType
;
bool
m_waitingForBreakpointSynchronizationToContinue
;
bool
m_waitingForFirstBreakpointToBeHit
;
bool
m_modulesListOutdated
;
DebuggerManager
*
q
;
...
...
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