This is the mail archive of the archer@sourceware.org mailing list for the Archer 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]

[python] misc regression fixes


This fixes most of the test suite regressions on the Python branch.  I
ran a 'make check' of the 'master' branch as the baseline.

There are a few checkpoint regressions.  I haven't looked at those
yet.

And, there is this oddity from cplusfuncs.exp:

print &'foo::operator()(foo&)'
$69 = (void (*)(foo * const, foo &)) 0x8048648 <foo::operator[](foo&)>
(gdb) FAIL: gdb.cp/cplusfuncs.exp: print &'foo::operator()(foo&)'

It prints "operator[]" here, oddly.  I couldn't reproduce it with a
simple test, and valgrind also showed nothing.

Tom

2008-12-08  Tom Tromey  <tromey@redhat.com>

	* value.c (value_free): Handle value==0.

	* gdbtypes.c (create_array_type): Use range_type as parent.

	* cli/cli-cmds.c (init_cli_cmds): Disambiguate help text.

2008-12-08  Tom Tromey  <tromey@redhat.com>

	* gdb.base/help.exp: Update.

diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index e1dc88a..806a68a 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1310,10 +1310,10 @@ Commands defined in this way may have up to ten arguments."));
 Read commands from a file named FILE.\n\
 Optional -v switch (before the filename) causes each command in\n\
 FILE to be echoed as it is executed.\n\
-Optional -p switch (before the filename) causes FILE to be evaluated\n\
-as Python code.\n\
 Note that the file \"%s\" is read automatically in this way\n\
-when GDB is started."), gdbinit);
+when GDB is started.\n\
+Optional -p switch (before the filename) causes FILE to be evaluated\n\
+as Python code."), gdbinit);
   c = add_cmd ("source", class_support, source_command,
 	       source_help_text, &cmdlist);
   set_cmd_completer (c, filename_completer);
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 96a15f5..1d9bc2d 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -844,7 +844,7 @@ create_array_type (struct type *result_type,
 
   if (result_type == NULL)
     {
-      result_type = alloc_type (TYPE_OBJFILE (range_type), element_type);
+      result_type = alloc_type (TYPE_OBJFILE (range_type), range_type);
     }
   else
     {
diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
index 65cb546..ca59ac9 100644
--- a/gdb/testsuite/gdb.base/help.exp
+++ b/gdb/testsuite/gdb.base/help.exp
@@ -602,7 +602,7 @@ gdb_test "help stepi" "Step one instruction exactly\.\[\r\n\]+Argument N means d
 gdb_test "help signal" "Continue program giving it signal.*" "help signal"
 # test help source
 # vxgdb reads .vxgdbinit
-gdb_test "help source" "Read commands from a file named FILE\.\[\r\n\]+Optional -v switch \\(before the filename\\) causes each command in\[\r\n\]+FILE to be echoed as it is executed\.\[\r\n\]+Note that the file \"\[^\"\]*\" is read automatically in this way\[\r\n\]+when GDB is started\." "help source"
+gdb_test "help source" "Read commands from a file named FILE\.\[\r\n\]+Optional -v switch \\(before the filename\\) causes each command in\[\r\n\]+FILE to be echoed as it is executed\.\[\r\n\]+Note that the file \"\[^\"\]*\" is read automatically in this way\[\r\n\]+when GDB is started\.\[\r\n\]+Optional -p switch \\(before the filename\\) causes FILE to be evaluated\[\r\n\]+as Python code\." "help source"
 # test help stack
 test_class_help "stack" {
     "Examining the stack\..*\[\r\n\]+"
diff --git a/gdb/value.c b/gdb/value.c
index d5b047f..9642878 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -275,9 +275,12 @@ allocate_value (struct type *type)
 void
 value_free (struct value *value)
 {
-  type_decref (value->type);
-  type_decref (value->enclosing_type);
-  xfree (value);
+  if (value)
+    {
+      type_decref (value->type);
+      type_decref (value->enclosing_type);
+      xfree (value);
+    }
 }
 
 /* Allocate a  value  that has the correct length


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