From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6952 invoked by alias); 22 Jan 2010 17:24:04 -0000 Received: (qmail 6943 invoked by uid 22791); 22 Jan 2010 17:24:03 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS 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; Fri, 22 Jan 2010 17:23:54 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0MHNrsA006369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 22 Jan 2010 12:23:53 -0500 Received: from qcore.mollernet.net (vpn-10-155.rdu.redhat.com [10.11.10.155]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0MHNqPM013325 for ; Fri, 22 Jan 2010 12:23:52 -0500 Message-ID: <4B59DF28.4090306@redhat.com> Date: Fri, 22 Jan 2010 17:24: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: Patch for cp-valprint.c Content-Type: multipart/mixed; boundary="------------080905050709040205010905" 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-01/txt/msg00550.txt.bz2 This is a multi-part message in MIME format. --------------080905050709040205010905 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 400 While working on something else, I found the following: /* FIXME (alloca): unsafe if baseclass is really really large. */ gdb_byte *buf = alloca (TYPE_LENGTH (baseclass)); The attached patch replaces that with a xmalloc/xfree pair. There are some differences I don't understand between the before- and after- gdb.sum files from make check--the diff -u of those files is also attached. --------------080905050709040205010905 Content-Type: text/plain; name="cp-valprint.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cp-valprint.c.patch" Content-length: 870 Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.11285 diff -r1.11285 ChangeLog 0a1,5 > Fri Jan 22 09:52:28 2010 Chris Moller > > * cp-valprint.c (cp_print_value): Took out an alloca and replaced > it with a xmalloc/xfree pair. > Index: cp-valprint.c =================================================================== RCS file: /cvs/src/src/gdb/cp-valprint.c,v retrieving revision 1.62 diff -r1.62 cp-valprint.c 356a357,359 > gdb_byte *buf; > > buf = NULL; 389,390c392 < /* FIXME (alloca): unsafe if baseclass is really really large. */ < gdb_byte *buf = alloca (TYPE_LENGTH (baseclass)); --- > buf = xmalloc (TYPE_LENGTH (baseclass)); 446a449,453 > > if (buf) { > xfree (buf); > buf = NULL; > } --------------080905050709040205010905 Content-Type: text/plain; name="gdb-sum.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb-sum.diff" Content-length: 3168 --- /tmp/virgin-gdb.sum 2010-01-22 11:57:29.542165115 -0500 +++ /tmp/patched-gdb.sum 2010-01-22 12:15:24.255165387 -0500 @@ -1,4 +1,4 @@ -Test Run By moller on Fri Jan 22 11:47:04 2010 +Test Run By moller on Fri Jan 22 11:57:53 2010 Native configuration is i686-pc-linux-gnu === gdb tests === @@ -8167,15 +8167,10 @@ PASS: gdb.base/solib-display.exp: display a_global PASS: gdb.base/solib-display.exp: display b_global PASS: gdb.base/solib-display.exp: display c_global -FAIL: gdb.base/solib-display.exp: after rerun -FAIL: gdb.base/solib-display.exp: after rerun (GDB internal error) -PASS: gdb.base/solib-display.exp: break 25 -FAIL: gdb.base/solib-display.exp: continue (GDB internal error) -PASS: gdb.base/solib-display.exp: display main_global -PASS: gdb.base/solib-display.exp: display a_local -PASS: gdb.base/solib-display.exp: display a_static -PASS: gdb.base/solib-display.exp: break 25 -FAIL: gdb.base/solib-display.exp: continue +ERROR: Process no longer exists +UNRESOLVED: gdb.base/solib-display.exp: after rerun +WARNING: remote_expect statement without a default case?! +FAIL: gdb.base/solib-display.exp: Can't run to main (3) Running ../../../src/gdb/testsuite/gdb.base/solib-overlap.exp ... PASS: gdb.base/solib-overlap.exp: 0x40000000: attach PASS: gdb.base/solib-overlap.exp: 0x40000000: detach @@ -12363,7 +12358,7 @@ PASS: gdb.mi/mi-break.exp: mi runto main PASS: gdb.mi/mi-break.exp: breakpoint commands: insert breakpoint at basics.c:callee2, again PASS: gdb.mi/mi-break.exp: breakpoint commands: set commands -PASS: gdb.mi/mi-break.exp: test hitting breakpoint with commands +FAIL: gdb.mi/mi-break.exp: test hitting breakpoint with commands Running ../../../src/gdb/testsuite/gdb.mi/mi-cli.exp ... PASS: gdb.mi/mi-cli.exp: -interpreter-exec with no arguments PASS: gdb.mi/mi-cli.exp: -interpreter-exec with one argument @@ -12526,7 +12521,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 -PASS: gdb.mi/mi-nsmoribund.exp: resume all, program exited normally +FAIL: gdb.mi/mi-nsmoribund.exp: unexpected stop 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 @@ -12592,6 +12587,7 @@ PASS: gdb.mi/mi-simplerun.exp: step at main PASS: gdb.mi/mi-simplerun.exp: step to callee4 PASS: gdb.mi/mi-simplerun.exp: exec-finish +FAIL: gdb.mi/mi-simplerun.exp: continue to end (failed to resume) PASS: gdb.mi/mi-simplerun.exp: continue to end Running ../../../src/gdb/testsuite/gdb.mi/mi-stack.exp ... PASS: gdb.mi/mi-stack.exp: breakpoint at callee4 @@ -15636,10 +15632,11 @@ === gdb Summary === -# of expected passes 14843 +# of expected passes 14836 # of unexpected failures 30 # of expected failures 41 # of untested testcases 3 +# of unresolved testcases 1 # of unsupported tests 61 /home/moller/tinkering/fsfgdb-ck/build/gdb/testsuite/../../gdb/gdb version 7.0.50.20100122-cvs -nw -nx --------------080905050709040205010905--