This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

(patch) hpjyg17: gdb testsuite compiler.c(c)


This patch moves compiler.c / compiler.cc to testsuite/lib/, and
modifies gdb.exp (get_compiler_info) to locate these two files from
$srcdir/lib/ instead of $srcdir/$subdir.

The reason for this change is to eliminate multiple copies of these two
files from existing (or future) test suite directories.

When applying this patch, please also remove existing compiler.c(c)
files from testsuite/gdb.* and testsuite/gdb.*/gdb.*/.  Thanks.

ChangeLog

1999-11-09	Jimmy Guo	<guo@cup.hp.com>

	* gdb.exp (get_compiler_info): pick up compiler.c compiler.cc
          from $srcdir/lib/.

	* compiler.c,compiler.cc: New files, moved from gdb.base/ and
          gdb.c++/.

Index: gdb/testsuite/lib/gdb.exp
/opt/gnu/bin/diff -r -c -N  /view/guo.import//CLO/Components/WDB/Src/gnu/gdb/testsuite/lib/gdb.exp gdb/testsuite/lib/gdb.exp
*** /view/guo.import//CLO/Components/WDB/Src/gnu/gdb/testsuite/lib/gdb.exp	Tue Nov  9 11:19:29 1999
--- gdb/testsuite/lib/gdb.exp	Tue Nov  9 12:15:19 1999
***************
*** 901,913 ****
      if {![istarget "hppa*-*-hpux*"]} {
  	if { [llength $args] > 0 } {
  	    if {$args == "c++"} {
! 		if { [gdb_compile "${srcdir}/${subdir}/compiler.cc" "${binfile}.ci" preprocess {}] != "" } {
  		    perror "Couldn't make ${binfile}.ci file"
  		    return 1;
  		}
  	    }
  	} else {
! 	    if { [gdb_compile "${srcdir}/${subdir}/compiler.c" "${binfile}.ci" preprocess {}] != "" } {
  		perror "Couldn't make ${binfile}.ci file"
  		return 1;
  	    }
--- 901,913 ----
      if {![istarget "hppa*-*-hpux*"]} {
  	if { [llength $args] > 0 } {
  	    if {$args == "c++"} {
! 		if { [gdb_compile "${srcdir}/lib/compiler.cc" "${binfile}.ci" preprocess {}] != "" } {
  		    perror "Couldn't make ${binfile}.ci file"
  		    return 1;
  		}
  	    }
  	} else {
! 	    if { [gdb_compile "${srcdir}/lib/compiler.c" "${binfile}.ci" preprocess {}] != "" } {
  		perror "Couldn't make ${binfile}.ci file"
  		return 1;
  	    }
***************
*** 916,922 ****
  	if { [llength $args] > 0 } {
  	    if {$args == "c++"} {
  		if { [eval gdb_preprocess \
! 			[list "${srcdir}/${subdir}/compiler.cc" "${binfile}.ci"] \
  			$args] != "" } {
  		    perror "Couldn't make ${binfile}.ci file"
  		    return 1;
--- 916,922 ----
  	if { [llength $args] > 0 } {
  	    if {$args == "c++"} {
  		if { [eval gdb_preprocess \
! 			[list "${srcdir}/lib/compiler.cc" "${binfile}.ci"] \
  			$args] != "" } {
  		    perror "Couldn't make ${binfile}.ci file"
  		    return 1;
***************
*** 924,930 ****
  	    }
  	} elseif { $args != "f77" } {
  	    if { [eval gdb_preprocess \
! 		    [list "${srcdir}/${subdir}/compiler.c" "${binfile}.ci"] \
  		    $args] != "" } {
  		perror "Couldn't make ${binfile}.ci file"
  		return 1;
--- 924,930 ----
  	    }
  	} elseif { $args != "f77" } {
  	    if { [eval gdb_preprocess \
! 		    [list "${srcdir}/lib/compiler.c" "${binfile}.ci"] \
  		    $args] != "" } {
  		perror "Couldn't make ${binfile}.ci file"
  		return 1;
Index: gdb/testsuite/lib/compiler.c
/opt/gnu/bin/diff -r -c -N  /view/guo.import//CLO/Components/WDB/Src/gnu/gdb/testsuite/lib/compiler.c gdb/testsuite/lib/compiler.c
*** /view/guo.import//CLO/Components/WDB/Src/gnu/gdb/testsuite/lib/compiler.c	Tue Nov  9 12:22:00 1999
--- gdb/testsuite/lib/compiler.c	Fri Oct 16 14:01:54 1998
***************
*** 0 ****
--- 1,31 ----
+ /* Often the behavior of any particular test depends upon what compiler was
+    used to compile the test.  As each test is compiled, this file is
+    preprocessed by the same compiler used to compile that specific test
+    (different tests might be compiled by different compilers, particularly
+    if compiled at different times), and used to generate a *.ci (compiler
+    info) file for that test.
+ 
+    I.E., when callfuncs is compiled, a callfuncs.ci file will be generated,
+    which can then be sourced by callfuncs.exp to give callfuncs.exp access
+    to information about the compilation environment.
+ 
+    TODO:  It might be a good idea to add expect code that tests each
+    definition made with 'set" to see if one already exists, and if so
+    warn about conflicts if it is being set to something else.  */
+ 
+ /* This needs to be kept in sync with whatis.c and gdb.exp(get_compiler_info).
+    If this ends up being hairy, we could use a common header file.  */
+ 
+ #if defined (__STDC__) || defined (_AIX)
+ set signed_keyword_not_used 0
+ #else
+ set signed_keyword_not_used 1
+ #endif
+ 
+ #if defined (__GNUC__)
+ set gcc_compiled __GNUC__
+ #else
+ set gcc_compiled 0
+ #endif
+ 
+ return 0
Index: gdb/testsuite/lib/compiler.cc
/opt/gnu/bin/diff -r -c -N  /view/guo.import//CLO/Components/WDB/Src/gnu/gdb/testsuite/lib/compiler.cc gdb/testsuite/lib/compiler.cc
*** /view/guo.import//CLO/Components/WDB/Src/gnu/gdb/testsuite/lib/compiler.cc	Tue Nov  9 12:22:00 1999
--- gdb/testsuite/lib/compiler.cc	Tue Oct 27 17:24:59 1998
***************
*** 0 ****
--- 1,34 ----
+ /* Often the behavior of any particular test depends upon what compiler was
+    used to compile the test.  As each test is compiled, this file is
+    preprocessed by the same compiler used to compile that specific test
+    (different tests might be compiled by different compilers, particularly
+    if compiled at different times), and used to generate a *.ci (compiler
+    info) file for that test.
+ 
+    I.E., when callfuncs is compiled, a callfuncs.ci file will be generated,
+    which can then be sourced by callfuncs.exp to give callfuncs.exp access
+    to information about the compilation environment.
+ 
+    TODO:  It might be a good idea to add expect code that tests each
+    definition made with 'set" to see if one already exists, and if so
+    warn about conflicts if it is being set to something else.  */
+ 
+ #if defined(__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 6
+ set supports_template_debugging 1
+ #else
+ set supports_template_debugging 0
+ #endif
+ 
+ #if defined(__cplusplus) 
+ set supports_template_debugging 1
+ #else
+ set supports_template_debugging 0
+ #endif
+ 
+ #if defined (__GNUC__)
+ set gcc_compiled __GNUC__
+ #else
+ set gcc_compiled 0
+ #endif
+ 
+ return 0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]