This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Robustify mi-var-cp


This test fails for me, apparently due to compiler version dependency.
The attached patch makes sure we don't try to access variables 
that are out of scope. OK?

- Volodya

Index: mi-var-cp.cc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-cp.cc,v
retrieving revision 1.5
diff -u -p -r1.5 mi-var-cp.cc
--- mi-var-cp.cc	9 Jan 2007 17:59:13 -0000	1.5
+++ mi-var-cp.cc	9 Jan 2007 20:54:23 -0000
@@ -31,6 +31,8 @@ void reference_update_tests ()
   x = 567;
   /*: mi_varobj_update RX {} "update RX (3)"
     :*/
+  /* Dummy assignment to keep 'x' in scope. */    
+  x = 444;    
 
   /*: END: reference_update :*/
 }
@@ -72,12 +74,11 @@ void base_in_reference_test_main ()
 
 int reference_to_pointer ()
 {
+  /*: BEGIN: reference_to_pointer :*/  
   S s, *ptr_s, *& rptr_s = ptr_s;
   s.i = 67;
   s.j = 89;
   ptr_s = &s;
-  /*: BEGIN: reference_to_pointer :*/
-  return 99;
   /*: 
     mi_create_varobj RPTR rptr_s "create varobj for rptr_s"
 
@@ -91,6 +92,7 @@ int reference_to_pointer ()
     mi_check_varobj_value RPTR.public.i 67 "check i member"
     mi_check_varobj_value RPTR.public.j 89 "check j member"
   :*/
+  return 99;
   /*: END: reference_to_pointer :*/
 }
 

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