From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2414 invoked by alias); 15 Apr 2009 21:55:07 -0000 Received: (qmail 2331 invoked by uid 22791); 15 Apr 2009 21:55:04 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_73,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Apr 2009 21:54:57 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3FLsswd003567; Wed, 15 Apr 2009 17:54:54 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3FLsre8021724; Wed, 15 Apr 2009 17:54:53 -0400 Received: from opsy.redhat.com (vpn-13-166.rdu.redhat.com [10.11.13.166]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n3FLsqsG013713; Wed, 15 Apr 2009 17:54:53 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 5FFC150830B; Wed, 15 Apr 2009 15:54:47 -0600 (MDT) To: Eli Zaretskii Cc: gdb-patches@sourceware.org, Jan Kratochvil Subject: Re: Current GDB crashes when it sources Emacs's .gdbinit References: <83ocuxlopc.fsf@gnu.org> <83fxg9lkm8.fsf@gnu.org> From: Tom Tromey Reply-To: Tom Tromey Date: Wed, 15 Apr 2009 21:55:00 -0000 In-Reply-To: (Tom Tromey's message of "Wed\, 15 Apr 2009 15\:07\:03 -0600") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00356.txt.bz2 >>>>> "Tom" == Tom Tromey writes: Tom> I found another crash through further testing. Tom> I'll send the final patch plus test case after the regression tests Tom> are done. Here's the fix and the test case. The one test exercises both bugs. Built and regtested on x86-64 (compile farm). I also reproduced both bugs here and verified the fix manually. Jan, this is needed for Fedora. Sorry about that. Tom 2009-04-15 Tom Tromey * c-lang.c (evaluate_subexp_c): Correctly handle EVAL_SKIP. 2009-04-15 Tom Tromey * gdb.base/charset.exp: Add regression test. Index: c-lang.c =================================================================== RCS file: /cvs/src/src/gdb/c-lang.c,v retrieving revision 1.64 diff -u -r1.64 c-lang.c --- c-lang.c 14 Apr 2009 21:54:33 -0000 1.64 +++ c-lang.c 15 Apr 2009 21:46:55 -0000 @@ -941,7 +941,15 @@ *pos += 2; if (noside == EVAL_SKIP) - return NULL; + { + /* Return a dummy value of the appropriate type. */ + if ((dest_type & C_CHAR) != 0) + result = allocate_value (type); + else + result = value_typed_string ("", 0, type); + do_cleanups (cleanup); + return result; + } if ((dest_type & C_CHAR) != 0) { Index: testsuite/gdb.base/charset.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/charset.exp,v retrieving revision 1.13 diff -u -r1.13 charset.exp --- testsuite/gdb.base/charset.exp 25 Mar 2009 19:25:49 -0000 1.13 +++ testsuite/gdb.base/charset.exp 15 Apr 2009 21:46:57 -0000 @@ -604,4 +604,9 @@ test_combination u UCS-2 U UCS-4 } +# Regression test for a cleanup bug in the charset code. +gdb_test "print 'a' == 'a' || 'b' == 'b'" \ + ".* = 1" \ + "EVAL_SKIP cleanup handling regression test" + gdb_exit