Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
c2b77a22
Commit
c2b77a22
authored
15 years ago
by
hjk
Browse files
Options
Downloads
Patches
Plain Diff
debugger: fix evaluation of complex watchers
parent
2e721186
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
share/qtcreator/gdbmacros/dumper.py
+35
-25
35 additions, 25 deletions
share/qtcreator/gdbmacros/dumper.py
with
35 additions
and
25 deletions
share/qtcreator/gdbmacros/dumper.py
+
35
−
25
View file @
c2b77a22
...
...
@@ -676,6 +676,7 @@ class FrameCommand(gdb.Command):
# Locals
#
for
item
in
listOfLocals
(
varList
):
d
.
anonNumber
=
-
1
#warn("ITEM NAME %s: " % item.name)
try
:
#warn("ITEM VALUE %s: " % item.value)
...
...
@@ -779,19 +780,19 @@ class FrameCommand(gdb.Command):
def
handleWatch
(
self
,
d
,
exp
,
iname
):
exp
=
str
(
exp
)
#warn("HANDLING WATCH %s, INAME: '%s'" % (exp, iname))
if
exp
.
startswith
(
"
[
"
):
warn
(
"
EVAL: EXP: %s
"
%
exp
)
if
exp
.
startswith
(
"
[
"
)
and
exp
.
endswith
(
"
]
"
)
:
#
warn("EVAL: EXP: %s" % exp)
d
.
beginHash
()
d
.
put
(
'
iname=
"
%s
"
,
'
%
iname
)
d
.
put
(
'
name=
"
%s
"
,
'
%
exp
)
d
.
put
(
'
exp=
"
%s
"
,
'
%
exp
)
d
.
put
Field
(
"
iname
"
,
iname
)
d
.
put
Field
(
"
name
"
,
exp
)
d
.
put
Field
(
"
exp
"
,
exp
)
try
:
list
=
eval
(
exp
)
#warn("EVAL: LIST: %s" % list)
d
.
put
(
'
value=
"
"'
)
d
.
put
(
'
type=
"
"'
)
d
.
put
(
'
numchild=
"
%d
"'
%
len
(
list
))
d
.
putValue
(
""
)
d
.
putType
(
"
"
)
d
.
putNumChild
(
len
(
list
))
# This is a list of expressions to evaluate
d
.
beginChildren
(
len
(
list
))
itemNumber
=
0
...
...
@@ -801,28 +802,28 @@ class FrameCommand(gdb.Command):
d
.
endChildren
()
except
:
warn
(
"
EVAL: ERROR CAUGHT
"
)
d
.
put
(
'
v
alue
=
"
<syntax error>
"
'
)
d
.
put
(
'
t
ype
=
"
"
'
)
d
.
put
(
'
n
um
c
hild
=
"
0
"'
)
d
.
put
V
alue
(
"
<syntax error>
"
)
d
.
put
T
ype
(
"
"
)
d
.
put
N
um
C
hild
(
0
)
d
.
beginChildren
(
0
)
d
.
endChildren
()
d
.
endHash
()
return
d
.
beginHash
()
d
.
put
(
'
iname=
"
%s
"
,
'
%
iname
)
d
.
put
(
'
name=
"
%s
"
,
'
%
exp
)
d
.
put
(
'
exp=
"
%s
"
,
'
%
exp
)
d
.
put
Field
(
"
iname
"
,
iname
)
d
.
put
Field
(
"
name
"
,
exp
)
d
.
put
Field
(
"
exp
"
,
exp
)
handled
=
False
if
exp
==
"
<Edit>
"
:
d
.
put
(
'
value=
"
"
,type=
"
"
,numchild=
"
0
"
,
'
)
d
.
put
Value
(
'
value=
"
"
,type=
"
"
,numchild=
"
0
"
,
'
)
else
:
try
:
#
try:
value
=
parseAndEvaluate
(
exp
)
item
=
Item
(
value
,
iname
,
None
,
None
)
d
.
putItemHelper
(
item
)
except
RuntimeError
:
d
.
put
(
'
value=
"
<invalid>
"
,type=
"
<unknown>
"
,numchild=
"
0
"
,
'
)
#
except RuntimeError:
#
d.put('value="<invalid>",type="<unknown>",numchild="0",')
d
.
endHash
()
...
...
@@ -1254,6 +1255,16 @@ class Dumper:
Item
(
item
.
value
.
dereference
(),
item
.
iname
,
"
*
"
,
"
*
"
))
self
.
endChildren
()
elif
str
(
type
).
startswith
(
"
<anon
"
):
# Anonymous union. We need a dummy name to distinguish
# multiple anonymous unions in the struct.
self
.
putType
(
item
.
value
.
type
)
self
.
putValue
(
"
{...}
"
)
self
.
anonNumber
+=
1
self
.
beginChildren
(
1
)
self
.
listAnonymous
(
item
,
"
#%d
"
%
self
.
anonNumber
,
type
)
self
.
endChildren
()
else
:
#warn("GENERIC STRUCT: %s" % item.value.type)
#warn("INAME: %s " % item.iname)
...
...
@@ -1292,7 +1303,6 @@ class Dumper:
self
.
beginChildren
(
1
,
innerType
)
baseNumber
=
0
anonNumber
=
0
for
field
in
fields
:
#warn("FIELD: %s" % field)
#warn(" BITSIZE: %s" % field.bitsize)
...
...
@@ -1329,8 +1339,8 @@ class Dumper:
elif
len
(
field
.
name
)
==
0
:
# Anonymous union. We need a dummy name to distinguish
# multiple anonymous unions in the struct.
anonNumber
+=
1
self
.
listAnonymous
(
item
,
"
#%d
"
%
anonNumber
,
field
.
type
)
self
.
anonNumber
+=
1
self
.
listAnonymous
(
item
,
"
#%d
"
%
self
.
anonNumber
,
field
.
type
)
else
:
# Named field.
self
.
beginHash
()
...
...
@@ -1342,8 +1352,8 @@ class Dumper:
self
.
endChildren
()
def
listAnonymous
(
self
,
item
,
name
,
type
):
anonNumber
=
0
for
field
in
type
.
fields
():
warn
(
"
FIELD NAME: %s
"
%
field
.
name
)
if
len
(
field
.
name
)
>
0
:
value
=
item
.
value
[
field
.
name
]
child
=
Item
(
value
,
item
.
iname
,
field
.
name
,
field
.
name
)
...
...
@@ -1353,8 +1363,8 @@ class Dumper:
self
.
endHash
();
else
:
# Further nested.
anonNumber
+=
1
name
=
"
#%d
"
%
anonNumber
self
.
anonNumber
+=
1
name
=
"
#%d
"
%
self
.
anonNumber
iname
=
"
%s.%s
"
%
(
item
.
iname
,
name
)
child
=
Item
(
item
.
value
,
iname
,
None
,
name
)
self
.
beginHash
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment