Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: David Carlton <carlton@math.stanford.edu>
To: gdb-patches@sources.redhat.com
Cc: Michael Elizabeth Chastain <mec@shout.net>,
	Daniel Jacobowitz <drow@mvista.com>
Subject: [patch] fix spurious FAIL in templates.exp
Date: Thu, 27 Feb 2003 21:38:00 -0000	[thread overview]
Message-ID: <ro1smu9o143.fsf@jackfruit.Stanford.EDU> (raw)

When I created the test "print Foo<volatile char*>::foo" in
gdb.c++/templates.exp (mimicking the same test with a space between
"char" and "*"), it turned out to FAIL under DWARF-2, for reasons that
weren't clear to me at the time.  I've investigated further, and it's
a testsuite bug: the output contains

  volatile char *(Foo<volatile char*> * const, int, volatile char *)

and the testsuite doesn't expect the ' const' there.  But it's
perfectly reasonable for that to occur there: the first argument is an
artificial parameter that corresponds to 'this', and you're not
allowed to set 'this' to refer to something else.  (Note: the 'const'
means that you can't modify the pointer itself, not the object pointed
to by the pointer.)

So this patch modifies that test and its twin to accept an optional
const there.  With this patch in place, the test PASSes under
GCC3.1/DWARF-2 and its twin still PASSes under GCC2.95.3/stabs.  (And
both of them PASS in both situations once you've patched GDB to fix PR
gdb/33; I'll send out a patch for that shortly.)

I'm planning to commit this tomorrow.  Only 5 templates.exp FAILs left
to analyze...

David Carlton
carlton@math.stanford.edu

2003-02-27  David Carlton  <carlton@math.stanford.edu>

	* gdb.c++/templates.exp (do_tests): Allow const in the two
	Foo<volatile char *>::foo tests.

Index: templates.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/templates.exp,v
retrieving revision 1.15
diff -u -p -r1.15 templates.exp
--- templates.exp	26 Feb 2003 20:30:05 -0000	1.15
+++ templates.exp	27 Feb 2003 21:27:30 -0000
@@ -301,7 +301,7 @@ gdb_expect {   
 
 send_gdb "print Foo<volatile char *>::foo\n"   
 gdb_expect {   
-    -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*, int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" }
+    -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" }
     -re "No symbol \"Foo<volatile char \\*>\" in current context.\r\n$gdb_prompt $"
     { kfail "gdb/33" "print Foo<volatile char *>::foo" }
     -re "$gdb_prompt $"                     { fail "print Foo<volatile char *>::foo" }
@@ -310,7 +310,7 @@ gdb_expect {   
 
 send_gdb "print Foo<volatile char*>::foo\n"   
 gdb_expect {   
-    -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*, int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char*>::foo" }
+    -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char*>::foo" }
     -re "No symbol \"Foo<volatile char\\*>\" in current context.\r\n$gdb_prompt $"
     { kfail "gdb/33" "print Foo<volatile char*>::foo" }
     -re "$gdb_prompt $"                     { fail "print Foo<volatile char*>::foo" }


             reply	other threads:[~2003-02-27 21:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-27 21:38 David Carlton [this message]
2003-02-28 17:28 ` David Carlton
2003-02-27 21:51 Michael Elizabeth Chastain

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=ro1smu9o143.fsf@jackfruit.Stanford.EDU \
    --to=carlton@math.stanford.edu \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec@shout.net \
    /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