Line 205... |
Line 205... |
1, 1, 0, 0,
|
1, 1, 0, 0,
|
DWARF2_LINE_DEFAULT_IS_STMT ? DWARF2_FLAG_IS_STMT : 0,
|
DWARF2_LINE_DEFAULT_IS_STMT ? DWARF2_FLAG_IS_STMT : 0,
|
0
|
0
|
};
|
};
|
|
|
|
/* Lines that are at the same location as CURRENT, and which are waiting
|
|
for a label. */
|
|
static struct line_entry *pending_lines, **pending_lines_tail = &pending_lines;
|
|
|
/* The size of an address on the target. */
|
/* The size of an address on the target. */
|
static unsigned int sizeof_address;
|
static unsigned int sizeof_address;
|
|
|
static unsigned int get_filenum (const char *, unsigned int);
|
static unsigned int get_filenum (const char *, unsigned int);
|
|
|
Line 278... |
Line 282... |
last_line_subseg = lss;
|
last_line_subseg = lss;
|
|
|
return lss;
|
return lss;
|
}
|
}
|
|
|
/* Record an entry for LOC occurring at LABEL. */
|
/* Push LOC onto the pending lines list. */
|
|
|
static void
|
static void
|
dwarf2_gen_line_info_1 (symbolS *label, struct dwarf2_line_info *loc)
|
dwarf2_push_line (struct dwarf2_line_info *loc)
|
{
|
{
|
struct line_subseg *lss;
|
|
struct line_entry *e;
|
struct line_entry *e;
|
|
|
e = (struct line_entry *) xmalloc (sizeof (*e));
|
e = (struct line_entry *) xmalloc (sizeof (*e));
|
e->next = NULL;
|
e->next = NULL;
|
e->label = label;
|
e->label = NULL;
|
e->loc = *loc;
|
e->loc = *loc;
|
|
|
|
*pending_lines_tail = e;
|
|
pending_lines_tail = &(*pending_lines_tail)->next;
|
|
}
|
|
|
|
/* Emit all pending line information. LABEL is the label with which the
|
|
lines should be associated, or null if they should be associated with
|
|
the current position. */
|
|
|
|
static void
|
|
dwarf2_flush_pending_lines (symbolS *label)
|
|
{
|
|
if (pending_lines)
|
|
{
|
|
struct line_subseg *lss;
|
|
struct line_entry *e;
|
|
|
|
if (!label)
|
|
label = symbol_temp_new_now ();
|
|
|
|
for (e = pending_lines; e; e = e->next)
|
|
e->label = label;
|
|
|
lss = get_line_subseg (now_seg, now_subseg);
|
lss = get_line_subseg (now_seg, now_subseg);
|
*lss->ptail = e;
|
*lss->ptail = pending_lines;
|
lss->ptail = &e->next;
|
lss->ptail = pending_lines_tail;
|
|
|
|
pending_lines = NULL;
|
|
pending_lines_tail = &pending_lines;
|
|
}
|
}
|
}
|
|
|
/* Record an entry for LOC occurring at OFS within the current fragment. */
|
/* Record an entry for LOC occurring at OFS within the current fragment. */
|
|
|
void
|
void
|
dwarf2_gen_line_info (addressT ofs, struct dwarf2_line_info *loc)
|
dwarf2_gen_line_info (addressT ofs, struct dwarf2_line_info *loc)
|
{
|
{
|
static unsigned int line = -1;
|
static unsigned int line = -1;
|
static unsigned int filenum = -1;
|
static unsigned int filenum = -1;
|
|
|
symbolS *sym;
|
|
|
|
/* Early out for as-yet incomplete location information. */
|
/* Early out for as-yet incomplete location information. */
|
if (loc->filenum == 0 || loc->line == 0)
|
if (loc->filenum == 0 || loc->line == 0)
|
return;
|
return;
|
|
|
/* Don't emit sequences of line symbols for the same line when the
|
/* Don't emit sequences of line symbols for the same line when the
|
Line 321... |
Line 348... |
return;
|
return;
|
|
|
line = loc->line;
|
line = loc->line;
|
filenum = loc->filenum;
|
filenum = loc->filenum;
|
|
|
sym = symbol_temp_new (now_seg, ofs, frag_now);
|
dwarf2_push_line (loc);
|
dwarf2_gen_line_info_1 (sym, loc);
|
dwarf2_flush_pending_lines (symbol_temp_new (now_seg, ofs, frag_now));
|
}
|
}
|
|
|
/* Returns the current source information. If .file directives have
|
/* Returns the current source information. If .file directives have
|
been encountered, the info for the corresponding source file is
|
been encountered, the info for the corresponding source file is
|
returned. Otherwise, the info for the assembly source file is
|
returned. Otherwise, the info for the assembly source file is
|
Line 383... |
Line 410... |
it has been used. */
|
it has been used. */
|
|
|
void
|
void
|
dwarf2_consume_line_info (void)
|
dwarf2_consume_line_info (void)
|
{
|
{
|
|
/* If the consumer has stashed the current location away for later use,
|
|
assume that any earlier location information should be associated
|
|
with ".". */
|
|
dwarf2_flush_pending_lines (NULL);
|
|
|
/* Unless we generate DWARF2 debugging information for each
|
/* Unless we generate DWARF2 debugging information for each
|
assembler line, we only emit one line symbol for one LOC. */
|
assembler line, we only emit one line symbol for one LOC. */
|
dwarf2_loc_directive_seen = FALSE;
|
dwarf2_loc_directive_seen = FALSE;
|
|
|
current.flags &= ~(DWARF2_FLAG_BASIC_BLOCK
|
current.flags &= ~(DWARF2_FLAG_BASIC_BLOCK
|
Line 414... |
Line 446... |
|
|
dwarf2_where (&loc);
|
dwarf2_where (&loc);
|
|
|
loc.flags |= DWARF2_FLAG_BASIC_BLOCK;
|
loc.flags |= DWARF2_FLAG_BASIC_BLOCK;
|
|
|
dwarf2_gen_line_info_1 (label, &loc);
|
dwarf2_push_line (&loc);
|
|
dwarf2_flush_pending_lines (label);
|
dwarf2_consume_line_info ();
|
dwarf2_consume_line_info ();
|
}
|
}
|
|
|
/* Get a .debug_line file number for FILENAME. If NUM is nonzero,
|
/* Get a .debug_line file number for FILENAME. If NUM is nonzero,
|
allocate it on that file table slot, otherwise return the first
|
allocate it on that file table slot, otherwise return the first
|
Line 574... |
Line 607... |
offsetT filenum, line;
|
offsetT filenum, line;
|
|
|
/* If we see two .loc directives in a row, force the first one to be
|
/* If we see two .loc directives in a row, force the first one to be
|
output now. */
|
output now. */
|
if (dwarf2_loc_directive_seen)
|
if (dwarf2_loc_directive_seen)
|
dwarf2_emit_insn (0);
|
dwarf2_push_line (¤t);
|
|
|
filenum = get_absolute_expression ();
|
filenum = get_absolute_expression ();
|
SKIP_WHITESPACE ();
|
SKIP_WHITESPACE ();
|
line = get_absolute_expression ();
|
line = get_absolute_expression ();
|
|
|