Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flatpak-qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
d5c5b90b
Commit
d5c5b90b
authored
Nov 30, 2010
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugger: make "threadspec" an int instead of a bytearray
parent
d02b2e9a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
43 deletions
+36
-43
src/plugins/debugger/breakhandler.cpp
src/plugins/debugger/breakhandler.cpp
+12
-10
src/plugins/debugger/breakhandler.h
src/plugins/debugger/breakhandler.h
+2
-2
src/plugins/debugger/breakpoint.cpp
src/plugins/debugger/breakpoint.cpp
+1
-1
src/plugins/debugger/breakpoint.h
src/plugins/debugger/breakpoint.h
+1
-1
src/plugins/debugger/breakwindow.cpp
src/plugins/debugger/breakwindow.cpp
+5
-6
src/plugins/debugger/cdb/cdbbreakpoint.cpp
src/plugins/debugger/cdb/cdbbreakpoint.cpp
+1
-6
src/plugins/debugger/cdb2/cdbparsehelpers.cpp
src/plugins/debugger/cdb2/cdbparsehelpers.cpp
+1
-1
src/plugins/debugger/gdb/gdbengine.cpp
src/plugins/debugger/gdb/gdbengine.cpp
+13
-16
No files found.
src/plugins/debugger/breakhandler.cpp
View file @
d5c5b90b
...
...
@@ -255,7 +255,7 @@ void BreakHandler::saveBreakpoints()
map
.
insert
(
_
(
"condition"
),
data
.
condition
);
if
(
data
.
ignoreCount
)
map
.
insert
(
_
(
"ignorecount"
),
data
.
ignoreCount
);
if
(
!
data
.
threadSpec
.
isEmpty
()
)
if
(
data
.
threadSpec
)
map
.
insert
(
_
(
"threadspec"
),
data
.
threadSpec
);
if
(
!
data
.
enabled
)
map
.
insert
(
_
(
"disabled"
),
_
(
"1"
));
...
...
@@ -294,7 +294,7 @@ void BreakHandler::loadBreakpoints()
data
.
ignoreCount
=
v
.
toString
().
toInt
();
v
=
map
.
value
(
_
(
"threadspec"
));
if
(
v
.
isValid
())
data
.
threadSpec
=
v
.
toString
().
to
Latin1
();
data
.
threadSpec
=
v
.
toString
().
to
Int
();
v
=
map
.
value
(
_
(
"funcname"
));
if
(
v
.
isValid
())
data
.
functionName
=
v
.
toString
();
...
...
@@ -375,6 +375,11 @@ Qt::ItemFlags BreakHandler::flags(const QModelIndex &index) const
// }
}
static
QString
threadString
(
int
spec
)
{
return
spec
==
0
?
BreakHandler
::
tr
(
"(all)"
)
:
QString
::
number
(
spec
);
}
QVariant
BreakHandler
::
data
(
const
QModelIndex
&
mi
,
int
role
)
const
{
static
const
QString
empty
=
QString
(
QLatin1Char
(
'-'
));
...
...
@@ -488,11 +493,8 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
return
data
.
ignoreCount
;
break
;
case
7
:
if
(
role
==
Qt
::
DisplayRole
)
{
if
(
orig
)
return
!
data
.
threadSpec
.
isEmpty
()
?
data
.
threadSpec
:
tr
(
"(all)"
);
return
!
response
.
threadSpec
.
isEmpty
()
?
response
.
threadSpec
:
tr
(
"(all)"
);
}
if
(
role
==
Qt
::
DisplayRole
)
return
threadString
(
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
)
...
...
@@ -538,7 +540,7 @@ PROPERTY(bool, useFullPath, setUseFullPath)
PROPERTY
(
QString
,
fileName
,
setFileName
)
PROPERTY
(
QString
,
functionName
,
setFunctionName
)
PROPERTY
(
BreakpointType
,
type
,
setType
)
PROPERTY
(
QByteArray
,
threadSpec
,
setThreadSpec
)
PROPERTY
(
int
,
threadSpec
,
setThreadSpec
)
PROPERTY
(
QByteArray
,
condition
,
setCondition
)
GETTER
(
int
,
lineNumber
)
PROPERTY
(
quint64
,
address
,
setAddress
)
...
...
@@ -745,10 +747,10 @@ void BreakHandler::notifyBreakpointAdjusted(BreakpointId id,
void
BreakHandler
::
notifyBreakpointNeedsReinsertion
(
BreakpointId
id
)
{
QTC_ASSERT
(
state
(
id
)
==
Breakpoint
Inserted
,
qDebug
()
<<
state
(
id
));
QTC_ASSERT
(
state
(
id
)
==
Breakpoint
ChangeProceeding
,
qDebug
()
<<
state
(
id
));
Iterator
it
=
m_storage
.
find
(
id
);
QTC_ASSERT
(
it
!=
m_storage
.
end
(),
return
);
it
->
state
=
Breakpoint
New
;
it
->
state
=
Breakpoint
InsertRequested
;
}
void
BreakHandler
::
removeBreakpoint
(
BreakpointId
id
)
...
...
src/plugins/debugger/breakhandler.h
View file @
d5c5b90b
...
...
@@ -107,8 +107,8 @@ public:
void
setCondition
(
BreakpointId
,
const
QByteArray
&
condition
);
int
ignoreCount
(
BreakpointId
id
)
const
;
void
setIgnoreCount
(
BreakpointId
,
const
int
&
count
);
QByteArray
threadSpec
(
BreakpointId
id
)
const
;
void
setThreadSpec
(
BreakpointId
,
const
QByteArray
&
spec
);
int
threadSpec
(
BreakpointId
id
)
const
;
void
setThreadSpec
(
BreakpointId
,
const
int
&
spec
);
QString
fileName
(
BreakpointId
id
)
const
;
void
setFileName
(
BreakpointId
,
const
QString
&
fileName
);
QString
functionName
(
BreakpointId
id
)
const
;
...
...
src/plugins/debugger/breakpoint.cpp
View file @
d5c5b90b
...
...
@@ -43,7 +43,7 @@ namespace Internal {
BreakpointParameters
::
BreakpointParameters
(
BreakpointType
t
)
:
type
(
t
),
enabled
(
true
),
useFullPath
(
false
),
ignoreCount
(
0
),
lineNumber
(
0
),
address
(
0
)
ignoreCount
(
0
),
lineNumber
(
0
),
address
(
0
)
,
threadSpec
(
0
)
{}
bool
BreakpointParameters
::
equals
(
const
BreakpointParameters
&
rhs
)
const
...
...
src/plugins/debugger/breakpoint.h
View file @
d5c5b90b
...
...
@@ -91,7 +91,7 @@ public:
int
ignoreCount
;
// Ignore count associated with breakpoint.
int
lineNumber
;
// Line in source file.
quint64
address
;
// Address for watchpoints.
QByteArray
threadSpec
;
// Thread specification.
int
threadSpec
;
// Thread specification.
QString
functionName
;
};
...
...
src/plugins/debugger/breakwindow.cpp
View file @
d5c5b90b
...
...
@@ -141,7 +141,7 @@ 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
(
data
.
threadSpec
);
m_ui
.
lineEditThreadSpec
->
setText
(
QString
::
number
(
data
.
threadSpec
)
);
}
BreakpointParameters
BreakpointDialog
::
parameters
()
const
...
...
@@ -150,7 +150,7 @@ 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
().
to
Utf8
();
data
.
threadSpec
=
m_ui
.
lineEditThreadSpec
->
text
().
to
Int
();
return
data
;
}
...
...
@@ -564,7 +564,7 @@ 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
::
fromLatin1
(
handler
->
threadSpec
(
id
));
const
QString
oldThreadSpec
=
QString
::
number
(
handler
->
threadSpec
(
id
));
ui
.
lineEditCondition
->
setText
(
oldCondition
);
ui
.
lineEditIgnoreCount
->
setText
(
oldIgnoreCount
);
...
...
@@ -584,16 +584,15 @@ 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
.
to
Latin1
());
handler
->
setThreadSpec
(
id
,
newThreadSpec
.
to
Int
());
}
}
void
BreakWindow
::
associateBreakpoint
(
const
BreakpointIds
&
ids
,
int
threadId
)
{
BreakHandler
*
handler
=
breakHandler
();
QByteArray
spec
=
QByteArray
::
number
(
threadId
);
foreach
(
const
BreakpointId
id
,
ids
)
handler
->
setThreadSpec
(
id
,
spec
);
handler
->
setThreadSpec
(
id
,
threadId
);
}
void
BreakWindow
::
resizeColumnsToContents
()
...
...
src/plugins/debugger/cdb/cdbbreakpoint.cpp
View file @
d5c5b90b
...
...
@@ -49,12 +49,7 @@ static CdbCore::BreakPoint breakPointFromBreakPointData(const BreakpointParamete
CdbCore
::
BreakPoint
::
Code
;
rc
.
address
=
bpd
.
address
;
if
(
!
bpd
.
threadSpec
.
isEmpty
())
{
bool
ok
;
rc
.
threadId
=
bpd
.
threadSpec
.
toInt
(
&
ok
);
if
(
!
ok
)
qWarning
(
"Cdb: Cannot convert breakpoint thread specification '%s'"
,
bpd
.
threadSpec
.
constData
());
}
rc
.
threadId
=
bpd
.
threadSpec
;
rc
.
fileName
=
QDir
::
toNativeSeparators
(
bpd
.
fileName
);
rc
.
condition
=
bpd
.
condition
;
rc
.
funcName
=
functionName
.
isEmpty
()
?
bpd
.
functionName
:
functionName
;
...
...
src/plugins/debugger/cdb2/cdbparsehelpers.cpp
View file @
d5c5b90b
...
...
@@ -62,7 +62,7 @@ QByteArray cdbAddBreakpointCommand(const Debugger::Internal::BreakpointParameter
QByteArray
rc
;
ByteArrayInputStream
str
(
rc
);
if
(
!
bp
.
threadSpec
.
isEmpty
()
)
if
(
bp
.
threadSpec
>
0
)
str
<<
'~'
<<
bp
.
threadSpec
<<
' '
;
str
<<
(
bp
.
type
==
Debugger
::
Internal
::
Watchpoint
?
"ba"
:
"bp"
);
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
d5c5b90b
...
...
@@ -2091,7 +2091,7 @@ void GdbEngine::updateBreakpointDataFromOutput(BreakpointId id, const GdbMi &bkp
ba
=
ba
.
mid
(
1
,
ba
.
size
()
-
2
);
response
.
functionName
=
_
(
ba
);
}
else
if
(
child
.
hasName
(
"thread"
))
{
response
.
threadSpec
=
child
.
data
();
response
.
threadSpec
=
child
.
data
()
.
toInt
()
;
}
else
if
(
child
.
hasName
(
"type"
))
{
if
(
!
child
.
data
().
contains
(
"reakpoint"
))
// "breakpoint", "hw breakpoint"
response
.
type
=
Watchpoint
;
...
...
@@ -2337,12 +2337,11 @@ void GdbEngine::handleBreakThreadSpec(const GdbResponse &response)
QTC_ASSERT
(
response
.
resultClass
==
GdbResultDone
,
/**/
)
const
BreakpointId
id
=
response
.
cookie
.
toInt
();
BreakHandler
*
handler
=
breakHandler
();
handler
->
notifyBreakpointChangeOk
(
id
);
handler
->
notifyBreakpointNeedsReinsertion
(
id
);
BreakpointResponse
br
=
handler
->
response
(
id
);
br
.
threadSpec
=
handler
->
threadSpec
(
id
);
handler
->
setResponse
(
id
,
br
);
changeBreakpoint
(
id
);
// Maybe there's more to do.
handler
->
notifyBreakpointNeedsReinsertion
(
id
);
insertBreakpoint
(
id
);
}
void
GdbEngine
::
handleBreakIgnore
(
const
GdbResponse
&
response
)
...
...
@@ -2377,7 +2376,6 @@ void GdbEngine::handleBreakCondition(const GdbResponse &response)
// Can happen at invalid condition strings.
//QTC_ASSERT(response.resultClass == GdbResultDone, /**/)
const
BreakpointId
id
=
response
.
cookie
.
toInt
();
qDebug
()
<<
"CONDITION FOR"
<<
id
;
BreakHandler
*
handler
=
breakHandler
();
// We just assume it was successful. Otherwise we had to parse
// the output stream data.
...
...
@@ -2518,10 +2516,10 @@ void GdbEngine::insertBreakpoint(BreakpointId id)
}
else
if
(
m_gdbAdapter
->
isTrkAdapter
())
{
cmd
=
"-break-insert -h -f "
;
}
else
if
(
m_gdbVersion
>=
70000
)
{
QByteArray
spec
=
handler
->
threadSpec
(
id
);
int
spec
=
handler
->
threadSpec
(
id
);
cmd
=
"-break-insert "
;
if
(
!
spec
.
isEmpty
()
)
cmd
+=
"-p "
+
spec
;
if
(
spec
)
cmd
+=
"-p "
+
QByteArray
::
number
(
spec
)
;
cmd
+=
" -f "
;
}
else
if
(
m_gdbVersion
>=
60800
)
{
// Probably some earlier version would work as well.
...
...
@@ -2551,6 +2549,13 @@ void GdbEngine::changeBreakpoint(BreakpointId id)
const
BreakpointState
state2
=
handler
->
state
(
id
);
QTC_ASSERT
(
state2
==
BreakpointChangeProceeding
,
qDebug
()
<<
state2
);
if
(
data
.
threadSpec
!=
response
.
threadSpec
)
{
// The only way to change this seems to be to re-set the bp completely.
postCommand
(
"-break-delete "
+
bpnr
,
NeedsStop
|
RebuildBreakpointModel
,
CB
(
handleBreakThreadSpec
),
id
);
return
;
}
if
(
!
data
.
conditionsMatch
(
response
.
condition
))
{
postCommand
(
"condition "
+
bpnr
+
' '
+
data
.
condition
,
NeedsStop
|
RebuildBreakpointModel
,
...
...
@@ -2575,14 +2580,6 @@ void GdbEngine::changeBreakpoint(BreakpointId id)
CB
(
handleBreakEnable
),
id
);
return
;
}
if
(
data
.
threadSpec
!=
response
.
threadSpec
)
{
// The only way to change this seems to be to re-set the bp completely.
postCommand
(
"-break-delete "
+
bpnr
,
NeedsStop
|
RebuildBreakpointModel
,
CB
(
handleBreakThreadSpec
),
id
);
return
;
}
handler
->
notifyBreakpointChangeOk
(
id
);
attemptAdjustBreakpointLocation
(
id
);
}
...
...
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