From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3062 invoked by alias); 30 Sep 2008 16:28:33 -0000 Received: (qmail 3049 invoked by uid 22791); 30 Sep 2008 16:28:31 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 30 Sep 2008 16:27:54 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m8UGRnEo031340 for ; Tue, 30 Sep 2008 12:27:49 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m8UGRm18000421; Tue, 30 Sep 2008 12:27:48 -0400 Received: from opsy.redhat.com (vpn-10-3.bos.redhat.com [10.16.10.3]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m8UGRl8C008285; Tue, 30 Sep 2008 12:27:48 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 7E7E43785CD; Tue, 30 Sep 2008 10:26:30 -0600 (MDT) To: gdb-patches@sourceware.org Subject: RFA: minor test suite fix From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Tue, 30 Sep 2008 16:28:00 -0000 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2008-09/txt/msg00574.txt.bz2 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 * 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; }