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]

Re: [PATCH] Fix variable objects for references to pointers


 > > 2006-12-14 ?Nick Roberts ?<nickrob@snap.net.nz>
 > > 
 > > * gdb.mi/mi-var-cp.exp: New test for references to pointers.
 > > 
 > > * gdb.mi/mi-var-cp.cc: Remove unnecessary string quotes.
 > 
 > This comment likely applies to .exp file, not .cc.  

Yes.

 >                                                     Besides, 
 > it would be better not to mix style changes with essential changes,
 > to simplify review.

I was trying to be consistent.  Previously some arguments were in string
quotes and some weren't.

 > Ah, and I've posted a patch to move most of .exp into .cc file,
 > so I guess we've mid-air collision.
 > 
 > > (reference_to_pointer): New procedure for above test.
 > 
 > Am I missing something, or this change is not included in
 > your mail? Ah, I think it's the CVS problem, whereas added
 > files are not included in diff.

Sorry, I forgot include it.  Its attached below

 > > + set end_of_proc [gdb_get_line_number "return 99;"]
 > > + send_gdb "-exec-next 4\n"
 > > + gdb_expect {
 > > + ? ? -re
 > > "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"reference_to_pointer\",args=\\\[\\\],file=\".*${srcfile}\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$end_of_proc\"\}\r\n$mi_gdb_prompt$"
 > > { + ??????pass "4xnext to return 99" + ? ? }
 > > + ? ? timeout { fail "4xnext in reference_to_pointer (timeout)" }
 > > + }
 > 
 > FWIW, once my "Simplified MI tests" patch is checked in, this block
 > can be just removed.

Sure.

 > > +
 > > + mi_create_varobj RPTR rptr_s "create varobj for rptr_s"
 > > +
 > > + mi_list_varobj_children RPTR {{RPTR.public public 2}} \
 > > + ? ? "list public child of RPTR"
 > > +
 > > + mi_list_varobj_children ?RPTR.public \
 > > + ? ? {{RPTR.public.i i 0 int}
 > > + ? ? ?{RPTR.public.j j 0 int}} "list children of 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"
 > 
 > Looks good. I've poked at this manually and it seems to work like
 > it should.
 > 
 > Now I guess you need to post a patch including the C++ file changes,
 > now that it's in CVS, and we need to find somebody who can actually
 > approve the patch.

I'm pursuing this issue.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


*** mi-var-cp.cc	09 Dec 2006 10:52:03 +1300	1.2
--- mi-var-cp.cc	14 Dec 2006 21:13:21 +1300	
*************** void base_in_reference_test_main ()
*** 39,48 ****
--- 39,57 ----
    base_in_reference_test (s);
  }
  
+ int reference_to_pointer ()
+ {
+   S s, *ptr_s, *& rptr_s = ptr_s;
+   s.i = 67;
+   s.j = 89;
+   ptr_s = &s;
+   return 99;
+ }
  
  int main ()
  {
    reference_update_tests ();
    base_in_reference_test_main ();
+   reference_to_pointer ();
    return 0;
  }


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