Community
Participate
Working Groups
Description: Variable view of the debugger resets and don't show any vars when exploring structure of string type variable in C++ How to Reproduce: #include <string> using namespace std; int main(int argc, char *argv[]) { string aa("foo"); return EXIT_SUCCESS; // breakpoint } * Run debugger (This is QNX Project) * Set breakpoint on return * when hit expore aa varaible ** expand protected ** expand _Bx ** expand public ** expnad _Buf View would become grey - no vars, error message displayed on console There is no member or method named _Buf. Type _Container_base has no component named _Buf. Mi Protocol looks like: [1,175,633,138,039] 1011-data-evaluate-expression aa [1,175,633,138,039] 1011^done,value="{<_String_val<char,std::allocator<char> >> = {<_String_base> = \ {<_Container_base> = {<No data fields>}, <No data fields>}, _Alval = {<_Allocator_base<char>> = {<No\ data fields>}, <No data fields>}}, static npos = 4294967295, _Bx = {_Buf = \"foo\\0\\001\\0\\0\\0\\\ 314z\\004\\b\\377\\377\\377\\377\", _Ptr = 0x6f6f66 <Error reading address 0x6f6f66: error 312>}, _M\ ysize = 3, _Myres = 15}" [1,175,633,138,039] (gdb) [1,175,633,150,498] 1012-var-create - * *(((aa)._Buf)+0)@16 [1,175,633,150,498] &"There is no member or method named _Buf.\n" [1,175,633,150,498] &"Type _Container_base has no component named _Buf.\n" [1,175,633,150,498] 1012^error,msg="." [1,175,633,150,498] (gdb) CDT 4.0 Still has this problem. I run same app as Local C++ App on Windows. Variable view does not crash but still shows wrong values: When exploring var and clicking on _M_p var it shows shole structure not single _M_p value, When clicking on *_M_p it gives an error: Target request failed: Structure has no component named operator*.. The reason is the same - MI incorrectly process situations when type is IncompleteType - which is Structure or Class from system headers usually ("string" in this case).
Created attachment 62943 [details] Debug Perspective after View resets
Created attachment 62956 [details] Patch for MI for cdt_3_1 branch Here is the patch. Probably there is some bugs in actual Variable view but I think it is better to fix data queries in this case.
Ok
Thank Elena, Patch apply to head and 3_1 branch. Dave you should put a tester to verify this for the 3_1 branh
Can you apply it on HEAD too, or it is going to merged later?
(In reply to comment #5) > Can you apply it on HEAD too, or it is going to merged later? it is apply to the head and cdt_3_1