public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-rmoseley-f11-merge: Merge branch 'archer-jankratochvil-vla' of ssh://sources.redhat.com/git/archer into archer-rmoseley-f11-merge
@ 2009-02-18 16:39 rmoseley
  0 siblings, 0 replies; only message in thread
From: rmoseley @ 2009-02-18 16:39 UTC (permalink / raw)
  To: archer-commits

The branch, archer-rmoseley-f11-merge has been updated
       via  396b49611247265f167ebdfc78ff09aa896d1e3c (commit)
       via  e947ab663936483dc67424c153f67e78a910b96b (commit)
       via  ad88187efac2686ec0b15c558e05262a003ba504 (commit)
       via  57f9b3e3aca4b09da7dee45bba37a60653de27ee (commit)
       via  8daf1989a99b49fb00fa475a10337916ec418ce2 (commit)
       via  a861ee310e073105e393e0f4353c6bd12f2dcdc9 (commit)
       via  7c2608818db4dc98bbbd9429b4530a8a8c191c4a (commit)
       via  9dc7f9a502f63c04302c19f5ae7c5d24953bb4c6 (commit)
       via  1424a5757dc0468db2f20be1ab9945a67da23931 (commit)
       via  206dd726511502c477ae435f0f0c2d8a253be064 (commit)
       via  a2359259373fcc5b393843c24bdfd03f5cfc6dff (commit)
       via  948311e2382e7a427f7f8d77e584e421c2c4ad52 (commit)
       via  1e702ec6c22c9ad145ae87d8073fc853973cc512 (commit)
       via  66d3e97f76138f50c5954b9f104c1a831bbf6932 (commit)
       via  3466f1a4bb94676a9305361bfd61e667315bff79 (commit)
       via  c953f5544c9e1769eaea18ef4326de7b872dd10f (commit)
       via  bd772e2cfac951fff4635f88316503f358186d8a (commit)
       via  9d03935cedfab00575fb087a3a71e54b3710b242 (commit)
       via  30cac77f8975ae7b16030107d938808e5debed8b (commit)
       via  23815d11dce4e80177e1bd1a0831c6d0b749eaaf (commit)
       via  859a1f3400cb83226e637bde7c2dd4e6a297db47 (commit)
       via  369c3a0ff8eddf3df247f5b77a68539cba872ba2 (commit)
       via  4f897fec65acd1ac030d0353843607722626f201 (commit)
       via  baaf53080172f2fa827f789f409e110fbcd27f24 (commit)
       via  539886db49880203764e2a0393f45c1119c75d05 (commit)
       via  389950e9086f8cd526f5fb5c56e7b789a728e86c (commit)
       via  7b8d1c1af4161d1929c73575312124f1acdd8377 (commit)
       via  13c7170fa46901aa186a0cdbdd1d4d3a43d2a78a (commit)
       via  6dca9f89ba63d3ab4c00beca25d5d076be6f5ad2 (commit)
       via  7a3432cb57021fbc9aba591bb5db9a26df190bba (commit)
       via  5eeba0ab12f0dafb05843d624b061fcca113cd47 (commit)
       via  bbbc382d7765225720a24212110e33be51d1d1e7 (commit)
       via  4cbf6bb6c2b73e3948bb88acc2f910282720453b (commit)
       via  10d81c8c20a52bb71503e9d5c933b5ead42bf7d6 (commit)
       via  1d65c1840dc354bef8cfd15686f4c9b103575108 (commit)
       via  bee50e76490e9d1e98de06fa8c686d52f569c1d5 (commit)
       via  fb2f150dc840dab31f4c322e44d0d22780c2f909 (commit)
       via  cca7c7b2f839db7ef38bbdafb32925548e5b5735 (commit)
       via  f131c5195070253cd426a744e3d89f8806fc8347 (commit)
       via  55e7e519e1accb3daf48799a8a9f01d98711d6c5 (commit)
       via  c86ed8212c4e6f4961bb65f5f724af1537460c6a (commit)
       via  f60119df99e34ac60f8b6324130c455ddb871604 (commit)
       via  36c59ca86e4ed5765b3fef856ca5269084e0c20e (commit)
       via  497dece94a7d853e2e0a09c265f5b3a425d309d2 (commit)
       via  10215662672716867cba70dac7d5882c1542c4cc (commit)
       via  2719d585732bfcbbd5d04a21d7db2514a75cbcb7 (commit)
       via  216a7959fdaf90de3c04fde80be10bebbb6807cc (commit)
       via  874e2c44163b54be7e44f16797a9b7725908efa6 (commit)
       via  436912c412da4a97fb07c8be2dddf757bbd49ca9 (commit)
       via  215f0621895dc4401f4817d086b56818b8087bc7 (commit)
       via  f4603aa50b6cd6f4ad07a9980eb3d722e055b327 (commit)
       via  32d49000050ce21ad728056463b109da6d07282e (commit)
       via  8adc620b56095f8d3d64ba3fcaba42683c282b7b (commit)
       via  9a83d7cb53d2c6913e1bf156e60ac46d611ef423 (commit)
       via  9455db1d51d5627bac7085f161100dec3600e676 (commit)
       via  16a63ebc3925d782f3df69b4159b8ef29c7ecc0d (commit)
       via  78aafc59571668be2658174b68b06f57e98d11a7 (commit)
       via  807b2b37633aab1e7887652af395b559c4a59f78 (commit)
       via  eef2176b1a600542410faa676c336726f5c2a8c2 (commit)
       via  d5cfcbafc9b74ab21f215585aab411c6b43f5620 (commit)
       via  204d89c72980d5576c9db996a88349ab154a66e7 (commit)
       via  dd7f93e299e04fc62769938813fb69a158b5d60e (commit)
       via  2e8f00516f29f4ffed5da535bd71a7d5d85a9723 (commit)
       via  250db25a0345574717bdbb2c95ec4d28972df8cb (commit)
       via  99bb72c6e4f47b898863446510de72a60b693d17 (commit)
       via  01546ee201a0997affba334011df98307a611890 (commit)
       via  d1ff02440097bc93c2a4c1f8867dea2ffcb1b552 (commit)
       via  f2deac9fa3dfd4d9010e3590963ded5f0d56fe0a (commit)
       via  78d71009e5a69dc53b8a4eb3ed99e702b37c1b2f (commit)
       via  9e26525dc904c6d7a01fad44348e590776aaa391 (commit)
       via  f858c3a0770bf47eb47b4d790268eb523773d1ea (commit)
      from  aa9e163aeabac07be9e5d02ca7c610e38c22adb6 (commit)

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

