From: Jeff Law Date: Wed, 15 Sep 1999 11:17:54 +0000 (+0000) Subject: * config/tc-hppa.c: Include dwarf2dbg.h if OBJ_ELF. Declare X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2d93dcc4506d364e1d5672520668b1fdd485d958;p=binutils-gdb.git * config/tc-hppa.c: Include dwarf2dbg.h if OBJ_ELF. Declare debug_line. (md_pseudo_table): Add .file and .line pseudo-ops for OBJ_ELF. (md_assemble): Call dwarf2_where for OBJ_ELF. (pa_ip): Call dwarf2_gen_line_info for OBJ_ELF. (pa_end_of_source): New function. * tc-hppa.h (md_end): Define for OBJ_ELF. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index ca19c0067d1..f8f3b45e7bc 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,13 @@ +Wed Sep 15 05:14:32 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c: Include dwarf2dbg.h if OBJ_ELF. Declare + debug_line. + (md_pseudo_table): Add .file and .line pseudo-ops for OBJ_ELF. + (md_assemble): Call dwarf2_where for OBJ_ELF. + (pa_ip): Call dwarf2_gen_line_info for OBJ_ELF. + (pa_end_of_source): New function. + * tc-hppa.h (md_end): Define for OBJ_ELF. + 1999-09-14 Michael Meissner * configure.in (Canonicalization of target names): Remove adding diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index 823238f7d64..eda75aa69e1 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -39,6 +39,14 @@ error only one of OBJ_ELF and OBJ_SOM can be defined #endif +/* If we are using ELF, then we probably can support dwarf2 debug + records. Furthermore, if we are supporting dwarf2 debug records, + then we want to use the assembler support for compact line numbers. */ +#ifdef OBJ_ELF +#include "dwarf2dbg.h" +struct dwarf2_line_info debug_line; +#endif + /* A "convient" place to put object file dependencies which do not need to be seen outside of tc-hppa.c. */ #ifdef OBJ_ELF @@ -630,6 +638,9 @@ const pseudo_typeS md_pseudo_table[] = {"equ", pa_equ, 0}, {"exit", pa_exit, 0}, {"export", pa_export, 0}, +#ifdef OBJ_ELF + { "file", dwarf2_directive_file }, +#endif {"fill", pa_fill, 0}, {"float", pa_float_cons, 'f'}, {"half", pa_cons, 2}, @@ -639,6 +650,9 @@ const pseudo_typeS md_pseudo_table[] = {"lcomm", pa_lcomm, 0}, {"leave", pa_leave, 0}, {"level", pa_level, 0}, +#ifdef OBJ_ELF + { "loc", dwarf2_directive_loc }, +#endif {"long", pa_cons, 4}, {"lsym", pa_lsym, 0}, #ifdef OBJ_SOM @@ -1443,6 +1457,12 @@ md_assemble (str) (offsetT) 0, &the_insn.exp, the_insn.pcrel, the_insn.reloc, the_insn.field_selector, the_insn.format, the_insn.arg_reloc, NULL); + +#ifdef OBJ_ELF + if (debug_type == DEBUG_DWARF2) + dwarf2_where (&debug_line); +#endif + } /* Do the real work for assembling a single instruction. Store results @@ -3357,6 +3377,16 @@ pa_ip (str) break; } +#ifdef OBJ_ELF + if (debug_type == DEBUG_DWARF2) + { + bfd_vma addr; + + addr = frag_now->fr_address + frag_now_fix (); + dwarf2_gen_line_info (addr, &debug_line); + } +#endif + the_insn.opcode = opcode; } @@ -7504,3 +7534,11 @@ elf_hppa_final_processing () } } #endif + +#ifdef OBJ_ELF +pa_end_of_source () +{ + if (debug_type == DEBUG_DWARF2) + dwarf2_finish (); +} +#endif diff --git a/gas/config/tc-hppa.h b/gas/config/tc-hppa.h index 13e10daf7df..67d55dc92a5 100644 --- a/gas/config/tc-hppa.h +++ b/gas/config/tc-hppa.h @@ -162,6 +162,9 @@ void elf_hppa_final_processing PARAMS ((void)); #endif #define md_operand(x) +#ifdef OBJ_ELF +#define md_end() pa_end_of_source () +#endif #define TC_FIX_TYPE PTR #define TC_INIT_FIX_DATA(FIXP) ((FIXP)->tc_fix_data = NULL)