This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Watchpoint segfaults
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb at sourceware dot org
- Date: Fri, 9 Dec 2005 14:58:11 -0500
- Subject: Watchpoint segfaults
This is just a brain dump; I was going to fix this today, but it was only
tangential to the patch I was working on, and it turned out to be a real
rathole.
There are lots of ways to make gdb segfault with watchpoints. Here's one of
the easiest to reproduce:
file ./gdb
watch object_files
file
info break
b->exp will be NULL because re-parsing the expression failed in
breakpoint_re_set_one. When we go to print the expression we crash.
I think we want to temporarily disable breakpoints whose expression can't be
parsed, and print it as a string rather than using the expression printer.
A frequent cause of this in my debugging sessions is "watch *$33" followed
by something that rereads the symbol table; as Andrew S. noticed, that
clears the history. Alternative to his patch coming right up which prevents
that particular case, by not clearing the history.
--
Daniel Jacobowitz
CodeSourcery, LLC