* dwarf2read.c (dwarf2_debug_line_missing_file_complaint): New
function. (dwarf_decode_lines): Check for line info without a file.
This commit is contained in:
parent
af2cbe8c98
commit
25e43795f0
|
@ -1,3 +1,10 @@
|
|||
2007-05-14 Paul Brook <paul@codesourcery.com>
|
||||
Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* dwarf2read.c (dwarf2_debug_line_missing_file_complaint): New
|
||||
function.
|
||||
(dwarf_decode_lines): Check for line info without a file.
|
||||
|
||||
2007-05-14 Daniel Jacobowitz <dan@codesourcery.com>
|
||||
|
||||
* linux-thread-db.c (thread_db_pid_to_str): Print thread IDs
|
||||
|
|
|
@ -687,6 +687,13 @@ dwarf2_statement_list_fits_in_line_number_section_complaint (void)
|
|||
_("statement list doesn't fit in .debug_line section"));
|
||||
}
|
||||
|
||||
static void
|
||||
dwarf2_debug_line_missing_file_complaint (void)
|
||||
{
|
||||
complaint (&symfile_complaints,
|
||||
_(".debug_line section has line data without a file"));
|
||||
}
|
||||
|
||||
static void
|
||||
dwarf2_complex_location_expr_complaint (void)
|
||||
{
|
||||
|
@ -6708,6 +6715,10 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
|
|||
address += (adj_opcode / lh->line_range)
|
||||
* lh->minimum_instruction_length;
|
||||
line += lh->line_base + (adj_opcode % lh->line_range);
|
||||
if (lh->num_file_names < file)
|
||||
dwarf2_debug_line_missing_file_complaint ();
|
||||
else
|
||||
{
|
||||
lh->file_names[file - 1].included_p = 1;
|
||||
if (!decode_for_pst_p)
|
||||
{
|
||||
|
@ -6721,6 +6732,7 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
|
|||
record_line (current_subfile, line,
|
||||
check_cu_functions (address, cu));
|
||||
}
|
||||
}
|
||||
basic_block = 1;
|
||||
}
|
||||
else switch (op_code)
|
||||
|
@ -6734,9 +6746,15 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
|
|||
{
|
||||
case DW_LNE_end_sequence:
|
||||
end_sequence = 1;
|
||||
|
||||
if (lh->num_file_names < file)
|
||||
dwarf2_debug_line_missing_file_complaint ();
|
||||
else
|
||||
{
|
||||
lh->file_names[file - 1].included_p = 1;
|
||||
if (!decode_for_pst_p)
|
||||
record_line (current_subfile, 0, address);
|
||||
}
|
||||
break;
|
||||
case DW_LNE_set_address:
|
||||
address = read_address (abfd, line_ptr, cu, &bytes_read);
|
||||
|
@ -6769,6 +6787,10 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
|
|||
}
|
||||
break;
|
||||
case DW_LNS_copy:
|
||||
if (lh->num_file_names < file)
|
||||
dwarf2_debug_line_missing_file_complaint ();
|
||||
else
|
||||
{
|
||||
lh->file_names[file - 1].included_p = 1;
|
||||
if (!decode_for_pst_p)
|
||||
{
|
||||
|
@ -6781,6 +6803,7 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
|
|||
record_line (current_subfile, line,
|
||||
check_cu_functions (address, cu));
|
||||
}
|
||||
}
|
||||
basic_block = 0;
|
||||
break;
|
||||
case DW_LNS_advance_pc:
|
||||
|
@ -6802,16 +6825,20 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
|
|||
|
||||
file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
|
||||
line_ptr += bytes_read;
|
||||
if (lh->num_file_names < file)
|
||||
dwarf2_debug_line_missing_file_complaint ();
|
||||
else
|
||||
{
|
||||
fe = &lh->file_names[file - 1];
|
||||
if (fe->dir_index)
|
||||
dir = lh->include_dirs[fe->dir_index - 1];
|
||||
|
||||
if (!decode_for_pst_p)
|
||||
{
|
||||
last_subfile = current_subfile;
|
||||
dwarf2_start_subfile (fe->name, dir, comp_dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DW_LNS_set_column:
|
||||
column = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
|
||||
|
|
Loading…
Reference in New Issue