Fix crash in -var-delete

Vladimir Prus ghost@cs.msu.su
Wed Nov 7 19:58:00 GMT 2007


A KDevelop user has reported that gdb 6.7 consistently crashes when
used in KDevelop. Of course, I should have tested gdb 6.7 before it's released,
but it's too late at this point, so here's a patch instead.

Historically, KDevelop deletes variable objects recursively -- first most
nested ones, then their parents and so on. Note that while it's not necessary
in most cases, there's nothing inherently wrong about it. Say,  if
GUI for some reason does not care about particular child anymore, it's free to
delete it (even though with frozen varobj, it can just freeze it). 

Unfortunately gdb 6.7, when deleting varobj where some children of it
are already deleted, tries to mess with NULL pointers, and crashes.

The patch and a testcase are attached. OK?

- Volodya



-------------- next part --------------
A non-text attachment was scrubbed...
Name: child_deletion.diff
Type: text/x-diff
Size: 2430 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20071107/fe4debb3/attachment.bin>


More information about the Gdb-patches mailing list