dwarf2 lineno fixes
Richard Henderson
rth@redhat.com
Fri Nov 17 01:04:00 GMT 2000
In the process of implementing .debug_line support for Alpha, I
discovered that someone had been confused as to what debug_type
actually means. Namely, it does _not_ mean what kind of debug
info is being emitted on behalf of gcc.
This patch:
(1) Cleans up this confusion by updating commentary and renaming functions.
(2) The call to dwarf2_finish is moved to generic code, simplifying the
target-specific requirements by half.
(3) Alpha support is added.
(4) Fix fragment bugs in dwarf2_finish. Also create a minimal
.debug_info entry.
I also note that -gdwarf2 doesn't actually work (even after the patch)
since we do not create a compilation unit DIE, and without that there
is no pointer to the debug_line information that we created.
Also, instead of collecting bits as we go, and having to emit a
set_address entry for every fragment we come across, we ought to
delay dwarf2_finish until after relax_and_size_seg when we know
the absolute addresses of the fragments.
r~
* as.c (debug_type): Init to DEBUG_UNSPECIFIED.
(main): Call dwarf2_finish.
* as.h (debug_type): Clarify documentation of the meaning
of this variable.
* dwarf2dbg.c (DWARF2_LINE_MIN_INSN_LENGTH): Default to 1.
(print_stats): Fix parenthesis problem.
(now_subseg_size): New.
(dwarf2_finish): Use it. If DEBUG_DWARF2, emit bits for .debug_info.
(dwarf2_directive_file): Don't set debug_type.
(dwarf2_where): Honor DEBUG_DWARF2 first.
(dwarf2_emit_insn): Renamed from dwarf2_generate_asm_lineno;
do nothing if not emitting dwarf2 debug info, or no work.
* dwarf2dbg.h (dwarf2_emit_insn): Update.
* ecoff.c (add_file): Turn on DEBUG_ECOFF only if DEBUG_UNSPECIFIED.
(ecoff_new_file): Likewise.
* read.c (generate_lineno_debug): Kill ecoff hackery. Update
commentary wrt dwarf2.
* config/tc-alpha.c (alpha_adjust_symtab_relocs): Add
ATTRIBUTE_UNUSED as needed.
(emit_insn): Call dwarf2_emit_insn.
(s_alpha_file): New.
(s_alpha_loc): New.
(s_alpha_coff_wrapper): Don't handle them.
(md_pseudo_table): Update for .file and .loc.
* config/tc-alpha.h (DWARF2_LINE_MIN_INSN_LENGTH): New.
* config/tc-arm.c (output_inst): Update for dwarf2_emit_insn;
don't protect with debug_type.
* config/tc-hppa.c (md_assemble): Likewise.
* config/tc-m68hc11.c (m68hc11_new_insn): Likewise.
* config/tc-mn10300.c (md_assemble): Likewise.
* config/tc-sh.c (md_assemble): Likewise.
* config/tc-v850.c (md_assemble): Likewise.
* config/tc-arm.c (arm_end_of_source): Remove.
* config/tc-hppa.c (pa_end_of_source): Remove.
* config/tc-m68hc11.c (m68hc11_end_of_source): Remove.
* config/tc-mn10300.c (mn10300_finalize): Remove.
* config/tc-sh.c (sh_finalize): Remove.
* config/tc-v850.c (sh_finalize): Remove.
* config/tc-arm.h (md_end): Remove.
* config/tc-hppa.h (md_end): Remove.
(DWARF2_LINE_MIN_INSN_LENGTH): New.
* config/tc-m68hc11.h (md_end): Remove.
* config/tc-mn10300.h (md_end): Remove.
* config/tc-sh.h (md_end): Remove.
* config/tc-v850.h (md_end): Remove.
* config/tc-ia64.c (emit_one_bundle): Don't protect
dwarf2 bits with debug_type.
(md_assemble): Likewise.
(ia64_end_of_source): Don't call dwarf2_finish.
Index: as.c
===================================================================
RCS file: /cvs/src/src/gas/as.c,v
retrieving revision 1.20
diff -c -p -d -r1.20 as.c
*** as.c 2000/11/07 01:18:45 1.20
--- as.c 2000/11/17 08:31:03
*************** static char *listing_filename = NULL;
*** 68,74 ****
/* Type of debugging to generate. */
! enum debug_info_type debug_type = DEBUG_NONE;
/* Maximum level of macro nesting. */
int max_macro_nest = 100;
--- 68,74 ----
/* Type of debugging to generate. */
! enum debug_info_type debug_type = DEBUG_UNSPECIFIED;
/* Maximum level of macro nesting. */
int max_macro_nest = 100;
*************** main (argc, argv)
*** 885,890 ****
--- 885,894 ----
md_end ();
#endif
+ /* If we've been collecting dwarf2 .debug_line info, either for
+ assembly debugging or on behalf of the compiler, emit it now. */
+ dwarf2_finish ();
+
if (seen_at_least_1_file ()
&& (flag_always_generate_output || had_errors () == 0))
keep_it = 1;
Index: as.h
===================================================================
RCS file: /cvs/src/src/gas/as.h,v
retrieving revision 1.17
diff -c -p -d -r1.17 as.h
*** as.h 2000/10/30 20:15:02 1.17
--- as.h 2000/11/17 08:31:03
*************** COMMON int linkrelax;
*** 454,461 ****
/* TRUE if we should produce a listing. */
extern int listing;
! /* Type of debugging information we should generate. We currently
! support stabs, ECOFF, and DWARF2. */
enum debug_info_type {
DEBUG_UNSPECIFIED,
--- 454,466 ----
/* TRUE if we should produce a listing. */
extern int listing;
! /* Type of debugging information we should generate. We currently support
! stabs, ECOFF, and DWARF2.
!
! NOTE! This means debug information about the assembly source code itself
! and _not_ about possible debug information from a high-level language.
! This is especially relevant to DWARF2, since the compiler may emit line
! number directives that the assembler resolves. */
enum debug_info_type {
DEBUG_UNSPECIFIED,
Index: dwarf2dbg.c
===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
retrieving revision 1.19
diff -c -p -d -r1.19 dwarf2dbg.c
*** dwarf2dbg.c 2000/11/13 01:10:05 1.19
--- dwarf2dbg.c 2000/11/17 08:31:03
***************
*** 63,69 ****
#ifndef DWARF2_LINE_MIN_INSN_LENGTH
/* Define the architecture-dependent minimum instruction length (in
bytes). This value should be rather too small than too big. */
! # define DWARF2_LINE_MIN_INSN_LENGTH 4
#endif
/* Flag that indicates the initial value of the is_stmt_start flag.
--- 63,69 ----
#ifndef DWARF2_LINE_MIN_INSN_LENGTH
/* Define the architecture-dependent minimum instruction length (in
bytes). This value should be rather too small than too big. */
! # define DWARF2_LINE_MIN_INSN_LENGTH 1
#endif
/* Flag that indicates the initial value of the is_stmt_start flag.
*************** static int get_filenum PARAMS ((int, cha
*** 178,183 ****
--- 178,184 ----
static void gen_dir_list PARAMS ((void));
static void gen_file_list PARAMS ((void));
static void print_stats PARAMS ((unsigned long));
+ static addressT now_subseg_size PARAMS ((void));
#define out_byte(byte) FRAG_APPEND_1_CHAR(byte)
#define out_opcode(opc) (out_byte ((opc)), ++ls.opcode_hist[(opc) & 0xff])
*************** print_stats (total_size)
*** 643,655 ****
j = SPECIAL_LINE (i);
if (j == DWARF2_LINE_BASE)
fprintf (stderr, "\n%4u: ",
! ((unsigned int)
! DWARF2_LINE_MIN_INSN_LENGTH * SPECIAL_ADDR (i)));
fprintf (stderr, " %2u", ls.opcode_hist[i]);
}
fprintf (stderr, "\n");
}
void
dwarf2_finish ()
{
--- 644,672 ----
j = SPECIAL_LINE (i);
if (j == DWARF2_LINE_BASE)
fprintf (stderr, "\n%4u: ",
! (unsigned int) (DWARF2_LINE_MIN_INSN_LENGTH
! * SPECIAL_ADDR (i)));
fprintf (stderr, " %2u", ls.opcode_hist[i]);
}
fprintf (stderr, "\n");
}
+ /* Compute the size of the current subsegment, taking all fragments
+ into account. Note that we don't generate variant frags, so the
+ fixed portion is all we need to consider. */
+
+ static addressT
+ now_subseg_size ()
+ {
+ struct frag *f;
+ addressT size = 0;
+
+ for (f = frchain_now->frch_root; f ; f = f->fr_next)
+ size += f->fr_fix;
+
+ return size + frag_now_fix_octets ();
+ }
+
void
dwarf2_finish ()
{
*************** dwarf2_finish ()
*** 667,689 ****
if (!ls.sm.empty_sequence)
out_end_sequence ();
! total_size = body_size = frag_now_fix ();
/* Now generate the directory and file lists. */
subseg_set (ls.line_seg, DL_FILES);
gen_dir_list ();
gen_file_list ();
! total_size += frag_now_fix ();
/* And now the header ("statement program prolog", in DWARF2 lingo...). */
subseg_set (ls.line_seg, DL_PROLOG);
cp = frag_more (15 + DWARF2_LINE_OPCODE_BASE - 1);
! total_size += frag_now_fix ();
prolog_size = total_size - body_size - 10;
! # define STUFF(val,size) md_number_to_chars (cp, val, size); cp += size;
STUFF (total_size - 4, 4); /* length */
STUFF (2, 2); /* version */
STUFF (prolog_size, 4); /* prologue_length */
--- 684,712 ----
if (!ls.sm.empty_sequence)
out_end_sequence ();
! subseg_set (ls.line_seg, DL_BODY);
! total_size = body_size = now_subseg_size ();
/* Now generate the directory and file lists. */
subseg_set (ls.line_seg, DL_FILES);
gen_dir_list ();
gen_file_list ();
! total_size += now_subseg_size ();
/* And now the header ("statement program prolog", in DWARF2 lingo...). */
subseg_set (ls.line_seg, DL_PROLOG);
cp = frag_more (15 + DWARF2_LINE_OPCODE_BASE - 1);
! total_size += now_subseg_size ();
prolog_size = total_size - body_size - 10;
! #define STUFF(val,size) \
! do { \
! md_number_to_chars (cp, val, size); \
! cp += size; \
! } while (0)
!
STUFF (total_size - 4, 4); /* length */
STUFF (2, 2); /* version */
STUFF (prolog_size, 4); /* prologue_length */
*************** dwarf2_finish ()
*** 704,709 ****
--- 727,773 ----
STUFF (0, 1); /* DW_LNS_const_add_pc */
STUFF (1, 1); /* DW_LNS_fixed_advance_pc */
+ #undef STUFF
+
+ /* If this is assembler generated line info, add a .debug_info
+ section as well. */
+ if (debug_type == DEBUG_DWARF2)
+ {
+ segT info_seg = subseg_new (".debug_info", 0);
+ segT abbrev_seg = subseg_new (".debug_abbrev", 0);
+ char *len;
+
+ #ifdef BFD_ASSEMBLER
+ bfd_set_section_flags (stdoutput, info_seg, SEC_READONLY);
+ bfd_set_section_flags (stdoutput, abbrev_seg, SEC_READONLY);
+ #endif
+
+ subseg_set (info_seg, 0);
+ len = frag_more (4);
+
+ #define STUFF(val, size) \
+ do { \
+ cp = frag_more (size); \
+ md_number_to_chars (cp, (val), (size)); \
+ } while(0)
+
+ STUFF (2, 2); /* Dwarf version */
+ STUFF (0, 4); /* Offset into (final!) .debug_abbrev. */
+
+ /* Pointer size. */
+ #ifdef BFD_ASSEMBLER
+ STUFF (bfd_arch_bits_per_address (stdoutput) / 8, 1);
+ #else
+ STUFF (4, 1);
+ #endif
+
+ /* FIXME: Add a DW_TAG_compile_unit DIE. The line info cannot
+ even be seen without it. */
+
+ /* Set size of debug_info. */
+ md_number_to_chars (len, now_subseg_size () - 4, 4);
+ }
+
subseg_set (saved_seg, saved_subseg);
if (flag_debug)
*************** dwarf2_directive_file (dummy)
*** 726,736 ****
ls.any_dwarf2_directives = 1;
- if (debug_type == DEBUG_NONE)
- /* Automatically turn on DWARF2 debug info unless something else
- has been selected. */
- debug_type = DEBUG_DWARF2;
-
ls.current.filenum = get_absolute_expression ();
ls.current.filename = demand_copy_C_string (&len);
--- 790,795 ----
*************** void
*** 762,794 ****
dwarf2_where (line)
struct dwarf2_line_info *line;
{
! if (ls.any_dwarf2_directives)
! *line = ls.current;
! else
{
as_where (&line->filename, &line->line);
line->filenum = 0;
line->column = 0;
line->flags = DWARF2_FLAG_BEGIN_STMT;
}
}
! /* Generate a DWARF2 line statement for an
! instruction of SIZE bytes in length. */
void
! dwarf2_generate_asm_lineno (size)
int size;
{
addressT addr;
! static struct dwarf2_line_info debug_line;
/* First update the notion of the current source line. */
dwarf2_where (&debug_line);
/* We want the offset of the start of this
instruction within the the current frag. */
! addr = frag_now->fr_address + frag_now_fix () - size;
/* And record the information. */
dwarf2_gen_line_info (addr, &debug_line);
--- 821,862 ----
dwarf2_where (line)
struct dwarf2_line_info *line;
{
! if (debug_type == DEBUG_DWARF2)
{
as_where (&line->filename, &line->line);
line->filenum = 0;
line->column = 0;
line->flags = DWARF2_FLAG_BEGIN_STMT;
}
+ else
+ *line = ls.current;
}
! /* Called for each machine instruction, or relatively atomic group of
! machine instructions (ie built-in macro). The instruction or group
! is SIZE bytes in length. If dwarf2 line number generation is called
! for, emit a line statement appropriately. */
void
! dwarf2_emit_insn (size)
int size;
{
addressT addr;
! struct dwarf2_line_info debug_line;
!
! if (debug_type != DEBUG_DWARF2 && ! ls.any_dwarf2_directives)
! return;
+ /* Reset any_dwarf2_directives so that we won't waste time
+ determining that no information has changed between insns. */
+ ls.any_dwarf2_directives = 0;
+
/* First update the notion of the current source line. */
dwarf2_where (&debug_line);
/* We want the offset of the start of this
instruction within the the current frag. */
! addr = frag_now_fix () - size;
/* And record the information. */
dwarf2_gen_line_info (addr, &debug_line);
Index: dwarf2dbg.h
===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.h,v
retrieving revision 1.7
diff -c -p -d -r1.7 dwarf2dbg.h
*** dwarf2dbg.h 2000/10/25 19:15:33 1.7
--- dwarf2dbg.h 2000/11/17 08:31:03
*************** extern void dwarf2_gen_line_info PARAMS
*** 65,70 ****
.debug_line section. */
extern void dwarf2_finish PARAMS ((void));
! extern void dwarf2_generate_asm_lineno PARAMS ((int));
#endif /* AS_DWARF2DBG_H */
--- 65,70 ----
.debug_line section. */
extern void dwarf2_finish PARAMS ((void));
! extern void dwarf2_emit_insn PARAMS ((int));
#endif /* AS_DWARF2DBG_H */
Index: ecoff.c
===================================================================
RCS file: /cvs/src/src/gas/ecoff.c,v
retrieving revision 1.6
diff -c -p -d -r1.6 ecoff.c
*** ecoff.c 2000/10/17 20:21:45 1.6
--- ecoff.c 2000/11/17 08:31:04
*************** add_file (file_name, indx, fake)
*** 2216,2224 ****
this if we see a .file directive with a string, since that
implies that some sort of debugging information is being
provided. */
! if (! symbol_table_frozen && debug_type == DEBUG_NONE)
debug_type = DEBUG_ECOFF;
}
#ifndef NO_LISTING
if (listing)
--- 2216,2226 ----
this if we see a .file directive with a string, since that
implies that some sort of debugging information is being
provided. */
! if (! symbol_table_frozen && debug_type == DEBUG_UNSPECIFIED)
debug_type = DEBUG_ECOFF;
}
+ else
+ debug_type = DEBUG_NONE;
#ifndef NO_LISTING
if (listing)
*************** ecoff_new_file (name)
*** 2335,2341 ****
/* This is a hand coded assembler file, so automatically turn on
debugging information. */
! if (debug_type == DEBUG_NONE)
debug_type = DEBUG_ECOFF;
}
--- 2337,2343 ----
/* This is a hand coded assembler file, so automatically turn on
debugging information. */
! if (debug_type == DEBUG_UNSPECIFIED)
debug_type = DEBUG_ECOFF;
}
Index: read.c
===================================================================
RCS file: /cvs/src/src/gas/read.c,v
retrieving revision 1.30
diff -c -p -d -r1.30 read.c
*** read.c 2000/11/07 01:18:45 1.30
--- read.c 2000/11/17 08:31:04
*************** generate_file_debug ()
*** 4982,5003 ****
void
generate_lineno_debug ()
{
- #ifdef ECOFF_DEBUGGING
- /* ECOFF assemblers automatically generate debugging information.
- FIXME: This should probably be handled elsewhere. */
- if (debug_type == DEBUG_UNSPECIFIED)
- {
- if (ECOFF_DEBUGGING && ecoff_no_current_file ())
- debug_type = DEBUG_ECOFF;
- else
- debug_type = DEBUG_NONE;
- }
- #endif
-
switch (debug_type)
{
case DEBUG_UNSPECIFIED:
case DEBUG_NONE:
break;
case DEBUG_STABS:
stabs_generate_asm_lineno ();
--- 4982,4992 ----
void
generate_lineno_debug ()
{
switch (debug_type)
{
case DEBUG_UNSPECIFIED:
case DEBUG_NONE:
+ case DEBUG_DWARF:
break;
case DEBUG_STABS:
stabs_generate_asm_lineno ();
*************** generate_lineno_debug ()
*** 5005,5020 ****
case DEBUG_ECOFF:
ecoff_generate_asm_lineno ();
break;
- case DEBUG_DWARF:
case DEBUG_DWARF2:
! /* This cannot safely be done in a generic manner. A single
! binary instruction word may span mutliple lines of assembler
! source and may occupy a variable number of bytes. Instead,
! if a port wishes to support DWARF2 line number generation by
! the assembler, it should add a call to dwarf2_generate_asm_lineno
! inside md_assemble() at whatever point is appropriate. Note,
! such a port should also define md_end and make sure that
! dwarf2_finish is called, to emit the accumulated line information. */
break;
}
}
--- 4994,5004 ----
case DEBUG_ECOFF:
ecoff_generate_asm_lineno ();
break;
case DEBUG_DWARF2:
! /* ??? We could here indicate to dwarf2dbg.c that something
! has changed. However, since there is additional backend
! support that is required (calling dwarf2_emit_insn), we
! let dwarf2dbg.c call as_where on its own. */
break;
}
}
Index: config/tc-alpha.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-alpha.c,v
retrieving revision 1.13
diff -c -p -d -r1.13 tc-alpha.c
*** tc-alpha.c 2000/11/14 20:46:25 1.13
--- tc-alpha.c 2000/11/17 08:31:04
***************
*** 58,63 ****
--- 58,64 ----
#ifdef OBJ_ELF
#include "elf/alpha.h"
+ #include "dwarf2dbg.h"
#endif
#include <ctype.h>
*************** static void s_alpha_end PARAMS ((int));
*** 245,250 ****
--- 246,253 ----
static void s_alpha_mask PARAMS ((int));
static void s_alpha_frame PARAMS ((int));
static void s_alpha_prologue PARAMS ((int));
+ static void s_alpha_file PARAMS ((int));
+ static void s_alpha_loc PARAMS ((int));
static void s_alpha_coff_wrapper PARAMS ((int));
#endif
#ifdef OBJ_EVAX
*************** static offsetT alpha_lit4_literal;
*** 393,400 ****
static offsetT alpha_lit8_literal;
#endif
- /* The active .ent symbol. */
#ifdef OBJ_ELF
static symbolS *alpha_cur_ent_sym;
#endif
--- 396,403 ----
static offsetT alpha_lit8_literal;
#endif
#ifdef OBJ_ELF
+ /* The active .ent symbol. */
static symbolS *alpha_cur_ent_sym;
#endif
*************** alpha_adjust_symtab ()
*** 1671,1679 ****
static void
alpha_adjust_symtab_relocs (abfd, sec, ptr)
! bfd *abfd;
asection *sec;
! PTR ptr;
{
segment_info_type *seginfo = seg_info (sec);
fixS **prevP;
--- 1674,1682 ----
static void
alpha_adjust_symtab_relocs (abfd, sec, ptr)
! bfd *abfd ATTRIBUTE_UNUSED;
asection *sec;
! PTR ptr ATTRIBUTE_UNUSED;
{
segment_info_type *seginfo = seg_info (sec);
fixS **prevP;
*************** emit_insn (insn)
*** 2466,2471 ****
--- 2469,2478 ----
f = frag_more (4);
md_number_to_chars (f, insn->insn, 4);
+ #ifdef OBJ_ELF
+ dwarf2_emit_insn (4);
+ #endif
+
/* Apply the fixups in order */
for (i = 0; i < insn->nfixups; ++i)
{
*************** emit_lda (tok, ntok, opname)
*** 3287,3294 ****
|| tok[2].X_op != O_pregister
|| !is_ir_num(tok[2].X_add_number))
{
! as_bad (_("bad instruction format for lda !%s!%d"), r->name,
! reloc->X_add_number);
reloc = (const expressionS *)0;
ntok--;
--- 3294,3301 ----
|| tok[2].X_op != O_pregister
|| !is_ir_num(tok[2].X_add_number))
{
! as_bad (_("bad instruction format for lda !%s!%ld"), r->name,
! (long) reloc->X_add_number);
reloc = (const expressionS *)0;
ntok--;
*************** s_alpha_prologue (ignore)
*** 4572,4577 ****
--- 4579,4604 ----
}
static void
+ s_alpha_file (ignore)
+ int ignore ATTRIBUTE_UNUSED;
+ {
+ if (ECOFF_DEBUGGING)
+ ecoff_directive_file (0);
+ else
+ dwarf2_directive_file (0);
+ }
+
+ static void
+ s_alpha_loc (ignore)
+ int ignore ATTRIBUTE_UNUSED;
+ {
+ if (ECOFF_DEBUGGING)
+ ecoff_directive_loc (0);
+ else
+ dwarf2_directive_loc (0);
+ }
+
+ static void
s_alpha_coff_wrapper (which)
int which;
{
*************** s_alpha_coff_wrapper (which)
*** 4581,4591 ****
ecoff_directive_def,
ecoff_directive_dim,
ecoff_directive_endef,
- ecoff_directive_file,
ecoff_directive_scl,
ecoff_directive_tag,
ecoff_directive_val,
- ecoff_directive_loc,
};
assert (which >= 0 && which < (int)(sizeof(fns)/sizeof(*fns)));
--- 4608,4616 ----
*************** const pseudo_typeS md_pseudo_table[] =
*** 5447,5463 ****
{"fmask", s_alpha_mask, 1},
{"frame", s_alpha_frame, 0},
{"prologue", s_alpha_prologue, 0},
/* COFF debugging related pseudos. */
{"begin", s_alpha_coff_wrapper, 0},
{"bend", s_alpha_coff_wrapper, 1},
{"def", s_alpha_coff_wrapper, 2},
{"dim", s_alpha_coff_wrapper, 3},
{"endef", s_alpha_coff_wrapper, 4},
! {"file", s_alpha_coff_wrapper, 5},
! {"scl", s_alpha_coff_wrapper, 6},
! {"tag", s_alpha_coff_wrapper, 7},
! {"val", s_alpha_coff_wrapper, 8},
! {"loc", s_alpha_coff_wrapper, 9},
#else
{"prologue", s_ignore, 0},
#endif
--- 5472,5488 ----
{"fmask", s_alpha_mask, 1},
{"frame", s_alpha_frame, 0},
{"prologue", s_alpha_prologue, 0},
+ {"file", s_alpha_file, 5},
+ {"loc", s_alpha_loc, 9},
/* COFF debugging related pseudos. */
{"begin", s_alpha_coff_wrapper, 0},
{"bend", s_alpha_coff_wrapper, 1},
{"def", s_alpha_coff_wrapper, 2},
{"dim", s_alpha_coff_wrapper, 3},
{"endef", s_alpha_coff_wrapper, 4},
! {"scl", s_alpha_coff_wrapper, 5},
! {"tag", s_alpha_coff_wrapper, 6},
! {"val", s_alpha_coff_wrapper, 7},
#else
{"prologue", s_ignore, 0},
#endif
Index: config/tc-alpha.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-alpha.h,v
retrieving revision 1.3
diff -c -p -d -r1.3 tc-alpha.h
*** tc-alpha.h 1999/11/29 00:46:16 1.3
--- tc-alpha.h 2000/11/17 08:31:04
*************** do { \
*** 146,148 ****
--- 146,150 ----
(long)fixP->tc_fix_data.next_lituse); \
} while (0)
#endif
+
+ #define DWARF2_LINE_MIN_INSN_LENGTH 4
Index: config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.66
diff -c -p -d -r1.66 tc-arm.c
*** tc-arm.c 2000/11/14 20:57:30 1.66
--- tc-arm.c 2000/11/17 08:31:04
*************** output_inst PARAMS ((void))
*** 6374,6384 ****
fix_new_arm (frag_now, to - frag_now->fr_literal,
inst.size, & inst.reloc.exp, inst.reloc.pc_rel,
inst.reloc.type);
#ifdef OBJ_ELF
! if (debug_type == DEBUG_DWARF2)
! dwarf2_generate_asm_lineno (inst.size);
#endif
- return;
}
void
--- 6374,6383 ----
fix_new_arm (frag_now, to - frag_now->fr_literal,
inst.size, & inst.reloc.exp, inst.reloc.pc_rel,
inst.reloc.type);
+
#ifdef OBJ_ELF
! dwarf2_emit_insn (inst.size);
#endif
}
void
*************** s_arm_elf_cons (nbytes)
*** 7503,7517 ****
/* Put terminator back into stream. */
input_line_pointer --;
demand_empty_rest_of_line ();
- }
-
- /* Stuff to do after assembling all of the source file. */
-
- void
- arm_end_of_source ()
- {
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
}
#endif /* OBJ_ELF */
--- 7502,7507 ----
Index: config/tc-arm.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.h,v
retrieving revision 1.9
diff -c -p -d -r1.9 tc-arm.h
*** tc-arm.h 2000/10/25 19:15:33 1.9
--- tc-arm.h 2000/11/17 08:31:04
*************** void armelf_frob_symbol PARAMS ((symbolS
*** 212,219 ****
#endif
#ifdef OBJ_ELF
- #define md_end() arm_end_of_source ()
- extern void arm_end_of_source PARAMS ((void));
-
#define DWARF2_LINE_MIN_INSN_LENGTH 2
#endif
--- 212,216 ----
Index: config/tc-hppa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-hppa.c,v
retrieving revision 1.71
diff -c -p -d -r1.71 tc-hppa.c
*** tc-hppa.c 2000/10/25 19:15:33 1.71
--- tc-hppa.c 2000/11/17 08:31:04
*************** md_assemble (str)
*** 1491,1498 ****
the_insn.format, the_insn.arg_reloc, NULL);
#ifdef OBJ_ELF
! if (debug_type == DEBUG_DWARF2)
! dwarf2_generate_asm_lineno (4);
#endif
}
--- 1491,1497 ----
the_insn.format, the_insn.arg_reloc, NULL);
#ifdef OBJ_ELF
! dwarf2_emit_insn (4);
#endif
}
*************** elf_hppa_final_processing ()
*** 8538,8550 ****
S_GET_VALUE (call_info_pointer->end_symbol)
- S_GET_VALUE (call_info_pointer->start_symbol) + 4;
}
- }
-
- void
- pa_end_of_source ()
- {
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
}
static void
--- 8537,8542 ----
Index: config/tc-hppa.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-hppa.h,v
retrieving revision 1.13
diff -c -p -d -r1.13 tc-hppa.h
*** tc-hppa.h 2000/09/18 12:36:03 1.13
--- tc-hppa.h 2000/11/17 08:31:04
*************** int hppa_fix_adjustable PARAMS((struct f
*** 173,180 ****
#define elf_tc_final_processing elf_hppa_final_processing
void elf_hppa_final_processing PARAMS ((void));
! #define md_end() pa_end_of_source ()
! void pa_end_of_source PARAMS ((void));
#endif /* OBJ_ELF */
#define md_operand(x)
--- 173,179 ----
#define elf_tc_final_processing elf_hppa_final_processing
void elf_hppa_final_processing PARAMS ((void));
! #define DWARF2_LINE_MIN_INSN_LENGTH 4
#endif /* OBJ_ELF */
#define md_operand(x)
Index: config/tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.30
diff -c -p -d -r1.30 tc-ia64.c
*** tc-ia64.c 2000/11/15 17:34:00 1.30
--- tc-ia64.c 2000/11/17 08:31:05
*************** emit_one_bundle ()
*** 5649,5655 ****
continue; /* try next slot */
}
- if (debug_type == DEBUG_DWARF2)
{
bfd_vma addr;
--- 5649,5654 ----
*************** ia64_end_of_source ()
*** 6197,6205 ****
bfd_set_private_flags (stdoutput, md.flags);
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
-
md.mem_offset.hint = 0;
}
--- 6196,6201 ----
*************** md_assemble (str)
*** 9088,9095 ****
CURR_SLOT.qp_regno = qp_regno;
CURR_SLOT.idesc = idesc;
as_where (&CURR_SLOT.src_file, &CURR_SLOT.src_line);
! if (debug_type == DEBUG_DWARF2)
! dwarf2_where (&CURR_SLOT.debug_line);
/* Add unwind entry, if there is one. */
if (unwind.current_entry)
--- 9084,9090 ----
CURR_SLOT.qp_regno = qp_regno;
CURR_SLOT.idesc = idesc;
as_where (&CURR_SLOT.src_file, &CURR_SLOT.src_line);
! dwarf2_where (&CURR_SLOT.debug_line);
/* Add unwind entry, if there is one. */
if (unwind.current_entry)
Index: config/tc-m68hc11.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68hc11.c,v
retrieving revision 1.6
diff -c -p -d -r1.6 tc-m68hc11.c
*** tc-m68hc11.c 2000/10/25 19:15:33 1.6
--- tc-m68hc11.c 2000/11/17 08:31:05
*************** m68hc11_new_insn (size)
*** 1371,1379 ****
f = frag_more (size);
! /* Emit line number information in dwarf2 debug sections. */
! if (debug_type == DEBUG_DWARF2)
! dwarf2_generate_asm_lineno (size);
return f;
}
--- 1371,1377 ----
f = frag_more (size);
! dwarf2_emit_insn (size);
return f;
}
*************** int
*** 2768,2806 ****
m68hc11_cleanup ()
{
return 1;
- }
-
- void
- m68hc11_end_of_source ()
- {
- segT saved_seg;
- subsegT saved_subseg;
- segT debug_info;
- char *p;
- long total_size = 0;
-
- if (debug_type != DEBUG_DWARF2)
- return;
-
- dwarf2_finish ();
-
- saved_seg = now_seg;
- saved_subseg = now_subseg;
-
- debug_info = subseg_new (".debug_info", 0);
- bfd_set_section_flags (stdoutput, debug_info, SEC_READONLY);
- subseg_set (debug_info, 0);
- p = frag_more (10);
- total_size = 12;
-
- # define STUFF(val,size) md_number_to_chars (p, val, size); p += size;
- STUFF (total_size, 4); /* Length of compilation unit. */
- STUFF (2, 2); /* Dwarf version */
- STUFF (0, 4);
- STUFF (2, 1); /* Pointer size */
- STUFF (1, 1); /* Compile unit */
- STUFF (0, 4);
-
- now_subseg = saved_subseg;
- now_seg = saved_seg;
}
--- 2766,2769 ----
Index: config/tc-m68hc11.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68hc11.h,v
retrieving revision 1.2
diff -c -p -d -r1.2 tc-m68hc11.h
*** tc-m68hc11.h 2000/09/20 22:05:08 1.2
--- tc-m68hc11.h 2000/11/17 08:31:05
*************** extern void m68hc11_init_after_args PARA
*** 79,87 ****
extern int m68hc11_parse_long_option PARAMS ((char *));
#define md_parse_long_option m68hc11_parse_long_option
- extern void m68hc11_end_of_source PARAMS ((void));
- #define md_end() m68hc11_end_of_source ()
-
#define DWARF2_LINE_MIN_INSN_LENGTH 1
/* We don't need to handle .word strangely. */
--- 79,84 ----
Index: config/tc-mn10300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mn10300.c,v
retrieving revision 1.15
diff -c -p -d -r1.15 tc-mn10300.c
*** tc-mn10300.c 2000/11/14 20:57:30 1.15
--- tc-mn10300.c 2000/11/17 08:31:05
*************** keep_going:
*** 1789,1796 ****
}
}
! if (debug_type == DEBUG_DWARF2)
! dwarf2_generate_asm_lineno (real_size);
}
/* If while processing a fixup, a reloc really needs to be created
--- 1789,1795 ----
}
}
! dwarf2_emit_insn (real_size);
}
/* If while processing a fixup, a reloc really needs to be created
*************** set_arch_mach (mach)
*** 2134,2144 ****
as_warn (_("could not set architecture and machine"));
current_machine = mach;
- }
-
- void
- mn10300_finalize ()
- {
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
}
--- 2133,2136 ----
Index: config/tc-mn10300.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mn10300.h,v
retrieving revision 1.5
diff -c -p -d -r1.5 tc-mn10300.h
*** tc-mn10300.h 2000/09/20 22:05:08 1.5
--- tc-mn10300.h 2000/11/17 08:31:05
*************** extern boolean mn10300_fix_adjustable PA
*** 62,68 ****
extern const struct relax_type md_relax_table[];
#define TC_GENERIC_RELAX_TABLE md_relax_table
- #define md_end() mn10300_finalize ()
- void mn10300_finalize PARAMS ((void));
-
#define DWARF2_LINE_MIN_INSN_LENGTH 1
--- 62,65 ----
Index: config/tc-sh.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh.c,v
retrieving revision 1.27
diff -c -p -d -r1.27 tc-sh.c
*** tc-sh.c 2000/10/31 12:33:13 1.27
--- tc-sh.c 2000/11/17 08:31:05
*************** md_assemble (str)
*** 1929,1936 ****
}
}
! if (debug_type == DEBUG_DWARF2)
! dwarf2_generate_asm_lineno (size);
}
/* This routine is called each time a label definition is seen. It
--- 1929,1935 ----
}
}
! dwarf2_emit_insn (size);
}
/* This routine is called each time a label definition is seen. It
*************** tc_gen_reloc (section, fixp)
*** 3324,3333 ****
}
#endif /* BFD_ASSEMBLER */
-
- void
- sh_finalize ()
- {
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
- }
--- 3323,3325 ----
Index: config/tc-sh.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-sh.h,v
retrieving revision 1.9
diff -c -p -d -r1.9 tc-sh.h
*** tc-sh.h 2000/09/26 07:09:19 1.9
--- tc-sh.h 2000/11/17 08:31:05
*************** extern void sh_elf_final_processing PARA
*** 206,211 ****
&& ! S_IS_COMMON ((FIX)->fx_addsy))))
#endif /* OBJ_ELF */
-
- #define md_end() sh_finalize ()
- void sh_finalize PARAMS ((void));
--- 206,208 ----
Index: config/tc-v850.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-v850.c,v
retrieving revision 1.11
diff -c -p -d -r1.11 tc-v850.c
*** tc-v850.c 2000/11/16 00:59:49 1.11
--- tc-v850.c 2000/11/17 08:31:05
*************** md_assemble (str)
*** 2275,2282 ****
input_line_pointer = saved_input_line_pointer;
! if (debug_type == DEBUG_DWARF2)
! dwarf2_generate_asm_lineno (total_insn_size);
}
/* If while processing a fixup, a reloc really needs to be created
--- 2275,2281 ----
input_line_pointer = saved_input_line_pointer;
! dwarf2_emit_insn (total_insn_size);
}
/* If while processing a fixup, a reloc really needs to be created
*************** v850_force_relocation (fixP)
*** 2533,2543 ****
return 1;
return 0;
- }
-
- void
- v850_finalize ()
- {
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
}
--- 2532,2535 ----
Index: config/tc-v850.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-v850.h,v
retrieving revision 1.5
diff -c -p -d -r1.5 tc-v850.h
*** tc-v850.h 2000/11/15 19:22:22 1.5
--- tc-v850.h 2000/11/17 08:31:05
*************** extern const struct relax_type md_relax_
*** 90,96 ****
#define MD_PCREL_FROM_SECTION(fixP,section) v850_pcrel_from_section (fixP, section)
extern long v850_pcrel_from_section ();
- #define md_end() v850_finalize ()
- extern void v850_finalize PARAMS ((void));
-
#define DWARF2_LINE_MIN_INSN_LENGTH 2
--- 90,93 ----
More information about the Binutils
mailing list