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
3215da91
Commit
3215da91
authored
Sep 23, 2009
by
Friedemann Kleint
Browse files
Gdb: Parse out MinGW gdb process id correctly, connect dumper acts.
parent
d25066f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdb/gdbengine.cpp
View file @
3215da91
...
...
@@ -193,14 +193,28 @@ GdbEngine::GdbEngine(DebuggerManager *parent) :
connect
(
this
,
SIGNAL
(
applicationOutputAvailable
(
QString
)),
m_manager
,
SLOT
(
showApplicationOutput
(
QString
)),
Qt
::
QueuedConnection
);
}
// FIXME: These trigger even if the engine is not active
connect
(
theDebuggerAction
(
UseDebuggingHelpers
),
SIGNAL
(
valueChanged
(
QVariant
)),
this
,
SLOT
(
setUseDebuggingHelpers
(
QVariant
)));
connect
(
theDebuggerAction
(
DebugDebuggingHelpers
),
SIGNAL
(
valueChanged
(
QVariant
)),
this
,
SLOT
(
setDebugDebuggingHelpers
(
QVariant
)));
connect
(
theDebuggerAction
(
RecheckDebuggingHelpers
),
SIGNAL
(
triggered
()),
this
,
SLOT
(
recheckDebuggingHelperAvailability
()));
void
GdbEngine
::
connectDebuggingHelperActions
(
bool
on
)
{
if
(
on
)
{
connect
(
theDebuggerAction
(
UseDebuggingHelpers
),
SIGNAL
(
valueChanged
(
QVariant
)),
this
,
SLOT
(
setUseDebuggingHelpers
(
QVariant
)));
connect
(
theDebuggerAction
(
DebugDebuggingHelpers
),
SIGNAL
(
valueChanged
(
QVariant
)),
this
,
SLOT
(
setDebugDebuggingHelpers
(
QVariant
)));
connect
(
theDebuggerAction
(
RecheckDebuggingHelpers
),
SIGNAL
(
triggered
()),
this
,
SLOT
(
recheckDebuggingHelperAvailability
()));
}
else
{
disconnect
(
theDebuggerAction
(
UseDebuggingHelpers
),
0
,
this
,
0
);
disconnect
(
theDebuggerAction
(
DebugDebuggingHelpers
),
0
,
this
,
0
);
disconnect
(
theDebuggerAction
(
RecheckDebuggingHelpers
),
0
,
this
,
0
);
}
}
DebuggerStartMode
GdbEngine
::
startMode
()
const
{
QTC_ASSERT
(
!
m_startParameters
.
isNull
(),
return
NoStartMode
);
return
m_startParameters
->
startMode
;
}
GdbEngine
::~
GdbEngine
()
...
...
@@ -529,11 +543,18 @@ void GdbEngine::handleResponse(const QByteArray &buff)
}
case
'~'
:
{
// Linux/Mac gdb: [New [Tt]hread 0x545 (LWP 4554)]
// MinGW gdb 6.8: [New thread 2728.0x1034]
static
QRegExp
re
(
_
(
"New .hread 0x[0-9a-f]*
\\
(LWP ([0-9]*)
\\
)"
));
static
QRegExp
re2
(
_
(
"New .hread ([0-9]+)
\\
.0x[0-9a-f]+"
));
QTC_ASSERT
(
re
.
isValid
()
&&
re2
.
isValid
(),
return
);
QByteArray
data
=
GdbMi
::
parseCString
(
from
,
to
);
m_pendingConsoleStreamOutput
+=
data
;
if
(
re
.
indexIn
(
_
(
data
))
!=
-
1
)
if
(
re
.
indexIn
(
_
(
data
))
!=
-
1
)
{
maybeHandleInferiorPidChanged
(
re
.
cap
(
1
));
}
else
if
(
re2
.
indexIn
(
_
(
data
))
!=
-
1
)
{
maybeHandleInferiorPidChanged
(
re2
.
cap
(
1
));
}
if
(
data
.
startsWith
(
"Reading symbols from "
))
showStatusMessage
(
tr
(
"Reading %1..."
).
arg
(
_
(
data
.
mid
(
21
))));
break
;
...
...
@@ -1498,6 +1519,7 @@ void GdbEngine::detachDebugger()
void
GdbEngine
::
exitDebugger
()
{
connectDebuggingHelperActions
(
false
);
m_outputCollector
.
shutdown
();
initializeVariables
();
m_gdbAdapter
->
shutdown
();
...
...
@@ -1522,6 +1544,8 @@ void GdbEngine::startDebugger(const DebuggerStartParametersPtr &sp)
//QTC_ASSERT(m_gdbAdapter == 0, delete m_gdbAdapter; m_gdbAdapter = 0);
m_startParameters
=
sp
;
if
(
startModeAllowsDumpers
())
connectDebuggingHelperActions
(
true
);
if
(
m_gdbAdapter
)
disconnectAdapter
();
...
...
@@ -3838,9 +3862,8 @@ void GdbEngine::recheckDebuggingHelperAvailability()
bool
GdbEngine
::
startModeAllowsDumpers
()
const
{
return
startMode
()
==
StartInternal
||
startMode
()
==
StartExternal
||
startMode
()
==
AttachExternal
;
const
DebuggerStartMode
m
=
startMode
();
return
m
==
StartInternal
||
m
==
StartExternal
||
m
==
AttachExternal
;
}
void
GdbEngine
::
watchPoint
(
const
QPoint
&
pnt
)
...
...
src/plugins/debugger/gdb/gdbengine.h
View file @
3215da91
...
...
@@ -281,7 +281,7 @@ private:
{
m_manager
->
showStatusMessage
(
msg
,
timeout
);
}
int
status
()
const
{
return
m_manager
->
status
();
}
QMainWindow
*
mainWindow
()
const
{
return
m_manager
->
mainWindow
();
}
DebuggerStartMode
startMode
()
const
{
return
m_startParameters
->
startMode
;
}
DebuggerStartMode
startMode
()
const
;
qint64
inferiorPid
()
const
{
return
m_manager
->
inferiorPid
();
}
void
handleChildren
(
const
WatchData
&
parent
,
const
GdbMi
&
child
,
...
...
@@ -412,6 +412,7 @@ private:
void
setWatchDataType
(
WatchData
&
data
,
const
GdbMi
&
mi
);
void
setWatchDataDisplayedType
(
WatchData
&
data
,
const
GdbMi
&
mi
);
void
setLocals
(
const
QList
<
GdbMi
>
&
locals
);
void
connectDebuggingHelperActions
(
bool
on
);
bool
startModeAllowsDumpers
()
const
;
QString
parseDisassembler
(
const
GdbMi
&
lines
);
...
...
Write
Preview
Markdown
is supported
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