Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Robustify mi-var-cp
@ 2007-01-09 20:58 Vladimir Prus
  2007-01-09 21:50 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Prus @ 2007-01-09 20:58 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]


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


[-- Attachment #2: mi-var-cp.diff --]
[-- Type: text/x-diff, Size: 1075 bytes --]

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 :*/
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-09 21:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-09 20:58 Robustify mi-var-cp Vladimir Prus
2007-01-09 21:50 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox