public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-jankratochvil-fedora12: Merge commit 'origin/archer-tromey-python' into archer-jankratochvil-fedora12
@ 2009-09-03 19:16 jkratoch
  0 siblings, 0 replies; 4+ messages in thread
From: jkratoch @ 2009-09-03 19:16 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-fedora12 has been updated
       via  a081d2f12945e9468edd5f4341d3e945bd0fefe9 (commit)
       via  30527757da2857c3d4b5786c4e601f1145beec30 (commit)
       via  7225ece6c898129ad368301a100451e6d1f6386e (commit)
       via  6e7d259f6a49bb3be0f6d94241519c7d23363cdf (commit)
       via  85640ad904cea9dcd9bbdf3cc84c6e4b26a5f9a9 (commit)
       via  a34786f245d01eabb4238244d475b58098ab6df3 (commit)
       via  09ff6f198a5ff0de41e7808532422c807db9d967 (commit)
      from  d25596676e8811b03f8c9aba6bbd04ebaa9ff5db (commit)

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

- Log -----------------------------------------------------------------
commit a081d2f12945e9468edd5f4341d3e945bd0fefe9
Merge: 30527757da2857c3d4b5786c4e601f1145beec30 6e7d259f6a49bb3be0f6d94241519c7d23363cdf
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Thu Sep 3 21:15:07 2009 +0200

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

commit 30527757da2857c3d4b5786c4e601f1145beec30
Merge: 7225ece6c898129ad368301a100451e6d1f6386e 85640ad904cea9dcd9bbdf3cc84c6e4b26a5f9a9
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Thu Sep 3 21:15:02 2009 +0200

    Merge commit 'origin/archer-tromey-dw-op-value' into archer-jankratochvil-fedora12

commit 7225ece6c898129ad368301a100451e6d1f6386e
Author: Sami Wagiaalla <swagiaal@redhat.com>
Date:   Thu Sep 3 10:35:01 2009 -0400

    Eleminated redundant searches performed by cp_lookup_symbol_imports.

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

Summary of changes:
 gdb/cp-namespace.c                            |   46 ++++++++++++++++---
 gdb/cp-support.h                              |    3 +-
 gdb/dwarf2-frame.c                            |    8 +++-
 gdb/dwarf2expr.c                              |   10 +++-
 gdb/symtab.c                                  |    2 +-
 gdb/testsuite/gdb.cp/namespace-stress.cc      |   60 +++++++++++++++++++++++++
 gdb/testsuite/gdb.cp/namespace-stress.exp     |   50 ++++++++++++++++++++
 gdb/testsuite/gdb.mi/mi-var-invalidate.exp    |    6 +-
 gdb/testsuite/gdb.python/python-mi.exp        |   11 +++++
 gdb/testsuite/gdb.python/python-prettyprint.c |    3 +
 gdb/varobj.c                                  |   29 +++++++++---
 11 files changed, 203 insertions(+), 25 deletions(-)
 create mode 100644 gdb/testsuite/gdb.cp/namespace-stress.cc
 create mode 100644 gdb/testsuite/gdb.cp/namespace-stress.exp

