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
ff2a1f81
Commit
ff2a1f81
authored
Oct 06, 2009
by
Oswald Buddenhagen
Browse files
purge completely dysfunctional debug-in-terminal code
parent
cff3b9e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdb/plaingdbadapter.cpp
View file @
ff2a1f81
...
...
@@ -60,19 +60,6 @@ PlainGdbAdapter::PlainGdbAdapter(GdbEngine *engine, QObject *parent)
{
commonInit
();
m_stubProc
.
setMode
(
Utils
::
ConsoleProcess
::
Debug
);
#ifdef Q_OS_UNIX
m_stubProc
.
setSettings
(
Core
::
ICore
::
instance
()
->
settings
());
#endif
connect
(
&
m_stubProc
,
SIGNAL
(
processError
(
QString
)),
this
,
SLOT
(
stubError
(
QString
)));
connect
(
&
m_stubProc
,
SIGNAL
(
processStarted
()),
this
,
SLOT
(
stubStarted
()));
// FIXME:
// connect(&m_stubProc, SIGNAL(wrapperStopped()),
// m_manager, SLOT(exitDebugger()));
// Output
connect
(
&
m_outputCollector
,
SIGNAL
(
byteDelivery
(
QByteArray
)),
engine
,
SLOT
(
readDebugeeOutput
(
QByteArray
)));
...
...
@@ -88,30 +75,17 @@ void PlainGdbAdapter::startAdapter()
gdbArgs
.
prepend
(
_
(
"mi"
));
gdbArgs
.
prepend
(
_
(
"-i"
));
if
(
startParameters
().
useTerminal
)
{
m_stubProc
.
stop
();
// We leave the console open, so recycle it now.
m_stubProc
.
setWorkingDirectory
(
startParameters
().
workingDir
);
m_stubProc
.
setEnvironment
(
startParameters
().
environment
);
if
(
!
m_stubProc
.
start
(
startParameters
().
executable
,
startParameters
().
processArgs
))
{
// Error message for user is delivered via a signal.
emitAdapterStartFailed
(
QString
());
return
;
}
}
else
{
if
(
!
m_outputCollector
.
listen
())
{
emitAdapterStartFailed
(
tr
(
"Cannot set up communication with child process: %1"
)
.
arg
(
m_outputCollector
.
errorString
()));
return
;
}
gdbArgs
.
prepend
(
_
(
"--tty="
)
+
m_outputCollector
.
serverName
());
if
(
!
startParameters
().
workingDir
.
isEmpty
())
m_gdbProc
.
setWorkingDirectory
(
startParameters
().
workingDir
);
if
(
!
startParameters
().
environment
.
isEmpty
())
m_gdbProc
.
setEnvironment
(
startParameters
().
environment
);
if
(
!
m_outputCollector
.
listen
())
{
emit
adapterStartFailed
(
tr
(
"Cannot set up communication with child process: %1"
)
.
arg
(
m_outputCollector
.
errorString
()));
return
;
}
gdbArgs
.
prepend
(
_
(
"--tty="
)
+
m_outputCollector
.
serverName
());
if
(
!
startParameters
().
workingDir
.
isEmpty
())
m_gdbProc
.
setWorkingDirectory
(
startParameters
().
workingDir
);
if
(
!
startParameters
().
environment
.
isEmpty
())
m_gdbProc
.
setEnvironment
(
startParameters
().
environment
);
m_gdbProc
.
start
(
theDebuggerStringSetting
(
GdbLocation
),
gdbArgs
);
}
...
...
@@ -269,34 +243,5 @@ void PlainGdbAdapter::handleGdbFinished(int, QProcess::ExitStatus)
emit
adapterShutDown
();
}
void
PlainGdbAdapter
::
stubStarted
()
{
const
qint64
attachedPID
=
m_stubProc
.
applicationPID
();
emit
inferiorPidChanged
(
attachedPID
);
m_engine
->
postCommand
(
_
(
"attach %1"
).
arg
(
attachedPID
),
CB
(
handleStubAttached
));
}
void
PlainGdbAdapter
::
handleStubAttached
(
const
GdbResponse
&
)
{
qDebug
()
<<
"STUB ATTACHED, FIXME"
;
//qq->notifyInferiorStopped();
//handleAqcuiredInferior();
}
void
PlainGdbAdapter
::
stubError
(
const
QString
&
msg
)
{
QMessageBox
::
critical
(
m_engine
->
mainWindow
(),
tr
(
"Debugger Error"
),
msg
);
}
void
PlainGdbAdapter
::
emitAdapterStartFailed
(
const
QString
&
msg
)
{
// QMessageBox::critical(mainWindow(), tr("Debugger Startup Failure"),
// tr("Cannot start debugger: %1").arg(m_gdbAdapter->errorString()));
bool
blocked
=
m_stubProc
.
blockSignals
(
true
);
m_stubProc
.
stop
();
m_stubProc
.
blockSignals
(
blocked
);
emit
adapterStartFailed
(
msg
,
QString
());
}
}
// namespace Internal
}
// namespace Debugger
src/plugins/debugger/gdb/plaingdbadapter.h
View file @
ff2a1f81
...
...
@@ -34,8 +34,6 @@
#include
"gdbengine.h"
#include
"outputcollector.h"
#include
<consoleprocess.h>
#include
<QtCore/QDebug>
#include
<QtCore/QProcess>
...
...
@@ -67,17 +65,12 @@ private:
void
handleFileExecAndSymbols
(
const
GdbResponse
&
response
);
void
handleKill
(
const
GdbResponse
&
response
);
void
handleExit
(
const
GdbResponse
&
response
);
void
handleStubAttached
(
const
GdbResponse
&
response
);
void
handleExecRun
(
const
GdbResponse
&
response
);
void
emitAdapterStartFailed
(
const
QString
&
msg
);
Q_SLOT
void
handleGdbFinished
(
int
,
QProcess
::
ExitStatus
status
);
Q_SLOT
void
handleGdbError
(
QProcess
::
ProcessError
error
);
Q_SLOT
void
handleGdbStarted
();
Q_SLOT
void
stubStarted
();
Q_SLOT
void
stubError
(
const
QString
&
msg
);
Utils
::
ConsoleProcess
m_stubProc
;
OutputCollector
m_outputCollector
;
};
...
...
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