public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-jankratochvil-python: cherry-pick: Fix FAILs due to now correctly read-in but unresolved `typedef's.
@ 2009-02-26 16:52 jkratoch
  0 siblings, 0 replies; only message in thread
From: jkratoch @ 2009-02-26 16:52 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-python has been updated
       via  32697aed4550cbdc8ede26167bdca21f36ecb8f6 (commit)
       via  1d3229a480d990e3af9c4d53c385501fad3f7a42 (commit)
       via  64015dc38f646586318cbd09be01f93580a7aa96 (commit)
       via  bed94acc7391ba339aa440d3f07db3aaf605629e (commit)
       via  20340ed988af98c24acd5efac0f36b015d3caf6a (commit)
      from  7f4036e06538041e6bd97c5f57616517c003b3a5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 32697aed4550cbdc8ede26167bdca21f36ecb8f6
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Feb 26 01:01:05 2009 +0100

    cherry-pick: Fix FAILs due to now correctly read-in but unresolved `typedef's.
    
    Regressed on gdb.ada/packed_array.exp.
    
    Due to the change 64015dc38f646586318cbd09be01f93580a7aa96 which started to
    create new `struct symbol's even for `typedef's the Ada support is wrongly
    missing a CHECK_TYPEDEF.
    
    	* ada-lang.c (decode_packed_array_type): Call CHECK_TYPEDEF on the
    	SYMBOL_TYPE result.

commit 1d3229a480d990e3af9c4d53c385501fad3f7a42
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Feb 26 17:39:00 2009 +0100

    Fix gdb.python/python-value.exp typedef lookups as they work now.
    
    This testcase was expecting the looked up type will be found as anonymous.
    This is no longer true after the [jankratochvil-python] commit
    64015dc38f646586318cbd09be01f93580a7aa96 which is a part of the [charset]
    commit f0fab6ed91c0d78127a52afc1965003efe5e64f5.
    
    I find the expectations of this updated testcase to be the correct ones.
    Also removing any file should not change the printed type - the type has to be
    reference counted.
    
    gdb/testsuite/
    	* gdb.python/python-value.exp (test_value_after_death): New test `check
    	initial PTR type'.  Test `print value's type'  now uses the original
    	type name that was looked up.

commit 64015dc38f646586318cbd09be01f93580a7aa96
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Feb 26 17:35:09 2009 +0100

    Fix lookups of typedef - create VAR_DOMAIN symbols for each typedef.
    
    Import the part of the [charset] change
    f0fab6ed91c0d78127a52afc1965003efe5e64f5 which started to create new `struct
    symbol's even for `typedef's.
    
    As the archer merge already imports this change from [charset] the other
    branches need to be kept compatible with the new behavior.
    
    This change also ensures the new typedef has its type name filled in its
    TYPE_NAME.
    
    	* dwarf2read.c (process_die <DW_TAG_typedef>): New.

commit bed94acc7391ba339aa440d3f07db3aaf605629e
Merge: 7f4036e06538041e6bd97c5f57616517c003b3a5 20340ed988af98c24acd5efac0f36b015d3caf6a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Feb 25 00:22:25 2009 +0100

    Merge commit 'origin/archer-tromey-python' into archer-jankratochvil-python

-----------------------------------------------------------------------

Summary of changes:
 gdb/ada-lang.c                            |    1 +
 gdb/dwarf2read.c                          |    1 +
 gdb/python/python.c                       |   10 +++++-----
 gdb/testsuite/gdb.python/python-value.exp |    6 +++++-
 4 files changed, 12 insertions(+), 6 deletions(-)

First 500 lines of diff:
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 77248e4..d9692e0 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -1831,6 +1831,7 @@ decode_packed_array_type (struct type *type)
       return NULL;
     }
   shadow_type = SYMBOL_TYPE (sym);
+  CHECK_TYPEDEF (shadow_type);
 
   if (TYPE_CODE (shadow_type) != TYPE_CODE_ARRAY)
     {
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 409efa6..07dbb1d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2861,6 +2861,7 @@ process_die (struct die_info *die, struct dwarf2_cu *cu)
 
     case DW_TAG_base_type:
     case DW_TAG_subrange_type:
+    case DW_TAG_typedef:
       /* Add a typedef symbol for the type definition, if it has a
          DW_AT_name.  */
       new_symbol (die, read_type_die (die, cu), cu);
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 54b35cd..99f9f40 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -489,7 +489,6 @@ gdbpy_search_memory (PyObject *self, PyObject *args)
   char *pattern_buf;
   ULONGEST pattern_len, search_space_len;
   PyObject *pattern, *list = NULL, *start_addr_obj;
-  struct cleanup *cleanups = NULL;
   volatile struct gdb_exception except;
 
   /* Assume CORE_ADDR corresponds to unsigned long.  */
@@ -535,7 +534,9 @@ gdbpy_search_memory (PyObject *self, PyObject *args)
 	{
 	  if (get_search_pattern (pattern, size, &pattern_buf, &pattern_len))
 	    {
-	      cleanups = make_cleanup (xfree, pattern_buf);
+	      /* Any cleanups get automatically executed on an exception.  */
+	      struct cleanup *cleanups = make_cleanup (xfree, pattern_buf);
+
 	      list = PyList_New (0);
 
 	      while (search_space_len >= pattern_len && found_count < max_count)
@@ -551,14 +552,13 @@ gdbpy_search_memory (PyObject *self, PyObject *args)
 		  PyList_Append (list, PyLong_FromUnsignedLong (found_addr));
 		  ++found_count;
 		}
+
+	      do_cleanups (cleanups);
 	    }
 	}
     }
   GDB_PY_HANDLE_EXCEPTION (except);
 
-  if (cleanups)
-    do_cleanups (cleanups);
-
   return list;
 }
 
diff --git a/gdb/testsuite/gdb.python/python-value.exp b/gdb/testsuite/gdb.python/python-value.exp
index 4abbfbd..9ca9593 100644
--- a/gdb/testsuite/gdb.python/python-value.exp
+++ b/gdb/testsuite/gdb.python/python-value.exp
@@ -232,6 +232,10 @@ proc test_value_after_death {} {
   gdb_py_test_silent_cmd "python ptrtype = gdb.Type('PTR')" \
     "create PTR type" 1
 
+  # Check the type has the expected name.
+  gdb_test "python print ptrtype" "PTR" \
+    "check initial PTR type"
+
   # Kill the inferior and remove the symbols.
   gdb_test "kill" "" "kill the inferior" \
     "Kill the program being debugged. .y or n. $" \
@@ -250,7 +254,7 @@ proc test_value_after_death {} {
     "delete PTR type" 1
 
   # Now see if the value's type is still valid.
-  gdb_test "python print castval.type()" "struct s .." \
+  gdb_test "python print castval.type()" "PTR \\*" \
     "print value's type"
 }
 


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-26 16:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-26 16:52 [SCM] archer-jankratochvil-python: cherry-pick: Fix FAILs due to now correctly read-in but unresolved `typedef's jkratoch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).