[PATCH RFA] testsuite changes needed for AIX 4.3
Kevin Buettner
kevinb@cygnus.com
Sat Apr 1 00:00:00 GMT 2000
I hereby reqest approval for committing the following changes:
* gdb.base/pointers.c (usevar): New function.
(main): Make sure that global variables v_int_pointer2, rptr,
and y are all referenced someplace in the program by calling
usevar() on them. [Some linkers delete symbols which are
never referenced. The space remains, but there's no way to
get a (symbolic) handle on the variable from the debugger.]
* gdb.base/scope.exp: For powerpc-*-*, xfail the same tests
that rs6000-*-* does.
Index: testsuite/gdb.base/pointers.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/pointers.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 pointers.c
--- pointers.c 1999/08/02 23:46:51 1.1.1.3
+++ pointers.c 2000/02/15 22:56:07
@@ -71,33 +71,26 @@ float ** ptr_to_ptr_to_float;
int y;
+/* Do nothing function used for forcing some of the above variables to
+ be referenced by the program source. If the variables are not
+ referenced, some linkers will remove the symbol from the symbol
+ table making it impossible to refer to the variable in gdb. */
+void usevar (void *var) {}
+
int main ()
{
- void dummy();
- int more_code();
-
- /* Ensure that malloc is a pointer type; avoid use of "void" and any include files. */
- /* extern char *malloc();*/
-
- /* void *malloc(size_t);*/
-
-
-
+ void dummy();
+ int more_code();
+
#ifdef usestubs
set_debug_traps();
breakpoint();
#endif
dummy();
-/* v_int_pointer2 = &v_int_pointer;
- v_unsigned_int_pointer = &v_int;
-
- y = (v_unsigned_int_pointer == v_double_pointer);
-
- x = v_unsigned_int_pointer * v_double_pointer;
-
- v_unsigned_int_pointer = v_double_pointer;
-
- v_unsigned_int_pointer = v_unsigned_int;*/
+
+ usevar (&v_int_pointer2);
+ usevar (&rptr);
+ usevar (&y);
more_code ();
Index: testsuite/gdb.base/scope.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/scope.exp,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 scope.exp
--- scope.exp 1999/08/02 23:46:51 1.1.1.3
+++ scope.exp 2000/02/15 22:56:08
@@ -130,6 +130,7 @@ proc test_at_main {} {
# Print scope1.c::filelocal_ro, which is 202
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*" 11747CLLbs}
if [gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"] {
gdb_suppress_tests ;
@@ -144,6 +145,7 @@ proc test_at_main {} {
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
if [gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"] {
gdb_suppress_tests ;
}
@@ -157,6 +159,7 @@ proc test_at_main {} {
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
if [gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"] {
gdb_suppress_tests ;
}
@@ -170,6 +173,7 @@ proc test_at_main {} {
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
if [gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"] {
gdb_suppress_tests ;
}
@@ -218,6 +222,7 @@ proc test_at_foo {} {
# Print scope1.c::filelocal, which is 2
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] {
gdb_suppress_tests ;
}
@@ -227,6 +232,7 @@ proc test_at_foo {} {
"print filelocal_bss at foo"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"
@@ -234,6 +240,7 @@ proc test_at_foo {} {
"print filelocal_ro at foo"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"
@@ -245,6 +252,7 @@ proc test_at_foo {} {
"print foo::funclocal at foo"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"
@@ -257,6 +265,7 @@ proc test_at_foo {} {
"print foo::funclocal_bss at foo"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_bss"
@@ -269,6 +278,7 @@ proc test_at_foo {} {
"print foo::funclocal_ro at foo"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"
@@ -278,6 +288,7 @@ proc test_at_foo {} {
"print bar::funclocal at foo"
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"
gdb_stop_suppressing_tests;
--
Kevin Buettner
kev@primenet.com, kevinb@redhat.com
More information about the Gdb-patches
mailing list