First 500 lines of diff:
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 5805a30..7672b2e 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -317,7 +317,7 @@ cp_lookup_symbol_namespace (const char *scope,
   /* Search for name in namespaces imported to this and parent blocks.  */
   while (block != NULL)
     {
-      sym = cp_lookup_symbol_imports(scope,name, block, domain,0);
+      sym = cp_lookup_symbol_imports(scope,name, block, domain,0,1);
 
       if (sym)
         return sym;
@@ -407,21 +407,47 @@ cp_lookup_symbol_in_namespace (const char *namespace,
 }
 
 /* Search for NAME by applying all import statements belonging
-   to BLOCK which are applicable in SCOPE.  */
+   to BLOCK which are applicable in SCOPE. If DECLARATION_ONLY the search
+   is restricted to using declarations.
+   Example:
+
+     namespace A{
+       int x;
+     }
+     using A::x;
+
+   If SEARCH_PARENTS the search will include imports which are applicable in
+   parents of scopes.
+   Example:
+
+     namespace A{
+       using namespace X;
+       namespace B{
+         using namespace Y;
+       }
+     }
+
+   If SCOPE is "A::B" and SEARCH_PARENTS is true the imports of namespaces X
+   and Y will be considered. If SEARCH_PARENTS is false only the import of Y
+   is considered.  */
 
 struct symbol *
 cp_lookup_symbol_imports (const char *scope,
                             const char *name,
                             const struct block *block,
                             const domain_enum domain,
-                            int declaration_only)
+                            int declaration_only,
+                            int search_parents)
 {
   struct using_direct *current;
   struct symbol *sym = NULL;
+  int directive_match;
+  int current_line = find_pc_line (get_frame_pc (get_current_frame ()), 0).line;
 
   if(!declaration_only)
-  /* First, try to find the symbol in the given namespace.  */
-  sym = cp_lookup_symbol_in_namespace (scope, name, block, domain);
+    /* First, try to find the symbol in the given namespace.  */
+    sym = cp_lookup_symbol_in_namespace (scope, name, block, domain);
+
   if ( sym != NULL)
     return sym;
 
@@ -433,12 +459,15 @@ cp_lookup_symbol_imports (const char *scope,
        current != NULL;
        current = current->next)
     {
-      int current_line = find_pc_line (get_frame_pc (get_current_frame ()), 0).line;
   
       /* If the import destination is the current scope or one of its ancestors then
          it is applicable.  */
-      if (strncmp (scope, current->import_dest,
-          strlen(current->import_dest)) == 0 &&
+      directive_match = search_parents ?
+                        strncmp (scope, current->import_dest,
+                                 strlen(current->import_dest)) == 0 :
+                        strcmp (scope, current->import_dest) == 0;
+
+      if (directive_match &&
           current->line_number < current_line &&
           !current->searched)
 	{
@@ -485,6 +514,7 @@ cp_lookup_symbol_imports (const char *scope,
 		                                name,
 		                                block,
 		                                domain,
+		                                0,
 		                                0);
 	    }
 
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index 022f102..3f48f98 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -131,7 +131,8 @@ struct symbol *cp_lookup_symbol_imports (const char *scope,
                                          const char *name,
                                          const struct block *block,
                                          const domain_enum domain,
-                                         int declaration_only);
+                                         int declaration_only,
+                                         int search_parents);
 
 extern struct symbol *cp_lookup_symbol_namespace (const char *namespace,
                                                   const char *name,
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 392a1b4..e66f007 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -380,7 +380,13 @@ execute_stack_op (gdb_byte *exp, ULONGEST len, int addr_size,
 
   if (ctx->location == DWARF_VALUE_REGISTER)
     result = read_reg (this_frame, result);
-  /* FIXME */
+  else if (ctx->location != DWARF_VALUE_MEMORY)
+    {
+      /* This is actually invalid DWARF, but if we ever do run across
+	 it somehow, we might as well support it.  So, instead, report
+	 it as unimplemented.  */
+      error (_("Not implemented: computing unwound register using explicit value operator"));
+    }
 
   do_cleanups (old_chain);
 
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index 228eae7..0644b46 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -299,7 +299,9 @@ signed_address_type (struct gdbarch *gdbarch, int addr_size)
 static void
 require_composition (gdb_byte *op_ptr, gdb_byte *op_end, const char *op_name)
 {
-  /* FIXME: DW_OP_GNU_uninit?  */
+  /* It seems like DW_OP_GNU_uninit should be handled here.  However,
+     it doesn't seem to make sense for DW_OP_*_value, and it was not
+     checked at the other place that this function is called.  */
   if (op_ptr != op_end && *op_ptr != DW_OP_piece && *op_ptr != DW_OP_bit_piece)
     error (_("DWARF-2 expression error: `%s' operations must be "
 	     "used either alone or in conjuction with DW_OP_piece "
@@ -470,7 +472,7 @@ execute_stack_op (struct dwarf_expr_context *ctx,
 	  {
 	    ULONGEST len;
 	    op_ptr = read_uleb128 (op_ptr, op_end, &len);
-	    if (op_ptr + len >= op_end)
+	    if (op_ptr + len > op_end)
 	      error (_("DW_OP_implicit_value: too few bytes available."));
 	    ctx->len = len;
 	    ctx->data = op_ptr;
@@ -548,10 +550,12 @@ execute_stack_op (struct dwarf_expr_context *ctx,
                specific this_base method.  */
 	    (ctx->get_frame_base) (ctx->baton, &datastart, &datalen);
 	    dwarf_expr_eval (ctx, datastart, datalen);
+	    if (ctx->location == DWARF_VALUE_LITERAL
+		|| ctx->location == DWARF_VALUE_STACK)
+	      error (_("Not implemented: computing frame base using explicit value operator"));
 	    result = dwarf_expr_fetch (ctx, 0);
 	    if (ctx->location == DWARF_VALUE_REGISTER)
 	      result = (ctx->read_reg) (ctx->baton, result);
-	    /* FIXME: other DWARF_VALUE_*?? */
 	    result = result + offset;
 	    ctx->stack_len = before_stack_len;
 	    ctx->location = DWARF_VALUE_MEMORY;
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 9c102c0..75b907f 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1382,7 +1382,7 @@ lookup_symbol_aux_local (const char *name, const struct block *block,
       if (language == language_cplus )
         {
           sym = cp_lookup_symbol_imports (block_scope (block_iterator), name,
-                                          block_iterator, domain, 1);
+                                          block_iterator, domain, 1, 1);
 
           if (sym != NULL)
             return sym;
diff --git a/gdb/testsuite/gdb.cp/namespace-stress.cc b/gdb/testsuite/gdb.cp/namespace-stress.cc
new file mode 100644
index 0000000..f34083e
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/namespace-stress.cc
@@ -0,0 +1,60 @@
+
+namespace A{ int x; }
+namespace B{ int x; }
+namespace C{ int x; }
+namespace D{ int x; }
+namespace E{ int x; }
+namespace F{ int x; }
+namespace G{ int x; }
+namespace H{ int x; }
+namespace I{ int x; }
+namespace J{ int x; }
+namespace K{ int x; }
+namespace L{ int x; }
+namespace M{ int x; }
+namespace N{ int x; }
+namespace O{ int x; }
+namespace P{ int x; }
+namespace Q{ int x; }
+namespace R{ int x; }
+namespace S{ int x; }
+namespace T{ int x; }
+namespace U{ int x; }
+namespace V{ int x; }
+namespace W{ int x; }
+namespace X{ int x; }
+namespace Y{ int x; }
+namespace Z{ int x; }
+
+
+int main(){
+
+  using namespace A;
+  using namespace B;
+  using namespace C;
+  using namespace D;
+  using namespace E;
+  using namespace F;
+  using namespace G;
+  using namespace H;
+  using namespace I;
+  using namespace J;
+  using namespace K;
+  using namespace L;
+  using namespace M;
+  using namespace N;
+  using namespace O;
+  using namespace P;
+  using namespace Q;
+  using namespace R;
+  using namespace S;
+  using namespace T;
+  using namespace U;
+  using namespace V;
+  using namespace W;
+  using namespace X;
+  using namespace Y;
+  using namespace Z;
+
+  return 0;
+}
\ No newline at end of file
diff --git a/gdb/testsuite/gdb.cp/namespace-stress.exp b/gdb/testsuite/gdb.cp/namespace-stress.exp
new file mode 100644
index 0000000..1806523
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/namespace-stress.exp
@@ -0,0 +1,50 @@
+# Copyright 2008 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile namespace-stress
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+    untested "Couldn't compile test program"
+    return -1
+}
+
+if [get_compiler_info ${binfile}] {
+    return -1;
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+    perror "couldn't run to breakpoint main"
+    continue
+}
+
+############################################
+# Test that the search can fail efficiently 
+
+gdb_test "print y" "No symbol \"y\" in current context."
diff --git a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp
index 05d46fa..4b95674 100644
--- a/gdb/testsuite/gdb.mi/mi-var-invalidate.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-invalidate.exp
@@ -72,7 +72,7 @@ mi_runto main
 
 # Check local variable is "invalid".
 mi_gdb_test "-var-update linteger" \
-	"\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\"\}\\\]" \
+	"\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\",has_more=\"0\"\}\\\]" \
 	"linteger not anymore in scope due to binary changes"
 
 mi_gdb_test "-var-info-type linteger" \
@@ -97,7 +97,7 @@ mi_delete_breakpoints
 mi_gdb_load ${binfile2}
 # Check local variable are "invalid"
 mi_gdb_test "-var-update linteger" \
-	"\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\"\}\\\]" \
+	"\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\",has_more=\"0\"\}\\\]" \
 	"linteger not valid anymore due to binary changes"
 
 mi_gdb_test "-var-info-type linteger" \
@@ -106,7 +106,7 @@ mi_gdb_test "-var-info-type linteger" \
 
 # Check global variable are still correct.
 mi_gdb_test "-var-update global_simple" \
-	"\\^done,changelist=\\\[\{name=\"global_simple\",in_scope=\"invalid\"\}\\\]" \
+	"\\^done,changelist=\\\[\{name=\"global_simple\",in_scope=\"invalid\",has_more=\"0\"\}\\\]" \
 	"global_simple not anymore in scope due to binary changes"
 
 mi_gdb_test "-var-info-type global_simple" \
diff --git a/gdb/testsuite/gdb.python/python-mi.exp b/gdb/testsuite/gdb.python/python-mi.exp
index 018c6a2..7791775 100644
--- a/gdb/testsuite/gdb.python/python-mi.exp
+++ b/gdb/testsuite/gdb.python/python-mi.exp
@@ -61,6 +61,17 @@ mi_delete_varobj container "delete varobj"
 
 mi_gdb_test "-enable-pretty-printing" ""
 
+mi_create_varobj_checked string string_1 \
+    "struct string_repr" \
+    "create string_1 varobj"
+
+mi_gdb_test "-data-evaluate-expression \"string_1 = string_2\"" ".*" \
+    "assign string_1 from string_2"
+
+mi_gdb_test "-var-update string" \
+    "\\^done,changelist=\\\[{name=\"string\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"}\\\]" \
+    "update string varobj after assignment"
+
 mi_create_dynamic_varobj container c \
   "create container varobj"
 
diff --git a/gdb/testsuite/gdb.python/python-prettyprint.c b/gdb/testsuite/gdb.python/python-prettyprint.c
index 5fbd534..adf66b5 100644
--- a/gdb/testsuite/gdb.python/python-prettyprint.c
+++ b/gdb/testsuite/gdb.python/python-prettyprint.c
@@ -155,6 +155,9 @@ struct nullstr
   char *s;
 };
 
+struct string_repr string_1 = { { "one" } };
+struct string_repr string_2 = { { "two" } };
+
 int
 main ()
 {
diff --git a/gdb/varobj.c b/gdb/varobj.c
index a730095..490ca33 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -1563,9 +1563,6 @@ install_new_value (struct varobj *var, struct value *value, int initial)
   var->value = value;
   if (value != NULL)
     value_incref (value);
-  if (var->print_value)
-    xfree (var->print_value);
-  var->print_value = print_value;
   if (value && value_lazy (value) && intentionally_not_fetched)
     var->not_fetched = 1;
   else
@@ -1574,6 +1571,19 @@ install_new_value (struct varobj *var, struct value *value, int initial)
 
   install_new_value_visualizer (var);
 
+  /* If we installed a pretty-printer, re-compare the printed version
+     to see if the variable changed.  */
+  if (var->pretty_printer)
+    {
+      xfree (print_value);
+      print_value = value_get_print_value (var->value, var->format, var);
+      if (!var->print_value || strcmp (var->print_value, print_value) != 0)
+	changed = 1;
+    }
+  if (var->print_value)
+    xfree (var->print_value);
+  var->print_value = print_value;
+
   gdb_assert (!var->value || value_type (var->value));
 
   return changed;
@@ -1758,11 +1768,14 @@ VEC(varobj_update_result) *varobj_update (struct varobj **varp, int explicit)
 		 it as unchanged -- presumably, such varobj is not yet
 		 expanded in the UI, so we need not bother getting
 		 it.  */
-	      if (varobj_has_more (v, 0))
-		continue;
+	      if (!varobj_has_more (v, 0))
+		{
+		  update_dynamic_varobj_children (v, NULL, NULL, &dummy, 0, 0);
+		  if (varobj_has_more (v, 0))
+		    r.changed = 1;
+		}
 
-	      update_dynamic_varobj_children (v, NULL, NULL, &dummy, 0, 0);
-	      if (varobj_has_more (v, 0))
+	      if (r.changed)
 		VEC_safe_push (varobj_update_result, result, &r);
 
 	      continue;


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


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

* [SCM]  archer-jankratochvil-fedora12: Merge commit 'origin/archer-tromey-python' into archer-jankratochvil-fedora12
@ 2009-09-10 20:55 jkratoch
  0 siblings, 0 replies; 4+ messages in thread
From: jkratoch @ 2009-09-10 20:55 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-fedora12 has been updated
       via  941eb487a42933e442cb4d11344cda96ecb8a04d (commit)
       via  f70f792b9f80a4eadc11fe8643dcfaad0a3296fb (commit)
       via  878e303643209f7451796b189ab3c982d0669bd7 (commit)
       via  439b2c04aa5870f7ac1c7a094363e7802e0471ff (commit)
       via  d31f12df6e630f933250ecd39f93273eb905c31a (commit)
       via  d325e18acb25eb143f7b3d402dfc42fdecdeed36 (commit)
       via  a9d097a4f1ecbf9dc6178975dc600b9cd05bfbd7 (commit)
       via  aaa78ac0a4b0ea8916ad44ad3b1bd3ca48ed7857 (commit)
       via  afa19af4acee87d926f2eed004c86c57ff1a6dce (commit)
       via  057a92145ba5855753b1983cde7357dde1818013 (commit)
       via  6e19c0b1cceb8e2486a5351fb6a358d7dddf0ace (commit)
       via  7656a3d39d82b8982f23b4279762d6495b08e151 (commit)
       via  44643559d56728995ab3e4f41ade08741b1f9e32 (commit)
       via  8aa0f9b13f24c024bbc778b099a8d4331428d2b1 (commit)
       via  f1ba9d5b070c1685b4652fe1fa6faa78fe0fe726 (commit)
       via  41d68796305f7aad0e396459d27fe683e17c4508 (commit)
       via  8b88696b6d6e87fede86fb804e813fda81370206 (commit)
       via  40f722c9bbee86df71f92420411afe9c7e9621a7 (commit)
       via  47a2cf2d557f260c4e6e98a60b88c12bb68ff036 (commit)
       via  5a3a159521fe1f1701fac78648769477619b526b (commit)
       via  c3e230fb3c372c78cd908efd02adb989b3320a16 (commit)
       via  27e200d1792d17772c81d4390d94a3bf9bc997ec (commit)
       via  7b5a7da962b37c24a558b04091a9c80eb7fdf6a2 (commit)
      from  b27001e28231ad66293a243417a704b554f6ad7c (commit)

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

- Log -----------------------------------------------------------------
commit 941eb487a42933e442cb4d11344cda96ecb8a04d
Merge: b27001e28231ad66293a243417a704b554f6ad7c f70f792b9f80a4eadc11fe8643dcfaad0a3296fb
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Sep 10 22:45:16 2009 +0200

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

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

Summary of changes:
 bfd/ChangeLog                                      |   91 +++++++++
 bfd/aoutx.h                                        |   44 +++--
 bfd/archive.c                                      |   66 ++++---
 bfd/archive64.c                                    |    4 +-
 bfd/archures.c                                     |    2 +-
 bfd/bfd-in2.h                                      |   17 +-
 bfd/bfd.c                                          |   27 ++--
 bfd/bfdio.c                                        |   12 +-
 bfd/binary.c                                       |    4 +-
 bfd/cache.c                                        |    6 +-
 bfd/coffcode.h                                     |   24 ++--
 bfd/coffgen.c                                      |   28 ++--
 bfd/cofflink.c                                     |   39 ++--
 bfd/compress.c                                     |    2 +-
 bfd/dwarf1.c                                       |    9 +-
 bfd/dwarf2.c                                       |   92 +++++-----
 bfd/elf-attrs.c                                    |    6 +-
 bfd/elf-bfd.h                                      |   42 +++--
 bfd/elf-eh-frame.c                                 |   33 ++--
 bfd/elf-strtab.c                                   |   13 +-
 bfd/elf.c                                          |  180 ++++++++++--------
 bfd/elf32-arm.c                                    |   23 ++-
 bfd/elf32-i386.c                                   |   14 +-
 bfd/elf64-x86-64.c                                 |    5 +-
 bfd/elfcode.h                                      |   55 ++++--
 bfd/elfcore.h                                      |    2 +-
 bfd/elflink.c                                      |  203 +++++++++++---------
 bfd/format.c                                       |    2 +-
 bfd/hash.c                                         |   18 +-
 bfd/ihex.c                                         |   15 +-
 bfd/libaout.h                                      |   34 ++--
 bfd/libbfd.c                                       |   40 ++--
 bfd/linker.c                                       |   52 +++---
 bfd/mach-o.c                                       |   52 +++++-
 bfd/mach-o.h                                       |   28 +++-
 bfd/merge.c                                        |   12 +-
 bfd/opncls.c                                       |   39 ++--
 bfd/peXXigen.c                                     |   10 +-
 bfd/peicode.h                                      |    4 +-
 bfd/reloc.c                                        |    2 +-
 bfd/section.c                                      |    5 +-
 bfd/simple.c                                       |   10 +-
 bfd/srec.c                                         |   25 ++--
 bfd/stabs.c                                        |   18 +-
 bfd/syms.c                                         |   22 +-
 bfd/targets.c                                      |    2 +-
 bfd/tekhex.c                                       |    7 +-
 bfd/verilog.c                                      |    6 +-
 bfd/version.h                                      |    2 +-
 config/ChangeLog                                   |   13 ++
 config/stdint.m4                                   |   14 ++
 gdb/ChangeLog                                      |   60 ++++++
 gdb/Makefile.in                                    |  128 ++++++------
 gdb/NEWS                                           |    8 +
 gdb/block.c                                        |    4 +
 gdb/blockframe.c                                   |    1 -
 gdb/configure                                      |    4 +-
 gdb/configure.ac                                   |    4 +-
 gdb/doc/ChangeLog                                  |    5 +
 gdb/doc/gdb.texinfo                                |   23 +++
 gdb/frame.c                                        |   55 +++++-
 gdb/mi/mi-main.c                                   |    4 -
 gdb/python/{python-block.c => py-block.c}          |    0
 .../{python-breakpoint.c => py-breakpoint.c}       |    0
 gdb/python/{python-cmd.c => py-cmd.c}              |    0
 gdb/python/{python-frame.c => py-frame.c}          |    0
 gdb/python/{python-function.c => py-function.c}    |    0
 gdb/python/{python-hooks.c => py-hooks.c}          |    0
 gdb/python/{python-inferior.c => py-inferior.c}    |    0
 gdb/python/{python-infthread.c => py-infthread.c}  |    0
 gdb/python/{python-membuf.c => py-membuf.c}        |    0
 gdb/python/{python-objfile.c => py-objfile.c}      |    0
 gdb/python/{python-param.c => py-param.c}          |    0
 .../{python-prettyprint.c => py-prettyprint.c}     |    0
 gdb/python/{python-symbol.c => py-symbol.c}        |    0
 gdb/python/{python-symtab.c => py-symtab.c}        |    0
 gdb/python/{python-type.c => py-type.c}            |    0
 gdb/python/{python-utils.c => py-utils.c}          |    0
 gdb/python/{python-value.c => py-value.c}          |    0
 gdb/rs6000-nat.c                                   |   27 ++--
 gdb/testsuite/ChangeLog                            |   22 ++
 gdb/testsuite/gdb.python/Makefile.in               |    2 +-
 .../gdb.python/{python-cmd.exp => py-cmd.exp}      |    0
 .../gdb.python/{python-frame.c => py-frame.c}      |    0
 .../gdb.python/{python-frame.exp => py-frame.exp}  |    2 +-
 .../{python-function.exp => py-function.exp}       |    0
 .../{python-inferior.c => py-inferior.c}           |    0
 .../{python-inferior.exp => py-inferior.exp}       |    2 +-
 .../{python-infthread.c => py-infthread.c}         |    0
 .../{python-infthread.exp => py-infthread.exp}     |    2 +-
 .../gdb.python/{python-mi.exp => py-mi.exp}        |    2 +-
 .../{python-prettyprint.c => py-prettyprint.c}     |    0
 .../{python-prettyprint.exp => py-prettyprint.exp} |    2 +-
 .../{python-prettyprint.py => py-prettyprint.py}   |    0
 .../{python-template.cc => py-template.cc}         |    0
 .../{python-template.exp => py-template.exp}       |    2 +-
 .../gdb.python/{python-value.c => py-value.c}      |    0
 .../gdb.python/{python-value.exp => py-value.exp}  |   41 ++++-
 gdb/top.c                                          |   38 ++++
 gdb/version.in                                     |    2 +-
 include/ChangeLog                                  |    5 +
 include/bfdlink.h                                  |   12 +-
 include/elf/sparc.h                                |    4 +-
 libdecnumber/ChangeLog                             |    8 +
 opcodes/ChangeLog                                  |   14 ++
 opcodes/i386-dis.c                                 |    4 +-
 opcodes/s390-dis.c                                 |   11 +-
 107 files changed, 1276 insertions(+), 697 deletions(-)
 rename gdb/python/{python-block.c => py-block.c} (100%)
 rename gdb/python/{python-breakpoint.c => py-breakpoint.c} (100%)
 rename gdb/python/{python-cmd.c => py-cmd.c} (100%)
 rename gdb/python/{python-frame.c => py-frame.c} (100%)
 rename gdb/python/{python-function.c => py-function.c} (100%)
 rename gdb/python/{python-hooks.c => py-hooks.c} (100%)
 rename gdb/python/{python-inferior.c => py-inferior.c} (100%)
 rename gdb/python/{python-infthread.c => py-infthread.c} (100%)
 rename gdb/python/{python-membuf.c => py-membuf.c} (100%)
 rename gdb/python/{python-objfile.c => py-objfile.c} (100%)
 rename gdb/python/{python-param.c => py-param.c} (100%)
 rename gdb/python/{python-prettyprint.c => py-prettyprint.c} (100%)
 rename gdb/python/{python-symbol.c => py-symbol.c} (100%)
 rename gdb/python/{python-symtab.c => py-symtab.c} (100%)
 rename gdb/python/{python-type.c => py-type.c} (100%)
 rename gdb/python/{python-utils.c => py-utils.c} (100%)
 rename gdb/python/{python-value.c => py-value.c} (100%)
 rename gdb/testsuite/gdb.python/{python-cmd.exp => py-cmd.exp} (100%)
 rename gdb/testsuite/gdb.python/{python-frame.c => py-frame.c} (100%)
 rename gdb/testsuite/gdb.python/{python-frame.exp => py-frame.exp} (99%)
 rename gdb/testsuite/gdb.python/{python-function.exp => py-function.exp} (100%)
 rename gdb/testsuite/gdb.python/{python-inferior.c => py-inferior.c} (100%)
 rename gdb/testsuite/gdb.python/{python-inferior.exp => py-inferior.exp} (99%)
 rename gdb/testsuite/gdb.python/{python-infthread.c => py-infthread.c} (100%)
 rename gdb/testsuite/gdb.python/{python-infthread.exp => py-infthread.exp} (98%)
 rename gdb/testsuite/gdb.python/{python-mi.exp => py-mi.exp} (99%)
 rename gdb/testsuite/gdb.python/{python-prettyprint.c => py-prettyprint.c} (100%)
 rename gdb/testsuite/gdb.python/{python-prettyprint.exp => py-prettyprint.exp} (98%)
 rename gdb/testsuite/gdb.python/{python-prettyprint.py => py-prettyprint.py} (100%)
 rename gdb/testsuite/gdb.python/{python-template.cc => py-template.cc} (100%)
 rename gdb/testsuite/gdb.python/{python-template.exp => py-template.exp} (98%)
 rename gdb/testsuite/gdb.python/{python-value.c => py-value.c} (100%)
 rename gdb/testsuite/gdb.python/{python-value.exp => py-value.exp} (91%)

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 9fd34c2..f804d9b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,94 @@
+2009-09-09  Martin Thuresson  <martin@mtme.org>
+
+	Update soruces to compile cleanly with -Wc++-compat:
+	* aoutx.h: Add casts.
+	* archive.c: Add casts.
+	* archive64.c: Add casts.
+	* archures.c: Add casts.
+	* bfd-in2.h: Regenerated.
+	* bfd.c: Add casts. (enum bfd_direction): Move out to top level.
+	* bfdio.c: Add casts.
+	* binary.c: Add casts.
+	* cache.c (cache_bseek,cache_bread_1,cache_bwrite): Updated
+	parameter to use enum value instead of int.
+	* coffcode.h: Add casts.
+	* coffgen.c: Add casts.
+	* cofflink.c: Add casts.
+	* compress.c: Add casts.
+	* dwarf1.c: Add casts.
+	* dwarf2.c: Add casts. (struct dwarf2_debug): Rename member bfd to
+	bfd_ptr. Update code to use new name.
+	* elf-attrs.c: Add casts.
+	* elf-bfd.h (elf_link_virtual_table_entry): Gives name to
+	anonymous struct. (union gotplt_union, struct
+	elf_link_virtual_table_entry): Move to top level.
+	* elf-eh-frame.c: Add casts.
+	* elf-strtab.c: Add casts.
+	* elf.c: Add casts. (_bfd_elm_make_Section_from_phdr): Change
+	argument name from typename to type_name.
+	* elf32-i386.c: Add casts.
+	* elf64-x86-64.c: Add casts.
+	* elfcode.h: Add casts.
+	* elfcore.h: Add casts.
+	* elflink.c: Add casts.
+	* format.c: Add casts.
+	* hash.c: Add casts.
+	* ihex.c: Add casts.
+	* libaout.h (enum aout_subformat, enum aout_magic): Move to top
+	level.
+	* libbfd.c: Add casts.
+	* linker.c: Add casts.
+	* merge.c: Add casts.
+	* opncls.c: Add casts.
+	* peXXigen.c: Add casts.
+	* peicode.h: Add casts.
+	* reloc.c: Add casts.
+	* section.c: Add casts.
+	* simple.c: Add casts.
+	* srec.c: Add casts.
+	* stabs.c: Add casts.
+	* syms.c: Add casts.
+	* targets.c: Add casts.
+	* tekhex.c: Add casts.
+	* verilog.c: Add casts.
+
+2009-09-09  Paolo Bonzini  <bonzini@gnu.org>
+
+	* configure: Regenerate.
+
+2009-09-09  Daniel Jacobowitz  <dan@codesourcery.com>
+
+	* elf32-arm.c (elf32_arm_final_link_relocate): Set sym_flags
+	for the mode of target PLT entries.
+	(allocate_dynrelocs): Only adjust symbol type if setting its
+	value.
+
+2009-09-09  Paolo Bonzini  <bonzini@gnu.org>
+
+	* configure: Regenerate.
+
+2009-09-09  Nick Clifton  <nickc@redhat.com>
+
+	PR 10478:
+	* elf.c (bfd_section_from_shdr): Do not reject sparc binaries with
+	section headers containing sh_link values of SHN_BEFORE or
+	SHN_AFTER.
+	* elfcode.h (elf_object_p): Likewise.
+
+2009-09-09  Tristan Gingold  <gingold@adacore.com>
+
+	Handle DYLD_INFO introduced by Darwin10.
+	* mach-o.h (bfd_mach_o_load_command_type): Add
+	BFD_MACH_O_LC_DYLD_INFO.
+	(bfd_mach_o_dyld_info_command): New type.
+	(bfd_mach_o_load_command): Add dyld_info field.
+	* mach-o.c (bfd_mach_o_scan_read_str): Reduce size of buf.
+	(bfd_mach_o_scan_read_dyld_info): New function.
+	(bfd_mach_o_scan_read_command): Handle BFD_MACH_O_LC_DYLD_INFO.
+	(bfd_mach_o_bfd_print_private_bfd_data): Ditto.
+	(bfd_mach_o_load_command_name): AddB FD_MACH_O_LC_DYLD_INFO.
+	(bfd_mach_o_print_dyld_info): New function.
+
 2009-09-09  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
 
 	* elf32-cr16.c (elf32_cr16_relocate_section): Add code to discard the
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 1dfd7a6..23fd5c4 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -464,7 +464,7 @@ NAME (aout, some_aout_object_p) (bfd *abfd,
   const bfd_target *result;
   bfd_size_type amt = sizeof (* rawptr);
 
-  rawptr = bfd_zalloc (abfd, amt);
+  rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, amt);
   if (rawptr == NULL)
     return NULL;
 
@@ -679,7 +679,7 @@ NAME (aout, mkobject) (bfd *abfd)
 
   bfd_set_error (bfd_error_system_call);
 
-  rawptr = bfd_zalloc (abfd, amt);
+  rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, amt);
   if (rawptr == NULL)
     return FALSE;
 
@@ -1309,7 +1309,7 @@ aout_get_external_symbols (bfd *abfd)
       /* We allocate using malloc to make the values easy to free
 	 later on.  If we put them on the objalloc it might not be
 	 possible to free them.  */
-      syms = bfd_malloc (count * EXTERNAL_NLIST_SIZE);
+      syms = (struct external_nlist *) bfd_malloc (count * EXTERNAL_NLIST_SIZE);
       if (syms == NULL)
 	return FALSE;
 
@@ -1349,7 +1349,7 @@ aout_get_external_symbols (bfd *abfd)
 	return FALSE;
       strings = (char *) obj_aout_string_window (abfd).data;
 #else
-      strings = bfd_malloc (stringsize + 1);
+      strings = (char *) bfd_malloc (stringsize + 1);
       if (strings == NULL)
 	return FALSE;
 
@@ -1750,7 +1750,7 @@ NAME (aout, slurp_symbol_table) (bfd *abfd)
     return TRUE;		/* Nothing to do.  */
 
   cached_size *= sizeof (aout_symbol_type);
-  cached = bfd_zmalloc (cached_size);
+  cached = (aout_symbol_type *) bfd_zmalloc (cached_size);
   if (cached == NULL)
     return FALSE;
 
@@ -2311,7 +2311,7 @@ NAME (aout, slurp_reloc_table) (bfd *abfd, sec_ptr asect, asymbol **symbols)
     return TRUE;		/* Nothing to be done.  */
 
   amt = count * sizeof (arelent);
-  reloc_cache = bfd_zmalloc (amt);
+  reloc_cache = (arelent *) bfd_zmalloc (amt);
   if (reloc_cache == NULL)
     return FALSE;
 
@@ -2372,7 +2372,7 @@ NAME (aout, squirt_out_relocs) (bfd *abfd, asection *section)
 
   each_size = obj_reloc_entry_size (abfd);
   natsize = (bfd_size_type) each_size * count;
-  native = bfd_zalloc (abfd, natsize);
+  native = (unsigned char *) bfd_zalloc (abfd, natsize);
   if (!native)
     return FALSE;
 
@@ -2786,7 +2786,7 @@ NAME (aout, find_nearest_line) (bfd *abfd,
     adata (abfd).line_buf = buf = NULL;
   else
     {
-      buf = bfd_malloc (filelen + funclen + 3);
+      buf = (char *) bfd_malloc (filelen + funclen + 3);
       adata (abfd).line_buf = buf;
       if (buf == NULL)
 	return FALSE;
@@ -2880,7 +2880,8 @@ NAME (aout, link_hash_newfunc) (struct bfd_hash_entry *entry,
   /* Allocate the structure if it has not already been allocated by a
      subclass.  */
   if (ret == NULL)
-    ret = bfd_hash_allocate (table, sizeof (* ret));
+    ret = (struct aout_link_hash_entry *) bfd_hash_allocate (table,
+                                                             sizeof (* ret));
   if (ret == NULL)
     return NULL;
 
@@ -2919,7 +2920,7 @@ NAME (aout, link_hash_table_create) (bfd *abfd)
   struct aout_link_hash_table *ret;
   bfd_size_type amt = sizeof (* ret);
 
-  ret = bfd_malloc (amt);
+  ret = (struct aout_link_hash_table *) bfd_malloc (amt);
   if (ret == NULL)
     return NULL;
 
@@ -2974,7 +2975,7 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
      table, but keeping the list is more efficient.  Perhaps this
      should be conditional on info->keep_memory.  */
   amt = sym_count * sizeof (struct aout_link_hash_entry *);
-  sym_hash = bfd_alloc (abfd, amt);
+  sym_hash = (struct aout_link_hash_entry **) bfd_alloc (abfd, amt);
   if (sym_hash == NULL)
     return FALSE;
   obj_aout_sym_hashes (abfd) = sym_hash;
@@ -3338,8 +3339,9 @@ aout_link_check_ar_symbols (bfd *abfd,
 		  /* Turn the current link symbol into a common
 		     symbol.  It is already on the undefs list.  */
 		  h->type = bfd_link_hash_common;
-		  h->u.c.p = bfd_hash_allocate (&info->hash->table,
-						sizeof (struct bfd_link_hash_common_entry));
+		  h->u.c.p = (struct bfd_link_hash_common_entry *)
+                      bfd_hash_allocate (&info->hash->table,
+                                         sizeof (struct bfd_link_hash_common_entry));
 		  if (h->u.c.p == NULL)
 		    return FALSE;
 
@@ -3509,7 +3511,8 @@ aout_link_includes_newfunc (struct bfd_hash_entry *entry,
   /* Allocate the structure if it has not already been allocated by a
      subclass.  */
   if (ret == NULL)
-    ret = bfd_hash_allocate (table, sizeof (* ret));
+    ret = (struct aout_link_includes_entry *)
+        bfd_hash_allocate (table, sizeof (* ret));
   if (ret == NULL)
     return NULL;
 
@@ -3786,7 +3789,7 @@ aout_link_reloc_link_order (struct aout_final_link_info *finfo,
 	  bfd_boolean ok;
 
 	  size = bfd_get_reloc_size (howto);
-	  buf = bfd_zmalloc (size);
+	  buf = (bfd_byte *) bfd_zmalloc (size);
 	  if (buf == NULL)
 	    return FALSE;
 	  r = MY_relocate_contents (howto, finfo->output_bfd,
@@ -5136,7 +5139,8 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
 		{
 		  /* This is the first time we have seen this header
                      file with this set of stabs strings.  */
-		  t = bfd_hash_allocate (&finfo->includes.root,
+		  t = (struct aout_link_includes_totals *)
+                      bfd_hash_allocate (&finfo->includes.root,
 					 sizeof *t);
 		  if (t == NULL)
 		    return FALSE;
@@ -5427,11 +5431,11 @@ NAME (aout, final_link) (bfd *abfd,
     goto error_return;
 
   /* Allocate buffers to hold section contents and relocs.  */
-  aout_info.contents = bfd_malloc (max_contents_size);
+  aout_info.contents = (bfd_byte *) bfd_malloc (max_contents_size);
   aout_info.relocs = bfd_malloc (max_relocs_size);
-  aout_info.symbol_map = bfd_malloc (max_sym_count * sizeof (int *));
-  aout_info.output_syms = bfd_malloc ((max_sym_count + 1)
-				      * sizeof (struct external_nlist));
+  aout_info.symbol_map = (int *) bfd_malloc (max_sym_count * sizeof (int *));
+  aout_info.output_syms = (struct external_nlist *)
+      bfd_malloc ((max_sym_count + 1) * sizeof (struct external_nlist));
   if ((aout_info.contents == NULL && max_contents_size != 0)
       || (aout_info.relocs == NULL && max_relocs_size != 0)
       || (aout_info.symbol_map == NULL && max_sym_count != 0)
diff --git a/bfd/archive.c b/bfd/archive.c
index 4e057cd..36252d5 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -181,7 +181,7 @@ _bfd_generic_mkarchive (bfd *abfd)
 {
   bfd_size_type amt = sizeof (struct artdata);
 
-  abfd->tdata.aout_ar_data = bfd_zalloc (abfd, amt);
+  abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt);
   if (bfd_ardata (abfd) == NULL)
     return FALSE;
 
@@ -319,7 +319,7 @@ _bfd_add_bfd_to_archive_cache (bfd *arch_bfd, file_ptr filepos, bfd *new_elt)
     }
 
   /* Insert new_elt into the hash table by filepos.  */
-  cache = bfd_zalloc (arch_bfd, sizeof (struct ar_cache));
+  cache = (struct ar_cache *) bfd_zalloc (arch_bfd, sizeof (struct ar_cache));
   cache->ptr = filepos;
   cache->arbfd = new_elt;
   *htab_find_slot (hash_table, (const void *) cache, INSERT) = cache;
@@ -462,7 +462,7 @@ _bfd_generic_read_ar_hdr_mag (bfd *abfd, const char *mag)
       allocsize += namelen + 1;
       parsed_size -= namelen;
 
-      allocptr = bfd_zalloc (abfd, allocsize);
+      allocptr = (char *) bfd_zalloc (abfd, allocsize);
       if (allocptr == NULL)
 	return NULL;
       filename = (allocptr
@@ -483,12 +483,12 @@ _bfd_generic_read_ar_hdr_mag (bfd *abfd, const char *mag)
 	 spaces, so only look for ' ' if we don't find '/'.  */
 
       char *e;
-      e = memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd));
+      e = (char *) memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd));
       if (e == NULL)
 	{
-	  e = memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));
+	  e = (char *) memchr (hdr.ar_name, '/', ar_maxnamelen (abfd));
 	  if (e == NULL)
-	    e = memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));
+	    e = (char *) memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd));
 	}
 
       if (e != NULL)
@@ -505,7 +505,7 @@ _bfd_generic_read_ar_hdr_mag (bfd *abfd, const char *mag)
 
   if (!allocptr)
     {
-      allocptr = bfd_zalloc (abfd, allocsize);
+      allocptr = (char *) bfd_zalloc (abfd, allocsize);
       if (allocptr == NULL)
 	return NULL;
     }
@@ -546,7 +546,7 @@ append_relative_path (bfd *arch, char *elt_name)
     return elt_name;
 
   prefix_len = base_name - arch_name;
-  filename = bfd_alloc (arch, prefix_len + strlen (elt_name) + 1);
+  filename = (char *) bfd_alloc (arch, prefix_len + strlen (elt_name) + 1);
   if (filename == NULL)
     return NULL;
 
@@ -579,7 +579,7 @@ _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos)
   if (0 > bfd_seek (archive, filepos, SEEK_SET))
     return NULL;
 
-  if ((new_areldata = _bfd_read_ar_hdr (archive)) == NULL)
+  if ((new_areldata = (struct areltdata *) _bfd_read_ar_hdr (archive)) == NULL)
     return NULL;
 
   filename = new_areldata->filename;
@@ -745,7 +745,7 @@ bfd_generic_archive_p (bfd *abfd)
   tdata_hold = bfd_ardata (abfd);
 
   amt = sizeof (struct artdata);
-  bfd_ardata (abfd) = bfd_zalloc (abfd, amt);
+  bfd_ardata (abfd) = (struct artdata *) bfd_zalloc (abfd, amt);
   if (bfd_ardata (abfd) == NULL)
     {
       bfd_ardata (abfd) = tdata_hold;
@@ -835,13 +835,13 @@ do_slurp_bsd_armap (bfd *abfd)
   bfd_size_type parsed_size, amt;
   carsym *set;
 
-  mapdata = _bfd_read_ar_hdr (abfd);
+  mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
   if (mapdata == NULL)
     return FALSE;
   parsed_size = mapdata->parsed_size;
   bfd_release (abfd, mapdata);	/* Don't need it any more.  */
 
-  raw_armap = bfd_zalloc (abfd, parsed_size);
+  raw_armap = (bfd_byte *) bfd_zalloc (abfd, parsed_size);
   if (raw_armap == NULL)
     return FALSE;
 
@@ -870,7 +870,7 @@ do_slurp_bsd_armap (bfd *abfd)
 		+ ardata->symdef_count * BSD_SYMDEF_SIZE
 		+ BSD_STRING_COUNT_SIZE);
   amt = ardata->symdef_count * sizeof (carsym);
-  ardata->symdefs = bfd_alloc (abfd, amt);
+  ardata->symdefs = (struct carsym *) bfd_alloc (abfd, amt);
   if (!ardata->symdefs)
     return FALSE;
 
@@ -911,7 +911,7 @@ do_slurp_coff_armap (bfd *abfd)
   bfd_size_type carsym_size, ptrsize;
   unsigned int i;
 
-  mapdata = _bfd_read_ar_hdr (abfd);
+  mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
   if (mapdata == NULL)
     return FALSE;
   parsed_size = mapdata->parsed_size;
@@ -956,14 +956,15 @@ do_slurp_coff_armap (bfd *abfd)
   if (carsym_size + stringsize + 1 <= carsym_size)
     return FALSE;
 
-  ardata->symdefs = bfd_zalloc (abfd, carsym_size + stringsize + 1);
+  ardata->symdefs = (struct carsym *) bfd_zalloc (abfd,
+                                                  carsym_size + stringsize + 1);
   if (ardata->symdefs == NULL)
     return FALSE;
   carsyms = ardata->symdefs;
   stringbase = ((char *) ardata->symdefs) + carsym_size;
 
   /* Allocate and read in the raw offsets.  */
-  raw_armap = bfd_alloc (abfd, ptrsize);
+  raw_armap = (int *) bfd_alloc (abfd, ptrsize);
   if (raw_armap == NULL)
     goto release_symdefs;
   if (bfd_bread (raw_armap, ptrsize, abfd) != ptrsize
@@ -998,7 +999,7 @@ do_slurp_coff_armap (bfd *abfd)
     struct areltdata *tmp;
 
     bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET);
-    tmp = _bfd_read_ar_hdr (abfd);
+    tmp = (struct areltdata *) _bfd_read_ar_hdr (abfd);
     if (tmp != NULL)
       {
 	if (tmp->arch_header[0] == '/'
@@ -1098,12 +1099,12 @@ bfd_slurp_bsd_armap_f2 (bfd *abfd)
       return TRUE;
     }
 
-  mapdata = _bfd_read_ar_hdr (abfd);
+  mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
   if (mapdata == NULL)
     return FALSE;
 
   amt = mapdata->parsed_size;
-  raw_armap = bfd_zalloc (abfd, amt);
+  raw_armap = (bfd_byte *) bfd_zalloc (abfd, amt);
   if (raw_armap == NULL)
     {
     byebye:
@@ -1139,7 +1140,7 @@ bfd_slurp_bsd_armap_f2 (bfd *abfd)
 		+ BSD_STRING_COUNT_SIZE);
   rbase = (bfd_byte *) stringbase + stringsize;
   amt = ardata->symdef_count * BSD_SYMDEF_SIZE;
-  ardata->symdefs = bfd_alloc (abfd, amt);
+  ardata->symdefs = (struct carsym *) bfd_alloc (abfd, amt);
   if (!ardata->symdefs)
     return FALSE;
 
@@ -1196,7 +1197,7 @@ _bfd_slurp_extended_name_table (bfd *abfd)
 	  return TRUE;
 	}
 
-      namedata = _bfd_read_ar_hdr (abfd);
+      namedata = (struct areltdata *) _bfd_read_ar_hdr (abfd);
       if (namedata == NULL)
 	return FALSE;
 
@@ -1205,7 +1206,7 @@ _bfd_slurp_extended_name_table (bfd *abfd)
         goto byebye;
 
       bfd_ardata (abfd)->extended_names_size = amt;
-      bfd_ardata (abfd)->extended_names = bfd_zalloc (abfd, amt + 1);
+      bfd_ardata (abfd)->extended_names = (char *) bfd_zalloc (abfd, amt + 1);
       if (bfd_ardata (abfd)->extended_names == NULL)
 	{
 	byebye:
@@ -1355,7 +1356,7 @@ adjust_relative_path (const char * path, const char * ref_path)
       if (pathbuf != NULL)
 	free (pathbuf);
       pathbuf_len = 0;
-      pathbuf = bfd_malloc (len);
+      pathbuf = (char *) bfd_malloc (len);
       if (pathbuf == NULL)
 	return path;
       pathbuf_len = len;
@@ -1505,7 +1506,7 @@ _bfd_construct_extended_name_table (bfd *abfd,
   if (total_namelen == 0)
     return TRUE;
 
-  *tabloc = bfd_zalloc (abfd, total_namelen);
+  *tabloc = (char *) bfd_zalloc (abfd, total_namelen);
   if (*tabloc == NULL)
     return FALSE;
 
@@ -1639,7 +1640,7 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, const char *filename, bfd *member)
   if (member && (member->flags & BFD_IN_MEMORY) != 0)
     {
       /* Assume we just "made" the member, and fake it.  */
-      struct bfd_in_memory *bim = member->iostream;
+      struct bfd_in_memory *bim = (struct bfd_in_memory *) member->iostream;
       time (&status.st_mtime);
       status.st_uid = getuid ();
       status.st_gid = getgid ();
@@ -1663,7 +1664,7 @@ bfd_ar_hdr_from_filesystem (bfd *abfd, const char *filename, bfd *member)
     }
 
   amt = sizeof (struct ar_hdr) + sizeof (struct areltdata);
-  ared = bfd_zalloc (abfd, amt);
+  ared = (struct areltdata *) bfd_zalloc (abfd, amt);
   if (ared == NULL)
     return NULL;
   hdr = (struct ar_hdr *) (((char *) ared) + sizeof (struct areltdata));
@@ -2088,13 +2089,13 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
   elength += elength % 2;
 
   amt = orl_max * sizeof (struct orl);
-  map = bfd_malloc (amt);
+  map = (struct orl *) bfd_malloc (amt);
   if (map == NULL)
     goto error_return;
 
   /* We put the symbol names on the arch objalloc, and then discard
      them when done.  */
-  first_name = bfd_alloc (arch, 1);
+  first_name = (char *) bfd_alloc (arch, 1);
   if (first_name == NULL)
     goto error_return;
 
@@ -2126,7 +2127,7 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength)
 		  if (syms_max > 0)


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


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

* [SCM]  archer-jankratochvil-fedora12: Merge commit 'origin/archer-tromey-python' into archer-jankratochvil-fedora12
@ 2009-09-10 19:29 jkratoch
  0 siblings, 0 replies; 4+ messages in thread
From: jkratoch @ 2009-09-10 19:29 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-fedora12 has been updated
       via  b27001e28231ad66293a243417a704b554f6ad7c (commit)
       via  b02b257244bed85db06668437ba4d07d607f51ed (commit)
      from  a5d9dae0b6a9fbba3aca67fe3a61ef9997544ed6 (commit)

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

- Log -----------------------------------------------------------------
commit b27001e28231ad66293a243417a704b554f6ad7c
Merge: a5d9dae0b6a9fbba3aca67fe3a61ef9997544ed6 b02b257244bed85db06668437ba4d07d607f51ed
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Sep 10 21:29:31 2009 +0200

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

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

Summary of changes:
 gdb/doc/gdb.texinfo                    |   10 ++++++++++
 gdb/mi/mi-cmd-var.c                    |    6 ++++++
 gdb/testsuite/gdb.python/python-mi.exp |   18 +++++++++---------
 3 files changed, 25 insertions(+), 9 deletions(-)

First 500 lines of diff:
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 31f4bc1..cbe71f6 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -23891,6 +23891,11 @@ the thread's identifier.
 @item has_more
 For a dynamic varobj, this indicates whether there appear to be any
 children available.  For a non-dynamic varobj, this will be 0.
+
+@item dynamic
+This attribute will be present and have the value @samp{1} if the
+varobj is a dynamic varobj.  If the varobj is not a dynamic varobj,
+then this attribute will not be present.
 @end table
 
 Typical output will look like this:
@@ -24301,6 +24306,11 @@ The display hint, if any.
 This is an integer value, which will be 1 if there are more children
 available outside the varobj's update range.
 
+@item dynamic
+This attribute will be present and have the value @samp{1} if the
+varobj is a dynamic varobj.  If the varobj is not a dynamic varobj,
+then this attribute will not be present.
+
 @item new_children
 If new children were added to a dynamic varobj within the selected
 update range (as set by @code{-var-set-update-range}), then they will
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index e4ca621..93459dd 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -79,6 +79,9 @@ print_varobj (struct varobj *var, enum print_values print_values,
 
   if (varobj_get_frozen (var))
     ui_out_field_int (uiout, "frozen", 1);
+
+  if (varobj_pretty_printed_p (var))
+    ui_out_field_int (uiout, "dynamic", 1);
 }
 
 /* VAROBJ operations */
@@ -758,6 +761,9 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
 	  xfree (display_hint);
 	}
 
+      if (varobj_pretty_printed_p (var))
+	ui_out_field_int (uiout, "dynamic", 1);
+
       varobj_get_child_range (r->varobj, &from, &to);
       ui_out_field_int (uiout, "has_more",
 			varobj_has_more (r->varobj, to));
diff --git a/gdb/testsuite/gdb.python/python-mi.exp b/gdb/testsuite/gdb.python/python-mi.exp
index 0178270..bfdb595 100644
--- a/gdb/testsuite/gdb.python/python-mi.exp
+++ b/gdb/testsuite/gdb.python/python-mi.exp
@@ -69,7 +69,7 @@ mi_gdb_test "-data-evaluate-expression \"string_1 = string_2\"" ".*" \
     "assign string_1 from string_2"
 
 mi_gdb_test "-var-update string" \
-    "\\^done,changelist=\\\[{name=\"string\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"}\\\]" \
+    "\\^done,changelist=\\\[{name=\"string\",in_scope=\"true\",type_changed=\"false\",dynamic=\"1\",has_more=\"0\"}\\\]" \
     "update string varobj after assignment"
 
 mi_create_dynamic_varobj container c \
@@ -81,7 +81,7 @@ mi_list_varobj_children container {
 mi_next "next over update 1"
 
 mi_varobj_update_dynamic container "varobj update 1" {
-    type_changed false new_num_children 1 has_more 0
+    type_changed false new_num_children 1 dynamic 1 has_more 0
 } {
 } {
     { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 }
@@ -90,7 +90,7 @@ mi_varobj_update_dynamic container "varobj update 1" {
 mi_next "next over update 2"
 
 mi_varobj_update_dynamic container "varobj update 2" {
-    type_changed false new_num_children 2 has_more 0
+    type_changed false new_num_children 2 dynamic 1 has_more 0
 } {
 } {
     { name {container.\[1\]} exp {\[1\]} numchild 0 type int thread-id 1 }
@@ -109,7 +109,7 @@ mi_gdb_test "-var-set-visualizer container gdb.default_visualizer" \
   "choose default visualizer"
 
 mi_varobj_update_dynamic container "varobj update after choosing default" {
-    type_changed false new_num_children 2 has_more 0
+    type_changed false new_num_children 2 dynamic 1 has_more 0
 } {
 } {
     { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 }
@@ -122,7 +122,7 @@ mi_gdb_test "-var-set-visualizer container ContainerPrinter" \
 
 mi_varobj_update_dynamic container \
   "varobj update after choosing via expression" {
-      type_changed false new_num_children 2 has_more 0
+      type_changed false new_num_children 2 dynamic 1 has_more 0
   } {
   } {
       { name {container.\[0\]} exp {\[0\]} numchild 0 type int thread-id 1 }
@@ -178,16 +178,16 @@ mi_next "next over update 5"
 # should not actually see them.
 mi_varobj_update_dynamic container2 \
     "update varobj 2, no children requested" {
-	type_changed false has_more 1
+	type_changed false dynamic 1 has_more 1
     } {} {}
 
 # This should only show the first child, because the update range has
 # been set.
 mi_varobj_update_dynamic container \
   "update after next with restricted range" {
-      type_changed false new_num_children 1 has_more 1
+      type_changed false new_num_children 1 dynamic 1 has_more 1
   } {
-      { name {container.\[0\]} in_scope true type_changed false has_more 0 }
+      { name {container.\[0\]} in_scope true type_changed false dynamic 1 has_more 0 }
   } {
   }
 
@@ -211,7 +211,7 @@ mi_list_varobj_children outer.s {
 mi_next "next over outer update"
 
 mi_gdb_test "-var-update outer" \
-  ".done,changelist=.{name=\"outer.s.a\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"}." \
+  ".done,changelist=.{name=\"outer.s.a\",in_scope=\"true\",type_changed=\"false\",dynamic=\"1\",has_more=\"0\"}." \
   "update after updating element of outer"
 
 mi_continue_to_line \


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


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

* [SCM]  archer-jankratochvil-fedora12: Merge commit 'origin/archer-tromey-python' into archer-jankratochvil-fedora12
@ 2009-08-12 16:56 jkratoch
  0 siblings, 0 replies; 4+ messages in thread
From: jkratoch @ 2009-08-12 16:56 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-fedora12 has been updated
       via  402bebe24f5cb2798e889050950a3ebdec575a52 (commit)
       via  f5e13c8a13824cb1851fa2f7ad972d4b764b1b8a (commit)
      from  2888fafe63889757c6fd27ccc2f25661d43fd1a4 (commit)

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

- Log -----------------------------------------------------------------
commit 402bebe24f5cb2798e889050950a3ebdec575a52
Merge: 2888fafe63889757c6fd27ccc2f25661d43fd1a4 f5e13c8a13824cb1851fa2f7ad972d4b764b1b8a
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Wed Aug 12 18:54:18 2009 +0200

    Merge commit 'origin/archer-tromey-python' into archer-jankratochvil-fedora12
    
    Conflicts:
    	gdb/ChangeLog
    	gdb/Makefile.in
    	gdb/gdbtypes.c
    	gdb/value.c

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

Summary of changes:
 gdb/Makefile.in                 |    2 +-
 gdb/python/python-prettyprint.c |    2 +-
 gdb/python/python-value.c       |    7 ++--
 gdb/value.c                     |   64 +++++++++++++++++++--------------------
 gdb/varobj.c                    |   11 ++-----
 5 files changed, 40 insertions(+), 46 deletions(-)

First 500 lines of diff:
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 496c9f2..36e20f3 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1242,7 +1242,7 @@ stamp-h: $(srcdir)/config.in config.status
 	  CONFIG_LINKS= \
 	  $(SHELL) config.status
 
-.gdbinit: gdbinit.in config.status
+.gdbinit: $(srcdir)/gdbinit.in config.status
 	CONFIG_FILES=".gdbinit:gdbinit.in" \
 	  CONFIG_COMMANDS= \
 	  CONFIG_HEADERS= \
diff --git a/gdb/python/python-prettyprint.c b/gdb/python/python-prettyprint.c
index 5be54b4..a6348ba 100644
--- a/gdb/python/python-prettyprint.c
+++ b/gdb/python/python-prettyprint.c
@@ -148,7 +148,7 @@ pretty_print_one_value (PyObject *printer, struct value **out_value)
 		/* We must increment the value's refcount, because we
 		   are about to decref RESULT, and this may result in
 		   the value being destroyed.  */
-		release_value (*out_value);
+		value_incref (*out_value);
  	      Py_DECREF (result);
  	      result = NULL;
 	    }
diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c
index dc76692..034eea0 100644
--- a/gdb/python/python-value.c
+++ b/gdb/python/python-value.c
@@ -130,7 +130,7 @@ valpy_new (PyTypeObject *subtype, PyObject *args, PyObject *keywords)
   value_obj->value = value;
   value_obj->address = NULL;
   value_obj->type = NULL;
-  release_value (value);
+  value_incref (value);
   value_obj->next = values_in_python;
   values_in_python = value_obj;
 
@@ -821,7 +821,7 @@ value_to_value_object (struct value *val)
       val_obj->value = val;
       val_obj->address = NULL;
       val_obj->type = NULL;
-      release_value (val);
+      value_incref (val);
       val_obj->next = values_in_python;
       values_in_python = val_obj;
     }
@@ -929,7 +929,8 @@ convert_value_from_python (PyObject *obj)
 	  /* This lets callers freely decref the Value wrapper object
 	     and not worry about whether or not the value will
 	     disappear.  */
-	  value = value_copy (((value_object *) obj)->value);
+	  value = ((value_object *) obj)->value;
+	  value_incref (value);
 	}
       else
 	PyErr_Format (PyExc_TypeError, _("Could not convert Python object: %s"),
diff --git a/gdb/value.c b/gdb/value.c
index fa39d3d..ad8cb60 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -637,28 +637,30 @@ value_free (struct value *val)
 {
   if (val)
     {
-      /* If the count was already 0, then the value was on the
-	 all_values list, and we must be freeing back to some
-	 point.  */
-      if (val->refcount <= 1)
-	{
-	  type_decref (val->type);
-	  type_decref (val->enclosing_type);
+      gdb_assert (val->reference_count > 0);
+      val->reference_count--;
+      if (val->reference_count > 0)
+	return;
 
-	  if (VALUE_LVAL (val) == lval_computed)
-	    {
-	      struct lval_funcs *funcs = val->location.computed.funcs;
+      /* If there's an associated parent value, drop our reference to
+	 it.  */
+      if (val->parent != NULL)
+	value_free (val->parent);
 
-	      if (funcs->free_closure)
-		funcs->free_closure (val);
-	    }
+      type_decref (val->type);
+      type_decref (val->enclosing_type);
+
+      if (VALUE_LVAL (val) == lval_computed)
+	{
+	  struct lval_funcs *funcs = val->location.computed.funcs;
 
-	  xfree (val->contents);
-	  xfree (val);
+	  if (funcs->free_closure)
+	    funcs->free_closure (val);
 	}
-      else
-	--val->refcount;
+
+      xfree (val->contents);
     }
+  xfree (val);
 }
 
 /* Free all values allocated since MARK was obtained by value_mark
@@ -701,26 +703,22 @@ free_all_values (void)
 void
 release_value (struct value *val)
 {
-  /* If the reference count is nonzero, then we have already removed
-     the item from the list, so there is no reason to do it again.  */
-  if (val->refcount == 0)
+  struct value *v;
+
+  if (all_values == val)
     {
-      if (all_values == val)
-	all_values = val->next;
-      else
+      all_values = val->next;
+      return;
+    }
+
+  for (v = all_values; v; v = v->next)
+    {
+      if (v->next == val)
 	{
-	  struct value *v;
-	  for (v = all_values; v; v = v->next)
-	    {
-	      if (v->next == val)
-		{
-		  v->next = val->next;
-		  break;
-		}
-	    }
+	  v->next = val->next;
+	  break;
 	}
     }
-  ++val->refcount;
 }
 
 /* Release all values up to mark  */
diff --git a/gdb/varobj.c b/gdb/varobj.c
index f2654f0..901fc13 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -1422,10 +1422,7 @@ install_new_value (struct varobj *var, struct value *value, int initial)
      that in C++ a reference is not rebindable, it cannot
      meaningfully change.  So, get hold of the real value.  */
   if (value)
-    {
-      value = coerce_ref (value);
-      release_value (value);
-    }
+    value = coerce_ref (value);
 
   if (var->type && TYPE_CODE (var->type) == TYPE_CODE_UNION)
     /* For unions, we need to fetch the value implicitly because
@@ -1533,6 +1530,7 @@ install_new_value (struct varobj *var, struct value *value, int initial)
   if (var->value != NULL && var->value != value)
     value_free (var->value);
   var->value = value;
+  value_incref (value);
   if (var->print_value)
     xfree (var->print_value);
   var->print_value = print_value;
@@ -3155,10 +3153,7 @@ cplus_describe_child (struct varobj *parent, int index,
 	    *cname = xstrdup (TYPE_FIELD_NAME (type, index));
 
 	  if (cvalue && value)
-	    {
-	      *cvalue = value_cast (TYPE_FIELD_TYPE (type, index), value);
-	      release_value (*cvalue);
-	    }
+	    *cvalue = value_cast (TYPE_FIELD_TYPE (type, index), value);
 
 	  if (ctype)
 	    {


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


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

end of thread, other threads:[~2009-09-10 20:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-03 19:16 [SCM] archer-jankratochvil-fedora12: Merge commit 'origin/archer-tromey-python' into archer-jankratochvil-fedora12 jkratoch
  -- strict thread matches above, loose matches on Subject: below --
2009-09-10 20:55 jkratoch
2009-09-10 19:29 jkratoch
2009-08-12 16:56 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).