void dwarf2_gen_line_info (addressT ofs, struct dwarf2_line_info *loc) { struct line_subseg *ss; struct line_entry *e; static unsigned int line = -1; static unsigned int filenum = -1; /* Early out for as-yet incomplete location information. */ if (loc->filenum == 0 || loc->line == 0) return; /* Don't emit sequences of line symbols for the same line when the symbols apply to assembler code. It is necessary to emit duplicate line symbols when a compiler asks for them, because GDB uses them to determine the end of the prologue. */ if (debug_type == DEBUG_DWARF2 && line == loc->line && filenum == loc->filenum) return; line = loc->line; filenum = loc->filenum; e = (struct line_entry *) xmalloc (sizeof (*e)); e->next = NULL; e->frag = frag_now; e->frag_ofs = ofs; e->loc = *loc; ss = get_line_subseg (now_seg, now_subseg); *ss->ptail = e; ss->ptail = &e->next; }
static void dwarf2_gen_line_info_1 (symbolS *label, struct dwarf2_line_info *loc) { struct line_subseg *lss; struct line_entry *e; e = (struct line_entry *) xmalloc (sizeof (*e)); e->next = NULL; e->label = label; e->loc = *loc; lss = get_line_subseg (now_seg, now_subseg); *lss->ptail = e; lss->ptail = &e->next; }
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->ptail = pending_lines; lss->ptail = pending_lines_tail; pending_lines = NULL; pending_lines_tail = &pending_lines; } }
void dwarf2_move_insn (int delta) { struct line_subseg *lss; struct line_entry *e; valueT now; if (delta == 0) return; lss = get_line_subseg (now_seg, now_subseg, FALSE); if (!lss) return; now = frag_now_fix (); while ((e = *lss->pmove_tail)) { if (S_GET_VALUE (e->label) == now) S_SET_VALUE (e->label, now + delta); lss->pmove_tail = &e->next; } }