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
7313f3d6
Commit
7313f3d6
authored
Oct 05, 2009
by
Oswald Buddenhagen
Browse files
don't instanciate all adaptors at once
parent
94cb4644
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdb/abstractgdbadapter.h
View file @
7313f3d6
...
...
@@ -51,6 +51,7 @@ public:
AbstractGdbAdapter
(
GdbEngine
*
engine
,
QObject
*
parent
=
0
)
:
QObject
(
parent
),
m_engine
(
engine
)
{}
virtual
~
AbstractGdbAdapter
()
{
disconnect
();
}
virtual
QByteArray
readAllStandardError
()
=
0
;
virtual
QByteArray
readAllStandardOutput
()
=
0
;
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
7313f3d6
...
...
@@ -179,14 +179,9 @@ GdbEngine::GdbEngine(DebuggerManager *manager) :
m_dumperInjectionLoad
(
false
)
#endif
{
m_trkOptions
=
QSharedPointer
<
TrkOptions
>
(
new
TrkOptions
);
m_trkOptions
->
fromSettings
(
Core
::
ICore
::
instance
()
->
settings
());
m_gdbAdapter
=
0
;
QSharedPointer
<
TrkOptions
>
options
(
new
TrkOptions
);
options
->
fromSettings
(
Core
::
ICore
::
instance
()
->
settings
());
m_plainAdapter
=
new
PlainGdbAdapter
(
this
);
m_trkAdapter
=
new
TrkGdbAdapter
(
this
,
options
);
m_remoteAdapter
=
new
RemoteGdbAdapter
(
this
);
m_coreAdapter
=
new
CoreGdbAdapter
(
this
);
m_attachAdapter
=
new
AttachGdbAdapter
(
this
);
// Output
connect
(
&
m_outputCollector
,
SIGNAL
(
byteDelivery
(
QByteArray
)),
...
...
@@ -237,16 +232,7 @@ QMainWindow *GdbEngine::mainWindow() const
GdbEngine
::~
GdbEngine
()
{
// prevent sending error messages afterwards
if
(
m_gdbAdapter
)
{
m_gdbAdapter
->
disconnect
(
this
);
//delete m_gdbAdapter;
m_gdbAdapter
=
0
;
}
delete
m_plainAdapter
;
delete
m_trkAdapter
;
delete
m_remoteAdapter
;
delete
m_coreAdapter
;
delete
m_attachAdapter
;
delete
m_gdbAdapter
;
}
void
GdbEngine
::
connectAdapter
()
...
...
@@ -282,11 +268,6 @@ void GdbEngine::connectAdapter()
this
,
SLOT
(
handleAdapterCrashed
(
QString
)));
}
void
GdbEngine
::
disconnectAdapter
()
{
disconnect
(
m_gdbAdapter
,
0
,
this
,
0
);
}
void
GdbEngine
::
initializeVariables
()
{
m_debuggingHelperState
=
DebuggingHelperUninitialized
;
...
...
@@ -1439,31 +1420,30 @@ int GdbEngine::currentFrame() const
return
manager
()
->
stackHandler
()
->
currentIndex
();
}
AbstractGdbAdapter
*
GdbEngine
::
determin
eAdapter
(
const
DebuggerStartParametersPtr
&
sp
)
const
AbstractGdbAdapter
*
GdbEngine
::
creat
eAdapter
(
const
DebuggerStartParametersPtr
&
sp
)
{
switch
(
sp
->
toolChainType
)
{
case
ProjectExplorer
::
ToolChain
::
WINSCW
:
// S60
case
ProjectExplorer
::
ToolChain
::
GCCE
:
case
ProjectExplorer
::
ToolChain
::
RVCT_ARMV5
:
case
ProjectExplorer
::
ToolChain
::
RVCT_ARMV6
:
return
m_trkAdapter
;
return
new
TrkGdbAdapter
(
this
,
m_trkOptions
)
;
default:
break
;
}
// @todo: remove testing hack
if
(
sp
->
processArgs
.
size
()
==
3
&&
sp
->
processArgs
.
at
(
0
)
==
_
(
"@sym@"
))
return
m_trkAdapter
;
return
new
TrkGdbAdapter
(
this
,
m_trkOptions
)
;
switch
(
sp
->
startMode
)
{
case
AttachCore
:
return
m_core
Adapter
;
return
new
CoreGdb
Adapter
(
this
)
;
case
StartRemote
:
return
m_r
emoteAdapter
;
return
new
R
emote
Gdb
Adapter
(
this
)
;
case
AttachExternal
:
return
m_a
ttachAdapter
;
return
new
A
ttach
Gdb
Adapter
(
this
)
;
default:
b
re
ak
;
re
turn
new
PlainGdbAdapter
(
this
)
;
}
return
m_plainAdapter
;
}
void
GdbEngine
::
startDebugger
(
const
DebuggerStartParametersPtr
&
sp
)
...
...
@@ -1477,10 +1457,8 @@ void GdbEngine::startDebugger(const DebuggerStartParametersPtr &sp)
m_startParameters
=
sp
;
if
(
m_gdbAdapter
)
disconnectAdapter
();
m_gdbAdapter
=
determineAdapter
(
sp
);
delete
m_gdbAdapter
;
m_gdbAdapter
=
createAdapter
(
sp
);
if
(
startModeAllowsDumpers
())
connectDebuggingHelperActions
();
...
...
@@ -4226,9 +4204,7 @@ void GdbEngine::handleAdapterShutdownFailed(const QString &msg)
void
GdbEngine
::
addOptionPages
(
QList
<
Core
::
IOptionsPage
*>
*
opts
)
const
{
opts
->
push_back
(
new
GdbOptionsPage
);
#ifdef QTCREATOR_WITH_S60
opts
->
push_back
(
new
TrkOptionsPage
(
m_trkAdapter
->
options
()));
#endif
opts
->
push_back
(
new
TrkOptionsPage
(
m_trkOptions
));
}
void
GdbEngine
::
showMessageBox
(
int
icon
,
const
QString
&
title
,
const
QString
&
text
)
...
...
src/plugins/debugger/gdb/gdbengine.h
View file @
7313f3d6
...
...
@@ -70,6 +70,7 @@ class CoreGdbAdapter;
class
PlainGdbAdapter
;
class
RemoteGdbAdapter
;
class
TrkGdbAdapter
;
struct
TrkOptions
;
enum
DebuggingHelperState
{
...
...
@@ -162,7 +163,6 @@ private:
StackFrame
parseStackFrame
(
const
GdbMi
&
mi
,
int
level
);
void
connectAdapter
();
void
disconnectAdapter
();
void
initializeVariables
();
QString
fullName
(
const
QString
&
fileName
);
// get one usable name out of these, try full names first
...
...
@@ -396,7 +396,7 @@ private:
void
setLocals
(
const
QList
<
GdbMi
>
&
locals
);
void
connectDebuggingHelperActions
();
void
disconnectDebuggingHelperActions
();
AbstractGdbAdapter
*
determin
eAdapter
(
const
DebuggerStartParametersPtr
&
dp
)
const
;
AbstractGdbAdapter
*
creat
eAdapter
(
const
DebuggerStartParametersPtr
&
dp
);
bool
startModeAllowsDumpers
()
const
;
QString
parseDisassembler
(
const
GdbMi
&
lines
);
...
...
@@ -423,13 +423,9 @@ private:
DebuggerStartParametersPtr
m_startParameters
;
// make sure to re-initialize new members in initializeVariables();
// only one of those is active at a given time, available in m_gdbAdapter
AbstractGdbAdapter
*
m_gdbAdapter
;
// pointer to one listed below
AttachGdbAdapter
*
m_attachAdapter
;
// owned
CoreGdbAdapter
*
m_coreAdapter
;
// owned
PlainGdbAdapter
*
m_plainAdapter
;
// owned
RemoteGdbAdapter
*
m_remoteAdapter
;
// owned
TrkGdbAdapter
*
m_trkAdapter
;
// owned
QSharedPointer
<
TrkOptions
>
m_trkOptions
;
AbstractGdbAdapter
*
m_gdbAdapter
;
public:
QString
errorMessage
(
QProcess
::
ProcessError
error
);
...
...
src/plugins/debugger/gdb/trkgdbadapter.h
View file @
7313f3d6
...
...
@@ -145,7 +145,6 @@ public:
// Set a device (from the project) to override the settings.
QString
overrideTrkDevice
()
const
;
void
setOverrideTrkDevice
(
const
QString
&
);
const
TrkOptionsPtr
options
()
const
{
return
m_options
;
}
signals:
void
output
(
const
QString
&
msg
);
...
...
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