| Summary: | Variable view fails to show details for base class member (next) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Francois Rigault <francois.rigault> | ||||||||
| Component: | cdt-debug-cdi-gdb | Assignee: | Elena Laskavaia <elaskavaia.cdt> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | Elena Laskavaia <elaskavaia.cdt> | ||||||||
| Severity: | major | ||||||||||
| Priority: | P3 | CC: | pawel.1.piech | ||||||||
| Version: | 5.0 | ||||||||||
| Target Milestone: | 7.0 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Francois Rigault
Created attachment 160276 [details]
Sample file with comments to reproduce the problem
Created attachment 160277 [details]
A patch that will fix the problem on the sample file
What if it is not a struct? What if it is a union? A union can't appear in the inheritance tree. The union type does not appear in the Variables view and the modified code is not triggered. I'd be happy to contribute to a test suite if one exists already. We might test some more tricky cases like inheritance with templates for example. This bug prevent memory introspection during a debugging session (no specific circumstances required), I guess it owned its major importance flag. Please tell me any test or any code you need, I'd be happy to provide them asap. I still don't think it is right patch. I don't understand statement: The union type does not appear in the Variables view and the modified code is not triggered. Union type does not but variable of this type will. I need to create more tests for it, sorry I did not have time yet to look at it. If you can contribute test it would be good. This is what happen for unions (here C is the union type and c the instance) http://i.imgur.com/zDefv.jpg Please tell me how I should contribute tests. --- above test: union U { int i; unsigned int j; }; struct S { U* u; S() {} }; int main() { S s; s.u = new U(); s.u->i = -1; /* display s.u here to see it's ok */ s.u->i = 0; } -> assigned Created attachment 164293 [details]
updated patch
finally I looked at it. So union is not a concern here because unions cannot be base classes, so struct should be ok.
I did some more testing and find out that is you declare pointer
to a class, such as
B * b; (from your example) and try to check values for base class it won't
work either. But this is unrelated to patch - it did not work before either.
I found a solution for that, see new patch attached
Hi Alena I verified your patch with previous tests and the pointer case and it works perfectly! I fixed it on trunk and 6.0 branch, however default framework now is DSF and it has same problem for base classes, but because gdb itself returns incorrect stuff... |