This is the mail archive of the
mailing list for the GDB project.
Fwd: [patch] avoid the crash of gdb+pretty printer on initialized local variables
- From: Martin Runge <martin dot runge at web dot de>
- To: gdb-patches at sourceware dot org
- Cc: asmwarrior <asmwarrior at gmail dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Mon, 5 Dec 2011 11:13:25 +0100
- Subject: Fwd: [patch] avoid the crash of gdb+pretty printer on initialized local variables
- References: <4ED379D8.email@example.com> <4ED8534D.firstname.lastname@example.org> <email@example.com> <4EDAD0B3.firstname.lastname@example.org> <CAF4KFGqyz0WMWWJt9x1HZpO+urMo9jJLyudcRrHxUTqJf8mvqA@mail.gmail.com> <CAF4KFGp2cDOzKdV62MfX0vpHUAxj1D2W0W3cBZnZpYHPYxZEuA@mail.gmail.com>
I have seen gdb running into very long loops on Linux, too (Ubuntu
11.04, gdb 7.2 and 7.3). It looks like gdb is frozen, but it uses 100%
CPU. When attaching to that gdb process, I observed gdb fetching a lot
of values (address increasing, but the range was by far too large). I
guess this comes from a pretty printer, asking gdb to fetch too many
values.Âlibstdc++ and Qt4 pretty printers were in use in my case.
Although the error is probably somewhere in the pretty_printers, the
user experience is very confusing. E.g. with Eclipse CDT on top, gdb
does not respond to mi commands any more. As gdb does not give any
"progress" of "still alive" messages via mi to Eclipse, it runs into a
timeout and assumes gdb dead, debug session is broken and needs to be
I think, only few people write their pretty printers themselves. Most
get them "somewhere from the Internet", so its hard to guarantee
quality or rely on it.
Would it be a good idea in your eyes, if
- gdb would guarantee a response time to mi commands ( limit the time
spent in a mi command -> stop fetching values when time is over)?
- gdb gave some progress reports "still working, nn% done" in regular
intervals, so mi clients like Eclipse can restart their timeout? For
Example smartcards do so. If asked for a long running operation, the
smartcard first replies by asking the terminal (== card reader) to
extend the timeout before starting work. This can be repeated as often
as neccessary to complete the operation and the terminal gets regular
feedback. The card terminal may not deny the smartcard's wish.
- some possibly long running mi commands could be aborted over mi
(those that run a loop over many small operations, like