aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2000-11-17 08:47:52 +0000
committerRichard Henderson <rth@redhat.com>2000-11-17 08:47:52 +0000
commit4dc7ead9fdf2143fa28755909c2cf9f47659aca4 (patch)
tree454af0e6a42bb531e86fbf5986c68eb863bfc2cc /gas/config
parent512d22f487a268fc32a4a9a6a88e8ac538ad8448 (diff)
downloadgdb-4dc7ead9fdf2143fa28755909c2cf9f47659aca4.zip
gdb-4dc7ead9fdf2143fa28755909c2cf9f47659aca4.tar.gz
gdb-4dc7ead9fdf2143fa28755909c2cf9f47659aca4.tar.bz2
* as.c (debug_type): Init to DEBUG_UNSPECIFIED.
* 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.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-alpha.c49
-rw-r--r--gas/config/tc-alpha.h2
-rw-r--r--gas/config/tc-arm.c14
-rw-r--r--gas/config/tc-arm.h3
-rw-r--r--gas/config/tc-hppa.c10
-rw-r--r--gas/config/tc-hppa.h3
-rw-r--r--gas/config/tc-ia64.c7
-rw-r--r--gas/config/tc-m68hc11.c39
-rw-r--r--gas/config/tc-m68hc11.h3
-rw-r--r--gas/config/tc-mn10300.c10
-rw-r--r--gas/config/tc-mn10300.h3
-rw-r--r--gas/config/tc-sh.c10
-rw-r--r--gas/config/tc-sh.h3
-rw-r--r--gas/config/tc-v850.c10
-rw-r--r--gas/config/tc-v850.h3
15 files changed, 48 insertions, 121 deletions
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index 44aedcd..66d208b 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -58,6 +58,7 @@
#ifdef OBJ_ELF
#include "elf/alpha.h"
+#include "dwarf2dbg.h"
#endif
#include <ctype.h>
@@ -245,6 +246,8 @@ static void s_alpha_end PARAMS ((int));
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
@@ -393,8 +396,8 @@ static offsetT alpha_lit4_literal;
static offsetT alpha_lit8_literal;
#endif
-/* The active .ent symbol. */
#ifdef OBJ_ELF
+/* The active .ent symbol. */
static symbolS *alpha_cur_ent_sym;
#endif
@@ -1671,9 +1674,9 @@ alpha_adjust_symtab ()
static void
alpha_adjust_symtab_relocs (abfd, sec, ptr)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
asection *sec;
- PTR ptr;
+ PTR ptr ATTRIBUTE_UNUSED;
{
segment_info_type *seginfo = seg_info (sec);
fixS **prevP;
@@ -2466,6 +2469,10 @@ emit_insn (insn)
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)
{
@@ -3287,8 +3294,8 @@ emit_lda (tok, ntok, opname)
|| 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);
+ as_bad (_("bad instruction format for lda !%s!%ld"), r->name,
+ (long) reloc->X_add_number);
reloc = (const expressionS *)0;
ntok--;
@@ -4572,6 +4579,26 @@ s_alpha_prologue (ignore)
}
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;
{
@@ -4581,11 +4608,9 @@ s_alpha_coff_wrapper (which)
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)));
@@ -5447,17 +5472,17 @@ const pseudo_typeS md_pseudo_table[] =
{"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},
- {"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},
+ {"scl", s_alpha_coff_wrapper, 5},
+ {"tag", s_alpha_coff_wrapper, 6},
+ {"val", s_alpha_coff_wrapper, 7},
#else
{"prologue", s_ignore, 0},
#endif
diff --git a/gas/config/tc-alpha.h b/gas/config/tc-alpha.h
index 632b04e..b4335e3 100644
--- a/gas/config/tc-alpha.h
+++ b/gas/config/tc-alpha.h
@@ -146,3 +146,5 @@ do { \
(long)fixP->tc_fix_data.next_lituse); \
} while (0)
#endif
+
+#define DWARF2_LINE_MIN_INSN_LENGTH 4
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 1556db6..eb22404 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -6374,11 +6374,10 @@ output_inst PARAMS ((void))
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);
+ dwarf2_emit_insn (inst.size);
#endif
- return;
}
void
@@ -7505,13 +7504,4 @@ s_arm_elf_cons (nbytes)
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 */
diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h
index e1de55e..365591c 100644
--- a/gas/config/tc-arm.h
+++ b/gas/config/tc-arm.h
@@ -212,8 +212,5 @@ void armelf_frob_symbol PARAMS ((symbolS *, int *));
#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
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index 7860370..e43e9be 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -1491,8 +1491,7 @@ md_assemble (str)
the_insn.format, the_insn.arg_reloc, NULL);
#ifdef OBJ_ELF
- if (debug_type == DEBUG_DWARF2)
- dwarf2_generate_asm_lineno (4);
+ dwarf2_emit_insn (4);
#endif
}
@@ -8540,13 +8539,6 @@ elf_hppa_final_processing ()
}
}
-void
-pa_end_of_source ()
-{
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
-}
-
static void
pa_vtable_entry (ignore)
int ignore ATTRIBUTE_UNUSED;
diff --git a/gas/config/tc-hppa.h b/gas/config/tc-hppa.h
index 5a54f16..bb40d59 100644
--- a/gas/config/tc-hppa.h
+++ b/gas/config/tc-hppa.h
@@ -173,8 +173,7 @@ int hppa_fix_adjustable PARAMS((struct fix *));
#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));
+#define DWARF2_LINE_MIN_INSN_LENGTH 4
#endif /* OBJ_ELF */
#define md_operand(x)
diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index 2474a48..afdf35b 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -5649,7 +5649,6 @@ emit_one_bundle ()
continue; /* try next slot */
}
- if (debug_type == DEBUG_DWARF2)
{
bfd_vma addr;
@@ -6197,9 +6196,6 @@ ia64_end_of_source ()
bfd_set_private_flags (stdoutput, md.flags);
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
-
md.mem_offset.hint = 0;
}
@@ -9088,8 +9084,7 @@ md_assemble (str)
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);
+ dwarf2_where (&CURR_SLOT.debug_line);
/* Add unwind entry, if there is one. */
if (unwind.current_entry)
diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c
index c0549ab..eabf8ef 100644
--- a/gas/config/tc-m68hc11.c
+++ b/gas/config/tc-m68hc11.c
@@ -1371,9 +1371,7 @@ m68hc11_new_insn (size)
f = frag_more (size);
- /* Emit line number information in dwarf2 debug sections. */
- if (debug_type == DEBUG_DWARF2)
- dwarf2_generate_asm_lineno (size);
+ dwarf2_emit_insn (size);
return f;
}
@@ -2769,38 +2767,3 @@ 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;
-}
diff --git a/gas/config/tc-m68hc11.h b/gas/config/tc-m68hc11.h
index 48139b6..8a1000d 100644
--- a/gas/config/tc-m68hc11.h
+++ b/gas/config/tc-m68hc11.h
@@ -79,9 +79,6 @@ extern void m68hc11_init_after_args PARAMS ((void));
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. */
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index 5c83421..51bc3fb 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -1789,8 +1789,7 @@ keep_going:
}
}
- if (debug_type == DEBUG_DWARF2)
- dwarf2_generate_asm_lineno (real_size);
+ dwarf2_emit_insn (real_size);
}
/* If while processing a fixup, a reloc really needs to be created
@@ -2135,10 +2134,3 @@ set_arch_mach (mach)
current_machine = mach;
}
-
-void
-mn10300_finalize ()
-{
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
-}
diff --git a/gas/config/tc-mn10300.h b/gas/config/tc-mn10300.h
index 0c61ed0..765ff5e 100644
--- a/gas/config/tc-mn10300.h
+++ b/gas/config/tc-mn10300.h
@@ -62,7 +62,4 @@ extern boolean mn10300_fix_adjustable PARAMS ((struct fix *));
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
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index 0f9ecdf..cdf249e 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -1929,8 +1929,7 @@ md_assemble (str)
}
}
- if (debug_type == DEBUG_DWARF2)
- dwarf2_generate_asm_lineno (size);
+ dwarf2_emit_insn (size);
}
/* This routine is called each time a label definition is seen. It
@@ -3324,10 +3323,3 @@ tc_gen_reloc (section, fixp)
}
#endif /* BFD_ASSEMBLER */
-
-void
-sh_finalize ()
-{
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
-}
diff --git a/gas/config/tc-sh.h b/gas/config/tc-sh.h
index 050d339..ed17a47 100644
--- a/gas/config/tc-sh.h
+++ b/gas/config/tc-sh.h
@@ -206,6 +206,3 @@ extern void sh_elf_final_processing PARAMS ((void));
&& ! S_IS_COMMON ((FIX)->fx_addsy))))
#endif /* OBJ_ELF */
-
-#define md_end() sh_finalize ()
-void sh_finalize PARAMS ((void));
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index 584579a..5793195 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -2275,8 +2275,7 @@ md_assemble (str)
input_line_pointer = saved_input_line_pointer;
- if (debug_type == DEBUG_DWARF2)
- dwarf2_generate_asm_lineno (total_insn_size);
+ dwarf2_emit_insn (total_insn_size);
}
/* If while processing a fixup, a reloc really needs to be created
@@ -2534,10 +2533,3 @@ v850_force_relocation (fixP)
return 0;
}
-
-void
-v850_finalize ()
-{
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
-}
diff --git a/gas/config/tc-v850.h b/gas/config/tc-v850.h
index 2347bc9..1e597f0 100644
--- a/gas/config/tc-v850.h
+++ b/gas/config/tc-v850.h
@@ -90,7 +90,4 @@ extern const struct relax_type md_relax_table[];
#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