- Log -----------------------------------------------------------------
commit 396b49611247265f167ebdfc78ff09aa896d1e3c
Merge: e947ab663936483dc67424c153f67e78a910b96b 9d03935cedfab00575fb087a3a71e54b3710b242
Author: Rick Moseley <rmoseley@localhost.localdomain>
Date:   Wed Feb 18 09:18:30 2009 -0600

    Merge branch 'archer-jankratochvil-vla' of ssh://sources.redhat.com/git/archer into archer-rmoseley-f11-merge

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

Summary of changes:
 bfd/ChangeLog                                   |   20 +
 bfd/elf32-mips.c                                |    2 +-
 bfd/elf32-spu.c                                 |   22 +-
 bfd/elflink.c                                   |    9 +-
 bfd/version.h                                   |    2 +-
 gdb/ChangeLog                                   |   32 +
 gdb/ada-lang.c                                  |   23 +-
 gdb/c-typeprint.c                               |    7 +-
 gdb/coffread.c                                  |    2 +-
 gdb/dwarf2expr.c                                |    7 +
 gdb/dwarf2expr.h                                |    2 +-
 gdb/dwarf2loc.c                                 |  213 ++++++-
 gdb/dwarf2loc.h                                 |    6 +
 gdb/dwarf2read.c                                |  467 +++++++++++----
 gdb/eval.c                                      |   51 ++-
 gdb/f-lang.h                                    |    4 +
 gdb/f-typeprint.c                               |   36 +-
 gdb/f-valprint.c                                |   59 ++-
 gdb/findvar.c                                   |  124 +++--
 gdb/gdbarch.c                                   |    4 +-
 gdb/gdbtypes.c                                  |  755 +++++++++++++++++++----
 gdb/gdbtypes.h                                  |  150 ++++-
 gdb/jv-lang.c                                   |    2 +-
 gdb/mdebugread.c                                |    2 +-
 gdb/mi/mi-main.c                                |    1 +
 gdb/p-lang.c                                    |   33 +-
 gdb/p-valprint.c                                |   20 +-
 gdb/printcmd.c                                  |    5 +
 gdb/stabsread.c                                 |    4 +-
 gdb/stack.c                                     |   11 +-
 gdb/testsuite/ChangeLog                         |    9 +
 gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S |  455 ++++++++++++++
 gdb/testsuite/gdb.arch/x86_64-vla-typedef.c     |   43 ++
 gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp   |   64 ++
 gdb/testsuite/gdb.base/vla-overflow.c           |   30 +
 gdb/testsuite/gdb.base/vla-overflow.exp         |  108 ++++
 gdb/testsuite/gdb.base/vla.c                    |   55 ++
 gdb/testsuite/gdb.base/vla.exp                  |   62 ++
 gdb/testsuite/gdb.cp/pr9594.cc                  |    1 +
 gdb/testsuite/gdb.dwarf2/dw2-stripped.c         |   42 ++
 gdb/testsuite/gdb.dwarf2/dw2-stripped.exp       |   79 +++
 gdb/testsuite/gdb.fortran/dynamic.exp           |  156 +++++
 gdb/testsuite/gdb.fortran/dynamic.f90           |   98 +++
 gdb/testsuite/gdb.fortran/module.exp            |   35 +
 gdb/testsuite/gdb.fortran/module.f90            |   22 +
 gdb/testsuite/gdb.fortran/string.exp            |   72 +++
 gdb/testsuite/gdb.fortran/string.f90            |   37 ++
 gdb/top.c                                       |    1 +
 gdb/typeprint.c                                 |   13 +-
 gdb/valarith.c                                  |   62 ++-
 gdb/valops.c                                    |   89 +++-
 gdb/value.c                                     |   58 ++-
 gdb/value.h                                     |    8 +-
 gdb/version.in                                  |    2 +-
 libdecnumber/ChangeLog                          |    4 +
 libdecnumber/Makefile.in                        |    4 +-
 opcodes/ChangeLog                               |    4 +
 opcodes/m68k-opc.c                              |    4 +-
 58 files changed, 3211 insertions(+), 481 deletions(-)
 create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S
 create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef.c
 create mode 100644 gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp
 create mode 100644 gdb/testsuite/gdb.base/vla-overflow.c
 create mode 100644 gdb/testsuite/gdb.base/vla-overflow.exp
 create mode 100644 gdb/testsuite/gdb.base/vla.c
 create mode 100644 gdb/testsuite/gdb.base/vla.exp
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-stripped.c
 create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
 create mode 100644 gdb/testsuite/gdb.fortran/dynamic.exp
 create mode 100644 gdb/testsuite/gdb.fortran/dynamic.f90
 create mode 100644 gdb/testsuite/gdb.fortran/module.exp
 create mode 100644 gdb/testsuite/gdb.fortran/module.f90
 create mode 100644 gdb/testsuite/gdb.fortran/string.exp
 create mode 100644 gdb/testsuite/gdb.fortran/string.f90

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ecc442f..f0515a2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,23 @@
+2009-02-12  Nick Clifton  <nickc@redhat.com>
+
+	PR 9827
+	* elflink.c (bfd_elf_final_link): When counting the relocations,
+	if the header size has not been set yet then assume that it will
+	match the output section's reloc type.
+
+2009-02-12  Nathan Sidwell  <nathan@codesourcery.com>
+
+	* elf32-mips.c (mips_elf_final_gp): Don't add 0x4000 offset for
+	relocatable link.
+
+2009-02-09  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf32-spu.c (spu_elf_find_overlays): Call bfd_set_error on errors.
+	(find_function): Likewise.
+	(pasted_function): Don't error if no prior function found.
+	(discover_functions): Revert 2008-12-10 change.  Extend first
+	function range to start of section.
+
 2009-02-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
 	* elf64-hppa.c: Remove PARAMS macro.  Replace PTR with void *.  Convert
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index 6c09ce5..c928586 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -1005,7 +1005,7 @@ mips_elf_final_gp (bfd *output_bfd, asymbol *symbol, bfd_boolean relocatable,
       if (relocatable)
 	{
 	  /* Make up a value.  */
-	  *pgp = symbol->section->output_section->vma + 0x4000;
+	  *pgp = symbol->section->output_section->vma /*+ 0x4000*/;
 	  _bfd_set_gp_value (output_bfd, *pgp);
 	}
       else if (!mips_elf_assign_gp (output_bfd, pgp))
diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c
index 725eb5a..3015cd6 100644
--- a/bfd/elf32-spu.c
+++ b/bfd/elf32-spu.c
@@ -686,6 +686,7 @@ spu_elf_find_overlays (struct bfd_link_info *info)
 		  info->callbacks->einfo (_("%X%P: overlay section %A "
 					    "does not start on a cache line.\n"),
 					  s);
+		  bfd_set_error (bfd_error_bad_value);
 		  return FALSE;
 		}
 	      else if (s->size > htab->params->line_size)
