|
Nicholas Clifton |
e0abd6 |
diff -rcp ../binutils-2.19.51.0.14.original/bfd/ChangeLog ./bfd/ChangeLog
|
|
Nicholas Clifton |
e0abd6 |
*** ../binutils-2.19.51.0.14.original/bfd/ChangeLog 2010-04-08 09:52:50.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
--- ./bfd/ChangeLog 2010-04-08 09:55:41.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
***************
|
|
Nicholas Clifton |
e0abd6 |
*** 1,3 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 1,31 ----
|
|
Nicholas Clifton |
e0abd6 |
+ 2010-04-08 Nick Clifton <nickc@redhat.com>
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ Import these patches from the mainline:
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ 2010-04-05 Jakub Jelinek <jakub@redhat.com>
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Handle CIE version 4
|
|
Nicholas Clifton |
e0abd6 |
+ provided that it has the expected address size and zero segment
|
|
Nicholas Clifton |
e0abd6 |
+ length.
|
|
Nicholas Clifton |
e0abd6 |
+ * dwarf2.c (struct line_head): Add maximum_ops_per_insn field.
|
|
Nicholas Clifton |
e0abd6 |
+ (struct line_info): Add op_index field, change end_sequence type to
|
|
Nicholas Clifton |
e0abd6 |
+ unsigned char.
|
|
Nicholas Clifton |
e0abd6 |
+ (new_line_sorts_after): For the same address compare op_index.
|
|
Nicholas Clifton |
e0abd6 |
+ (add_line_info): Add op_index argument, store it into the structure.
|
|
Nicholas Clifton |
e0abd6 |
+ (decode_line_info): Complain about unknown versions of .debug_line.
|
|
Nicholas Clifton |
e0abd6 |
+ Initialize maximum_ops_per_insn. Add op_index state register and
|
|
Nicholas Clifton |
e0abd6 |
+ track it.
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ 2010-04-01 Jakub Jelinek <jakub@redhat.com>
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ * dwarf2.c (read_attribute_value): Handle CU version 4
|
|
Nicholas Clifton |
e0abd6 |
+ for DW_FORM_ref_addr, handle DW_FORM_sec_offset, DW_FORM_exprloc
|
|
Nicholas Clifton |
e0abd6 |
+ and DW_FORM_flag_present. For unknown form value return NULL.
|
|
Nicholas Clifton |
e0abd6 |
+ (scan_unit_for_symbols): For DW_AT_location handle DW_FORM_exprloc
|
|
Nicholas Clifton |
e0abd6 |
+ like DW_FORM_block.
|
|
Nicholas Clifton |
e0abd6 |
+ (parse_comp_unit): Allow CU version 4.
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
2010-04-07 Nick Clifton <nickc@redhat.com>
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
Import this patch from the mainline:
|
|
Nicholas Clifton |
e0abd6 |
diff -rcp ../binutils-2.19.51.0.14.original/bfd/dwarf2.c ./bfd/dwarf2.c
|
|
Nicholas Clifton |
e0abd6 |
*** ../binutils-2.19.51.0.14.original/bfd/dwarf2.c 2010-04-08 09:52:50.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
--- ./bfd/dwarf2.c 2010-04-08 09:53:13.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
*************** struct line_head
|
|
Nicholas Clifton |
e0abd6 |
*** 45,50 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 45,51 ----
|
|
Nicholas Clifton |
e0abd6 |
unsigned short version;
|
|
Nicholas Clifton |
e0abd6 |
bfd_vma prologue_length;
|
|
Nicholas Clifton |
e0abd6 |
unsigned char minimum_instruction_length;
|
|
Nicholas Clifton |
e0abd6 |
+ unsigned char maximum_ops_per_insn;
|
|
Nicholas Clifton |
e0abd6 |
unsigned char default_is_stmt;
|
|
Nicholas Clifton |
e0abd6 |
int line_base;
|
|
Nicholas Clifton |
e0abd6 |
unsigned char line_range;
|
|
Nicholas Clifton |
e0abd6 |
*************** read_attribute_value (struct attribute *
|
|
Nicholas Clifton |
e0abd6 |
*** 750,756 ****
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_ref_addr:
|
|
Nicholas Clifton |
e0abd6 |
/* DW_FORM_ref_addr is an address in DWARF2, and an offset in
|
|
Nicholas Clifton |
e0abd6 |
DWARF3. */
|
|
Nicholas Clifton |
e0abd6 |
! if (unit->version == 3)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
if (unit->offset_size == 4)
|
|
Nicholas Clifton |
e0abd6 |
attr->u.val = read_4_bytes (unit->abfd, info_ptr);
|
|
Nicholas Clifton |
e0abd6 |
--- 751,757 ----
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_ref_addr:
|
|
Nicholas Clifton |
e0abd6 |
/* DW_FORM_ref_addr is an address in DWARF2, and an offset in
|
|
Nicholas Clifton |
e0abd6 |
DWARF3. */
|
|
Nicholas Clifton |
e0abd6 |
! if (unit->version == 3 || unit->version == 4)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
if (unit->offset_size == 4)
|
|
Nicholas Clifton |
e0abd6 |
attr->u.val = read_4_bytes (unit->abfd, info_ptr);
|
|
Nicholas Clifton |
e0abd6 |
*************** read_attribute_value (struct attribute *
|
|
Nicholas Clifton |
e0abd6 |
*** 764,769 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 765,777 ----
|
|
Nicholas Clifton |
e0abd6 |
attr->u.val = read_address (unit, info_ptr);
|
|
Nicholas Clifton |
e0abd6 |
info_ptr += unit->addr_size;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
+ case DW_FORM_sec_offset:
|
|
Nicholas Clifton |
e0abd6 |
+ if (unit->offset_size == 4)
|
|
Nicholas Clifton |
e0abd6 |
+ attr->u.val = read_4_bytes (unit->abfd, info_ptr);
|
|
Nicholas Clifton |
e0abd6 |
+ else
|
|
Nicholas Clifton |
e0abd6 |
+ attr->u.val = read_8_bytes (unit->abfd, info_ptr);
|
|
Nicholas Clifton |
e0abd6 |
+ info_ptr += unit->offset_size;
|
|
Nicholas Clifton |
e0abd6 |
+ break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_block2:
|
|
Nicholas Clifton |
e0abd6 |
amt = sizeof (struct dwarf_block);
|
|
Nicholas Clifton |
e0abd6 |
blk = bfd_alloc (abfd, amt);
|
|
Nicholas Clifton |
e0abd6 |
*************** read_attribute_value (struct attribute *
|
|
Nicholas Clifton |
e0abd6 |
*** 802,807 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 810,816 ----
|
|
Nicholas Clifton |
e0abd6 |
attr->u.str = read_indirect_string (unit, info_ptr, &bytes_read);
|
|
Nicholas Clifton |
e0abd6 |
info_ptr += bytes_read;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
+ case DW_FORM_exprloc:
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_block:
|
|
Nicholas Clifton |
e0abd6 |
amt = sizeof (struct dwarf_block);
|
|
Nicholas Clifton |
e0abd6 |
blk = bfd_alloc (abfd, amt);
|
|
Nicholas Clifton |
e0abd6 |
*************** read_attribute_value (struct attribute *
|
|
Nicholas Clifton |
e0abd6 |
*** 828,833 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 837,845 ----
|
|
Nicholas Clifton |
e0abd6 |
attr->u.val = read_1_byte (abfd, info_ptr);
|
|
Nicholas Clifton |
e0abd6 |
info_ptr += 1;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
+ case DW_FORM_flag_present:
|
|
Nicholas Clifton |
e0abd6 |
+ attr->u.val = 1;
|
|
Nicholas Clifton |
e0abd6 |
+ break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_sdata:
|
|
Nicholas Clifton |
e0abd6 |
attr->u.sval = read_signed_leb128 (abfd, info_ptr, &bytes_read);
|
|
Nicholas Clifton |
e0abd6 |
info_ptr += bytes_read;
|
|
Nicholas Clifton |
e0abd6 |
*************** read_attribute_value (struct attribute *
|
|
Nicholas Clifton |
e0abd6 |
*** 865,870 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 877,883 ----
|
|
Nicholas Clifton |
e0abd6 |
(*_bfd_error_handler) (_("Dwarf Error: Invalid or unhandled FORM value: %u."),
|
|
Nicholas Clifton |
e0abd6 |
form);
|
|
Nicholas Clifton |
e0abd6 |
bfd_set_error (bfd_error_bad_value);
|
|
Nicholas Clifton |
e0abd6 |
+ return NULL;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
return info_ptr;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
*************** struct line_info
|
|
Nicholas Clifton |
e0abd6 |
*** 894,900 ****
|
|
Nicholas Clifton |
e0abd6 |
char *filename;
|
|
Nicholas Clifton |
e0abd6 |
unsigned int line;
|
|
Nicholas Clifton |
e0abd6 |
unsigned int column;
|
|
Nicholas Clifton |
e0abd6 |
! int end_sequence; /* End of (sequential) code sequence. */
|
|
Nicholas Clifton |
e0abd6 |
};
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
struct fileinfo
|
|
Nicholas Clifton |
e0abd6 |
--- 907,914 ----
|
|
Nicholas Clifton |
e0abd6 |
char *filename;
|
|
Nicholas Clifton |
e0abd6 |
unsigned int line;
|
|
Nicholas Clifton |
e0abd6 |
unsigned int column;
|
|
Nicholas Clifton |
e0abd6 |
! unsigned char op_index;
|
|
Nicholas Clifton |
e0abd6 |
! unsigned char end_sequence; /* End of (sequential) code sequence. */
|
|
Nicholas Clifton |
e0abd6 |
};
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
struct fileinfo
|
|
Nicholas Clifton |
e0abd6 |
*************** new_line_sorts_after (struct line_info *
|
|
Nicholas Clifton |
e0abd6 |
*** 960,966 ****
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
return (new_line->address > line->address
|
|
Nicholas Clifton |
e0abd6 |
|| (new_line->address == line->address
|
|
Nicholas Clifton |
e0abd6 |
! && new_line->end_sequence < line->end_sequence));
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
--- 974,982 ----
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
return (new_line->address > line->address
|
|
Nicholas Clifton |
e0abd6 |
|| (new_line->address == line->address
|
|
Nicholas Clifton |
e0abd6 |
! && (new_line->op_index > line->op_index
|
|
Nicholas Clifton |
e0abd6 |
! || (new_line->op_index == line->op_index
|
|
Nicholas Clifton |
e0abd6 |
! && new_line->end_sequence < line->end_sequence))));
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
*************** new_line_sorts_after (struct line_info *
|
|
Nicholas Clifton |
e0abd6 |
*** 972,977 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 988,994 ----
|
|
Nicholas Clifton |
e0abd6 |
static void
|
|
Nicholas Clifton |
e0abd6 |
add_line_info (struct line_info_table *table,
|
|
Nicholas Clifton |
e0abd6 |
bfd_vma address,
|
|
Nicholas Clifton |
e0abd6 |
+ unsigned char op_index,
|
|
Nicholas Clifton |
e0abd6 |
char *filename,
|
|
Nicholas Clifton |
e0abd6 |
unsigned int line,
|
|
Nicholas Clifton |
e0abd6 |
unsigned int column,
|
|
Nicholas Clifton |
e0abd6 |
*************** add_line_info (struct line_info_table *t
|
|
Nicholas Clifton |
e0abd6 |
*** 982,987 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 999,1005 ----
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
/* Set member data of 'info'. */
|
|
Nicholas Clifton |
e0abd6 |
info->address = address;
|
|
Nicholas Clifton |
e0abd6 |
+ info->op_index = op_index;
|
|
Nicholas Clifton |
e0abd6 |
info->line = line;
|
|
Nicholas Clifton |
e0abd6 |
info->column = column;
|
|
Nicholas Clifton |
e0abd6 |
info->end_sequence = end_sequence;
|
|
Nicholas Clifton |
e0abd6 |
*************** add_line_info (struct line_info_table *t
|
|
Nicholas Clifton |
e0abd6 |
*** 1012,1017 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 1030,1036 ----
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
if (table->last_line
|
|
Nicholas Clifton |
e0abd6 |
&& table->last_line->address == address
|
|
Nicholas Clifton |
e0abd6 |
+ && table->last_line->op_index == op_index
|
|
Nicholas Clifton |
e0abd6 |
&& table->last_line->end_sequence == end_sequence)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
/* We only keep the last entry with the same address and end
|
|
Nicholas Clifton |
e0abd6 |
*************** decode_line_info (struct comp_unit *unit
|
|
Nicholas Clifton |
e0abd6 |
*** 1222,1227 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 1241,1253 ----
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
line_end = line_ptr + lh.total_length;
|
|
Nicholas Clifton |
e0abd6 |
lh.version = read_2_bytes (abfd, line_ptr);
|
|
Nicholas Clifton |
e0abd6 |
+ if (lh.version < 2 || lh.version > 4)
|
|
Nicholas Clifton |
e0abd6 |
+ {
|
|
Nicholas Clifton |
e0abd6 |
+ (*_bfd_error_handler)
|
|
Nicholas Clifton |
e0abd6 |
+ (_("Dwarf Error: Unhandled .debug_line version %d."), lh.version);
|
|
Nicholas Clifton |
e0abd6 |
+ bfd_set_error (bfd_error_bad_value);
|
|
Nicholas Clifton |
e0abd6 |
+ return NULL;
|
|
Nicholas Clifton |
e0abd6 |
+ }
|
|
Nicholas Clifton |
e0abd6 |
line_ptr += 2;
|
|
Nicholas Clifton |
e0abd6 |
if (offset_size == 4)
|
|
Nicholas Clifton |
e0abd6 |
lh.prologue_length = read_4_bytes (abfd, line_ptr);
|
|
Nicholas Clifton |
e0abd6 |
*************** decode_line_info (struct comp_unit *unit
|
|
Nicholas Clifton |
e0abd6 |
*** 1230,1235 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 1256,1275 ----
|
|
Nicholas Clifton |
e0abd6 |
line_ptr += offset_size;
|
|
Nicholas Clifton |
e0abd6 |
lh.minimum_instruction_length = read_1_byte (abfd, line_ptr);
|
|
Nicholas Clifton |
e0abd6 |
line_ptr += 1;
|
|
Nicholas Clifton |
e0abd6 |
+ if (lh.version >= 4)
|
|
Nicholas Clifton |
e0abd6 |
+ {
|
|
Nicholas Clifton |
e0abd6 |
+ lh.maximum_ops_per_insn = read_1_byte (abfd, line_ptr);
|
|
Nicholas Clifton |
e0abd6 |
+ line_ptr += 1;
|
|
Nicholas Clifton |
e0abd6 |
+ }
|
|
Nicholas Clifton |
e0abd6 |
+ else
|
|
Nicholas Clifton |
e0abd6 |
+ lh.maximum_ops_per_insn = 1;
|
|
Nicholas Clifton |
e0abd6 |
+ if (lh.maximum_ops_per_insn == 0)
|
|
Nicholas Clifton |
e0abd6 |
+ {
|
|
Nicholas Clifton |
e0abd6 |
+ (*_bfd_error_handler)
|
|
Nicholas Clifton |
e0abd6 |
+ (_("Dwarf Error: Invalid maximum operations per instruction."));
|
|
Nicholas Clifton |
e0abd6 |
+ bfd_set_error (bfd_error_bad_value);
|
|
Nicholas Clifton |
e0abd6 |
+ return NULL;
|
|
Nicholas Clifton |
e0abd6 |
+ }
|
|
Nicholas Clifton |
e0abd6 |
lh.default_is_stmt = read_1_byte (abfd, line_ptr);
|
|
Nicholas Clifton |
e0abd6 |
line_ptr += 1;
|
|
Nicholas Clifton |
e0abd6 |
lh.line_base = read_1_signed_byte (abfd, line_ptr);
|
|
Nicholas Clifton |
e0abd6 |
*************** decode_line_info (struct comp_unit *unit
|
|
Nicholas Clifton |
e0abd6 |
*** 1317,1322 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 1357,1363 ----
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
/* State machine registers. */
|
|
Nicholas Clifton |
e0abd6 |
bfd_vma address = 0;
|
|
Nicholas Clifton |
e0abd6 |
+ unsigned char op_index = 0;
|
|
Nicholas Clifton |
e0abd6 |
char * filename = table->num_files ? concat_filename (table, 1) : NULL;
|
|
Nicholas Clifton |
e0abd6 |
unsigned int line = 1;
|
|
Nicholas Clifton |
e0abd6 |
unsigned int column = 0;
|
|
Nicholas Clifton |
e0abd6 |
*************** decode_line_info (struct comp_unit *unit
|
|
Nicholas Clifton |
e0abd6 |
*** 1340,1350 ****
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
/* Special operand. */
|
|
Nicholas Clifton |
e0abd6 |
adj_opcode = op_code - lh.opcode_base;
|
|
Nicholas Clifton |
e0abd6 |
! address += (adj_opcode / lh.line_range)
|
|
Nicholas Clifton |
e0abd6 |
! * lh.minimum_instruction_length;
|
|
Nicholas Clifton |
e0abd6 |
line += lh.line_base + (adj_opcode % lh.line_range);
|
|
Nicholas Clifton |
e0abd6 |
/* Append row to matrix using current values. */
|
|
Nicholas Clifton |
e0abd6 |
! add_line_info (table, address, filename, line, column, 0);
|
|
Nicholas Clifton |
e0abd6 |
if (address < low_pc)
|
|
Nicholas Clifton |
e0abd6 |
low_pc = address;
|
|
Nicholas Clifton |
e0abd6 |
if (address > high_pc)
|
|
Nicholas Clifton |
e0abd6 |
--- 1381,1401 ----
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
/* Special operand. */
|
|
Nicholas Clifton |
e0abd6 |
adj_opcode = op_code - lh.opcode_base;
|
|
Nicholas Clifton |
e0abd6 |
! if (lh.maximum_ops_per_insn == 1)
|
|
Nicholas Clifton |
e0abd6 |
! address += (adj_opcode / lh.line_range)
|
|
Nicholas Clifton |
e0abd6 |
! * lh.minimum_instruction_length;
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! address += ((op_index + (adj_opcode / lh.line_range))
|
|
Nicholas Clifton |
e0abd6 |
! / lh.maximum_ops_per_insn)
|
|
Nicholas Clifton |
e0abd6 |
! * lh.minimum_instruction_length;
|
|
Nicholas Clifton |
e0abd6 |
! op_index = (op_index + (adj_opcode / lh.line_range))
|
|
Nicholas Clifton |
e0abd6 |
! % lh.maximum_ops_per_insn;
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
line += lh.line_base + (adj_opcode % lh.line_range);
|
|
Nicholas Clifton |
e0abd6 |
/* Append row to matrix using current values. */
|
|
Nicholas Clifton |
e0abd6 |
! add_line_info (table, address, op_index, filename,
|
|
Nicholas Clifton |
e0abd6 |
! line, column, 0);
|
|
Nicholas Clifton |
e0abd6 |
if (address < low_pc)
|
|
Nicholas Clifton |
e0abd6 |
low_pc = address;
|
|
Nicholas Clifton |
e0abd6 |
if (address > high_pc)
|
|
Nicholas Clifton |
e0abd6 |
*************** decode_line_info (struct comp_unit *unit
|
|
Nicholas Clifton |
e0abd6 |
*** 1362,1369 ****
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNE_end_sequence:
|
|
Nicholas Clifton |
e0abd6 |
end_sequence = 1;
|
|
Nicholas Clifton |
e0abd6 |
! add_line_info (table, address, filename, line, column,
|
|
Nicholas Clifton |
e0abd6 |
! end_sequence);
|
|
Nicholas Clifton |
e0abd6 |
if (address < low_pc)
|
|
Nicholas Clifton |
e0abd6 |
low_pc = address;
|
|
Nicholas Clifton |
e0abd6 |
if (address > high_pc)
|
|
Nicholas Clifton |
e0abd6 |
--- 1413,1420 ----
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNE_end_sequence:
|
|
Nicholas Clifton |
e0abd6 |
end_sequence = 1;
|
|
Nicholas Clifton |
e0abd6 |
! add_line_info (table, address, op_index, filename,
|
|
Nicholas Clifton |
e0abd6 |
! line, column, end_sequence);
|
|
Nicholas Clifton |
e0abd6 |
if (address < low_pc)
|
|
Nicholas Clifton |
e0abd6 |
low_pc = address;
|
|
Nicholas Clifton |
e0abd6 |
if (address > high_pc)
|
|
Nicholas Clifton |
e0abd6 |
*************** decode_line_info (struct comp_unit *unit
|
|
Nicholas Clifton |
e0abd6 |
*** 1372,1377 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 1423,1429 ----
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNE_set_address:
|
|
Nicholas Clifton |
e0abd6 |
address = read_address (unit, line_ptr);
|
|
Nicholas Clifton |
e0abd6 |
+ op_index = 0;
|
|
Nicholas Clifton |
e0abd6 |
line_ptr += unit->addr_size;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNE_define_file:
|
|
Nicholas Clifton |
e0abd6 |
*************** decode_line_info (struct comp_unit *unit
|
|
Nicholas Clifton |
e0abd6 |
*** 1419,1433 ****
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_copy:
|
|
Nicholas Clifton |
e0abd6 |
! add_line_info (table, address, filename, line, column, 0);
|
|
Nicholas Clifton |
e0abd6 |
if (address < low_pc)
|
|
Nicholas Clifton |
e0abd6 |
low_pc = address;
|
|
Nicholas Clifton |
e0abd6 |
if (address > high_pc)
|
|
Nicholas Clifton |
e0abd6 |
high_pc = address;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
! address += lh.minimum_instruction_length
|
|
Nicholas Clifton |
e0abd6 |
! * read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
|
|
Nicholas Clifton |
e0abd6 |
line_ptr += bytes_read;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_line:
|
|
Nicholas Clifton |
e0abd6 |
--- 1471,1496 ----
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_copy:
|
|
Nicholas Clifton |
e0abd6 |
! add_line_info (table, address, op_index,
|
|
Nicholas Clifton |
e0abd6 |
! filename, line, column, 0);
|
|
Nicholas Clifton |
e0abd6 |
if (address < low_pc)
|
|
Nicholas Clifton |
e0abd6 |
low_pc = address;
|
|
Nicholas Clifton |
e0abd6 |
if (address > high_pc)
|
|
Nicholas Clifton |
e0abd6 |
high_pc = address;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
! if (lh.maximum_ops_per_insn == 1)
|
|
Nicholas Clifton |
e0abd6 |
! address += lh.minimum_instruction_length
|
|
Nicholas Clifton |
e0abd6 |
! * read_unsigned_leb128 (abfd, line_ptr,
|
|
Nicholas Clifton |
e0abd6 |
! &bytes_read);
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! bfd_vma adjust = read_unsigned_leb128 (abfd, line_ptr,
|
|
Nicholas Clifton |
e0abd6 |
! &bytes_read);
|
|
Nicholas Clifton |
e0abd6 |
! address = ((op_index + adjust) / lh.maximum_ops_per_insn)
|
|
Nicholas Clifton |
e0abd6 |
! * lh.minimum_instruction_length;
|
|
Nicholas Clifton |
e0abd6 |
! op_index = (op_index + adjust) % lh.maximum_ops_per_insn;
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
line_ptr += bytes_read;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_line:
|
|
Nicholas Clifton |
e0abd6 |
*************** decode_line_info (struct comp_unit *unit
|
|
Nicholas Clifton |
e0abd6 |
*** 1457,1467 ****
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_set_basic_block:
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_const_add_pc:
|
|
Nicholas Clifton |
e0abd6 |
! address += lh.minimum_instruction_length
|
|
Nicholas Clifton |
e0abd6 |
! * ((255 - lh.opcode_base) / lh.line_range);
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_fixed_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
address += read_2_bytes (abfd, line_ptr);
|
|
Nicholas Clifton |
e0abd6 |
line_ptr += 2;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
default:
|
|
Nicholas Clifton |
e0abd6 |
--- 1520,1539 ----
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_set_basic_block:
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_const_add_pc:
|
|
Nicholas Clifton |
e0abd6 |
! if (lh.maximum_ops_per_insn == 1)
|
|
Nicholas Clifton |
e0abd6 |
! address += lh.minimum_instruction_length
|
|
Nicholas Clifton |
e0abd6 |
! * ((255 - lh.opcode_base) / lh.line_range);
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! bfd_vma adjust = ((255 - lh.opcode_base) / lh.line_range);
|
|
Nicholas Clifton |
e0abd6 |
! address += lh.minimum_instruction_length
|
|
Nicholas Clifton |
e0abd6 |
! * ((op_index + adjust) / lh.maximum_ops_per_insn);
|
|
Nicholas Clifton |
e0abd6 |
! op_index = (op_index + adjust) % lh.maximum_ops_per_insn;
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_fixed_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
address += read_2_bytes (abfd, line_ptr);
|
|
Nicholas Clifton |
e0abd6 |
+ op_index = 0;
|
|
Nicholas Clifton |
e0abd6 |
line_ptr += 2;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
default:
|
|
Nicholas Clifton |
e0abd6 |
*************** scan_unit_for_symbols (struct comp_unit
|
|
Nicholas Clifton |
e0abd6 |
*** 1994,1999 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 2066,2072 ----
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_block1:
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_block2:
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_block4:
|
|
Nicholas Clifton |
e0abd6 |
+ case DW_FORM_exprloc:
|
|
Nicholas Clifton |
e0abd6 |
if (*attr.u.blk->data == DW_OP_addr)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
var->stack = 0;
|
|
Nicholas Clifton |
e0abd6 |
*************** parse_comp_unit (struct dwarf2_debug *st
|
|
Nicholas Clifton |
e0abd6 |
*** 2095,2103 ****
|
|
Nicholas Clifton |
e0abd6 |
addr_size = read_1_byte (abfd, info_ptr);
|
|
Nicholas Clifton |
e0abd6 |
info_ptr += 1;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
! if (version != 2 && version != 3)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! (*_bfd_error_handler) (_("Dwarf Error: found dwarf version '%u', this reader only handles version 2 and 3 information."), version);
|
|
Nicholas Clifton |
e0abd6 |
bfd_set_error (bfd_error_bad_value);
|
|
Nicholas Clifton |
e0abd6 |
return 0;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
--- 2168,2176 ----
|
|
Nicholas Clifton |
e0abd6 |
addr_size = read_1_byte (abfd, info_ptr);
|
|
Nicholas Clifton |
e0abd6 |
info_ptr += 1;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
! if (version != 2 && version != 3 && version != 4)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! (*_bfd_error_handler) (_("Dwarf Error: found dwarf version '%u', this reader only handles version 2, 3 and 4 information."), version);
|
|
Nicholas Clifton |
e0abd6 |
bfd_set_error (bfd_error_bad_value);
|
|
Nicholas Clifton |
e0abd6 |
return 0;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
diff -rcp ../binutils-2.19.51.0.14.original/bfd/elf-eh-frame.c ./bfd/elf-eh-frame.c
|
|
Nicholas Clifton |
e0abd6 |
*** ../binutils-2.19.51.0.14.original/bfd/elf-eh-frame.c 2010-04-08 09:52:50.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
--- ./bfd/elf-eh-frame.c 2010-04-08 09:53:24.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
*************** _bfd_elf_parse_eh_frame (bfd *abfd, stru
|
|
Nicholas Clifton |
e0abd6 |
*** 610,616 ****
|
|
Nicholas Clifton |
e0abd6 |
REQUIRE (read_byte (&buf, end, &cie->version));
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
/* Cannot handle unknown versions. */
|
|
Nicholas Clifton |
e0abd6 |
! REQUIRE (cie->version == 1 || cie->version == 3);
|
|
Nicholas Clifton |
e0abd6 |
REQUIRE (strlen ((char *) buf) < sizeof (cie->augmentation));
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
strcpy (cie->augmentation, (char *) buf);
|
|
Nicholas Clifton |
e0abd6 |
--- 610,618 ----
|
|
Nicholas Clifton |
e0abd6 |
REQUIRE (read_byte (&buf, end, &cie->version));
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
/* Cannot handle unknown versions. */
|
|
Nicholas Clifton |
e0abd6 |
! REQUIRE (cie->version == 1
|
|
Nicholas Clifton |
e0abd6 |
! || cie->version == 3
|
|
Nicholas Clifton |
e0abd6 |
! || cie->version == 4);
|
|
Nicholas Clifton |
e0abd6 |
REQUIRE (strlen ((char *) buf) < sizeof (cie->augmentation));
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
strcpy (cie->augmentation, (char *) buf);
|
|
Nicholas Clifton |
e0abd6 |
*************** _bfd_elf_parse_eh_frame (bfd *abfd, stru
|
|
Nicholas Clifton |
e0abd6 |
*** 625,630 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 627,639 ----
|
|
Nicholas Clifton |
e0abd6 |
REQUIRE (skip_bytes (&buf, end, ptr_size));
|
|
Nicholas Clifton |
e0abd6 |
SKIP_RELOCS (buf);
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
+ if (cie->version >= 4)
|
|
Nicholas Clifton |
e0abd6 |
+ {
|
|
Nicholas Clifton |
e0abd6 |
+ REQUIRE (buf + 1 < end);
|
|
Nicholas Clifton |
e0abd6 |
+ REQUIRE (buf[0] == ptr_size);
|
|
Nicholas Clifton |
e0abd6 |
+ REQUIRE (buf[1] == 0);
|
|
Nicholas Clifton |
e0abd6 |
+ buf += 2;
|
|
Nicholas Clifton |
e0abd6 |
+ }
|
|
Nicholas Clifton |
e0abd6 |
REQUIRE (read_uleb128 (&buf, end, &cie->code_align));
|
|
Nicholas Clifton |
e0abd6 |
REQUIRE (read_sleb128 (&buf, end, &cie->data_align));
|
|
Nicholas Clifton |
e0abd6 |
if (cie->version == 1)
|
|
Nicholas Clifton |
e0abd6 |
diff -rcp ../binutils-2.19.51.0.14.original/binutils/ChangeLog ./binutils/ChangeLog
|
|
Nicholas Clifton |
e0abd6 |
*** ../binutils-2.19.51.0.14.original/binutils/ChangeLog 2010-04-08 09:52:41.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
--- ./binutils/ChangeLog 2010-04-08 09:56:22.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
***************
|
|
Nicholas Clifton |
e0abd6 |
*** 1,3 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 1,31 ----
|
|
Nicholas Clifton |
e0abd6 |
+ 2010-04-08 Nick Clifton <nickc@redhat.com>
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ Import these patches from the mainline:
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ 2010-04-05 Jakub Jelinek <jakub@redhat.com>
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ * dwarf.c (struct Frame_Chunk): Add ptr_size and segment_size
|
|
Nicholas Clifton |
e0abd6 |
+ fields.
|
|
Nicholas Clifton |
e0abd6 |
+ (display_debug_frames): Handle CIE version 4.
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ * dwarf.c (struct State_Machine_Registers): Add op_index field,
|
|
Nicholas Clifton |
e0abd6 |
+ change end_sequence type to unsigned char.
|
|
Nicholas Clifton |
e0abd6 |
+ (reset_state_machine): Clear op_index.
|
|
Nicholas Clifton |
e0abd6 |
+ (process_extended_line_op): For DW_LNE_set_address clear op_index.
|
|
Nicholas Clifton |
e0abd6 |
+ (display_debug_lines_raw): Initialize li_max_ops_per_insn.
|
|
Nicholas Clifton |
e0abd6 |
+ Track op_index state machine register and print it if
|
|
Nicholas Clifton |
e0abd6 |
+ li_max_ops_per_insn is != 1.
|
|
Nicholas Clifton |
e0abd6 |
+ (display_debug_lines_decoded): Likewise.
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ 2010-04-01 Jakub Jelinek <jakub@redhat.com>
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ * dwarf.c (read_and_display_attr_value): Don't reject
|
|
Nicholas Clifton |
e0abd6 |
+ dwarf_version == 4. Handle DW_FORM_sec_offset, DW_FORM_flag_present
|
|
Nicholas Clifton |
e0abd6 |
+ and DW_FORM_exprloc.
|
|
Nicholas Clifton |
e0abd6 |
+ (process_debug_info): Handle cu_version == 4.
|
|
Nicholas Clifton |
e0abd6 |
+ (display_debug_lines_raw, display_debug_lines_decoded): Handle
|
|
Nicholas Clifton |
e0abd6 |
+ li_version == 4.
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
2009-07-20 H.J. Lu <hongjiu.lu@intel.com>
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
* NEWS: Mention --insn-width.
|
|
Nicholas Clifton |
e0abd6 |
diff -rcp ../binutils-2.19.51.0.14.original/binutils/dwarf.c ./binutils/dwarf.c
|
|
Nicholas Clifton |
e0abd6 |
*** ../binutils-2.19.51.0.14.original/binutils/dwarf.c 2010-04-08 09:52:41.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
--- ./binutils/dwarf.c 2010-04-08 09:53:32.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
*************** typedef struct State_Machine_Registers
|
|
Nicholas Clifton |
e0abd6 |
*** 253,259 ****
|
|
Nicholas Clifton |
e0abd6 |
unsigned int column;
|
|
Nicholas Clifton |
e0abd6 |
int is_stmt;
|
|
Nicholas Clifton |
e0abd6 |
int basic_block;
|
|
Nicholas Clifton |
e0abd6 |
! int end_sequence;
|
|
Nicholas Clifton |
e0abd6 |
/* This variable hold the number of the last entry seen
|
|
Nicholas Clifton |
e0abd6 |
in the File Table. */
|
|
Nicholas Clifton |
e0abd6 |
unsigned int last_file_entry;
|
|
Nicholas Clifton |
e0abd6 |
--- 253,260 ----
|
|
Nicholas Clifton |
e0abd6 |
unsigned int column;
|
|
Nicholas Clifton |
e0abd6 |
int is_stmt;
|
|
Nicholas Clifton |
e0abd6 |
int basic_block;
|
|
Nicholas Clifton |
e0abd6 |
! unsigned char op_index;
|
|
Nicholas Clifton |
e0abd6 |
! unsigned char end_sequence;
|
|
Nicholas Clifton |
e0abd6 |
/* This variable hold the number of the last entry seen
|
|
Nicholas Clifton |
e0abd6 |
in the File Table. */
|
|
Nicholas Clifton |
e0abd6 |
unsigned int last_file_entry;
|
|
Nicholas Clifton |
e0abd6 |
*************** static void
|
|
Nicholas Clifton |
e0abd6 |
*** 265,270 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 266,272 ----
|
|
Nicholas Clifton |
e0abd6 |
reset_state_machine (int is_stmt)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.address = 0;
|
|
Nicholas Clifton |
e0abd6 |
+ state_machine_regs.op_index = 0;
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.file = 1;
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.line = 1;
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.column = 0;
|
|
Nicholas Clifton |
e0abd6 |
*************** process_extended_line_op (unsigned char
|
|
Nicholas Clifton |
e0abd6 |
*** 311,316 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 313,319 ----
|
|
Nicholas Clifton |
e0abd6 |
adr = byte_get (data, len - bytes_read - 1);
|
|
Nicholas Clifton |
e0abd6 |
printf (_("set Address to 0x%lx\n"), adr);
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.address = adr;
|
|
Nicholas Clifton |
e0abd6 |
+ state_machine_regs.op_index = 0;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNE_define_file:
|
|
Nicholas Clifton |
e0abd6 |
*************** read_and_display_attr_value (unsigned lo
|
|
Nicholas Clifton |
e0abd6 |
*** 1132,1145 ****
|
|
Nicholas Clifton |
e0abd6 |
uvalue = byte_get (data, pointer_size);
|
|
Nicholas Clifton |
e0abd6 |
data += pointer_size;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
! else if (dwarf_version == 3)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
uvalue = byte_get (data, offset_size);
|
|
Nicholas Clifton |
e0abd6 |
data += offset_size;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
else
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! error (_("Internal error: DWARF version is not 2 or 3.\n"));
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
--- 1135,1148 ----
|
|
Nicholas Clifton |
e0abd6 |
uvalue = byte_get (data, pointer_size);
|
|
Nicholas Clifton |
e0abd6 |
data += pointer_size;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
! else if (dwarf_version == 3 || dwarf_version == 4)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
uvalue = byte_get (data, offset_size);
|
|
Nicholas Clifton |
e0abd6 |
data += offset_size;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
else
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! error (_("Internal error: DWARF version is not 2, 3 or 4.\n"));
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
*************** read_and_display_attr_value (unsigned lo
|
|
Nicholas Clifton |
e0abd6 |
*** 1149,1158 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 1152,1166 ----
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_strp:
|
|
Nicholas Clifton |
e0abd6 |
+ case DW_FORM_sec_offset:
|
|
Nicholas Clifton |
e0abd6 |
uvalue = byte_get (data, offset_size);
|
|
Nicholas Clifton |
e0abd6 |
data += offset_size;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
+ case DW_FORM_flag_present:
|
|
Nicholas Clifton |
e0abd6 |
+ uvalue = 1;
|
|
Nicholas Clifton |
e0abd6 |
+ break;
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_ref1:
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_flag:
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_data1:
|
|
Nicholas Clifton |
e0abd6 |
*************** read_and_display_attr_value (unsigned lo
|
|
Nicholas Clifton |
e0abd6 |
*** 1211,1220 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 1219,1230 ----
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_data4:
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_addr:
|
|
Nicholas Clifton |
e0abd6 |
+ case DW_FORM_sec_offset:
|
|
Nicholas Clifton |
e0abd6 |
if (!do_loc)
|
|
Nicholas Clifton |
e0abd6 |
printf (" 0x%lx", uvalue);
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
+ case DW_FORM_flag_present:
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_flag:
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_data1:
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_data2:
|
|
Nicholas Clifton |
e0abd6 |
*************** read_and_display_attr_value (unsigned lo
|
|
Nicholas Clifton |
e0abd6 |
*** 1250,1255 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 1260,1266 ----
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_FORM_block:
|
|
Nicholas Clifton |
e0abd6 |
+ case DW_FORM_exprloc:
|
|
Nicholas Clifton |
e0abd6 |
uvalue = read_leb128 (data, & bytes_read, 0);
|
|
Nicholas Clifton |
e0abd6 |
block_start = data + bytes_read;
|
|
Nicholas Clifton |
e0abd6 |
if (do_loc)
|
|
Nicholas Clifton |
e0abd6 |
*************** read_and_display_attr_value (unsigned lo
|
|
Nicholas Clifton |
e0abd6 |
*** 1315,1321 ****
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_segment:
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_static_link:
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_use_location:
|
|
Nicholas Clifton |
e0abd6 |
! if (form == DW_FORM_data4 || form == DW_FORM_data8)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
/* Process location list. */
|
|
Nicholas Clifton |
e0abd6 |
unsigned int max = debug_info_p->max_loc_offsets;
|
|
Nicholas Clifton |
e0abd6 |
--- 1326,1334 ----
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_segment:
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_static_link:
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_use_location:
|
|
Nicholas Clifton |
e0abd6 |
! if (form == DW_FORM_data4
|
|
Nicholas Clifton |
e0abd6 |
! || form == DW_FORM_data8
|
|
Nicholas Clifton |
e0abd6 |
! || form == DW_FORM_sec_offset)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
/* Process location list. */
|
|
Nicholas Clifton |
e0abd6 |
unsigned int max = debug_info_p->max_loc_offsets;
|
|
Nicholas Clifton |
e0abd6 |
*************** read_and_display_attr_value (unsigned lo
|
|
Nicholas Clifton |
e0abd6 |
*** 1344,1350 ****
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_ranges:
|
|
Nicholas Clifton |
e0abd6 |
! if (form == DW_FORM_data4 || form == DW_FORM_data8)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
/* Process range list. */
|
|
Nicholas Clifton |
e0abd6 |
unsigned int max = debug_info_p->max_range_lists;
|
|
Nicholas Clifton |
e0abd6 |
--- 1357,1365 ----
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_ranges:
|
|
Nicholas Clifton |
e0abd6 |
! if (form == DW_FORM_data4
|
|
Nicholas Clifton |
e0abd6 |
! || form == DW_FORM_data8
|
|
Nicholas Clifton |
e0abd6 |
! || form == DW_FORM_sec_offset)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
/* Process range list. */
|
|
Nicholas Clifton |
e0abd6 |
unsigned int max = debug_info_p->max_range_lists;
|
|
Nicholas Clifton |
e0abd6 |
*************** read_and_display_attr_value (unsigned lo
|
|
Nicholas Clifton |
e0abd6 |
*** 1552,1558 ****
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_segment:
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_static_link:
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_use_location:
|
|
Nicholas Clifton |
e0abd6 |
! if (form == DW_FORM_data4 || form == DW_FORM_data8)
|
|
Nicholas Clifton |
e0abd6 |
printf (_("(location list)"));
|
|
Nicholas Clifton |
e0abd6 |
/* Fall through. */
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_allocated:
|
|
Nicholas Clifton |
e0abd6 |
--- 1567,1575 ----
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_segment:
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_static_link:
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_use_location:
|
|
Nicholas Clifton |
e0abd6 |
! if (form == DW_FORM_data4
|
|
Nicholas Clifton |
e0abd6 |
! || form == DW_FORM_data8
|
|
Nicholas Clifton |
e0abd6 |
! || form == DW_FORM_sec_offset)
|
|
Nicholas Clifton |
e0abd6 |
printf (_("(location list)"));
|
|
Nicholas Clifton |
e0abd6 |
/* Fall through. */
|
|
Nicholas Clifton |
e0abd6 |
case DW_AT_allocated:
|
|
Nicholas Clifton |
e0abd6 |
*************** process_debug_info (struct dwarf_section
|
|
Nicholas Clifton |
e0abd6 |
*** 1949,1955 ****
|
|
Nicholas Clifton |
e0abd6 |
tags = hdrptr;
|
|
Nicholas Clifton |
e0abd6 |
start += compunit.cu_length + initial_length_size;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
! if (compunit.cu_version != 2 && compunit.cu_version != 3)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
warn (_("CU at offset %lx contains corrupt or unsupported version number: %d.\n"),
|
|
Nicholas Clifton |
e0abd6 |
cu_offset, compunit.cu_version);
|
|
Nicholas Clifton |
e0abd6 |
--- 1966,1974 ----
|
|
Nicholas Clifton |
e0abd6 |
tags = hdrptr;
|
|
Nicholas Clifton |
e0abd6 |
start += compunit.cu_length + initial_length_size;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
! if (compunit.cu_version != 2
|
|
Nicholas Clifton |
e0abd6 |
! && compunit.cu_version != 3
|
|
Nicholas Clifton |
e0abd6 |
! && compunit.cu_version != 4)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
warn (_("CU at offset %lx contains corrupt or unsupported version number: %d.\n"),
|
|
Nicholas Clifton |
e0abd6 |
cu_offset, compunit.cu_version);
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_raw (struct dwarf_se
|
|
Nicholas Clifton |
e0abd6 |
*** 2166,2174 ****
|
|
Nicholas Clifton |
e0abd6 |
/* Check its version number. */
|
|
Nicholas Clifton |
e0abd6 |
info.li_version = byte_get (hdrptr, 2);
|
|
Nicholas Clifton |
e0abd6 |
hdrptr += 2;
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_version != 2 && info.li_version != 3)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! warn (_("Only DWARF version 2 and 3 line info is currently supported.\n"));
|
|
Nicholas Clifton |
e0abd6 |
return 0;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
--- 2185,2195 ----
|
|
Nicholas Clifton |
e0abd6 |
/* Check its version number. */
|
|
Nicholas Clifton |
e0abd6 |
info.li_version = byte_get (hdrptr, 2);
|
|
Nicholas Clifton |
e0abd6 |
hdrptr += 2;
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_version != 2
|
|
Nicholas Clifton |
e0abd6 |
! && info.li_version != 3
|
|
Nicholas Clifton |
e0abd6 |
! && info.li_version != 4)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! warn (_("Only DWARF version 2, 3 and 4 line info is currently supported.\n"));
|
|
Nicholas Clifton |
e0abd6 |
return 0;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_raw (struct dwarf_se
|
|
Nicholas Clifton |
e0abd6 |
*** 2176,2181 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 2197,2214 ----
|
|
Nicholas Clifton |
e0abd6 |
hdrptr += offset_size;
|
|
Nicholas Clifton |
e0abd6 |
info.li_min_insn_length = byte_get (hdrptr, 1);
|
|
Nicholas Clifton |
e0abd6 |
hdrptr++;
|
|
Nicholas Clifton |
e0abd6 |
+ if (info.li_version >= 4)
|
|
Nicholas Clifton |
e0abd6 |
+ {
|
|
Nicholas Clifton |
e0abd6 |
+ info.li_max_ops_per_insn = byte_get (hdrptr, 1);
|
|
Nicholas Clifton |
e0abd6 |
+ hdrptr++;
|
|
Nicholas Clifton |
e0abd6 |
+ if (info.li_max_ops_per_insn == 0)
|
|
Nicholas Clifton |
e0abd6 |
+ {
|
|
Nicholas Clifton |
e0abd6 |
+ warn (_("Invalid maximum operations per insn.\n"));
|
|
Nicholas Clifton |
e0abd6 |
+ return 0;
|
|
Nicholas Clifton |
e0abd6 |
+ }
|
|
Nicholas Clifton |
e0abd6 |
+ }
|
|
Nicholas Clifton |
e0abd6 |
+ else
|
|
Nicholas Clifton |
e0abd6 |
+ info.li_max_ops_per_insn = 1;
|
|
Nicholas Clifton |
e0abd6 |
info.li_default_is_stmt = byte_get (hdrptr, 1);
|
|
Nicholas Clifton |
e0abd6 |
hdrptr++;
|
|
Nicholas Clifton |
e0abd6 |
info.li_line_base = byte_get (hdrptr, 1);
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_raw (struct dwarf_se
|
|
Nicholas Clifton |
e0abd6 |
*** 2194,2199 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 2227,2234 ----
|
|
Nicholas Clifton |
e0abd6 |
printf (_(" DWARF Version: %d\n"), info.li_version);
|
|
Nicholas Clifton |
e0abd6 |
printf (_(" Prologue Length: %d\n"), info.li_prologue_length);
|
|
Nicholas Clifton |
e0abd6 |
printf (_(" Minimum Instruction Length: %d\n"), info.li_min_insn_length);
|
|
Nicholas Clifton |
e0abd6 |
+ if (info.li_version >= 4)
|
|
Nicholas Clifton |
e0abd6 |
+ printf (_(" Maximum Ops per Instruction: %d\n"), info.li_max_ops_per_insn);
|
|
Nicholas Clifton |
e0abd6 |
printf (_(" Initial value of 'is_stmt': %d\n"), info.li_default_is_stmt);
|
|
Nicholas Clifton |
e0abd6 |
printf (_(" Line Base: %d\n"), info.li_line_base);
|
|
Nicholas Clifton |
e0abd6 |
printf (_(" Line Range: %d\n"), info.li_line_range);
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_raw (struct dwarf_se
|
|
Nicholas Clifton |
e0abd6 |
*** 2277,2286 ****
|
|
Nicholas Clifton |
e0abd6 |
if (op_code >= info.li_opcode_base)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
op_code -= info.li_opcode_base;
|
|
Nicholas Clifton |
e0abd6 |
! uladv = (op_code / info.li_line_range) * info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
! printf (_(" Special opcode %d: advance Address by %lu to 0x%lx"),
|
|
Nicholas Clifton |
e0abd6 |
! op_code, uladv, state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
adv = (op_code % info.li_line_range) + info.li_line_base;
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.line += adv;
|
|
Nicholas Clifton |
e0abd6 |
printf (_(" and Line by %d to %d\n"),
|
|
Nicholas Clifton |
e0abd6 |
--- 2312,2338 ----
|
|
Nicholas Clifton |
e0abd6 |
if (op_code >= info.li_opcode_base)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
op_code -= info.li_opcode_base;
|
|
Nicholas Clifton |
e0abd6 |
! uladv = (op_code / info.li_line_range);
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_max_ops_per_insn == 1)
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! uladv *= info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
! printf (_(" Special opcode %d: advance Address by %lu to 0x%lx"),
|
|
Nicholas Clifton |
e0abd6 |
! op_code, uladv, state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address
|
|
Nicholas Clifton |
e0abd6 |
! += ((state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! / info.li_max_ops_per_insn)
|
|
Nicholas Clifton |
e0abd6 |
! * info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.op_index
|
|
Nicholas Clifton |
e0abd6 |
! = (state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! % info.li_max_ops_per_insn;
|
|
Nicholas Clifton |
e0abd6 |
! printf (_(" Special opcode %d: advance Address by %lu to 0x%lx[%d]"),
|
|
Nicholas Clifton |
e0abd6 |
! op_code, uladv, state_machine_regs.address,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.op_index);
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
adv = (op_code % info.li_line_range) + info.li_line_base;
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.line += adv;
|
|
Nicholas Clifton |
e0abd6 |
printf (_(" and Line by %d to %d\n"),
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_raw (struct dwarf_se
|
|
Nicholas Clifton |
e0abd6 |
*** 2298,2308 ****
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
uladv = read_leb128 (data, & bytes_read, 0);
|
|
Nicholas Clifton |
e0abd6 |
- uladv *= info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
data += bytes_read;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
! printf (_(" Advance PC by %lu to 0x%lx\n"), uladv,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_line:
|
|
Nicholas Clifton |
e0abd6 |
--- 2350,2376 ----
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
uladv = read_leb128 (data, & bytes_read, 0);
|
|
Nicholas Clifton |
e0abd6 |
data += bytes_read;
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_max_ops_per_insn == 1)
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! uladv *= info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
! printf (_(" Advance PC by %lu to 0x%lx\n"), uladv,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address
|
|
Nicholas Clifton |
e0abd6 |
! += ((state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! / info.li_max_ops_per_insn)
|
|
Nicholas Clifton |
e0abd6 |
! * info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.op_index
|
|
Nicholas Clifton |
e0abd6 |
! = (state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! % info.li_max_ops_per_insn;
|
|
Nicholas Clifton |
e0abd6 |
! printf (_(" Advance PC by %lu to 0x%lx[%d]\n"), uladv,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.op_index);
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_line:
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_raw (struct dwarf_se
|
|
Nicholas Clifton |
e0abd6 |
*** 2341,2357 ****
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_const_add_pc:
|
|
Nicholas Clifton |
e0abd6 |
! uladv = (((255 - info.li_opcode_base) / info.li_line_range)
|
|
Nicholas Clifton |
e0abd6 |
! * info.li_min_insn_length);
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
! printf (_(" Advance PC by constant %lu to 0x%lx\n"), uladv,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_fixed_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
uladv = byte_get (data, 2);
|
|
Nicholas Clifton |
e0abd6 |
data += 2;
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
printf (_(" Advance PC by fixed size amount %lu to 0x%lx\n"),
|
|
Nicholas Clifton |
e0abd6 |
uladv, state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
--- 2409,2442 ----
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_const_add_pc:
|
|
Nicholas Clifton |
e0abd6 |
! uladv = ((255 - info.li_opcode_base) / info.li_line_range);
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_max_ops_per_insn)
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! uladv *= info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
! printf (_(" Advance PC by constant %lu to 0x%lx\n"), uladv,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address
|
|
Nicholas Clifton |
e0abd6 |
! += ((state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! / info.li_max_ops_per_insn)
|
|
Nicholas Clifton |
e0abd6 |
! * info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.op_index
|
|
Nicholas Clifton |
e0abd6 |
! = (state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! % info.li_max_ops_per_insn;
|
|
Nicholas Clifton |
e0abd6 |
! printf (_(" Advance PC by constant %lu to 0x%lx[%d]\n"),
|
|
Nicholas Clifton |
e0abd6 |
! uladv, state_machine_regs.address,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.op_index);
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_fixed_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
uladv = byte_get (data, 2);
|
|
Nicholas Clifton |
e0abd6 |
data += 2;
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
+ state_machine_regs.op_index = 0;
|
|
Nicholas Clifton |
e0abd6 |
printf (_(" Advance PC by fixed size amount %lu to 0x%lx\n"),
|
|
Nicholas Clifton |
e0abd6 |
uladv, state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_decoded (struct dwar
|
|
Nicholas Clifton |
e0abd6 |
*** 2454,2462 ****
|
|
Nicholas Clifton |
e0abd6 |
/* Get this CU's Line Number Block version number. */
|
|
Nicholas Clifton |
e0abd6 |
info.li_version = byte_get (hdrptr, 2);
|
|
Nicholas Clifton |
e0abd6 |
hdrptr += 2;
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_version != 2 && info.li_version != 3)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! warn (_("Only DWARF version 2 and 3 line info is currently "
|
|
Nicholas Clifton |
e0abd6 |
"supported.\n"));
|
|
Nicholas Clifton |
e0abd6 |
return 0;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
--- 2539,2549 ----
|
|
Nicholas Clifton |
e0abd6 |
/* Get this CU's Line Number Block version number. */
|
|
Nicholas Clifton |
e0abd6 |
info.li_version = byte_get (hdrptr, 2);
|
|
Nicholas Clifton |
e0abd6 |
hdrptr += 2;
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_version != 2
|
|
Nicholas Clifton |
e0abd6 |
! && info.li_version != 3
|
|
Nicholas Clifton |
e0abd6 |
! && info.li_version != 4)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! warn (_("Only DWARF version 2, 3 and 4 line info is currently "
|
|
Nicholas Clifton |
e0abd6 |
"supported.\n"));
|
|
Nicholas Clifton |
e0abd6 |
return 0;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_decoded (struct dwar
|
|
Nicholas Clifton |
e0abd6 |
*** 2465,2470 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 2552,2569 ----
|
|
Nicholas Clifton |
e0abd6 |
hdrptr += offset_size;
|
|
Nicholas Clifton |
e0abd6 |
info.li_min_insn_length = byte_get (hdrptr, 1);
|
|
Nicholas Clifton |
e0abd6 |
hdrptr++;
|
|
Nicholas Clifton |
e0abd6 |
+ if (info.li_version >= 4)
|
|
Nicholas Clifton |
e0abd6 |
+ {
|
|
Nicholas Clifton |
e0abd6 |
+ info.li_max_ops_per_insn = byte_get (hdrptr, 1);
|
|
Nicholas Clifton |
e0abd6 |
+ hdrptr++;
|
|
Nicholas Clifton |
e0abd6 |
+ if (info.li_max_ops_per_insn == 0)
|
|
Nicholas Clifton |
e0abd6 |
+ {
|
|
Nicholas Clifton |
e0abd6 |
+ warn (_("Invalid maximum operations per insn.\n"));
|
|
Nicholas Clifton |
e0abd6 |
+ return 0;
|
|
Nicholas Clifton |
e0abd6 |
+ }
|
|
Nicholas Clifton |
e0abd6 |
+ }
|
|
Nicholas Clifton |
e0abd6 |
+ else
|
|
Nicholas Clifton |
e0abd6 |
+ info.li_max_ops_per_insn = 1;
|
|
Nicholas Clifton |
e0abd6 |
info.li_default_is_stmt = byte_get (hdrptr, 1);
|
|
Nicholas Clifton |
e0abd6 |
hdrptr++;
|
|
Nicholas Clifton |
e0abd6 |
info.li_line_base = byte_get (hdrptr, 1);
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_decoded (struct dwar
|
|
Nicholas Clifton |
e0abd6 |
*** 2601,2608 ****
|
|
Nicholas Clifton |
e0abd6 |
if (op_code >= info.li_opcode_base)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
op_code -= info.li_opcode_base;
|
|
Nicholas Clifton |
e0abd6 |
! uladv = (op_code / info.li_line_range) * info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
adv = (op_code % info.li_line_range) + info.li_line_base;
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.line += adv;
|
|
Nicholas Clifton |
e0abd6 |
--- 2700,2721 ----
|
|
Nicholas Clifton |
e0abd6 |
if (op_code >= info.li_opcode_base)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
op_code -= info.li_opcode_base;
|
|
Nicholas Clifton |
e0abd6 |
! uladv = (op_code / info.li_line_range);
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_max_ops_per_insn == 1)
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! uladv *= info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address
|
|
Nicholas Clifton |
e0abd6 |
! += ((state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! / info.li_max_ops_per_insn)
|
|
Nicholas Clifton |
e0abd6 |
! * info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.op_index
|
|
Nicholas Clifton |
e0abd6 |
! = (state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! % info.li_max_ops_per_insn;
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
adv = (op_code % info.li_line_range) + info.li_line_base;
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.line += adv;
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_decoded (struct dwar
|
|
Nicholas Clifton |
e0abd6 |
*** 2636,2641 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 2749,2755 ----
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNE_set_address:
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.address =
|
|
Nicholas Clifton |
e0abd6 |
byte_get (op_code_data, ext_op_code_len - bytes_read - 1);
|
|
Nicholas Clifton |
e0abd6 |
+ state_machine_regs.op_index = 0;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNE_define_file:
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_decoded (struct dwar
|
|
Nicholas Clifton |
e0abd6 |
*** 2664,2672 ****
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
uladv = read_leb128 (data, & bytes_read, 0);
|
|
Nicholas Clifton |
e0abd6 |
- uladv *= info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
data += bytes_read;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_line:
|
|
Nicholas Clifton |
e0abd6 |
--- 2778,2799 ----
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
uladv = read_leb128 (data, & bytes_read, 0);
|
|
Nicholas Clifton |
e0abd6 |
data += bytes_read;
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_max_ops_per_insn == 1)
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! uladv *= info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address
|
|
Nicholas Clifton |
e0abd6 |
! += ((state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! / info.li_max_ops_per_insn)
|
|
Nicholas Clifton |
e0abd6 |
! * info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.op_index
|
|
Nicholas Clifton |
e0abd6 |
! = (state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! % info.li_max_ops_per_insn;
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_advance_line:
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_decoded (struct dwar
|
|
Nicholas Clifton |
e0abd6 |
*** 2711,2725 ****
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_const_add_pc:
|
|
Nicholas Clifton |
e0abd6 |
! uladv = (((255 - info.li_opcode_base) / info.li_line_range)
|
|
Nicholas Clifton |
e0abd6 |
! * info.li_min_insn_length);
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_fixed_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
uladv = byte_get (data, 2);
|
|
Nicholas Clifton |
e0abd6 |
data += 2;
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_set_prologue_end:
|
|
Nicholas Clifton |
e0abd6 |
--- 2838,2866 ----
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_const_add_pc:
|
|
Nicholas Clifton |
e0abd6 |
! uladv = ((255 - info.li_opcode_base) / info.li_line_range);
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_max_ops_per_insn == 1)
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! uladv *= info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address
|
|
Nicholas Clifton |
e0abd6 |
! += ((state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! / info.li_max_ops_per_insn)
|
|
Nicholas Clifton |
e0abd6 |
! * info.li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.op_index
|
|
Nicholas Clifton |
e0abd6 |
! = (state_machine_regs.op_index + uladv)
|
|
Nicholas Clifton |
e0abd6 |
! % info.li_max_ops_per_insn;
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_fixed_advance_pc:
|
|
Nicholas Clifton |
e0abd6 |
uladv = byte_get (data, 2);
|
|
Nicholas Clifton |
e0abd6 |
data += 2;
|
|
Nicholas Clifton |
e0abd6 |
state_machine_regs.address += uladv;
|
|
Nicholas Clifton |
e0abd6 |
+ state_machine_regs.op_index = 0;
|
|
Nicholas Clifton |
e0abd6 |
break;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
case DW_LNS_set_prologue_end:
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_lines_decoded (struct dwar
|
|
Nicholas Clifton |
e0abd6 |
*** 2773,2785 ****
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
if (!do_wide || (fileNameLength <= MAX_FILENAME_LENGTH))
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! printf (_("%-35s %11d %#18lx\n"), newFileName,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.line, state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
else
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! printf (_("%s %11d %#18lx\n"), newFileName,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.line, state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
if (op_code == DW_LNE_end_sequence)
|
|
Nicholas Clifton |
e0abd6 |
--- 2914,2940 ----
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
if (!do_wide || (fileNameLength <= MAX_FILENAME_LENGTH))
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_max_ops_per_insn == 1)
|
|
Nicholas Clifton |
e0abd6 |
! printf (_("%-35s %11d %#18lx\n"), newFileName,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.line,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! printf (_("%-35s %11d %#18lx[%d]\n"), newFileName,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.line,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.op_index);
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
else
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! if (info.li_max_ops_per_insn == 1)
|
|
Nicholas Clifton |
e0abd6 |
! printf (_("%s %11d %#18lx\n"), newFileName,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.line,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address);
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! printf (_("%s %11d %#18lx[%d]\n"), newFileName,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.line,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.address,
|
|
Nicholas Clifton |
e0abd6 |
! state_machine_regs.op_index);
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
if (op_code == DW_LNE_end_sequence)
|
|
Nicholas Clifton |
e0abd6 |
*************** typedef struct Frame_Chunk
|
|
Nicholas Clifton |
e0abd6 |
*** 3644,3649 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 3799,3806 ----
|
|
Nicholas Clifton |
e0abd6 |
int ra;
|
|
Nicholas Clifton |
e0abd6 |
unsigned char fde_encoding;
|
|
Nicholas Clifton |
e0abd6 |
unsigned char cfa_exp;
|
|
Nicholas Clifton |
e0abd6 |
+ unsigned char ptr_size;
|
|
Nicholas Clifton |
e0abd6 |
+ unsigned char segment_size;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
Frame_Chunk;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_frames (struct dwarf_secti
|
|
Nicholas Clifton |
e0abd6 |
*** 3851,3856 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 4008,4014 ----
|
|
Nicholas Clifton |
e0abd6 |
unsigned int length_return;
|
|
Nicholas Clifton |
e0abd6 |
int max_regs = 0;
|
|
Nicholas Clifton |
e0abd6 |
const char *bad_reg = _("bad register: ");
|
|
Nicholas Clifton |
e0abd6 |
+ int saved_eh_addr_size = eh_addr_size;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
printf (_("Contents of the %s section:\n"), section->name);
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_frames (struct dwarf_secti
|
|
Nicholas Clifton |
e0abd6 |
*** 3865,3871 ****
|
|
Nicholas Clifton |
e0abd6 |
int need_col_headers = 1;
|
|
Nicholas Clifton |
e0abd6 |
unsigned char *augmentation_data = NULL;
|
|
Nicholas Clifton |
e0abd6 |
unsigned long augmentation_data_len = 0;
|
|
Nicholas Clifton |
e0abd6 |
! int encoded_ptr_size = eh_addr_size;
|
|
Nicholas Clifton |
e0abd6 |
int offset_size;
|
|
Nicholas Clifton |
e0abd6 |
int initial_length_size;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
--- 4023,4029 ----
|
|
Nicholas Clifton |
e0abd6 |
int need_col_headers = 1;
|
|
Nicholas Clifton |
e0abd6 |
unsigned char *augmentation_data = NULL;
|
|
Nicholas Clifton |
e0abd6 |
unsigned long augmentation_data_len = 0;
|
|
Nicholas Clifton |
e0abd6 |
! int encoded_ptr_size = saved_eh_addr_size;
|
|
Nicholas Clifton |
e0abd6 |
int offset_size;
|
|
Nicholas Clifton |
e0abd6 |
int initial_length_size;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_frames (struct dwarf_secti
|
|
Nicholas Clifton |
e0abd6 |
*** 3921,3968 ****
|
|
Nicholas Clifton |
e0abd6 |
fc->augmentation = (char *) start;
|
|
Nicholas Clifton |
e0abd6 |
start = (unsigned char *) strchr ((char *) start, '\0') + 1;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
! if (fc->augmentation[0] == 'z')
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! fc->code_factor = LEB ();
|
|
Nicholas Clifton |
e0abd6 |
! fc->data_factor = SLEB ();
|
|
Nicholas Clifton |
e0abd6 |
! if (version == 1)
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! fc->ra = GET (1);
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! fc->ra = LEB ();
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
! augmentation_data_len = LEB ();
|
|
Nicholas Clifton |
e0abd6 |
! augmentation_data = start;
|
|
Nicholas Clifton |
e0abd6 |
! start += augmentation_data_len;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
! else if (strcmp (fc->augmentation, "eh") == 0)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! start += eh_addr_size;
|
|
Nicholas Clifton |
e0abd6 |
! fc->code_factor = LEB ();
|
|
Nicholas Clifton |
e0abd6 |
! fc->data_factor = SLEB ();
|
|
Nicholas Clifton |
e0abd6 |
! if (version == 1)
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! fc->ra = GET (1);
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! fc->ra = LEB ();
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
else
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! fc->code_factor = LEB ();
|
|
Nicholas Clifton |
e0abd6 |
! fc->data_factor = SLEB ();
|
|
Nicholas Clifton |
e0abd6 |
! if (version == 1)
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! fc->ra = GET (1);
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! fc->ra = LEB ();
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
cie = fc;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
--- 4079,4114 ----
|
|
Nicholas Clifton |
e0abd6 |
fc->augmentation = (char *) start;
|
|
Nicholas Clifton |
e0abd6 |
start = (unsigned char *) strchr ((char *) start, '\0') + 1;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
! if (strcmp (fc->augmentation, "eh") == 0)
|
|
Nicholas Clifton |
e0abd6 |
! start += eh_addr_size;
|
|
Nicholas Clifton |
e0abd6 |
!
|
|
Nicholas Clifton |
e0abd6 |
! if (version >= 4)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! fc->ptr_size = GET (1);
|
|
Nicholas Clifton |
e0abd6 |
! fc->segment_size = GET (1);
|
|
Nicholas Clifton |
e0abd6 |
! eh_addr_size = fc->ptr_size;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
! else
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! fc->ptr_size = eh_addr_size;
|
|
Nicholas Clifton |
e0abd6 |
! fc->segment_size = 0;
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
! fc->code_factor = LEB ();
|
|
Nicholas Clifton |
e0abd6 |
! fc->data_factor = SLEB ();
|
|
Nicholas Clifton |
e0abd6 |
! if (version == 1)
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! fc->ra = GET (1);
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
else
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
! fc->ra = LEB ();
|
|
Nicholas Clifton |
e0abd6 |
! }
|
|
Nicholas Clifton |
e0abd6 |
!
|
|
Nicholas Clifton |
e0abd6 |
! if (fc->augmentation[0] == 'z')
|
|
Nicholas Clifton |
e0abd6 |
! {
|
|
Nicholas Clifton |
e0abd6 |
! augmentation_data_len = LEB ();
|
|
Nicholas Clifton |
e0abd6 |
! augmentation_data = start;
|
|
Nicholas Clifton |
e0abd6 |
! start += augmentation_data_len;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
cie = fc;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_frames (struct dwarf_secti
|
|
Nicholas Clifton |
e0abd6 |
*** 3977,3982 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 4123,4133 ----
|
|
Nicholas Clifton |
e0abd6 |
(unsigned long)(saved_start - section_start), length, cie_id);
|
|
Nicholas Clifton |
e0abd6 |
printf (" Version: %d\n", version);
|
|
Nicholas Clifton |
e0abd6 |
printf (" Augmentation: \"%s\"\n", fc->augmentation);
|
|
Nicholas Clifton |
e0abd6 |
+ if (version >= 4)
|
|
Nicholas Clifton |
e0abd6 |
+ {
|
|
Nicholas Clifton |
e0abd6 |
+ printf (" Pointer Size: %u\n", fc->ptr_size);
|
|
Nicholas Clifton |
e0abd6 |
+ printf (" Segment Size: %u\n", fc->segment_size);
|
|
Nicholas Clifton |
e0abd6 |
+ }
|
|
Nicholas Clifton |
e0abd6 |
printf (" Code alignment factor: %u\n", fc->code_factor);
|
|
Nicholas Clifton |
e0abd6 |
printf (" Data alignment factor: %d\n", fc->data_factor);
|
|
Nicholas Clifton |
e0abd6 |
printf (" Return address column: %d\n", fc->ra);
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_frames (struct dwarf_secti
|
|
Nicholas Clifton |
e0abd6 |
*** 4021,4026 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 4172,4178 ----
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
unsigned char *look_for;
|
|
Nicholas Clifton |
e0abd6 |
static Frame_Chunk fde_fc;
|
|
Nicholas Clifton |
e0abd6 |
+ unsigned long segment_selector;
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
fc = & fde_fc;
|
|
Nicholas Clifton |
e0abd6 |
memset (fc, 0, sizeof (Frame_Chunk));
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_frames (struct dwarf_secti
|
|
Nicholas Clifton |
e0abd6 |
*** 4042,4047 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 4194,4201 ----
|
|
Nicholas Clifton |
e0abd6 |
cie = fc;
|
|
Nicholas Clifton |
e0abd6 |
fc->augmentation = "";
|
|
Nicholas Clifton |
e0abd6 |
fc->fde_encoding = 0;
|
|
Nicholas Clifton |
e0abd6 |
+ fc->ptr_size = eh_addr_size;
|
|
Nicholas Clifton |
e0abd6 |
+ fc->segment_size = 0;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
else
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_frames (struct dwarf_secti
|
|
Nicholas Clifton |
e0abd6 |
*** 4051,4056 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 4205,4213 ----
|
|
Nicholas Clifton |
e0abd6 |
memcpy (fc->col_type, cie->col_type, fc->ncols * sizeof (short int));
|
|
Nicholas Clifton |
e0abd6 |
memcpy (fc->col_offset, cie->col_offset, fc->ncols * sizeof (int));
|
|
Nicholas Clifton |
e0abd6 |
fc->augmentation = cie->augmentation;
|
|
Nicholas Clifton |
e0abd6 |
+ fc->ptr_size = cie->ptr_size;
|
|
Nicholas Clifton |
e0abd6 |
+ eh_addr_size = cie->ptr_size;
|
|
Nicholas Clifton |
e0abd6 |
+ fc->segment_size = cie->segment_size;
|
|
Nicholas Clifton |
e0abd6 |
fc->code_factor = cie->code_factor;
|
|
Nicholas Clifton |
e0abd6 |
fc->data_factor = cie->data_factor;
|
|
Nicholas Clifton |
e0abd6 |
fc->cfa_reg = cie->cfa_reg;
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_frames (struct dwarf_secti
|
|
Nicholas Clifton |
e0abd6 |
*** 4063,4068 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 4220,4231 ----
|
|
Nicholas Clifton |
e0abd6 |
if (fc->fde_encoding)
|
|
Nicholas Clifton |
e0abd6 |
encoded_ptr_size = size_of_encoded_value (fc->fde_encoding);
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
+ segment_selector = 0;
|
|
Nicholas Clifton |
e0abd6 |
+ if (fc->segment_size)
|
|
Nicholas Clifton |
e0abd6 |
+ {
|
|
Nicholas Clifton |
e0abd6 |
+ segment_selector = byte_get (start, fc->segment_size);
|
|
Nicholas Clifton |
e0abd6 |
+ start += fc->segment_size;
|
|
Nicholas Clifton |
e0abd6 |
+ }
|
|
Nicholas Clifton |
e0abd6 |
fc->pc_begin = get_encoded_value (start, fc->fde_encoding);
|
|
Nicholas Clifton |
e0abd6 |
if ((fc->fde_encoding & 0x70) == DW_EH_PE_pcrel)
|
|
Nicholas Clifton |
e0abd6 |
fc->pc_begin += section->address + (start - section_start);
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_frames (struct dwarf_secti
|
|
Nicholas Clifton |
e0abd6 |
*** 4077,4086 ****
|
|
Nicholas Clifton |
e0abd6 |
start += augmentation_data_len;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
! printf ("\n%08lx %08lx %08lx FDE cie=%08lx pc=%08lx..%08lx\n",
|
|
Nicholas Clifton |
e0abd6 |
(unsigned long)(saved_start - section_start), length, cie_id,
|
|
Nicholas Clifton |
e0abd6 |
! (unsigned long)(cie->chunk_start - section_start),
|
|
Nicholas Clifton |
e0abd6 |
! fc->pc_begin, fc->pc_begin + fc->pc_range);
|
|
Nicholas Clifton |
e0abd6 |
if (! do_debug_frames_interp && augmentation_data_len)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
unsigned long i;
|
|
Nicholas Clifton |
e0abd6 |
--- 4240,4251 ----
|
|
Nicholas Clifton |
e0abd6 |
start += augmentation_data_len;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
! printf ("\n%08lx %08lx %08lx FDE cie=%08lx pc=",
|
|
Nicholas Clifton |
e0abd6 |
(unsigned long)(saved_start - section_start), length, cie_id,
|
|
Nicholas Clifton |
e0abd6 |
! (unsigned long)(cie->chunk_start - section_start));
|
|
Nicholas Clifton |
e0abd6 |
! if (fc->segment_size)
|
|
Nicholas Clifton |
e0abd6 |
! printf ("%04lx:", segment_selector);
|
|
Nicholas Clifton |
e0abd6 |
! printf ("%08lx..%08lx\n", fc->pc_begin, fc->pc_begin + fc->pc_range);
|
|
Nicholas Clifton |
e0abd6 |
if (! do_debug_frames_interp && augmentation_data_len)
|
|
Nicholas Clifton |
e0abd6 |
{
|
|
Nicholas Clifton |
e0abd6 |
unsigned long i;
|
|
Nicholas Clifton |
e0abd6 |
*************** display_debug_frames (struct dwarf_secti
|
|
Nicholas Clifton |
e0abd6 |
*** 4627,4632 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 4792,4798 ----
|
|
Nicholas Clifton |
e0abd6 |
frame_display_row (fc, &need_col_headers, &max_regs);
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
start = block_end;
|
|
Nicholas Clifton |
e0abd6 |
+ eh_addr_size = saved_eh_addr_size;
|
|
Nicholas Clifton |
e0abd6 |
}
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
printf ("\n");
|
|
Nicholas Clifton |
e0abd6 |
diff -rcp ../binutils-2.19.51.0.14.original/include/ChangeLog ./include/ChangeLog
|
|
Nicholas Clifton |
e0abd6 |
*** ../binutils-2.19.51.0.14.original/include/ChangeLog 2010-04-08 09:52:37.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
--- ./include/ChangeLog 2010-04-08 09:56:53.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
***************
|
|
Nicholas Clifton |
e0abd6 |
*** 1,3 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 1,12 ----
|
|
Nicholas Clifton |
e0abd6 |
+ 2010-04-08 Nick Clifton <nickc@redhat.com>
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ Import these patches from the mainline:
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ 2010-04-05 Jakub Jelinek <jakub@redhat.com>
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
+ * dwarf2.h (DWARF2_Internal_LineInfo): Add li_max_ops_per_insn
|
|
Nicholas Clifton |
e0abd6 |
+ field.
|
|
Nicholas Clifton |
e0abd6 |
+
|
|
Nicholas Clifton |
e0abd6 |
2009-07-20 Cary Coutant <ccoutant@google.com>
|
|
Nicholas Clifton |
e0abd6 |
Doug Evans <dje@google.com>
|
|
Nicholas Clifton |
e0abd6 |
|
|
Nicholas Clifton |
e0abd6 |
diff -rcp ../binutils-2.19.51.0.14.original/include/dwarf2.h ./include/dwarf2.h
|
|
Nicholas Clifton |
e0abd6 |
*** ../binutils-2.19.51.0.14.original/include/dwarf2.h 2010-04-08 09:52:37.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
--- ./include/dwarf2.h 2010-04-08 09:53:38.000000000 +0100
|
|
Nicholas Clifton |
e0abd6 |
*************** typedef struct
|
|
Nicholas Clifton |
e0abd6 |
*** 66,71 ****
|
|
Nicholas Clifton |
e0abd6 |
--- 66,72 ----
|
|
Nicholas Clifton |
e0abd6 |
unsigned short li_version;
|
|
Nicholas Clifton |
e0abd6 |
unsigned int li_prologue_length;
|
|
Nicholas Clifton |
e0abd6 |
unsigned char li_min_insn_length;
|
|
Nicholas Clifton |
e0abd6 |
+ unsigned char li_max_ops_per_insn;
|
|
Nicholas Clifton |
e0abd6 |
unsigned char li_default_is_stmt;
|
|
Nicholas Clifton |
e0abd6 |
int li_line_base;
|
|
Nicholas Clifton |
e0abd6 |
unsigned char li_line_range;
|