com.commandF(&resultData, "-var-create %s @ %s", stringToCStr(watchId), stringToCStr(varName)); com.commandF(&resultData, "-data-evaluate-expression %s", stringToCStr(expr)); com.commandF(&resultData, "-var-update --all-values *"); com.commandF(&resultData, "-var-list-children --simple-values %s", stringToCStr(watchId)); com.commandF(&resultData, "-var-delete %s", stringToCStr(watchId)); com.commandF(&resultData, "-var-info-path-expression %s", stringToCStr(w.getWatchId())); com.commandF(&resultData, "-data-evaluate-expression &(%s)", stringToCStr(expr)); The following is the complete set of GDB/MI operations defined to access this functionality: Operation Description -enable-pretty-printing enable Python-based pretty-printing (VERY Important to print std::string and other structures!!!). -var-create create a variable object -var-delete delete the variable object and/or its children -var-set-format set the display format of this variable -var-show-format show the display format of this variable -var-info-num-children tells how many children this object has -var-list-children return a list of the object’s children -var-info-type show the type of this variable object -var-info-expression print parent-relative expression that this variable object represents -var-info-path-expression print full expression that this variable object represents -var-show-attributes is this variable editable? does it exist here? -var-evaluate-expression get the value of this variable -var-assign set the value of this variable -var-update update the variable and its children -var-set-frozen set frozeness attribute -var-set-update-range set range of children to display on update "-data-evaluate-expression %s" "-data-add-expression %s" "-data-delete-expression id1 id2 ..." "-data-list-expressions" # # var examples. # using 'hellostruct' as the example with a 'Person' struct that contains a 'Location' struct. # # 'me' # "-var-create x2112 "*" me" ^done,name="x2112",numchild="1",value="{...}",type="Person",thread-id="1",has_more="0" "-var-info-type x2112" "-var-info-type x2112.public.location" ^done,type="Person" ^done,type="Location" "-var-info-num-children x2112" ^done,numchild="1" "-var-list-children --no-values x2112" ^done,numchild="1", children=[ child={name="x2112.public",exp="public",numchild="4",thread-id="1"} ], has_more="0" "-var-list-children --no-values x2112.public" ^done,numchild="4", children=[ child={name="x2112.public.name", exp="name", numchild="2", type="std::string", thread-id="1"}, child={name="x2112.public.age", exp="age", numchild="0", type="int", thread-id="1"}, child={name="x2112.public.salary", exp="salary", numchild="0", type="float", thread-id="1"}, child={name="x2112.public.location", exp="location", numchild="1", type="Location", thread-id="1"} ], has_more="0" "-var-list-children --all-values x2112" ^done,numchild="1", children=[ child={name="x2112.public", exp="public", numchild="4", value="", thread-id="1"} ], has_more="0" "-var-list-children --all-values x2112.public" ^done,numchild="4", children=[ child={name="x2112.public.name", exp="name", numchild="2", value="{...}", type="std::string", thread-id="1"}, child={name="x2112.public.age", exp="age", numchild="0", value="60", type="int", thread-id="1"}, child={name="x2112.public.salary", exp="salary", numchild="0", value="0.25", type="float", thread-id="1"}, child={name="x2112.public.location", exp="location", numchild="1", value="{...}", type="Location", thread-id="1"} ], has_more="0" "-var-list-children --simple-values x2112.public" ^done,numchild="4", children=[ child={name="x2112.public.name", exp="name", numchild="2", type="std::string", thread-id="1"}, child={name="x2112.public.age", exp="age", numchild="0", value="60", type="int", thread-id="1"}, child={name="x2112.public.salary", exp="salary", numchild="0", value="0.25", type="float", thread-id="1"}, child={name="x2112.public.location", exp="location", numchild="1", type="Location", thread-id="1"} ], has_more="0" "-var-evaluate-expression x2112" ^done,value="{...}" "-var-evaluate-expression x2112.name" "-var-evaluate-expression x2112.age" "-var-evaluate-expression x2112.salary" "-var-evaluate-expression x2112.location" ^done,value="{...}" ^done,value="60" ^done,value="0.25" ^done,value="{...}" "-var-info-expression x2112" "-var-info-expression x2112.public" "-var-info-expression x2112.public.age" ^done,lang="C++",exp="me" ^done,lang="C++",exp="public" ^done,lang="C++",exp="age" "-var-info-path-expression x2112" "-var-info-path-expression x2112.public" "-var-info-path-expression x2112.public.age" ^done,path_expr="me" ^done,path_expr="" ^done,path_expr="((me).age)" "-var-delete x2112" ^done,ndeleted="1" # # 'me.name' # "-var-create x2112 "*" me.name" ^done,name="x2112",numchild="2",value="{...}",type="std::string",thread-id="1",has_more="0" "-var-info-type x2112" ^done,type="std::string" "-var-info-num-children x2112" ^done,numchild="2" "-var-evaluate-expression x2112" ^done,value="{...}" "-var-list-children --no-values x2112" ^done,numchild="2", children=[ child={name="x2112.public", exp="public", numchild="1", thread-id="1"}, child={name="x2112.private", exp="private", numchild="3", thread-id="1"} ], has_more="0" "-var-list-children --no-values x2112.public" ^done,numchild="1", children=[ child={name="x2112.public.npos",exp="npos",numchild="0",type="const std::__cxx11::basic_string, std::allocator >::size_type",thread-id="1"} ], has_more="0" "-var-list-children --no-values x2112.private" ^done,numchild="3", children=[ child={name="x2112.private._M_dataplus",exp="_M_dataplus",numchild="2",type="std::__cxx11::basic_string, std::allocator >::_Alloc_hider",thread-id="1"}, child={name="x2112.private._M_string_length",exp="_M_string_length",numchild="0",type="std::__cxx11::basic_string, std::allocator >::size_type",thread-id="1"}, child={name="x2112.private.2_anonymous",exp="",numchild="1",type="union {...}",thread-id="1"} ], has_more="0" "-var-list-children --no-values x2112.public.npos" ^done,numchild="0",has_more="0" "-var-show-attributes seer4.public.name" "-var-show-attributes seer4.public.age" ^done,attr="noneditable" ^done,attr="editable"