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
588d44c5
Commit
588d44c5
authored
Jul 21, 2010
by
hjk
Browse files
debugger: always enable attaching to external process
parent
cc013037
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggerdialogs.cpp
View file @
588d44c5
...
...
@@ -74,7 +74,7 @@ public:
void
populate
(
QList
<
ProcData
>
processes
,
const
QString
&
excludePid
=
QString
());
private:
enum
{
p
rocessImageRole
=
Qt
::
UserRole
};
enum
{
P
rocessImageRole
=
Qt
::
UserRole
,
ProcessNameRole
};
bool
lessThan
(
const
QModelIndex
&
left
,
const
QModelIndex
&
right
)
const
;
...
...
@@ -121,8 +121,12 @@ QString ProcessListFilterModel::executableForPid(const QString &pid) const
const
int
rowCount
=
m_model
->
rowCount
();
for
(
int
r
=
0
;
r
<
rowCount
;
r
++
)
{
const
QStandardItem
*
item
=
m_model
->
item
(
r
,
0
);
if
(
item
->
text
()
==
pid
)
return
item
->
data
(
processImageRole
).
toString
();
if
(
item
->
text
()
==
pid
)
{
QString
name
=
item
->
data
(
ProcessImageRole
).
toString
();
if
(
name
.
isEmpty
())
name
=
item
->
data
(
ProcessNameRole
).
toString
();
return
name
;
}
}
return
QString
();
}
...
...
@@ -135,18 +139,18 @@ void ProcessListFilterModel::populate(QList<ProcData> processes, const QString &
m_model
->
removeRows
(
0
,
rowCount
);
QStandardItem
*
root
=
m_model
->
invisibleRootItem
();
foreach
(
const
ProcData
&
proc
,
processes
)
{
foreach
(
const
ProcData
&
proc
,
processes
)
{
QList
<
QStandardItem
*>
row
;
row
.
append
(
new
QStandardItem
(
proc
.
ppid
));
row
.
front
()
->
setData
(
QVariant
(
proc
.
image
),
processImageRole
);
QString
name
=
proc
.
image
.
isEmpty
()
?
proc
.
name
:
proc
.
image
;
row
.
back
()
->
setData
(
name
,
ProcessImageRole
);
row
.
append
(
new
QStandardItem
(
proc
.
name
));
if
(
!
proc
.
image
.
isEmpty
())
row
.
back
()
->
setToolTip
(
proc
.
image
);
row
.
back
()
->
setToolTip
(
proc
.
image
);
row
.
append
(
new
QStandardItem
(
proc
.
state
));
if
(
proc
.
ppid
==
excludePid
)
foreach
(
QStandardItem
*
i
,
row
)
i
->
setEnabled
(
false
);
foreach
(
QStandardItem
*
i
tem
,
row
)
i
tem
->
setEnabled
(
false
);
root
->
appendRow
(
row
);
}
}
...
...
@@ -412,7 +416,7 @@ QString AttachExternalDialog::executable() const
void
AttachExternalDialog
::
pidChanged
(
const
QString
&
pid
)
{
bool
enabled
=
!
pid
.
isEmpty
()
&&
pid
!=
QLatin1String
(
"0"
)
&&
pid
!=
m_selfPid
;
;
bool
enabled
=
!
pid
.
isEmpty
()
&&
pid
!=
QLatin1String
(
"0"
)
&&
pid
!=
m_selfPid
;
okButton
()
->
setEnabled
(
enabled
);
}
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
588d44c5
...
...
@@ -1694,6 +1694,7 @@ void DebuggerPluginPrivate::attachExternalApplication
}
DebuggerStartParameters
sp
;
sp
.
attachPID
=
pid
;
sp
.
displayName
=
tr
(
"Process %1"
).
arg
(
pid
);
sp
.
executable
=
binary
;
sp
.
crashParameter
=
crashParameter
;
sp
.
startMode
=
crashParameter
.
isEmpty
()
?
AttachExternal
:
AttachCrashedExternal
;
...
...
@@ -1718,7 +1719,7 @@ void DebuggerPluginPrivate::attachCore(const QString &core, const QString &exe)
DebuggerStartParameters
sp
;
sp
.
executable
=
exe
;
sp
.
coreFile
=
core
;
sp
.
displayName
=
tr
(
"Core file
:
\"
%1
\"
"
).
arg
(
core
);
sp
.
displayName
=
tr
(
"Core file
\"
%1
\"
"
).
arg
(
core
);
sp
.
startMode
=
AttachCore
;
DebuggerRunControl
*
rc
=
createDebugger
(
sp
);
startDebugger
(
rc
);
...
...
@@ -2187,7 +2188,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
//const bool running = m_state == InferiorRunOk;
m_startExternalAction
->
setEnabled
(
!
started
&&
!
starting
);
m_attachExternalAction
->
setEnabled
(
!
started
&&
!
starting
);
m_attachExternalAction
->
setEnabled
(
true
);
#ifdef Q_OS_WIN
m_attachCoreAction
->
setEnabled
(
false
);
#else
...
...
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