@@ -693,6 +694,7 @@ spu_elf_find_overlays (struct bfd_link_info *info)
 		  info->callbacks->einfo (_("%X%P: overlay section %A "
 					    "is larger than a cache line.\n"),
 					  s);
+		  bfd_set_error (bfd_error_bad_value);
 		  return FALSE;
 		}
 
@@ -712,6 +714,7 @@ spu_elf_find_overlays (struct bfd_link_info *info)
 	      info->callbacks->einfo (_("%X%P: overlay section %A "
 					"is not in cache area.\n"),
 				      alloc_sec[i-1]);
+	      bfd_set_error (bfd_error_bad_value);
 	      return FALSE;
 	    }
 	  else
@@ -752,6 +755,7 @@ spu_elf_find_overlays (struct bfd_link_info *info)
 						"and %A do not start at the "
 						"same address.\n"),
 					      s0, s);
+		      bfd_set_error (bfd_error_bad_value);
 		      return FALSE;
 		    }
 		  if (ovl_end < s->vma + s->size)
@@ -2473,6 +2477,7 @@ find_function (asection *sec, bfd_vma offset, struct bfd_link_info *info)
     }
   info->callbacks->einfo (_("%A:0x%v not found in function table\n"),
 			  sec, offset);
+  bfd_set_error (bfd_error_bad_value);
   return NULL;
 }
 
