Bug 19321 - MI pretty printing -var-list-children segfaults
Summary: MI pretty printing -var-list-children segfaults
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: varobj (show other bugs)
Version: 7.10
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-01 14:45 UTC by Xavier de Gaye
Modified: 2023-08-31 17:28 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xavier de Gaye 2015-12-01 14:45:50 UTC
gdb 7.10 segfaults after deleting the varobj child of a vector with one
element.

The last part of the debugging session:

(gdb)
~"8\t    v.push_back(3);\n"
*stopped,reason="end-stepping-range",frame={addr="0x0000000000400b35",func="main",args=[],file="pret
ty-printing.cc",fullname="/home/xavier/src/pyclewn/pyclewn-hg-working/testsuite/pretty-printing.cc",
line="8"},thread-id="1",stopped-threads="all",core="1"
(gdb)
-enable-pretty-printing
^done
(gdb)
-var-create var1 * "v"
^done,name="var1",numchild="0",value="{...}",type="std::vector<int, std::allocator<int> >",thread-id
="1",displayhint="array",dynamic="1",has_more="1"
(gdb)
-var-list-children var1
^done,numchild="1",displayhint="array",children=[child={name="var1.[0]",exp="[0]",numchild="0",type=
"int",thread-id="1"}],has_more="0"
(gdb)
-var-delete var1.[0]
^done,ndeleted="1"
(gdb)
-var-list-children var1
Segmentation fault (core dumped)


And the source code:

#include <vector>
#include <string>

int main()
{
     std::vector<int> v;
     v.push_back(2);
     v.push_back(3);
     return 0;
}