aboutsummaryrefslogtreecommitdiff
path: root/gas/dwarf2dbg.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-09-17 02:55:57 +0000
committerRichard Henderson <rth@redhat.com>2002-09-17 02:55:57 +0000
commit48b9193866818e75b4aacf07f887c4107e9739f9 (patch)
treebe37cf9e084653fff6c64e4bafc329d42a104084 /gas/dwarf2dbg.c
parent4ada7262d0ae846b2ece141e6c8e091d7b350832 (diff)
downloadbinutils-48b9193866818e75b4aacf07f887c4107e9739f9.zip
binutils-48b9193866818e75b4aacf07f887c4107e9739f9.tar.gz
binutils-48b9193866818e75b4aacf07f887c4107e9739f9.tar.bz2
* dwarf2dbg.c (out_debug_abbrev): Add support for the DW_AT_name field.
(out_debug_info): Likewise.
Diffstat (limited to 'gas/dwarf2dbg.c')
-rw-r--r--gas/dwarf2dbg.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index f8a388b..7f78606 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -1149,6 +1149,7 @@ out_debug_abbrev (abbrev_seg)
out_abbrev (DW_AT_low_pc, DW_FORM_addr);
out_abbrev (DW_AT_high_pc, DW_FORM_addr);
}
+ out_abbrev (DW_AT_name, DW_FORM_string);
out_abbrev (DW_AT_comp_dir, DW_FORM_string);
out_abbrev (DW_AT_producer, DW_FORM_string);
out_abbrev (DW_AT_language, DW_FORM_data2);
@@ -1224,6 +1225,16 @@ out_debug_info (info_seg, abbrev_seg, line_seg)
emit_expr (&expr, sizeof_address);
}
+ /* DW_AT_name. We don't have the actual file name that was present
+ on the command line, so assume files[1] is the main input file.
+ We're not supposed to get called unless at least one line number
+ entry was emitted, so this should always be defined. */
+ if (!files || files_in_use < 1)
+ abort ();
+ len = strlen (files[1].filename) + 1;
+ p = frag_more (len);
+ memcpy (p, files[1].filename, len);
+
/* DW_AT_comp_dir */
comp_dir = getpwd ();
len = strlen (comp_dir) + 1;