/* The data in a compilation unit header, after target2host
translation, looks like this. */
struct comp_unit_head
- {
- unsigned long length;
- short version;
- unsigned int abbrev_offset;
- unsigned char addr_size;
- unsigned char signed_addr_p;
- unsigned int offset_size; /* size of file offsets; either 4 or 8 */
- unsigned int initial_length_size; /* size of the length field; either
- 4 or 12 */
-
- /* Offset to the first byte of this compilation unit header in the
- * .debug_info section, for resolving relative reference dies. */
-
- unsigned int offset;
-
- /* Pointer to this compilation unit header in the .debug_info
- * section */
-
- char *cu_head_ptr;
+{
+ unsigned long length;
+ short version;
+ unsigned int abbrev_offset;
+ unsigned char addr_size;
+ unsigned char signed_addr_p;
- /* Pointer to the first die of this compilatio unit. This will
- * be the first byte following the compilation unit header. */
+ /* Size of file offsets; either 4 or 8. */
+ unsigned int offset_size;
- char *first_die_ptr;
+ /* Size of the length field; either 4 or 12. */
+ unsigned int initial_length_size;
- /* Pointer to the next compilation unit header in the program. */
+ /* Offset to the first byte of this compilation unit header in the
+ .debug_info section, for resolving relative reference dies. */
+ unsigned int offset;
- struct comp_unit_head *next;
+ /* Pointer to this compilation unit header in the .debug_info
+ section. */
+ char *cu_head_ptr;
- /* Base address of this compilation unit. */
+ /* Pointer to the first die of this compilation unit. This will be
+ the first byte following the compilation unit header. */
+ char *first_die_ptr;
- CORE_ADDR base_address;
+ /* Pointer to the next compilation unit header in the program. */
+ struct comp_unit_head *next;
- /* Non-zero if base_address has been set. */
+ /* Base address of this compilation unit. */
+ CORE_ADDR base_address;
- int base_known;
- };
+ /* Non-zero if base_address has been set. */
+ int base_known;
+};
/* Fixed size for the DIE hash table. */
#ifndef REF_HASH_SIZE
return 0;
}
- /* Make sure that at least there's room for the total_length field. That
- could be 12 bytes long, but we're just going to fudge that. */
+ /* Make sure that at least there's room for the total_length field.
+ That could be 12 bytes long, but we're just going to fudge that. */
if (offset + 4 >= dwarf2_per_objfile->line_size)
{
dwarf2_statement_list_fits_in_line_number_section_complaint ();
line_ptr = dwarf2_per_objfile->line_buffer + offset;
- /* read in the header */
+ /* Read in the header. */
lh->total_length = read_initial_length (abfd, line_ptr, NULL, &bytes_read);
line_ptr += bytes_read;
if (line_ptr + lh->total_length > (dwarf2_per_objfile->line_buffer
line_ptr += 1;
}
- /* Read directory table */
+ /* Read directory table. */
while ((cur_dir = read_string (abfd, line_ptr, &bytes_read)) != NULL)
{
line_ptr += bytes_read;
}
line_ptr += bytes_read;
- /* Read file name table */
+ /* Read file name table. */
while ((cur_file = read_string (abfd, line_ptr, &bytes_read)) != NULL)
{
unsigned int dir_index, mod_time, length;
are 1-based. */
struct file_entry *fe = &lh->file_names[file - 1];
char *dir;
+
if (fe->dir_index)
dir = lh->include_dirs[fe->dir_index - 1];
else
dwarf2_start_subfile (fe->name, dir);
}
- /* Decode the table. */
+ /* Decode the table. */
while (!end_sequence)
{
op_code = read_1_byte (abfd, line_ptr);
line_ptr += 1;
if (op_code >= lh->opcode_base)
- { /* Special operand. */
+ {
+ /* Special operand. */
adj_opcode = op_code - lh->opcode_base;
address += (adj_opcode / lh->line_range)
* lh->minimum_instruction_length;
lh->file_names[file - 1].included_p = 1;
if (!decode_for_pst_p)
{
- /* append row to matrix using current values */
+ /* Append row to matrix using current values. */
record_line (current_subfile, line,
check_cu_functions (address, cu));
}
break;
case DW_LNS_set_file:
{
- /* lh->include_dirs and lh->file_names are 0-based,
- but the directory and file name numbers in the
- statement program are 1-based. */
+ /* The arrays lh->include_dirs and lh->file_names are
+ 0-based, but the directory and file name numbers in
+ the statement program are 1-based. */
struct file_entry *fe;
char *dir;
+
file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
line_ptr += bytes_read;
fe = &lh->file_names[file - 1];
break;
/* Add to the address register of the state machine the
address increment value corresponding to special opcode
- 255. Ie, this value is scaled by the minimum instruction
- length since special opcode 255 would have scaled the
- the increment. */
+ 255. I.e., this value is scaled by the minimum
+ instruction length since special opcode 255 would have
+ scaled the the increment. */
case DW_LNS_const_add_pc:
address += (lh->minimum_instruction_length
* ((255 - lh->opcode_base) / lh->line_range));
line_ptr += 2;
break;
default:
- { /* Unknown standard opcode, ignore it. */
+ {
+ /* Unknown standard opcode, ignore it. */
int i;
+
for (i = 0; i < lh->standard_opcode_lengths[op_code]; i++)
{
(void) read_unsigned_leb128 (abfd, line_ptr, &bytes_read);