This is the mail archive of the gdb-patches@sources.redhat.com 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: tests for MI commands


Again, sorry for not getting back to you on Thursday.

On Thu, Jul 28, 2005 at 01:40:46PM +1200, Nick Roberts wrote:
> I never intended to leave things broken.  You have asked me to fix the
> failures, and I will, but I'm not sure if that means submit further patches to
> the mailing list or commit appropriate fixes.  Based on Mark Kettenis' e-mail,

Submit patches, please.

> I attach a simple fix for mi-var-child.exp.  Does it work in your case?  I

> 2005-07-28  Nick Roberts  <nickrob@snap.net.nz>
> 
> 	* gdb.mi/mi-var-child.exp: Allow struct_declarations.character to be
> 	uninitialized.

First of all, it won't work.  You added:
  value=\"0 '\\\\\\\\$decimal'\"
which still has 0 in it :-)

Second, I get a value of 0 here, but the test still fails. 
func_ptr_struct and func_ptr_ptr aren't initialized either.  Chasing
uninitialized members is going to leave the tests script a bit of a
mess.

Initializing the whole structure proved to be a bit of a pain - these
tests are ridiculously tricky to edit.  But here it is.  Tested on
i686-pc-linux-gnu and committed.  I hope this will be more useful if we
add any additional value-related tests.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

2005-07-31  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.mi/mi-var-child.c (do_children_tests): Initialize
	struct_declarations.
	* gdb.mi/mi-var-child.exp: Step over the initialization of
	struct_declarations.

Index: gdb.mi/mi-var-child.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-child.c,v
retrieving revision 1.1
diff -u -p -r1.1 mi-var-child.c
--- gdb.mi/mi-var-child.c	31 Jul 2005 21:24:25 -0000	1.1
+++ gdb.mi/mi-var-child.c	31 Jul 2005 22:04:14 -0000
@@ -208,6 +208,7 @@ do_children_tests (void)
   int bar;
 
   struct _struct_decl struct_declarations;
+  memset (&struct_declarations, 0, sizeof (struct_declarations));
   weird = &struct_declarations;
 
   struct_declarations.integer = 123;
Index: gdb.mi/mi-var-child.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-child.exp,v
retrieving revision 1.19
diff -u -p -r1.19 mi-var-child.exp
--- gdb.mi/mi-var-child.exp	31 Jul 2005 21:24:25 -0000	1.19
+++ gdb.mi/mi-var-child.exp	31 Jul 2005 22:04:14 -0000
@@ -47,6 +47,10 @@ mi_runto do_children_tests
 #                #
 #####        #####
 
+# Step past the initialization of struct_declarations.
+set line_weird [gdb_get_line_number "weird = &struct_declarations;"]
+mi_execute_to "exec-next" "end-stepping-range" do_children_tests {} ".*${srcfile}" \
+    [expr $line_weird] {} "step \$line_weird"
 
 # Test: c_variable-4.2
 # Desc: create variable "struct_declarations"


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