Bug 10615

Summary: Nested structs don't get updated in MI
Product: gdb Reporter: Noam Yorav-Raphael <noamraph>
Component: miAssignee: Tom Tromey <tromey>
Status: RESOLVED FIXED    
Severity: normal CC: gdb-prs, tromey
Priority: P2    
Version: archer   
Target Milestone: 6.8   
Host: Target:
Build: Last reconfirmed:
Attachments: File needed to recreate the bug
File needed to recreate the bug

Description Noam Yorav-Raphael 2009-09-08 07:33:04 UTC
Hello,

Thankfully, Tom fixed bug 10584. However, it seems that members of structs which
are members of pretty-printed variables still don't get updated.

To recreate:

Download bug.c, bug.py.
> gcc -g -o bug bug.c
> gdb --int mi2 --nx bug
> -enable-pretty-printing
> python execfile('bug.py')
> b main
> r
# Initialize m to {{0},0}
> n
# Do what a standard UI is expected to do to print the m variable
# Its structure is: { {int a; int b;} s; int x; }
> -var-create m * m
> -var-list-children m
> -var-evaluate-expression m.s
> -var-list-children m.s
> -var-evaluate-expression m.s.a
> -var-evaluate-expression m.s.b
> -var-evaluate-expression m.x
# Modify m.s.a
> n
# Check if something was updated
> -var-update *
^done,changelist=[]
# Oops.

Thanks,
Noam
Comment 1 Noam Yorav-Raphael 2009-09-08 07:33:44 UTC
Created attachment 4178 [details]
File needed to recreate the bug
Comment 2 Noam Yorav-Raphael 2009-09-08 07:34:03 UTC
Created attachment 4179 [details]
File needed to recreate the bug
Comment 3 Tom Tromey 2009-09-09 16:08:05 UTC
Thanks for the report & the simple test case.
I've checked in a regression test and a fix.