* gdb.stabs/wierd{.def,.exp,-aout.S,-xcoff.S}: Add common block test.
authorJim Kingdon <jkingdon@engr.sgi.com>
Sat, 26 Jun 1993 03:30:24 +0000 (03:30 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Sat, 26 Jun 1993 03:30:24 +0000 (03:30 +0000)
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.stabs/wierd-aout.S
gdb/testsuite/gdb.stabs/wierd-xcoff.S
gdb/testsuite/gdb.stabs/wierd.def
gdb/testsuite/gdb.stabs/wierd.exp

index 8bac7dc3dd1ed189fa084b11d555f0bca356f947..9dbfbcb97ebfb0bbf18055d19e286497bffb3e40 100644 (file)
@@ -1,5 +1,7 @@
 Fri Jun 25 12:00:46 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
+       * gdb.stabs/wierd{.def,.exp,-aout.S,-xcoff.S}: Add common block test.
+
        * gdb.t{02,13}/{Makefile.in,gdbme.c,comp-info.c}: New way of
        generating comp-info.exp which works for cross-compilation.
 
index e188185a118659c90f45cb84ae377e96e4e42a98..08878b62a1cbed998c8e546a7a55239d6ff68981 100644 (file)
@@ -3,6 +3,8 @@
 
 #define N_LSYM 0x80
 #define N_GSYM 0x20
+#define N_BCOMM 0xe2
+#define N_ECOMM 0xe4
 
 #define VAR(name) \
        .globl name; \
index b4d3a24d9dfcedb8561d63a6fb6af9402e9e291f..f0aed3118a9e897c1b39d62b7fc168bb9a3be28d 100644 (file)
@@ -1,5 +1,7 @@
-#define N_LSYM 0x81
-#define N_GSYM 0x80
+#define N_GSYM 128
+#define N_LSYM 129
+#define N_BCOMM 135
+#define N_ECOMM 137
 
 #define VAR(name) \
        .globl name; \
index 81a384c65c7d4e51878f92860ab39baf3a7e373b..4de0d9f2a804199a7bb16c885499af1a95fe1314 100644 (file)
@@ -306,6 +306,21 @@ STAB("attr90:G390=@Z !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]
 STAB("attr91:G391=@[ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,attr91)
 STAB("attr92:G392=@\ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,attr92)
 STAB("attr93:G393=@] !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,attr93)
+
+/* Provide one of each, so this wins regardless of whether names have
+   underscores.  */
+VAR (_common0)
+     .long 24
+     .long 22
+VAR (common0)
+     .long 24
+     .long 22
+STAB ("common0", N_BCOMM, 0)
+STAB ("common0var0:S1", N_GSYM, 0)
+STAB ("common0var1:S1", N_GSYM, 4)
+STAB ("common0var2:S1", N_GSYM, 8)
+STAB ("common0", N_ECOMM, 0)
+
 STAB("attr94:G394=@^ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,attr94)
 STAB("attr95:G395=@_ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,attr95)
 STAB("attr100:G400=@d !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,attr100)
index a8afcecebf0e64f8009a266fb907993cf0dc3da9..a734a057c22d39b245cba46e6fa812c61dad7292 100644 (file)
@@ -157,6 +157,17 @@ field3 = 0x77888877\}" "print struct constant"
        gdb_test "whatis pointer_to_int_var" "type = int \*" "whatis p t i v"
        setup_xfail "*-*-*"
        gdb_test "whatis intp_var" "type = intp" "whatis intp_var"
+
+       gdb_test "p common0var0" "= 42"
+       # GDB seems to only understand common blocks local to a function.
+       # These variables never get relocated to be relative to the common 
+       # block.
+       # I'm not sure whether it is valid to have a common block which
+       # is not local to a function.
+       setup_xfail "*-*-*"
+       gdb_test "p common0var1" "= 24"
+       setup_xfail "*-*-*"
+       gdb_test "p common0var2" "= 22"
 }
 
 proc print_wierd_var { var } {