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
122f6a18
Commit
122f6a18
authored
Apr 04, 2011
by
Friedemann Kleint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugger: Add size to watch data.
Have CDB report it, pass it on to adding watches.
parent
e5f72538
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
5 deletions
+30
-5
src/libs/qtcreatorcdbext/symbolgroupnode.cpp
src/libs/qtcreatorcdbext/symbolgroupnode.cpp
+2
-1
src/plugins/debugger/debuggerconstants.h
src/plugins/debugger/debuggerconstants.h
+1
-0
src/plugins/debugger/debuggerstreamops.cpp
src/plugins/debugger/debuggerstreamops.cpp
+2
-0
src/plugins/debugger/watchdata.cpp
src/plugins/debugger/watchdata.cpp
+5
-0
src/plugins/debugger/watchdata.h
src/plugins/debugger/watchdata.h
+1
-0
src/plugins/debugger/watchhandler.cpp
src/plugins/debugger/watchhandler.cpp
+2
-0
src/plugins/debugger/watchutils.cpp
src/plugins/debugger/watchutils.cpp
+11
-0
src/plugins/debugger/watchwindow.cpp
src/plugins/debugger/watchwindow.cpp
+5
-3
src/plugins/debugger/watchwindow.h
src/plugins/debugger/watchwindow.h
+1
-1
No files found.
src/libs/qtcreatorcdbext/symbolgroupnode.cpp
View file @
122f6a18
...
...
@@ -987,7 +987,8 @@ int SymbolGroupNode::dumpNode(std::ostream &str,
if
(
addr
)
str
<<
",addr=
\"
"
<<
std
::
hex
<<
std
::
showbase
<<
addr
<<
std
::
noshowbase
<<
std
::
dec
<<
'"'
;
if
(
const
ULONG
s
=
size
())
str
<<
",size=
\"
"
<<
s
<<
'"'
;
const
bool
uninitialized
=
flags
()
&
Uninitialized
;
bool
valueEditable
=
!
uninitialized
;
bool
valueEnabled
=
!
uninitialized
;
...
...
src/plugins/debugger/debuggerconstants.h
View file @
122f6a18
...
...
@@ -220,6 +220,7 @@ enum ModelRoles
LocalsTypeFormatRole
,
// Used to communicate alternative formats to the view
LocalsIndividualFormatRole
,
LocalsAddressRole
,
// Memory address of variable as quint64
LocalsSizeRole
,
// Size of variable as quint
LocalsRawValueRole
,
// Unformatted value as string
LocalsPointerValueRole
,
// Pointer value (address) as quint64
LocalsIsWatchpointAtAddressRole
,
...
...
src/plugins/debugger/debuggerstreamops.cpp
View file @
122f6a18
...
...
@@ -225,6 +225,7 @@ QDataStream &operator<<(QDataStream &stream, const WatchData &wd)
stream
<<
wd
.
displayedType
;
stream
<<
wd
.
variable
;
stream
<<
wd
.
address
;
stream
<<
wd
.
size
;
stream
<<
wd
.
hasChildren
;
stream
<<
wd
.
generation
;
stream
<<
wd
.
valueEnabled
;
...
...
@@ -250,6 +251,7 @@ QDataStream &operator>>(QDataStream &stream, WatchData &wd)
stream
>>
wd
.
displayedType
;
stream
>>
wd
.
variable
;
stream
>>
wd
.
address
;
stream
>>
wd
.
size
;
stream
>>
wd
.
hasChildren
;
stream
>>
wd
.
generation
;
stream
>>
wd
.
valueEnabled
;
...
...
src/plugins/debugger/watchdata.cpp
View file @
122f6a18
...
...
@@ -145,6 +145,7 @@ WatchData::WatchData() :
state
(
InitialState
),
editformat
(
0
),
address
(
0
),
size
(
0
),
bitpos
(
0
),
bitsize
(
0
),
generation
(
-
1
),
...
...
@@ -170,6 +171,7 @@ bool WatchData::isEqual(const WatchData &other) const
&&
displayedType
==
other
.
displayedType
&&
variable
==
other
.
variable
&&
address
==
other
.
address
&&
size
==
other
.
size
&&
hasChildren
==
other
.
hasChildren
&&
valueEnabled
==
other
.
valueEnabled
&&
valueEditable
==
other
.
valueEditable
...
...
@@ -370,6 +372,9 @@ QString WatchData::toToolTip() const
formatToolTipRow
(
str
,
tr
(
"Value"
),
val
);
formatToolTipRow
(
str
,
tr
(
"Object Address"
),
QString
::
fromAscii
(
hexAddress
()));
if
(
size
)
formatToolTipRow
(
str
,
tr
(
"Size"
),
QString
::
number
(
size
));
formatToolTipRow
(
str
,
tr
(
"Internal ID"
),
iname
);
formatToolTipRow
(
str
,
tr
(
"Generation"
),
QString
::
number
(
generation
));
...
...
src/plugins/debugger/watchdata.h
View file @
122f6a18
...
...
@@ -128,6 +128,7 @@ public:
QByteArray
type
;
// Type for further processing
QString
displayedType
;
// Displayed type (optional)
quint64
address
;
// Displayed address
uint
size
;
// Size
uint
bitpos
;
// Position within bit fields
uint
bitsize
;
// Size in case of bit fields
qint32
generation
;
// When updated?
...
...
src/plugins/debugger/watchhandler.cpp
View file @
122f6a18
...
...
@@ -735,6 +735,8 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
case
LocalsAddressRole
:
return
data
.
coreAddress
();
case
LocalsSizeRole
:
return
QVariant
(
data
.
size
);
case
LocalsIsWatchpointAtPointerValueRole
:
if
(
isPointerType
(
data
.
type
))
{
...
...
src/plugins/debugger/watchutils.cpp
View file @
122f6a18
...
...
@@ -1349,6 +1349,16 @@ void setWatchDataAddress(WatchData &data, const GdbMi &mi)
setWatchDataAddressHelper
(
data
,
mi
.
data
());
}
void
setWatchDataSize
(
WatchData
&
data
,
const
GdbMi
&
mi
)
{
if
(
mi
.
isValid
())
{
bool
ok
=
false
;
const
unsigned
size
=
mi
.
data
().
toUInt
(
&
ok
);
if
(
ok
)
data
.
size
=
size
;
}
}
void
setWatchDataAddressHelper
(
WatchData
&
data
,
const
QByteArray
&
addr
)
{
if
(
addr
.
startsWith
(
"0x"
))
{
// Item model dumpers pull tricks
...
...
@@ -1408,6 +1418,7 @@ void parseWatchData(const QSet<QByteArray> &expandedINames,
setWatchDataValue
(
data
,
item
);
setWatchDataAddress
(
data
,
item
.
findChild
(
"addr"
));
setWatchDataSize
(
data
,
item
.
findChild
(
"size"
));
setWatchDataExpression
(
data
,
item
.
findChild
(
"exp"
));
setWatchDataValueEnabled
(
data
,
item
.
findChild
(
"valueenabled"
));
setWatchDataValueEditable
(
data
,
item
.
findChild
(
"valueeditable"
));
...
...
src/plugins/debugger/watchwindow.cpp
View file @
122f6a18
...
...
@@ -279,6 +279,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
const
QModelIndex
mi1
=
idx
.
sibling
(
idx
.
row
(),
1
);
const
QModelIndex
mi2
=
idx
.
sibling
(
idx
.
row
(),
2
);
const
quint64
address
=
mi0
.
data
(
LocalsAddressRole
).
toULongLong
();
const
uint
size
=
mi0
.
data
(
LocalsSizeRole
).
toUInt
();
const
quint64
pointerValue
=
mi0
.
data
(
LocalsPointerValueRole
).
toULongLong
();
const
QString
exp
=
mi0
.
data
(
LocalsExpressionRole
).
toString
();
const
QString
type
=
mi2
.
data
().
toString
();
...
...
@@ -513,9 +514,9 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
if
(
dialog
.
exec
()
==
QDialog
::
Accepted
)
currentEngine
()
->
openMemoryView
(
dialog
.
address
());
}
else
if
(
act
==
actSetWatchpointAtVariableAddress
)
{
setWatchpoint
(
address
);
setWatchpoint
(
address
,
size
);
}
else
if
(
act
==
actSetWatchpointAtPointerValue
)
{
setWatchpoint
(
pointerValue
);
setWatchpoint
(
pointerValue
,
1
);
}
else
if
(
act
==
actSelectWidgetToWatch
)
{
grabMouse
(
Qt
::
CrossCursor
);
m_grabbing
=
true
;
...
...
@@ -661,10 +662,11 @@ void WatchWindow::setModelData
model
()
->
setData
(
index
,
value
,
role
);
}
void
WatchWindow
::
setWatchpoint
(
quint64
address
)
void
WatchWindow
::
setWatchpoint
(
quint64
address
,
unsigned
size
)
{
BreakpointParameters
data
(
Watchpoint
);
data
.
address
=
address
;
data
.
size
=
size
;
BreakpointId
id
=
breakHandler
()
->
findWatchpoint
(
data
);
if
(
id
)
{
qDebug
()
<<
"WATCHPOINT EXISTS"
;
...
...
src/plugins/debugger/watchwindow.h
View file @
122f6a18
...
...
@@ -79,7 +79,7 @@ private:
void
editItem
(
const
QModelIndex
&
idx
);
void
resetHelper
(
const
QModelIndex
&
idx
);
void
setWatchpoint
(
quint64
address
);
void
setWatchpoint
(
quint64
address
,
unsigned
size
);
void
setModelData
(
int
role
,
const
QVariant
&
value
=
QVariant
(),
const
QModelIndex
&
index
=
QModelIndex
());
...
...
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