Bug 25153 - In mi mode and with pretty printer, variable with child shows no value when using -var-create
Summary: In mi mode and with pretty printer, variable with child shows no value when u...
Status: RESOLVED DUPLICATE of bug 11335
Alias: None
Product: gdb
Classification: Unclassified
Component: mi (show other bugs)
Version: 8.2
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-01 21:53 UTC by Pierson
Modified: 2022-05-25 18:25 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
code and pretty printer example (684 bytes, application/x-zip-compressed)
2019-11-01 21:53 UTC, Pierson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierson 2019-11-01 21:53:23 UTC
Created attachment 12061 [details]
code and pretty printer example

OS: Ubuntu 18.04
gdb version 8.2
gcc version 7.3.0

Pretty printing enabled for an object with a child object, -var-create shows a value of {...} even though gdb in normal mode ("p <object>") shows that it has a value.

With pretty printer enabled, "p d" gives 
1: (613612) ->~"$2 = \"Test\""
1: (613613) ->~" = {value1 = 1"
1: (613613) ->~", value2 = 2"
1: (613613) ->~", dc = \"Child\""
1: (613613) ->~" = {child_value1 = 9"
1: (613614) ->~", child_value2 = 8"
1: (613614) ->~"}}\n"

but -var-create - * "d" gives 
^done,name="var10",numchild="0",value="{...}",type="test::debug",thread-id="1",dynamic="1",has_more="1"

Sample .cpp and pretty printer python file are attached.

RE:https://github.com/microsoft/vscode-cpptools/issues/2792
Comment 1 Tom Tromey 2022-05-25 18:25:51 UTC
Agreed, this is a longstanding weirdness of variable objects.

*** This bug has been marked as a duplicate of bug 11335 ***