Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Chris Moller <cmoller@redhat.com>
To: gdb-patches@sourceware.org
Subject: Patch for cp-valprint.c
Date: Fri, 22 Jan 2010 17:24:00 -0000	[thread overview]
Message-ID: <4B59DF28.4090306@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

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.



[-- Attachment #2: cp-valprint.c.patch --]
[-- Type: text/plain, Size: 870 bytes --]

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  <cmoller@redhat.com>
> 
> 	* 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;
>       }

[-- Attachment #3: gdb-sum.diff --]
[-- Type: text/plain, Size: 3168 bytes --]

--- /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 
 

             reply	other threads:[~2010-01-22 17:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-22 17:24 Chris Moller [this message]
2010-01-22 22:07 ` Tom Tromey
2010-01-23  0:26   ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B59DF28.4090306@redhat.com \
    --to=cmoller@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox