aboutsummaryrefslogtreecommitdiff
path: root/bfd/dwarf2.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-04-01 10:31:34 +0000
committerNick Clifton <nickc@redhat.com>2003-04-01 10:31:34 +0000
commitd63fd5d103a7ddf4b15c2945b47a5f633485c6cf (patch)
tree774e4d753bd6b3cd128102555e11c263b95b5048 /bfd/dwarf2.c
parentaf3ef9fe5c1b25265c6c6188a48020b5e6512b75 (diff)
downloadgdb-d63fd5d103a7ddf4b15c2945b47a5f633485c6cf.zip
gdb-d63fd5d103a7ddf4b15c2945b47a5f633485c6cf.tar.gz
gdb-d63fd5d103a7ddf4b15c2945b47a5f633485c6cf.tar.bz2
Make add_line_info() take a copy of the filename.
Diffstat (limited to 'bfd/dwarf2.c')
-rw-r--r--bfd/dwarf2.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index e8ebd62..1566b9a 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -901,10 +901,19 @@ add_line_info (table, address, filename, line, column, end_sequence)
/* Set member data of 'info'. */
info->address = address;
- info->filename = filename;
info->line = line;
info->column = column;
info->end_sequence = end_sequence;
+
+ amt = strlen (filename);
+ if (amt)
+ {
+ info->filename = bfd_alloc (table->abfd, amt + 1);
+ if (info->filename)
+ strcpy (info->filename, filename);
+ }
+ else
+ info->filename = NULL;
}
/* Extract a fully qualified filename from a line info table.