Bug 10252 - -var-info-path-expression broken with python pretty-printing
Summary: -var-info-path-expression broken with python pretty-printing
Alias: None
Product: gdb
Classification: Unclassified
Component: varobj (show other bugs)
Version: unknown
: P2 normal
Target Milestone: 6.8
Assignee: Tom Tromey
: 10284 17529 (view as bug list)
Depends on: 30816
  Show dependency treegraph
Reported: 2009-06-07 22:49 UTC by Vladimir Prus
Modified: 2023-09-26 15:36 UTC (History)
9 users (show)

See Also:
Last reconfirmed: 2009-06-08 16:03:15


Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Prus 2009-06-07 22:49:19 UTC
I have a test program that basically pushed ints to a vector, and I'm getting 
this output:

~"11\t    v.push_back(10);\n"
-var-create V * v
^done,name="V",numchild="0",value="std::vector of length 0, capacity 
0",type="std::vector<int, std::allocator<int> > &",thread-id="1"
-var-list-children V
-var-update V
-var-evaluate-expression V.[0]
-var-info-path-expression V.[0]
^done,path_expr="((std::_Vector_base<int, std::allocator<int> >) v)"

I don't know what the right output from the last command might be, and whether 
it's possible to produce the right output, but saying that expression for the 
first element is 'v' is just bogus. I imagine we want to fix this by 7.0
Comment 1 Tom Tromey 2009-06-08 16:03:15 UTC
I'll handle this.
Comment 2 Tom Tromey 2009-06-15 19:26:33 UTC
*** Bug 10284 has been marked as a duplicate of this bug. ***
Comment 3 Tom Tromey 2023-08-31 19:10:25 UTC
At some point I think we declared that -var-info-path-expression
would simply not work for dynamic varobj.
However, at times it would be nice if it did, at least in
the cases where this makes sense.
This would require an extension to the pretty-printing API.
Comment 4 Tom Tromey 2023-08-31 19:11:07 UTC
*** Bug 17529 has been marked as a duplicate of this bug. ***
Comment 5 Tom Tromey 2023-09-26 15:36:06 UTC
Now that the new base class is in, the idea here is to
add a new method to ValuePrinter and have the varobj code
call it when needed.
Exactly how the method should work is TBD.