@@ -2744,7 +2749,7 @@ mark_functions_via_relocs (asection *sec,
    These sections are pasted together to form a single function.  */
 
 static bfd_boolean
-pasted_function (asection *sec, struct bfd_link_info *info)
+pasted_function (asection *sec)
 {
   struct bfd_link_order *l;
   struct _spu_elf_section_data *sec_data;
@@ -2793,8 +2798,9 @@ pasted_function (asection *sec, struct bfd_link_info *info)
 	fun_start = &sinfo->fun[sinfo->num_fun - 1];
     }
 
-  info->callbacks->einfo (_("%A link_order not found\n"), sec);
-  return FALSE;
+  /* Don't return an error if we did not find a function preceding this
+     section.  The section may have incorrect flags.  */
+  return TRUE;
 }
 
 /* Map address ranges in code sections to functions.  */
@@ -2818,7 +2824,6 @@ discover_functions (struct bfd_link_info *info)
   sec_arr = bfd_zmalloc (bfd_idx * sizeof (*sec_arr));
   if (sec_arr == NULL)
     return FALSE;
-
   
   for (ibfd = info->input_bfds, bfd_idx = 0;
        ibfd != NULL;
@@ -2873,8 +2878,7 @@ discover_functions (struct bfd_link_info *info)
       sec_arr[bfd_idx] = psecs;
       for (psy = psyms, p = psecs, sy = syms; sy < syms + symcount; ++p, ++sy)
 	if (ELF_ST_TYPE (sy->st_info) == STT_NOTYPE
-	    || ELF_ST_TYPE (sy->st_info) == STT_FUNC
-	    || ELF_ST_TYPE (sy->st_info) == STT_SECTION)
+	    || ELF_ST_TYPE (sy->st_info) == STT_FUNC)
 	  {
 	    asection *s;
 
@@ -3004,7 +3008,7 @@ discover_functions (struct bfd_link_info *info)
 
 		sec_data = spu_elf_section_data (sec);
 		sinfo = sec_data->u.i.stack_info;
-		if (sinfo != NULL)
+		if (sinfo != NULL && sinfo->num_fun != 0)
 		  {
 		    int fun_idx;
 		    bfd_vma hi = sec->size;
@@ -3014,10 +3018,12 @@ discover_functions (struct bfd_link_info *info)
 			sinfo->fun[fun_idx].hi = hi;
 			hi = sinfo->fun[fun_idx].lo;
 		      }
+
+		    sinfo->fun[0].lo = 0;
 		  }
 		/* No symbols in this section.  Must be .init or .fini
 		   or something similar.  */
