From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15755 invoked by alias); 22 Apr 2010 14:06:38 -0000 Received: (qmail 15736 invoked by uid 22791); 22 Apr 2010 14:06:36 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Apr 2010 14:06:26 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3ME6OQW029474 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 22 Apr 2010 10:06:24 -0400 Received: from qcore.mollernet.net (vpn-10-25.rdu.redhat.com [10.11.10.25]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3ME6NxY011964 for ; Thu, 22 Apr 2010 10:06:24 -0400 Message-ID: <4BD057DF.7070904@redhat.com> Date: Thu, 22 Apr 2010 14:06:00 -0000 From: Chris Moller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: Another obstack patch. Content-Type: multipart/mixed; boundary="------------020205060709060701020102" X-IsSubscribed: yes 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: 2010-04/txt/msg00752.txt.bz2 This is a multi-part message in MIME format. --------------020205060709060701020102 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 404 There are two separate recursion control obstacks in cp-valprint.c, both originally incorrectly using obstack_next_free(). I fixed one of those in the patch for pr9167, but the other one would have collided with the patch for pr10687. Here is the fix for the second instance. (No new testcases are required--the existing t/cs for pr9067, pr9167, and pr10687 test the code in this patch.) Chris --------------020205060709060701020102 Content-Type: text/x-patch; name="obstack.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="obstack.patch" Content-length: 3186 Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.11667 diff -u -r1.11667 ChangeLog --- ChangeLog 22 Apr 2010 12:30:54 -0000 1.11667 +++ ChangeLog 22 Apr 2010 13:56:51 -0000 @@ -1,3 +1,10 @@ +2010-04-22 Chris Moller + + * cp-valprint.c (cp_print_value_fields): Replaced obstack_base() + method of popping recursion-detection stack with a method based on + obstack_object_size(). (Similar to the PR9167 patch below, but for + the static array obstack rather than the static member obstack.) + 2010-04-22 Pierre Muller PR stabs/11479. Index: cp-valprint.c =================================================================== RCS file: /cvs/src/src/gdb/cp-valprint.c,v retrieving revision 1.66 diff -u -r1.66 cp-valprint.c --- cp-valprint.c 21 Apr 2010 17:33:54 -0000 1.66 +++ cp-valprint.c 22 Apr 2010 13:56:51 -0000 @@ -81,7 +81,8 @@ static void cp_print_value (struct type *, struct type *, const gdb_byte *, int, CORE_ADDR, struct ui_file *, int, - const struct value_print_options *, struct type **); + const struct value_print_options *, + struct type **); /* GCC versions after 2.4.5 use this. */ @@ -186,18 +187,18 @@ fprintf_filtered (stream, ""); else { - int obstack_initial_size = 0; - void *stat_array_obstack_top = NULL; + int statmem_obstack_initial_size = 0; + int stat_array_obstack_initial_size = 0; if (dont_print_statmem == 0) { - obstack_initial_size = + statmem_obstack_initial_size = obstack_object_size (&dont_print_statmem_obstack); if (last_set_recurse != recurse) { - stat_array_obstack_top - = obstack_next_free (&dont_print_stat_array_obstack); + stat_array_obstack_initial_size = + obstack_object_size (&dont_print_stat_array_obstack); last_set_recurse = recurse; } } @@ -323,12 +324,12 @@ int obstack_final_size = obstack_object_size (&dont_print_statmem_obstack); - if (obstack_final_size > obstack_initial_size) { + if (obstack_final_size > statmem_obstack_initial_size) { /* In effect, a pop of the printed-statics stack. */ void *free_to_ptr = obstack_next_free (&dont_print_statmem_obstack) - - (obstack_final_size - obstack_initial_size); + (obstack_final_size - statmem_obstack_initial_size); obstack_free (&dont_print_statmem_obstack, free_to_ptr); @@ -336,9 +337,17 @@ if (last_set_recurse != recurse) { - if (obstack_object_size (&dont_print_stat_array_obstack) > 0) + int obstack_final_size = + obstack_object_size (&dont_print_stat_array_obstack); + + if (obstack_final_size > stat_array_obstack_initial_size) { + void *free_to_ptr = + obstack_next_free (&dont_print_stat_array_obstack) - + (obstack_final_size - stat_array_obstack_initial_size); + obstack_free (&dont_print_stat_array_obstack, - stat_array_obstack_top); + free_to_ptr); + } last_set_recurse = -1; } } --------------020205060709060701020102 Content-Type: text/x-patch; name="obstack-sum.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="obstack-sum.diff" Content-length: 1983 --- virgin.sum 2010-04-22 09:38:17.519201307 -0400 +++ patched.sum 2010-04-22 09:49:38.613201404 -0400 @@ -1,4 +1,4 @@ -Test Run By moller on Thu Apr 22 09:04:28 2010 +Test Run By moller on Thu Apr 22 09:40:22 2010 Native configuration is i686-pc-linux-gnu === gdb tests === @@ -5997,7 +5997,7 @@ PASS: gdb.base/pr11022.exp: watchpoint hit 2 Running ../../../src/gdb/testsuite/gdb.base/prelink.exp ... PASS: gdb.base/prelink.exp: set verbose on -FAIL: gdb.base/prelink.exp: prelink +PASS: gdb.base/prelink.exp: prelink Running ../../../src/gdb/testsuite/gdb.base/printcmds.exp ... PASS: gdb.base/printcmds.exp: print $pc PASS: gdb.base/printcmds.exp: print "abc" @@ -13430,7 +13430,7 @@ PASS: gdb.mi/mi-nsmoribund.exp: resume all, thread specific breakpoint PASS: gdb.mi/mi-nsmoribund.exp: hit thread specific breakpoint PASS: gdb.mi/mi-nsmoribund.exp: thread state: all running except the breakpoint thread -FAIL: gdb.mi/mi-nsmoribund.exp: unexpected stop +PASS: gdb.mi/mi-nsmoribund.exp: resume all, program exited normally Running ../../../src/gdb/testsuite/gdb.mi/mi-nsthrexec.exp ... PASS: gdb.mi/mi-nsthrexec.exp: successfully compiled posix threads test case PASS: gdb.mi/mi-nsthrexec.exp: breakpoint at main @@ -16468,7 +16468,7 @@ PASS: gdb.threads/watchthreads.exp: successfully compiled posix threads test case PASS: gdb.threads/watchthreads.exp: watch args[0] PASS: gdb.threads/watchthreads.exp: watch args[1] -PASS: gdb.threads/watchthreads.exp: disable 2 +PASS: gdb.threads/watchthreads.exp: disable 3 PASS: gdb.threads/watchthreads.exp: threaded watch loop PASS: gdb.threads/watchthreads.exp: first watchpoint on args[0] hit PASS: gdb.threads/watchthreads.exp: first watchpoint on args[1] hit @@ -16749,8 +16749,8 @@ === gdb Summary === -# of expected passes 15916 -# of unexpected failures 18 +# of expected passes 15918 +# of unexpected failures 16 # of expected failures 44 # of untested testcases 6 # of unsupported tests 62 --------------020205060709060701020102--