aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 468ac87..dab4290 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -4941,6 +4941,12 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
|| cu->language == language_pascal)
TYPE_FLAGS (ftype) |= TYPE_FLAG_PROTOTYPED;
+ /* Store the calling convention in the type if it's available in
+ the subroutine die. Otherwise set the calling convention to
+ the default value DW_CC_normal. */
+ attr = dwarf2_attr (die, DW_AT_calling_convention, cu);
+ TYPE_CALLING_CONVENTION (ftype) = attr ? DW_UNSND (attr) : DW_CC_normal;
+
if (die->child != NULL)
{
struct die_info *child_die;