-		else if (!pasted_function (sec, info))
+		else if (!pasted_function (sec))
 		  return FALSE;
 	      }
 	}
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 8685a2f..d0e4534 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -10228,8 +10228,13 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
 	      bfd_size_type entsize1;
 
 	      entsize1 = esdi->rel_hdr.sh_entsize;
-	      BFD_ASSERT (entsize1 == bed->s->sizeof_rel
-			  || entsize1 == bed->s->sizeof_rela);
+	      /* PR 9827: If the header size has not been set yet then
+		 assume that it will match the output section's reloc type.  */
+	      if (entsize1 == 0)
+		entsize1 = o->use_rela_p ? bed->s->sizeof_rela : bed->s->sizeof_rel;
+	      else
+		BFD_ASSERT (entsize1 == bed->s->sizeof_rel
+			    || entsize1 == bed->s->sizeof_rela);
 	      same_size = !o->use_rela_p == (entsize1 == bed->s->sizeof_rel);
 
 	      if (!same_size)
diff --git a/bfd/version.h b/bfd/version.h
index 1a5acc9..bf02ea1 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20090209
+#define BFD_VERSION_DATE 20090212
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 42872b0..4ebcfc5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,35 @@
+2009-02-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	PR fortran/9806
+	* dwarf2read.c (process_die <DW_TAG_module>, read_module)
+	(scan_partial_symbols <DW_TAG_module>, add_partial_module): New.
+
+2009-02-11  Pierre Muller  <muller@ics.u-strasbg.fr>
+
+	* dwarf2read.c (read_base_type): Set code to TYPE_CODE_CHAR
+	for DW_ATE_signed_char and DW_ATE_unsigned_char
+	for pascal language.
+
+2009-02-11  Jim Meyering  <meyering@redhat.com>
+	    Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	Avoid NULL dereference.
+	* stack.c (return_command): Guard use of SYMBOL_TYPE (thisfun).
+	New variable func_type.
+
+2009-02-11  Pedro Alves  <pedro@codesourcery.com>
+
+	* gdbarch.c: Regenerate.
+
+2009-02-10  Pierre Muller  <muller@ics.u-strasbg.fr>
+
+	* p-lang.c (is_pascal_string_type): Fix comment.
+	Determine exact size of char elements for GPC
+	strings.
+	(pascal_printstr): Handle char width of 2 or 4.
+	* p-valprint.c (pascal_val_print): Handle char
+	of width 2 or 4.
+	
 2009-02-07  Daniel Jacobowitz  <dan@codesourcery.com>
 
 	* dwarf2read.c (dwarf2_build_psymtabs_hard): Move lowpc and highpc
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index a6d5757..5c44b52 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -1666,8 +1666,8 @@ ada_type_of_array (struct value *arr, int bounds)
         return NULL;
       while (arity > 0)
         {
-          struct type *range_type = alloc_type (objf);
-          struct type *array_type = alloc_type (objf);
+          struct type *range_type = alloc_type (objf, NULL);
+          struct type *array_type = alloc_type (objf, NULL);
           struct value *low = desc_one_bound (descriptor, arity, 0);
           struct value *high = desc_one_bound (descriptor, arity, 1);
           arity -= 1;
@@ -1774,9 +1774,9 @@ packed_array_type (struct type *type, long *elt_bits)
   if (TYPE_CODE (type) != TYPE_CODE_ARRAY)
     return type;
 
-  new_type = alloc_type (TYPE_OBJFILE (type));
   new_elt_type = packed_array_type (ada_check_typedef (TYPE_TARGET_TYPE (type)),
                                     elt_bits);
+  new_type = alloc_type (TYPE_OBJFILE (type), new_elt_type);
   create_array_type (new_type, new_elt_type, TYPE_INDEX_TYPE (type));
   TYPE_FIELD_BITSIZE (new_type, 0) = *elt_bits;
   TYPE_NAME (new_type) = ada_type_name (type);
@@ -6790,7 +6790,7 @@ variant_field_index (struct type *type)
 static struct type *
 empty_record (struct objfile *objfile)
 {
-  struct type *type = alloc_type (objfile);
+  struct type *type = alloc_type (objfile, NULL);
   TYPE_CODE (type) = TYPE_CODE_STRUCT;
   TYPE_NFIELDS (type) = 0;
   TYPE_FIELDS (type) = NULL;
@@ -6847,7 +6847,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
         nfields++;
     }
 
-  rtype = alloc_type (TYPE_OBJFILE (type));
+  rtype = alloc_type (TYPE_OBJFILE (type), NULL);
   TYPE_CODE (rtype) = TYPE_CODE_STRUCT;
   INIT_CPLUS_SPECIFIC (rtype);
   TYPE_NFIELDS (rtype) = nfields;
@@ -7034,7 +7034,8 @@ template_to_static_fixed_type (struct type *type0)
         new_type = static_unwrap_type (field_type);
       if (type == type0 && new_type != field_type)
         {
-          TYPE_TARGET_TYPE (type0) = type = alloc_type (TYPE_OBJFILE (type0));
+          TYPE_TARGET_TYPE (type0) = type = alloc_type (TYPE_OBJFILE (type0),
+							NULL);
           TYPE_CODE (type) = TYPE_CODE (type0);
           INIT_CPLUS_SPECIFIC (type);
           TYPE_NFIELDS (type) = nfields;
@@ -7079,7 +7080,7 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr,
   else
     dval = dval0;
 
-  rtype = alloc_type (TYPE_OBJFILE (type));
+  rtype = alloc_type (TYPE_OBJFILE (type), NULL);
   TYPE_CODE (rtype) = TYPE_CODE_STRUCT;
   INIT_CPLUS_SPECIFIC (rtype);
   TYPE_NFIELDS (rtype) = nfields;
@@ -7251,7 +7252,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
       if (elt_type0 == elt_type)
         result = type0;
       else
-        result = create_array_type (alloc_type (TYPE_OBJFILE (type0)),
+        result = create_array_type (alloc_type (TYPE_OBJFILE (type0), NULL),
                                     elt_type, TYPE_INDEX_TYPE (type0));
     }
   else
@@ -7281,7 +7282,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
           struct type *range_type =
             to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, i),
                                  dval, TYPE_OBJFILE (type0));
-          result = create_array_type (alloc_type (TYPE_OBJFILE (type0)),
+          result = create_array_type (alloc_type (TYPE_OBJFILE (type0), NULL),
                                       result, range_type);
         }
       if (!ignore_too_big && TYPE_LENGTH (result) > varsize_limit)
@@ -9546,7 +9547,7 @@ to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile)
       if (L < INT_MIN || U > INT_MAX)
 	return raw_type;
       else
-	return create_range_type (alloc_type (objfile), raw_type, 
+	return create_range_type (alloc_type (objfile, NULL), raw_type, 
 				  discrete_type_low_bound (raw_type),
 				  discrete_type_high_bound (raw_type));
     }
@@ -9611,7 +9612,7 @@ to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile)
 
       if (objfile == NULL)
         objfile = TYPE_OBJFILE (base_type);
-      type = create_range_type (alloc_type (objfile), base_type, L, U);
+      type = create_range_type (alloc_type (objfile, NULL), base_type, L, U);
       TYPE_NAME (type) = name;
       return type;
     }
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 0929516..2aaf9ad 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -559,7 +559,12 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
 	fprintf_filtered (stream, ")");
 
       fprintf_filtered (stream, "[");
-      if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
+      if (TYPE_ARRAY_BOUND_IS_DWARF_BLOCK (type, 1))
+	{
+	  /* No _() - printed sources should not be locale dependent.  */
+	  fprintf_filtered (stream, "variable");
+	}
+      else if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0
 	&& !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
 	fprintf_filtered (stream, "%d",
 			  (TYPE_LENGTH (type)
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 6059d68..6a24c2c 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -346,7 +346,7 @@ coff_alloc_type (int index)
      We will fill it in later if we find out how.  */
   if (type == NULL)
     {
-      type = alloc_type (current_objfile);
+      type = alloc_type (current_objfile, NULL);
       *type_addr = type;
     }
   return type;
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index 75a4ec7..aa8ab33 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -752,6 +752,13 @@ execute_stack_op (struct dwarf_expr_context *ctx,
 	  ctx->initialized = 0;
 	  goto no_push;
 
+	case DW_OP_push_object_address:
+	  if (ctx->get_object_address == NULL)
+	    error (_("DWARF-2 expression error: DW_OP_push_object_address must "
+	           "have a value to push."));
+	  result = (ctx->get_object_address) (ctx->baton);
+	  break;
+
 	default:
 	  error (_("Unhandled dwarf expression opcode 0x%x"), op);
 	}
diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h
index 7047922..a287b6f 100644
--- a/gdb/dwarf2expr.h
+++ b/gdb/dwarf2expr.h
@@ -67,10 +67,10 @@ struct dwarf_expr_context
      The result must be live until the current expression evaluation
      is complete.  */
   unsigned char *(*get_subr) (void *baton, off_t offset, size_t *length);
+#endif
 
   /* Return the `object address' for DW_OP_push_object_address.  */
   CORE_ADDR (*get_object_address) (void *baton);
-#endif
 
   /* The current depth of dwarf expression recursion, via DW_OP_call*,
      DW_OP_fbreg, DW_OP_push_object_address, etc., and the maximum
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index cad3db8..65751a4 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -107,6 +107,9 @@ struct dwarf_expr_baton
 {
   struct frame_info *frame;
   struct objfile *objfile;
+  /* From DW_TAG_variable's DW_AT_location (not DW_TAG_type's
+     DW_AT_data_location) for DW_OP_push_object_address.  */
+  CORE_ADDR object_address;
 };
 
 /* Helper functions for dwarf2_evaluate_loc_desc.  */
@@ -163,22 +166,32 @@ dwarf_expr_frame_base (void *baton, gdb_byte **start, size_t * length)
       *start = find_location_expression (symbaton, length,
 					 get_frame_address_in_block (frame));
     }
