void dwarf2_emit_label (symbolS *label) { struct dwarf2_line_info loc; if (!dwarf2_loc_mark_labels) return; if (S_GET_SEGMENT (label) != now_seg) return; if (!(bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE)) return; if (debug_type == DEBUG_DWARF2) dwarf2_where (&loc); else { loc = current; loc_directive_seen = FALSE; } loc.flags |= DWARF2_FLAG_BASIC_BLOCK; current.flags &= ~(DWARF2_FLAG_BASIC_BLOCK | DWARF2_FLAG_PROLOGUE_END | DWARF2_FLAG_EPILOGUE_BEGIN); dwarf2_gen_line_info_1 (label, &loc); }
void dwarf2_gen_line_info (addressT ofs, struct dwarf2_line_info *loc) { static unsigned int line = -1; static unsigned int filenum = -1; symbolS *sym; /* 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; sym = symbol_temp_new (now_seg, ofs, frag_now); dwarf2_gen_line_info_1 (sym, loc); }
void dwarf2_emit_label (symbolS *label) { struct dwarf2_line_info loc; if (!dwarf2_loc_mark_labels) return; if (S_GET_SEGMENT (label) != now_seg) return; if (!(bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE)) return; if (files_in_use == 0 && debug_type != DEBUG_DWARF2) return; dwarf2_where (&loc); loc.flags |= DWARF2_FLAG_BASIC_BLOCK; dwarf2_gen_line_info_1 (label, &loc); dwarf2_consume_line_info (); }
void dwarf2_gen_line_info (addressT ofs, struct dwarf2_line_info *loc) { static unsigned int line = -1; static unsigned int filenum = -1; symbolS *sym; /* 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; if (linkrelax) { char name[120]; /* Use a non-fake name for the line number location, so that it can be referred to by relocations. */ sprintf (name, ".Loc.%u.%u", line, filenum); sym = symbol_new (name, now_seg, ofs, frag_now); } else sym = symbol_temp_new (now_seg, ofs, frag_now); dwarf2_gen_line_info_1 (sym, loc); }