* dwarf2-frame.c (dwarf2_frame_find_quirks): Use producer_is_realview.

* dwarf2read.c (load_full_comp_unit): Read DW_AT_producer.
	(read_structure_type): For RealView, set TYPE_STUB on structures with
	no byte size and no children.
	(read_subroutine_type): Mark functions as prototyped by default.
	* symtab.c (producer_is_realview): New function.
	* symtab.h (expand_line_sal): Fix declaration formatting.
	(producer_is_realview): Declare.

	testsuite/
	* gdb.base/callfuncs.exp (do_function_calls): Add XFAILs for RealView.
	* gdb.base/ptype.exp (ptype_maybe_prototyped): Add overprototyped
	argument.  Handle "short" and "long".
	(Top level): Pass overprototyped output for old_fptr and xptr.
This commit is contained in:
Daniel Jacobowitz
2010-03-24 21:06:33 +00:00
parent 0d39a07082
commit a6c727b2f1
8 changed files with 112 additions and 37 deletions

View File

@@ -3085,6 +3085,12 @@ load_full_comp_unit (struct dwarf2_per_cu_data *per_cu, struct objfile *objfile)
else
set_cu_language (language_minimal, cu);
/* Similarly, if we do not read the producer, we can not apply
producer-specific interpretation. */
attr = dwarf2_attr (cu->dies, DW_AT_producer, cu);
if (attr)
cu->producer = DW_STRING (attr);
/* Link this CU into read_in_chain. */
per_cu->cu->read_in_chain = dwarf2_per_objfile->read_in_chain;
dwarf2_per_objfile->read_in_chain = per_cu;
@@ -5084,6 +5090,11 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
TYPE_STUB_SUPPORTED (type) = 1;
if (die_is_declaration (die, cu))
TYPE_STUB (type) = 1;
else if (attr == NULL && die->child == NULL
&& producer_is_realview (cu->producer))
/* RealView does not output the required DW_AT_declaration
on incomplete types. */
TYPE_STUB (type) = 1;
set_descriptive_type (type, die, cu);
@@ -5882,6 +5893,12 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
|| cu->language == language_java
|| cu->language == language_pascal)
TYPE_PROTOTYPED (ftype) = 1;
else if (producer_is_realview (cu->producer))
/* RealView does not emit DW_AT_prototyped. We can not
distinguish prototyped and unprototyped functions; default to
prototyped, since that is more common in modern code (and
RealView warns about unprototyped functions). */
TYPE_PROTOTYPED (ftype) = 1;
/* Store the calling convention in the type if it's available in
the subroutine die. Otherwise set the calling convention to