-  else
+  else if (SYMBOL_OPS (framefunc) == &dwarf2_locexpr_funcs)
     {
       struct dwarf2_locexpr_baton *symbaton;
+
       symbaton = SYMBOL_LOCATION_BATON (framefunc);
-      if (symbaton != NULL)
-	{
-	  *length = symbaton->size;
-	  *start = symbaton->data;
-	}
-      else
-	*start = NULL;
+      gdb_assert (symbaton != NULL);
+      *start = symbaton->data;
+      *length = symbaton->size;
+    }
+  else if (SYMBOL_OPS (framefunc) == &dwarf2_missing_funcs)
+    {
+      struct dwarf2_locexpr_baton *symbaton;
+
+      symbaton = SYMBOL_LOCATION_BATON (framefunc);
+      gdb_assert (symbaton == NULL);
+      *start = NULL;
+      *length = 0;	/* unused */
     }
+  else
+    internal_error (__FILE__, __LINE__,
+		    _("Unsupported SYMBOL_OPS %p for \"%s\""),
+		    SYMBOL_OPS (framefunc), SYMBOL_PRINT_NAME (framefunc));
 
   if (*start == NULL)
     error (_("Could not find the frame base for \"%s\"."),
-	   SYMBOL_NATURAL_NAME (framefunc));
+	   SYMBOL_PRINT_NAME (framefunc));
 }
 
 /* Using the objfile specified in BATON, find the address for the
@@ -191,6 +204,119 @@ dwarf_expr_tls_address (void *baton, CORE_ADDR offset)
   return target_translate_tls_address (debaton->objfile, offset);
 }
 
+static CORE_ADDR
+dwarf_expr_object_address (void *baton)
+{
+  struct dwarf_expr_baton *debaton = baton;
+
+  /* The message is suppressed in DWARF_BLOCK_EXEC.  */
+  if (debaton->object_address == 0)
+    error (_("Cannot resolve DW_OP_push_object_address for a missing object"));
+
+  return debaton->object_address;
+}
+
+/* Address of the variable we are currently referring to.  It is set from
+   DW_TAG_variable's DW_AT_location (not DW_TAG_type's DW_AT_data_location) for
+   DW_OP_push_object_address.  */
+
+static CORE_ADDR object_address;
+
+/* Callers use object_address_set while their callers use the result set so we
+   cannot run the cleanup at the local block of our direct caller.  Still we
+   should reset OBJECT_ADDRESS at least for the next GDB command.  */
+
+static void
+object_address_cleanup (void *prev_save_voidp)
+{
+  CORE_ADDR *prev_save = prev_save_voidp;
+
+  object_address = *prev_save;
+  xfree (prev_save);
+}
+
+/* Set the base address - DW_AT_location - of a variable.  It is being later
+   used to derive other object addresses by DW_OP_push_object_address.
+
+   It would be useful to sanity check ADDRESS - such as for some objects with
+   unset VALUE_ADDRESS - but some valid addresses may be zero (such as first
+   objects in relocatable .o files).  */
+
+void
+object_address_set (CORE_ADDR address)
+{
+  CORE_ADDR *prev_save;
+
+  prev_save = xmalloc (sizeof *prev_save);
+  *prev_save = object_address;
+  make_cleanup (object_address_cleanup, prev_save);
+
+  object_address = address;
+}
+
+/* Evaluate DWARF expression at DATA ... DATA + SIZE with its result readable
+   by dwarf_expr_fetch (RETVAL, 0).  FRAME parameter can be NULL to call
+   get_selected_frame to find it.  Returned dwarf_expr_context freeing is
+   pushed on the cleanup chain.  */
+
+static struct dwarf_expr_context *
+dwarf_expr_prep_ctx (struct frame_info *frame, gdb_byte *data,
+		     unsigned short size, struct dwarf2_per_cu_data *per_cu)
+{


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


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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-18 16:39 [SCM] archer-rmoseley-f11-merge: Merge branch 'archer-jankratochvil-vla' of ssh://sources.redhat.com/git/archer into archer-rmoseley-f11-merge rmoseley

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).