You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gdb/mi freezes with pretty/printers enabled when a user access a not initialized vector. gdb/mi not directly freezes, but walks through all the memory it can access, as long as is doesn't access a not exisiting memory (segsev). for the user gdb/mi looks frozen because the size of the vector can be of different sizes (YMMS). This errors comes from calculating the size of the std::vector, which is calculated from vec._M_impl._M_finish - vec._M_impl._M_start. Size of the vector is not calculable, when the vector is not initialized.
gdb/mi freezes with pretty/printers enabled when a user access a not initialized vector. gdb/mi not directly freezes, but walks through all the memory it can access, as long as is doesn't access a not exisiting memory (segsev). for the user gdb/mi looks frozen because the size of the vector can be of different sizes (YMMS). This errors comes from calculating the size of the std::vector, which is calculated from vec._M_impl._M_finish - vec._M_impl._M_start. Size of the vector is not calculable, when the vector is not initialized.
Reported-Bug : http://sourceware.org/bugzilla/show_bug.cgi?id=14373
This issue gives an impression of this known but not avoidable bug under current versions:
Install Pretty Printers:
Create a Testprogram called main.cpp:
Create the Objectfile:
g++ -g main.cpp -o main.o
Start GDB/MI:
gdb -i mi main.o
Execute following CMD's and GDB-Freezes:
-enable-pretty-printing
-break-insert main
-exec-run
-stack-list-variables --all-values
-var-create - * vec
-var-list-children var1
Execute following CMD's and GDB doesn't freeze but shows non existing values:
-enable-pretty-printing
-break-insert main
-exec-run
-stack-list-variables --all-values
-var-create - * vec
-var-list-children var1 0 10
^done,numchild="10",displayhint="array",children=[child={name="var2.[0]",exp="[0]",numchild="0",type="int",thread-id="1"},child={name="var2.[1]",exp="[1]",numchild="0",type="int",thread-id="1"},child={name="var2.[2]",exp="[2]",numchild="0",type="int",thread-id="1"},child={name="var2.[3]",exp="[3]",numchild="0",type="int",thread-id="1"},child={name="var2.[4]",exp="[4]",numchild="0",type="int",thread-id="1"},child={name="var2.[5]",exp="[5]",numchild="0",type="int",thread-id="1"},child={name="var2.[6]",exp="[6]",numchild="0",type="int",thread-id="1"},child={name="var2.[7]",exp="[7]",numchild="0",type="int",thread-id="1"},child={name="var2.[8]",exp="[8]",numchild="0",type="int",thread-id="1"},child={name="var2.[9]",exp="[9]",numchild="0",type="int",thread-id="1"}],has_more="1"
Further CMD's
Use these commands to evaluate that your pretty-printers are really enabled or disabled.
disable pretty-printer
enable pretty-printer
The text was updated successfully, but these errors were encountered: