aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2010-03-24 21:06:33 +0000
committerDaniel Jacobowitz <drow@false.org>2010-03-24 21:06:33 +0000
commita6c727b2f1c9804ca95ebc61de518246d03abb37 (patch)
tree6ba99723ff001306b83dbd7a030dbd4a2835505f /gdb/dwarf2read.c
parent0d39a07082291dc1bfc36568ea6a60a78739db41 (diff)
downloadgdb-a6c727b2f1c9804ca95ebc61de518246d03abb37.zip
gdb-a6c727b2f1c9804ca95ebc61de518246d03abb37.tar.gz
gdb-a6c727b2f1c9804ca95ebc61de518246d03abb37.tar.bz2
* 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.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index ed7923e..40f8cde 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -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