mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-10 12:22:20 +08:00
Make add_line_info() take a copy of the filename.
This commit is contained in:
@ -3,6 +3,8 @@
|
|||||||
* dwarf2.c (concat_filename): Use bfd_malloc() and strdup()
|
* dwarf2.c (concat_filename): Use bfd_malloc() and strdup()
|
||||||
instead of concat().
|
instead of concat().
|
||||||
(decode_line_info): Only free filename if it is not NULL.
|
(decode_line_info): Only free filename if it is not NULL.
|
||||||
|
(add_line_info): Make a copy of the filename when storing it into
|
||||||
|
the info structure.
|
||||||
|
|
||||||
2003-03-31 Andreas Schwab <schwab@suse.de>
|
2003-03-31 Andreas Schwab <schwab@suse.de>
|
||||||
Daniel Jacobowitz <drow@mvista.com>
|
Daniel Jacobowitz <drow@mvista.com>
|
||||||
|
11
bfd/dwarf2.c
11
bfd/dwarf2.c
@ -901,10 +901,19 @@ add_line_info (table, address, filename, line, column, end_sequence)
|
|||||||
|
|
||||||
/* Set member data of 'info'. */
|
/* Set member data of 'info'. */
|
||||||
info->address = address;
|
info->address = address;
|
||||||
info->filename = filename;
|
|
||||||
info->line = line;
|
info->line = line;
|
||||||
info->column = column;
|
info->column = column;
|
||||||
info->end_sequence = end_sequence;
|
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.
|
/* Extract a fully qualified filename from a line info table.
|
||||||
|
Reference in New Issue
Block a user