Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
9fc5970b
Commit
9fc5970b
authored
Nov 15, 2010
by
Friedemann Kleint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugger: Introduce BreakpointParameters as base struct.
For Breakpoint data manipulation. Reviewed-by: hjk
parent
50dc4d86
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
202 additions
and
196 deletions
+202
-196
src/plugins/debugger/breakhandler.cpp
src/plugins/debugger/breakhandler.cpp
+45
-45
src/plugins/debugger/breakpoint.cpp
src/plugins/debugger/breakpoint.cpp
+41
-37
src/plugins/debugger/breakpoint.h
src/plugins/debugger/breakpoint.h
+42
-40
src/plugins/debugger/cdb/cdbbreakpoint.cpp
src/plugins/debugger/cdb/cdbbreakpoint.cpp
+12
-12
src/plugins/debugger/debuggerplugin.cpp
src/plugins/debugger/debuggerplugin.cpp
+2
-2
src/plugins/debugger/debuggerstreamops.cpp
src/plugins/debugger/debuggerstreamops.cpp
+18
-18
src/plugins/debugger/gdb/gdbengine.cpp
src/plugins/debugger/gdb/gdbengine.cpp
+33
-33
src/plugins/debugger/pdb/pdbengine.cpp
src/plugins/debugger/pdb/pdbengine.cpp
+3
-3
src/plugins/debugger/qml/qmlengine.cpp
src/plugins/debugger/qml/qmlengine.cpp
+3
-3
src/plugins/debugger/script/scriptengine.cpp
src/plugins/debugger/script/scriptengine.cpp
+3
-3
No files found.
src/plugins/debugger/breakhandler.cpp
View file @
9fc5970b
...
...
@@ -97,26 +97,26 @@ static bool isSimilarTo(const BreakpointData &data, const BreakpointResponse &ne
{
// Clear hit.
// Clear miss.
if
(
needle
.
bpT
ype
!=
UnknownType
&&
data
.
type
()
!=
UnknownType
&&
data
.
type
()
!=
needle
.
bpT
ype
)
if
(
needle
.
t
ype
!=
UnknownType
&&
data
.
type
()
!=
UnknownType
&&
data
.
type
()
!=
needle
.
t
ype
)
return
false
;
// Clear hit.
if
(
data
.
address
()
&&
data
.
address
()
==
needle
.
bpA
ddress
)
if
(
data
.
address
()
&&
data
.
address
()
==
needle
.
a
ddress
)
return
true
;
// At least at a position we were looking for.
// FIXME: breaks multiple breakpoints at the same location
if
(
!
data
.
fileName
().
isEmpty
()
&&
fileNameMatch
(
data
.
fileName
(),
needle
.
bpF
ileName
)
&&
data
.
lineNumber
()
==
needle
.
bpL
ineNumber
)
&&
fileNameMatch
(
data
.
fileName
(),
needle
.
f
ileName
)
&&
data
.
lineNumber
()
==
needle
.
l
ineNumber
)
return
true
;
// At least at a position we were looking for.
// FIXME: breaks multiple breakpoints at the same location
if
(
!
data
.
fileName
().
isEmpty
()
&&
fileNameMatch
(
data
.
fileName
(),
needle
.
bpF
ileName
)
&&
data
.
lineNumber
()
==
needle
.
bpL
ineNumber
)
&&
fileNameMatch
(
data
.
fileName
(),
needle
.
f
ileName
)
&&
data
.
lineNumber
()
==
needle
.
l
ineNumber
)
return
true
;
return
false
;
...
...
@@ -131,7 +131,7 @@ BreakpointId BreakHandler::findSimilarBreakpoint(const BreakpointResponse &needl
const
BreakpointData
&
data
=
it
->
data
;
const
BreakpointResponse
&
response
=
it
->
response
;
qDebug
()
<<
"COMPARING "
<<
data
.
toString
()
<<
" WITH "
<<
needle
.
toString
();
if
(
response
.
bpN
umber
&&
response
.
bpN
umber
==
needle
.
bpN
umber
)
if
(
response
.
n
umber
&&
response
.
n
umber
==
needle
.
n
umber
)
return
id
;
if
(
isSimilarTo
(
data
,
needle
))
...
...
@@ -144,7 +144,7 @@ BreakpointId BreakHandler::findBreakpointByNumber(int bpNumber) const
{
ConstIterator
it
=
m_storage
.
constBegin
(),
et
=
m_storage
.
constEnd
();
for
(
;
it
!=
et
;
++
it
)
if
(
it
->
response
.
bpN
umber
==
bpNumber
)
if
(
it
->
response
.
n
umber
==
bpNumber
)
return
it
.
key
();
return
BreakpointId
(
-
1
);
}
...
...
@@ -377,7 +377,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
case
0
:
if
(
role
==
Qt
::
DisplayRole
)
{
return
QString
::
number
(
id
);
//return QString("%1 - %2").arg(id).arg(response.
bpN
umber);
//return QString("%1 - %2").arg(id).arg(response.
n
umber);
}
if
(
role
==
Qt
::
DecorationRole
)
{
if
(
data
.
isWatchpoint
())
...
...
@@ -390,14 +390,14 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
case
1
:
if
(
role
==
Qt
::
DisplayRole
)
{
const
QString
str
=
it
->
isPending
()
?
data
.
functionName
()
:
response
.
bpFunc
Name
;
?
data
.
functionName
()
:
response
.
function
Name
;
return
str
.
isEmpty
()
?
empty
:
str
;
}
break
;
case
2
:
if
(
role
==
Qt
::
DisplayRole
)
{
QString
str
=
it
->
isPending
()
?
data
.
fileName
()
:
response
.
bpF
ileName
;
?
data
.
fileName
()
:
response
.
f
ileName
;
str
=
QFileInfo
(
str
).
fileName
();
// FIXME: better?
//if (data.bpMultiple && str.isEmpty() && !data.markerFileName.isEmpty())
...
...
@@ -414,7 +414,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
//if (data.bpMultiple && str.isEmpty() && !data.markerFileName.isEmpty())
// str = data.markerLineNumber;
const
int
nr
=
it
->
isPending
()
?
data
.
lineNumber
()
:
response
.
bpL
ineNumber
;
?
data
.
lineNumber
()
:
response
.
l
ineNumber
;
return
nr
?
QString
::
number
(
nr
)
:
empty
;
}
if
(
role
==
Qt
::
UserRole
+
1
)
...
...
@@ -422,7 +422,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
break
;
case
4
:
if
(
role
==
Qt
::
DisplayRole
)
return
it
->
isPending
()
?
data
.
condition
()
:
response
.
bpC
ondition
;
return
it
->
isPending
()
?
data
.
condition
()
:
response
.
c
ondition
;
if
(
role
==
Qt
::
ToolTipRole
)
return
tr
(
"Breakpoint will only be hit if this condition is met."
);
if
(
role
==
Qt
::
UserRole
+
1
)
...
...
@@ -431,7 +431,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
case
5
:
if
(
role
==
Qt
::
DisplayRole
)
{
const
int
ignoreCount
=
it
->
isPending
()
?
data
.
ignoreCount
()
:
response
.
bpI
gnoreCount
;
it
->
isPending
()
?
data
.
ignoreCount
()
:
response
.
i
gnoreCount
;
return
ignoreCount
?
QVariant
(
ignoreCount
)
:
QVariant
(
QString
());
}
if
(
role
==
Qt
::
ToolTipRole
)
...
...
@@ -444,7 +444,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
if
(
it
->
isPending
())
return
!
data
.
threadSpec
().
isEmpty
()
?
data
.
threadSpec
()
:
tr
(
"(all)"
);
else
return
!
response
.
bpT
hreadSpec
.
isEmpty
()
?
response
.
bpT
hreadSpec
:
tr
(
"(all)"
);
return
!
response
.
t
hreadSpec
.
isEmpty
()
?
response
.
t
hreadSpec
:
tr
(
"(all)"
);
}
if
(
role
==
Qt
::
ToolTipRole
)
return
tr
(
"Breakpoint will only be hit in the specified thread(s)."
);
...
...
@@ -455,13 +455,13 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
if
(
role
==
Qt
::
DisplayRole
)
{
QString
displayValue
;
const
quint64
address
=
data
.
isWatchpoint
()
?
data
.
address
()
:
response
.
bpA
ddress
;
data
.
isWatchpoint
()
?
data
.
address
()
:
response
.
a
ddress
;
if
(
address
)
displayValue
+=
QString
::
fromAscii
(
"0x%1"
).
arg
(
address
,
0
,
16
);
if
(
!
response
.
bpS
tate
.
isEmpty
())
{
if
(
!
response
.
s
tate
.
isEmpty
())
{
if
(
!
displayValue
.
isEmpty
())
displayValue
+=
QLatin1Char
(
' '
);
displayValue
+=
QString
::
fromAscii
(
response
.
bpS
tate
);
displayValue
+=
QString
::
fromAscii
(
response
.
s
tate
);
}
return
displayValue
;
}
...
...
@@ -516,7 +516,7 @@ PROPERTY(int, ignoreCount, setIgnoreCount)
bool
BreakHandler
::
isEnabled
(
BreakpointId
id
)
const
{
ConstIterator
it
=
m_storage
.
find
(
id
);
QTC_ASSERT
(
it
!=
m_storage
.
end
(),
return
BreakpointDead
);
QTC_ASSERT
(
it
!=
m_storage
.
end
(),
return
false
);
return
it
->
data
.
isEnabled
();
}
...
...
@@ -576,7 +576,7 @@ void BreakHandler::ackCondition(BreakpointId id)
{
Iterator
it
=
m_storage
.
find
(
id
);
QTC_ASSERT
(
it
!=
m_storage
.
end
(),
return
);
it
->
response
.
bpC
ondition
=
it
->
data
.
condition
();
it
->
response
.
c
ondition
=
it
->
data
.
condition
();
updateMarker
(
id
);
}
...
...
@@ -584,7 +584,7 @@ void BreakHandler::ackIgnoreCount(BreakpointId id)
{
Iterator
it
=
m_storage
.
find
(
id
);
QTC_ASSERT
(
it
!=
m_storage
.
end
(),
return
);
it
->
response
.
bpI
gnoreCount
=
it
->
data
.
ignoreCount
();
it
->
response
.
i
gnoreCount
=
it
->
data
.
ignoreCount
();
updateMarker
(
id
);
}
...
...
@@ -592,7 +592,7 @@ void BreakHandler::ackEnabled(BreakpointId id)
{
Iterator
it
=
m_storage
.
find
(
id
);
QTC_ASSERT
(
it
!=
m_storage
.
end
(),
return
);
it
->
response
.
bpE
nabled
=
it
->
data
.
isEnabled
();
it
->
response
.
e
nabled
=
it
->
data
.
isEnabled
();
updateMarker
(
id
);
}
...
...
@@ -751,7 +751,7 @@ void BreakHandler::updateLineNumberFromMarker(BreakpointId id, int lineNumber)
// running, as this can be triggered by moving the breakpoint to
// the next line that generated code.
// FIXME: Do we need yet another data member?
if
(
it
->
response
.
bpN
umber
==
0
)
{
if
(
it
->
response
.
n
umber
==
0
)
{
it
->
data
.
setLineNumber
(
lineNumber
);
updateMarker
(
id
);
}
...
...
@@ -925,36 +925,36 @@ QString BreakHandler::BreakpointItem::toToolTip() const
<<
"<tr><td>"
<<
tr
(
"Marker Line:"
)
<<
"</td><td>"
<<
data
.
m_markerLineNumber
<<
"</td></tr>"
<<
"<tr><td>"
<<
tr
(
"Breakpoint Number:"
)
<<
"</td><td>"
<<
response
.
bpN
umber
<<
"</td></tr>"
<<
"</td><td>"
<<
response
.
n
umber
<<
"</td></tr>"
<<
"<tr><td>"
<<
tr
(
"Breakpoint Type:"
)
<<
"</td><td>"
<<
t
<<
"</td></tr>"
<<
"<tr><td>"
<<
tr
(
"State:"
)
<<
"</td><td>"
<<
response
.
bpS
tate
<<
"</td></tr>"
<<
"</td><td>"
<<
response
.
s
tate
<<
"</td></tr>"
<<
"</table><br><hr><table>"
<<
"<tr><th>"
<<
tr
(
"Property"
)
<<
"</th><th>"
<<
tr
(
"Requested"
)
<<
"</th><th>"
<<
tr
(
"Obtained"
)
<<
"</th></tr>"
<<
"<tr><td>"
<<
tr
(
"Internal Number:"
)
<<
"</td><td>—</td><td>"
<<
response
.
bpN
umber
<<
"</td></tr>"
<<
"</td><td>—</td><td>"
<<
response
.
n
umber
<<
"</td></tr>"
<<
"<tr><td>"
<<
tr
(
"File Name:"
)
<<
"</td><td>"
<<
QDir
::
toNativeSeparators
(
data
.
m_
fileName
)
<<
"</td><td>"
<<
QDir
::
toNativeSeparators
(
response
.
bpF
ileName
)
<<
"</td><td>"
<<
QDir
::
toNativeSeparators
(
data
.
fileName
()
)
<<
"</td><td>"
<<
QDir
::
toNativeSeparators
(
response
.
f
ileName
)
<<
"</td></tr>"
<<
"<tr><td>"
<<
tr
(
"Function Name:"
)
<<
"</td><td>"
<<
data
.
m_
functionName
<<
"</td><td>"
<<
response
.
bpFunc
Name
<<
"</td></tr>"
<<
"</td><td>"
<<
data
.
functionName
()
<<
"</td><td>"
<<
response
.
function
Name
<<
"</td></tr>"
<<
"<tr><td>"
<<
tr
(
"Line Number:"
)
<<
"</td><td>"
;
if
(
data
.
m_
lineNumber
)
str
<<
data
.
m_
lineNumber
;
if
(
data
.
lineNumber
()
)
str
<<
data
.
lineNumber
()
;
str
<<
"</td><td>"
;
if
(
response
.
bpL
ineNumber
)
str
<<
response
.
bpL
ineNumber
;
if
(
response
.
l
ineNumber
)
str
<<
response
.
l
ineNumber
;
str
<<
"</td></tr>"
<<
"<tr><td>"
<<
tr
(
"Breakpoint Address:"
)
<<
"</td><td>"
;
formatAddress
(
str
,
data
.
m_
address
);
formatAddress
(
str
,
data
.
address
()
);
str
<<
"</td><td>"
;
formatAddress
(
str
,
response
.
bpA
ddress
);
formatAddress
(
str
,
response
.
a
ddress
);
//str << "</td></tr>"
// << "<tr><td>" << tr("Corrected Line Number:")
// << "</td><td>-</td><td>";
...
...
@@ -964,18 +964,18 @@ QString BreakHandler::BreakpointItem::toToolTip() const
// str << '-';
str
<<
"</td></tr>"
<<
"<tr><td>"
<<
tr
(
"Condition:"
)
<<
"</td><td>"
<<
data
.
m_
condition
<<
"</td><td>"
<<
response
.
bpC
ondition
<<
"</td></tr>"
<<
"</td><td>"
<<
data
.
condition
()
<<
"</td><td>"
<<
response
.
c
ondition
<<
"</td></tr>"
<<
"<tr><td>"
<<
tr
(
"Ignore Count:"
)
<<
"</td><td>"
;
if
(
data
.
m_
ignoreCount
)
str
<<
data
.
m_
ignoreCount
;
if
(
data
.
ignoreCount
()
)
str
<<
data
.
ignoreCount
()
;
str
<<
"</td><td>"
;
if
(
response
.
bpI
gnoreCount
)
str
<<
response
.
bpI
gnoreCount
;
if
(
response
.
i
gnoreCount
)
str
<<
response
.
i
gnoreCount
;
str
<<
"</td></tr>"
<<
"<tr><td>"
<<
tr
(
"Thread Specification:"
)
<<
"</td><td>"
<<
data
.
m_
threadSpec
<<
"</td><td>"
<<
response
.
bpT
hreadSpec
<<
"</td></tr>"
<<
"</td><td>"
<<
data
.
threadSpec
()
<<
"</td><td>"
<<
response
.
t
hreadSpec
<<
"</td></tr>"
<<
"</table></body></html>"
;
return
rc
;
}
...
...
src/plugins/debugger/breakpoint.cpp
View file @
9fc5970b
...
...
@@ -44,32 +44,36 @@ namespace Internal {
const
char
*
BreakpointData
::
throwFunction
=
"throw"
;
const
char
*
BreakpointData
::
catchFunction
=
"catch"
;
BreakpointData
::
BreakpointData
(
BreakpointType
type
)
BreakpointParameters
::
BreakpointParameters
(
BreakpointType
t
)
:
type
(
t
),
enabled
(
type
),
useFullPath
(
false
),
ignoreCount
(
0
),
lineNumber
(
0
)
{
m_type
=
type
;
m_enabled
=
true
;
m_ignoreCount
=
0
;
m_lineNumber
=
0
;
m_address
=
0
;
m_useFullPath
=
false
;
m_markerLineNumber
=
0
;
}
BreakpointResponse
::
BreakpointResponse
()
bool
BreakpointParameters
::
equals
(
const
BreakpointParameters
&
rhs
)
const
{
return
type
!=
rhs
.
type
&&
enabled
==
rhs
.
enabled
&&
useFullPath
==
rhs
.
useFullPath
&&
fileName
==
rhs
.
fileName
&&
condition
==
rhs
.
condition
&&
ignoreCount
==
rhs
.
ignoreCount
&&
lineNumber
==
rhs
.
lineNumber
&&
address
==
rhs
.
address
&&
threadSpec
==
rhs
.
threadSpec
&&
functionName
==
rhs
.
functionName
;
}
BreakpointData
::
BreakpointData
(
BreakpointType
type
)
:
m_parameters
(
type
),
m_markerLineNumber
(
0
)
{
}
BreakpointResponse
::
BreakpointResponse
()
:
number
(
0
),
multiple
(
false
)
{
bpNumber
=
0
;
bpIgnoreCount
=
0
;
bpLineNumber
=
0
;
//bpCorrectedLineNumber = 0;
bpAddress
=
0
;
bpMultiple
=
false
;
bpEnabled
=
true
;
}
#define SETIT(var, value) return (var != value) && (var = value, true)
bool
BreakpointData
::
setUseFullPath
(
bool
on
)
{
SETIT
(
m_useFullPath
,
on
);
}
{
SETIT
(
m_
parameters
.
useFullPath
,
on
);
}
bool
BreakpointData
::
setMarkerFileName
(
const
QString
&
file
)
{
SETIT
(
m_markerFileName
,
file
);
}
...
...
@@ -78,31 +82,31 @@ bool BreakpointData::setMarkerLineNumber(int line)
{
SETIT
(
m_markerLineNumber
,
line
);
}
bool
BreakpointData
::
setFileName
(
const
QString
&
file
)
{
SETIT
(
m_fileName
,
file
);
}
{
SETIT
(
m_
parameters
.
fileName
,
file
);
}
bool
BreakpointData
::
setEnabled
(
bool
on
)
{
SETIT
(
m_enabled
,
on
);
}
{
SETIT
(
m_
parameters
.
enabled
,
on
);
}
bool
BreakpointData
::
setIgnoreCount
(
int
count
)
{
SETIT
(
m_ignoreCount
,
count
);
}
{
SETIT
(
m_
parameters
.
ignoreCount
,
count
);
}
bool
BreakpointData
::
setFunctionName
(
const
QString
&
name
)
{
SETIT
(
m_functionName
,
name
);
}
{
SETIT
(
m_
parameters
.
functionName
,
name
);
}
bool
BreakpointData
::
setLineNumber
(
int
line
)
{
SETIT
(
m_lineNumber
,
line
);
}
{
SETIT
(
m_
parameters
.
lineNumber
,
line
);
}
bool
BreakpointData
::
setAddress
(
quint64
address
)
{
SETIT
(
m_address
,
address
);
}
{
SETIT
(
m_
parameters
.
address
,
address
);
}
bool
BreakpointData
::
setThreadSpec
(
const
QByteArray
&
spec
)
{
SETIT
(
m_threadSpec
,
spec
);
}
{
SETIT
(
m_
parameters
.
threadSpec
,
spec
);
}
bool
BreakpointData
::
setType
(
BreakpointType
type
)
{
SETIT
(
m_type
,
type
);
}
{
SETIT
(
m_
parameters
.
type
,
type
);
}
bool
BreakpointData
::
setCondition
(
const
QByteArray
&
cond
)
{
SETIT
(
m_condition
,
cond
);
}
{
SETIT
(
m_
parameters
.
condition
,
cond
);
}
#undef SETIT
...
...
@@ -120,14 +124,14 @@ static inline bool fileNameMatch(const QString &f1, const QString &f2)
bool
BreakpointData
::
isLocatedAt
(
const
QString
&
fileName
,
int
lineNumber
,
bool
useMarkerPosition
)
const
{
int
line
=
useMarkerPosition
?
m_markerLineNumber
:
m_lineNumber
;
int
line
=
useMarkerPosition
?
m_markerLineNumber
:
m_
parameters
.
lineNumber
;
return
lineNumber
==
line
&&
fileNameMatch
(
fileName
,
m_markerFileName
);
}
bool
BreakpointData
::
conditionsMatch
(
const
QByteArray
&
other
)
const
{
// Some versions of gdb "beautify" the passed condition.
QByteArray
s1
=
m_condition
;
QByteArray
s1
=
m_
parameters
.
condition
;
s1
.
replace
(
' '
,
""
);
QByteArray
s2
=
other
;
s2
.
replace
(
' '
,
""
);
...
...
@@ -152,15 +156,15 @@ QString BreakpointResponse::toString() const
{
QString
result
;
QTextStream
ts
(
&
result
);
ts
<<
bpN
umber
;
ts
<<
bpC
ondition
;
ts
<<
bpI
gnoreCount
;
ts
<<
bpF
ileName
;
ts
<<
bpF
ullName
;
ts
<<
bpL
ineNumber
;
ts
<<
bpT
hreadSpec
;
ts
<<
bpFunc
Name
;
ts
<<
bpA
ddress
;
ts
<<
n
umber
;
ts
<<
c
ondition
;
ts
<<
i
gnoreCount
;
ts
<<
f
ileName
;
ts
<<
f
ullName
;
ts
<<
l
ineNumber
;
ts
<<
t
hreadSpec
;
ts
<<
function
Name
;
ts
<<
a
ddress
;
return
result
;
}
...
...
src/plugins/debugger/breakpoint.h
View file @
9fc5970b
...
...
@@ -81,6 +81,28 @@ enum BreakpointState
BreakpointDead
,
};
class
BreakpointParameters
{
public:
explicit
BreakpointParameters
(
BreakpointType
=
UnknownType
);
bool
equals
(
const
BreakpointParameters
&
rhs
)
const
;
BreakpointType
type
;
// Type of breakpoint.
bool
enabled
;
// Should we talk to the debugger engine?
bool
useFullPath
;
// Should we use the full path when setting the bp?
QString
fileName
;
// Short name of source file.
QByteArray
condition
;
// Condition associated with breakpoint.
int
ignoreCount
;
// Ignore count associated with breakpoint.
int
lineNumber
;
// Line in source file.
quint64
address
;
// Address for watchpoints.
QByteArray
threadSpec
;
// Thread specification.
QString
functionName
;
};
inline
bool
operator
==
(
const
BreakpointParameters
&
p1
,
const
BreakpointParameters
&
p2
)
{
return
p1
.
equals
(
p2
);
}
inline
bool
operator
!=
(
const
BreakpointParameters
&
p1
,
const
BreakpointParameters
&
p2
)
{
return
!
p1
.
equals
(
p2
);
}
class
BreakpointData
{
private:
...
...
@@ -92,26 +114,27 @@ private:
public:
explicit
BreakpointData
(
BreakpointType
=
UnknownType
);
BreakpointType
type
()
const
{
return
m_type
;
}
quint64
address
()
const
{
return
m_address
;
}
bool
useFullPath
()
const
{
return
m_useFullPath
;
}
BreakpointType
type
()
const
{
return
m_
parameters
.
type
;
}
quint64
address
()
const
{
return
m_
parameters
.
address
;
}
bool
useFullPath
()
const
{
return
m_
parameters
.
useFullPath
;
}
QString
toString
()
const
;
bool
isLocatedAt
(
const
QString
&
fileName
,
int
lineNumber
,
bool
useMarkerPosition
)
const
;
bool
conditionsMatch
(
const
QByteArray
&
other
)
const
;
QString
functionName
()
const
{
return
m_functionName
;
}
QString
functionName
()
const
{
return
m_
parameters
.
functionName
;
}
QString
markerFileName
()
const
{
return
m_markerFileName
;
}
QString
fileName
()
const
{
return
m_fileName
;
}
QString
fileName
()
const
{
return
m_
parameters
.
fileName
;
}
int
markerLineNumber
()
const
{
return
m_markerLineNumber
;
}
int
lineNumber
()
const
{
return
m_lineNumber
;
}
int
ignoreCount
()
const
{
return
m_ignoreCount
;
}
bool
isEnabled
()
const
{
return
m_enabled
;
}
QByteArray
threadSpec
()
const
{
return
m_threadSpec
;
}
QByteArray
condition
()
const
{
return
m_condition
;
}
bool
isWatchpoint
()
const
{
return
m_type
==
Watchpoint
;
}
bool
isBreakpoint
()
const
{
return
m_type
!=
Watchpoint
;
}
// Enough for now.
int
lineNumber
()
const
{
return
m_parameters
.
lineNumber
;
}
int
ignoreCount
()
const
{
return
m_parameters
.
ignoreCount
;
}
bool
isEnabled
()
const
{
return
m_parameters
.
enabled
;
}
QByteArray
threadSpec
()
const
{
return
m_parameters
.
threadSpec
;
}
QByteArray
condition
()
const
{
return
m_parameters
.
condition
;
}
const
BreakpointParameters
&
parameters
()
const
{
return
m_parameters
;
}
bool
isWatchpoint
()
const
{
return
type
()
==
Watchpoint
;
}
bool
isBreakpoint
()
const
{
return
type
()
!=
Watchpoint
;
}
// Enough for now.
// Generic name for function to break on 'throw'
static
const
char
*
throwFunction
;
static
const
char
*
catchFunction
;
...
...
@@ -133,18 +156,7 @@ private:
private:
// This "user requested information" will get stored in the session.
BreakpointType
m_type
;
// Type of breakpoint.
bool
m_enabled
;
// Should we talk to the debugger engine?
bool
m_useFullPath
;
// Should we use the full path when setting the bp?
QString
m_fileName
;
// Short name of source file.
QByteArray
m_condition
;
// Condition associated with breakpoint.
int
m_ignoreCount
;
// Ignore count associated with breakpoint.
int
m_lineNumber
;
// Line in source file.
quint64
m_address
;
// Address for watchpoints.
QByteArray
m_threadSpec
;
// Thread specification.
// Name of containing function, special values:
// BreakpointData::throwFunction, BreakpointData::catchFunction
QString
m_functionName
;
BreakpointParameters
m_parameters
;
QString
m_markerFileName
;
// Used to locate the marker.
int
m_markerLineNumber
;
...
...
@@ -154,27 +166,17 @@ public:
// This is what debuggers produced in response to the attempt to
// insert a breakpoint. The data might differ from the requested bits.
class
BreakpointResponse
class
BreakpointResponse
:
public
BreakpointParameters
{
public:
BreakpointResponse
();
QString
toString
()
const
;
public:
int
bpNumber
;
// Breakpoint number assigned by the debugger engine.
BreakpointType
bpType
;
// Breakpoint type used by debugger engine.
QByteArray
bpCondition
;
// Condition acknowledged by the debugger engine.
int
bpIgnoreCount
;
// Ignore count acknowledged by the debugger engine.
QString
bpFileName
;
// File name acknowledged by the debugger engine.
QString
bpFullName
;
// Full file name acknowledged by the debugger engine.
int
bpLineNumber
;
// Line number acknowledged by the debugger engine.
//int bpCorrectedLineNumber; // Acknowledged by the debugger engine.
QByteArray
bpThreadSpec
;
// Thread spec acknowledged by the debugger engine.
QString
bpFuncName
;
// Function name acknowledged by the debugger engine.
quint64
bpAddress
;
// Address acknowledged by the debugger engine.
bool
bpMultiple
;
// Happens in constructors/gdb.
bool
bpEnabled
;
// Enable/disable command sent.
QByteArray
bpState
;
// gdb: <PENDING>, <MULTIPLE>
int
number
;
// Breakpoint number assigned by the debugger engine.
QString
fullName
;
// Full file name acknowledged by the debugger engine.
bool
multiple
;
// Happens in constructors/gdb.
QByteArray
state
;
// gdb: <PENDING>, <MULTIPLE>
};
typedef
QList
<
BreakpointId
>
BreakpointIds
;
...
...
src/plugins/debugger/cdb/cdbbreakpoint.cpp
View file @
9fc5970b
...
...
@@ -71,16 +71,16 @@ static inline QString msgCannotSetBreakAtFunction(const QString &func, const QSt
void
setBreakpointResponse
(
const
BreakpointData
*
nbd
,
int
number
,
BreakpointResponse
*
response
)
{
response
->
bpA
ddress
=
nbd
->
address
();
response
->
bpN
umber
=
number
;
response
->
bpFunc
Name
=
nbd
->
functionName
();
response
->
bpT
ype
=
nbd
->
type
();
response
->
bpC
ondition
=
nbd
->
condition
();
response
->
bpI
gnoreCount
=
nbd
->
ignoreCount
();
response
->
bpF
ullName
=
response
->
bpF
ileName
=
nbd
->
fileName
();
response
->
bpL
ineNumber
=
nbd
->
lineNumber
();
response
->
bpT
hreadSpec
=
nbd
->
threadSpec
();
response
->
bpE
nabled
=
nbd
->
isEnabled
();
response
->
a
ddress
=
nbd
->
address
();
response
->
n
umber
=
number
;
response
->
function
Name
=
nbd
->
functionName
();
response
->
t
ype
=
nbd
->
type
();
response
->
c
ondition
=
nbd
->
condition
();
response
->
i
gnoreCount
=
nbd
->
ignoreCount
();
response
->
f
ullName
=
response
->
f
ileName
=
nbd
->
fileName
();
response
->
l
ineNumber
=
nbd
->
lineNumber
();
response
->
t
hreadSpec
=
nbd
->
threadSpec
();
response
->
e
nabled
=
nbd
->
isEnabled
();
}
bool
addCdbBreakpoint
(
CIDebugControl
*
debugControl
,
...
...
@@ -116,8 +116,8 @@ bool addCdbBreakpoint(CIDebugControl* debugControl,
if
(
debugBreakpoints
)
qDebug
(
"Added %lu at 0x%lx %s"
,
id
,
address
,
qPrintable
(
ncdbbp
.
toString
()));
setBreakpointResponse
(
nbd
,
id
,
response
);
response
->
bpA
ddress
=
address
;
response
->
bpFunc
Name
=
resolvedFunction
;
response
->
a
ddress
=
address
;
response
->
function
Name
=
resolvedFunction
;
return
true
;
}
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
9fc5970b
...
...
@@ -2293,8 +2293,8 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditor::ITextEditor *editor,
QString
line
=
editor
->
contents
()
.
section
(
'\n'
,
lineNumber
-
1
,
lineNumber
-
1
);
BreakpointResponse
needle
;
needle
.
bpA
ddress
=
DisassemblerViewAgent
::
addressFromDisassemblyLine
(
line
);
needle
.
bpL
ineNumber
=
-
1
;
needle
.
a
ddress
=
DisassemblerViewAgent
::
addressFromDisassemblyLine
(
line
);
needle
.
l
ineNumber
=
-
1
;
id
=
breakHandler
()
->
findSimilarBreakpoint
(
needle
);
}
else
{
fileName
=
editor
->
file
()
->
fileName
();
...
...
src/plugins/debugger/debuggerstreamops.cpp
View file @
9fc5970b
...
...
@@ -136,31 +136,31 @@ QDataStream &operator>>(QDataStream &stream, StackFrames &frames)
QDataStream
&
operator
<<
(
QDataStream
&
stream
,
const
BreakpointResponse
&
s
)
{
stream
<<
s
.
bpN
umber
;
stream
<<
s
.
bpC
ondition
;
stream
<<
s
.
bpI
gnoreCount
;
stream
<<
s
.
bpF
ileName
;
stream
<<
s
.
bpF
ullName
;
stream
<<
s
.
bpL
ineNumber
;
stream
<<
s
.
n
umber
;
stream
<<
s
.
c
ondition
;
stream
<<
s
.
i
gnoreCount
;
stream
<<
s
.
f
ileName
;
stream
<<
s
.
f
ullName
;
stream
<<
s
.
l
ineNumber
;
//stream << s.bpCorrectedLineNumber;
stream
<<
s
.
bpT
hreadSpec
;
stream
<<
s
.
bpFunc
Name
;
stream
<<
s
.
bpA
ddress
;
stream
<<
s
.
t
hreadSpec
;
stream
<<
s
.
function
Name
;
stream
<<
s
.
a
ddress
;
return
stream
;
}
QDataStream
&
operator
>>
(
QDataStream
&
stream
,
BreakpointResponse
&
s
)
{
stream
>>
s
.
bpN
umber
;
stream
>>
s
.
bpC
ondition
;
stream
>>
s
.
bpI
gnoreCount
;
stream
>>
s
.
bpF
ileName
;
stream
>>
s
.
bpF
ullName
;
stream
>>
s
.
bpL
ineNumber
;
stream
>>
s
.
n
umber
;
stream
>>
s
.
c
ondition
;
stream
>>
s
.
i
gnoreCount
;
stream
>>
s
.
f
ileName
;