Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: RFA: minor test suite fix
Date: Tue, 30 Sep 2008 16:28:00 -0000	[thread overview]
Message-ID: <m3hc7xob0q.fsf@fleche.redhat.com> (raw)

Today I happened to notice that some macro tests fail on my main
machine.  In particular, the "print M" tests fail.

I looked into this.  The problem occurs because I have glibc debug
info installed, and it has a (static) global variable named "M".

This patch works around the problem by renaming the M macro to
something less likely to conflict with glibc.

Built and regtested on x86-64 (compile farm).
I also ran this .exp on this machine, where I was seeing the problem.

Please review.

Tom

:ADDPATCH testsuite:

2008-09-30  Tom Tromey  <tromey@redhat.com>

	* gdb.base/macscp.exp: Change "M" to "MACRO_TO_EXPAND"
	everywhere.
	* gdb.base/macscp1.c (MACRO_TO_EXPAND): Rename from "M".

diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
index 3424714..3dba479 100644
--- a/gdb/testsuite/gdb.base/macscp.exp
+++ b/gdb/testsuite/gdb.base/macscp.exp
@@ -410,64 +410,64 @@ gdb_test "break [gdb_get_line_number "set breakpoint here"]" \
 
 gdb_test "continue" "foo = 0;.*" "continue to macsp_expr"
 
-gdb_test "print M" \
-    "No symbol \"M\" in current context\." \
+gdb_test "print MACRO_TO_EXPAND" \
+    "No symbol \"MACRO_TO_EXPAND\" in current context\." \
     "print expression with macro before define."
 
 gdb_test "next" "foo = 1;" "next to definition"
 
-gdb_test "print M" \
+gdb_test "print MACRO_TO_EXPAND" \
     " = 0" \
     "print expression with macro in scope."
 
-gdb_test "macro define M 72" \
+gdb_test "macro define MACRO_TO_EXPAND 72" \
   "" \
   "user macro override"
 
-gdb_test "print M" \
+gdb_test "print MACRO_TO_EXPAND" \
   " = 72" \
   "choose user macro"
 
-gdb_test "macro undef M" \
+gdb_test "macro undef MACRO_TO_EXPAND" \
   "" \
   "remove user override"
 
-gdb_test "print M" \
+gdb_test "print MACRO_TO_EXPAND" \
     " = 0" \
     "print expression with macro after removing override"
 
 gdb_test "next" "foo = 2;" "next to definition"
 
-gdb_test "print M" \
-    "No symbol \"M\" in current context\." \
+gdb_test "print MACRO_TO_EXPAND" \
+    "No symbol \"MACRO_TO_EXPAND\" in current context\." \
     "print expression with macro after undef."
 
-gdb_test "macro define M 5" \
+gdb_test "macro define MACRO_TO_EXPAND 5" \
   "" \
   "basic macro define"
 
-gdb_test "print M" \
+gdb_test "print MACRO_TO_EXPAND" \
   " = 5" \
   "expansion of defined macro"
 
 gdb_test "macro list" \
-  "macro define M 5" \
+  "macro define MACRO_TO_EXPAND 5" \
   "basic macro list"
 
-gdb_test "macro define M(x) x" \
+gdb_test "macro define MACRO_TO_EXPAND(x) x" \
   "" \
   "basic redefine, macro with args"
 
-gdb_test "print M (7)" \
+gdb_test "print MACRO_TO_EXPAND (7)" \
   " = 7" \
   "expansion of macro with arguments"
 
-gdb_test "macro undef M" \
+gdb_test "macro undef MACRO_TO_EXPAND" \
   "" \
   "basic macro undef"
 
-gdb_test "print M" \
-    "No symbol \"M\" in current context\." \
+gdb_test "print MACRO_TO_EXPAND" \
+    "No symbol \"MACRO_TO_EXPAND\" in current context\." \
     "print expression with macro after user undef."
 
 # Regression test; this used to crash.
diff --git a/gdb/testsuite/gdb.base/macscp1.c b/gdb/testsuite/gdb.base/macscp1.c
index 200ac26..0be78c6 100644
--- a/gdb/testsuite/gdb.base/macscp1.c
+++ b/gdb/testsuite/gdb.base/macscp1.c
@@ -69,9 +69,9 @@ macscp_expr (void)
   int foo = -1;
 
   foo = 0;  /* set breakpoint here */
-#define M foo
+#define MACRO_TO_EXPAND foo
   foo = 1;
-#undef M
+#undef MACRO_TO_EXPAND
   foo = 2;
 }
 


             reply	other threads:[~2008-09-30 16:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-30 16:28 Tom Tromey [this message]
2008-09-30 16:45 ` Joel Brobecker

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=m3hc7xob0q.fsf@fleche.redhat.com \
    --to=tromey@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