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
6e17e7a3
Commit
6e17e7a3
authored
Dec 14, 2010
by
hjk
Browse files
debugger: thread 0 is valid for cdb. so use -1 as 'any' value
parent
7ef927ac
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/breakhandler.cpp
View file @
6e17e7a3
...
...
@@ -375,9 +375,16 @@ Qt::ItemFlags BreakHandler::flags(const QModelIndex &index) const
// }
}
static
QString
th
rea
dString
(
int
spec
)
QString
B
rea
kHandler
::
displayFromThreadSpec
(
int
spec
)
{
return
spec
==
0
?
BreakHandler
::
tr
(
"(all)"
)
:
QString
::
number
(
spec
);
return
spec
==
-
1
?
BreakHandler
::
tr
(
"(all)"
)
:
QString
::
number
(
spec
);
}
int
BreakHandler
::
threadSpecFromDisplay
(
const
QString
&
str
)
{
bool
ok
=
false
;
int
result
=
str
.
toInt
(
&
ok
);
return
ok
?
result
:
-
1
;
}
QVariant
BreakHandler
::
data
(
const
QModelIndex
&
mi
,
int
role
)
const
...
...
@@ -494,11 +501,11 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
break
;
case
7
:
if
(
role
==
Qt
::
DisplayRole
)
return
t
hreadS
tring
(
orig
?
data
.
threadSpec
:
response
.
threadSpec
);
return
displayFromT
hreadS
pec
(
orig
?
data
.
threadSpec
:
response
.
threadSpec
);
if
(
role
==
Qt
::
ToolTipRole
)
return
tr
(
"Breakpoint will only be hit in the specified thread(s)."
);
if
(
role
==
Qt
::
UserRole
+
1
)
return
data
.
threadSpec
;
return
displayFromThreadSpec
(
data
.
threadSpec
)
;
break
;
}
if
(
role
==
Qt
::
ToolTipRole
)
...
...
src/plugins/debugger/breakhandler.h
View file @
6e17e7a3
...
...
@@ -149,6 +149,9 @@ public:
void
notifyBreakpointAdjusted
(
BreakpointId
id
,
const
BreakpointParameters
&
data
);
static
QString
displayFromThreadSpec
(
int
spec
);
static
int
threadSpecFromDisplay
(
const
QString
&
str
);
private:
// QAbstractItemModel implementation.
int
columnCount
(
const
QModelIndex
&
parent
)
const
;
...
...
src/plugins/debugger/breakpoint.cpp
View file @
6e17e7a3
...
...
@@ -43,7 +43,7 @@ namespace Internal {
BreakpointParameters
::
BreakpointParameters
(
BreakpointType
t
)
:
type
(
t
),
enabled
(
true
),
useFullPath
(
false
),
ignoreCount
(
0
),
lineNumber
(
0
),
address
(
0
),
threadSpec
(
0
)
ignoreCount
(
0
),
lineNumber
(
0
),
address
(
0
),
threadSpec
(
-
1
)
{}
bool
BreakpointParameters
::
equals
(
const
BreakpointParameters
&
rhs
)
const
...
...
src/plugins/debugger/breakwindow.cpp
View file @
6e17e7a3
...
...
@@ -141,7 +141,8 @@ void BreakpointDialog::setParameters(const BreakpointParameters &data)
setParts
(
AllParts
,
data
);
m_ui
.
lineEditCondition
->
setText
(
QString
::
fromUtf8
(
data
.
condition
));
m_ui
.
lineEditIgnoreCount
->
setText
(
QString
::
number
(
data
.
ignoreCount
));
m_ui
.
lineEditThreadSpec
->
setText
(
QString
::
number
(
data
.
threadSpec
));
m_ui
.
lineEditThreadSpec
->
setText
(
BreakHandler
::
displayFromThreadSpec
(
data
.
threadSpec
));
}
BreakpointParameters
BreakpointDialog
::
parameters
()
const
...
...
@@ -150,7 +151,8 @@ BreakpointParameters BreakpointDialog::parameters() const
getParts
(
AllParts
,
&
data
);
data
.
condition
=
m_ui
.
lineEditCondition
->
text
().
toUtf8
();
data
.
ignoreCount
=
m_ui
.
lineEditIgnoreCount
->
text
().
toInt
();
data
.
threadSpec
=
m_ui
.
lineEditThreadSpec
->
text
().
toInt
();
data
.
threadSpec
=
BreakHandler
::
threadSpecFromDisplay
(
m_ui
.
lineEditThreadSpec
->
text
());
return
data
;
}
...
...
@@ -564,7 +566,8 @@ void BreakWindow::editBreakpoints(const BreakpointIds &ids)
BreakHandler
*
handler
=
breakHandler
();
const
QString
oldCondition
=
QString
::
fromLatin1
(
handler
->
condition
(
id
));
const
QString
oldIgnoreCount
=
QString
::
number
(
handler
->
ignoreCount
(
id
));
const
QString
oldThreadSpec
=
QString
::
number
(
handler
->
threadSpec
(
id
));
const
QString
oldThreadSpec
=
BreakHandler
::
displayFromThreadSpec
(
handler
->
threadSpec
(
id
));
ui
.
lineEditCondition
->
setText
(
oldCondition
);
ui
.
lineEditIgnoreCount
->
setText
(
oldIgnoreCount
);
...
...
@@ -584,7 +587,8 @@ void BreakWindow::editBreakpoints(const BreakpointIds &ids)
foreach
(
const
BreakpointId
id
,
ids
)
{
handler
->
setCondition
(
id
,
newCondition
.
toLatin1
());
handler
->
setIgnoreCount
(
id
,
newIgnoreCount
.
toInt
());
handler
->
setThreadSpec
(
id
,
newThreadSpec
.
toInt
());
handler
->
setThreadSpec
(
id
,
BreakHandler
::
threadSpecFromDisplay
(
newThreadSpec
));
}
}
...
...
src/plugins/debugger/cdb2/cdbparsehelpers.cpp
View file @
6e17e7a3
...
...
@@ -61,7 +61,7 @@ QByteArray cdbAddBreakpointCommand(const Debugger::Internal::BreakpointParameter
QByteArray
rc
;
ByteArrayInputStream
str
(
rc
);
if
(
bp
.
threadSpec
>
0
)
if
(
bp
.
threadSpec
>
=
0
)
str
<<
'~'
<<
bp
.
threadSpec
<<
' '
;
str
<<
(
bp
.
type
==
Debugger
::
Internal
::
Watchpoint
?
"ba"
:
"bp"
);
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
6e17e7a3
...
...
@@ -2486,7 +2486,7 @@ void GdbEngine::insertBreakpoint(BreakpointId id)
}
else
if
(
m_gdbVersion
>=
70000
)
{
int
spec
=
handler
->
threadSpec
(
id
);
cmd
=
"-break-insert "
;
if
(
spec
)
if
(
spec
>=
0
)
cmd
+=
"-p "
+
QByteArray
::
number
(
spec
);
cmd
+=
" -f "
;
}
else
if
(
m_gdbVersion
>=
60800
)
{
...
...
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