This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/commit] DWARF: Mark all Ada functions as prototyped.

>>>>> "Joel" == Joel Brobecker <> writes:

Joel> This makes sure that the types of the arguments are taken into account
Joel> when performing an inferior function call, and in particular
Joel> appropriatly converted to the correct type.

DWARF implies that this attribute is only meaningful for C.  And GCC
emits it only for C89 (though GCC pretends that all variants of C are
C89... oops):

static inline void
add_prototyped_attribute (dw_die_ref die, tree func_type)
  if (get_AT_unsigned (comp_unit_die (), DW_AT_language) == DW_LANG_C89
      && prototype_p (func_type))
    add_AT_flag (die, DW_AT_prototyped, 1);

Joel> -  /* All functions in C++, Pascal and Java have prototypes.  */
Joel> +  /* All functions in Ada, C++, Pascal and Java have prototypes.  */
Joel>    attr = dwarf2_attr (die, DW_AT_prototyped, cu);
Joel>    if ((attr && (DW_UNSND (attr) != 0))
Joel> +      || cu->language == language_ada
Joel>        || cu->language == language_cplus
Joel>        || cu->language == language_java
Joel>        || cu->language == language_pascal)

... so I suggest instead inverting the sense here and rewriting it to
check just for languages that are "C-like" -- DW_LANG_C89, DW_LANG_C,

What do you think?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]