From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22250 invoked by alias); 9 Dec 2005 19:58:14 -0000 Received: (qmail 22242 invoked by uid 22791); 9 Dec 2005 19:58:13 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 09 Dec 2005 19:58:13 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1EkoNf-0005Bj-2F for gdb@sourceware.org; Fri, 09 Dec 2005 14:58:11 -0500 Date: Fri, 09 Dec 2005 19:58:00 -0000 From: Daniel Jacobowitz To: gdb@sourceware.org Subject: Watchpoint segfaults Message-ID: <20051209195811.GA19885@nevyn.them.org> Mail-Followup-To: gdb@sourceware.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00104.txt.bz2 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