Add support for dwarf2 debug information.
authorNick Clifton <nickc@redhat.com>
Thu, 24 Apr 2003 12:47:32 +0000 (12:47 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 24 Apr 2003 12:47:32 +0000 (12:47 +0000)
gas/ChangeLog
gas/Makefile.am
gas/Makefile.in
gas/config/tc-h8300.c
gas/config/tc-h8300.h

index 285877d74d8e7c0c3e42865e4e3841c7724b51b1..c5ba178389d47c26a334d479ccc1daf579b14a08 100644 (file)
@@ -1,3 +1,12 @@
+2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+       * config/tc-h8300.h (DWARF2_LINE_MIN_INSN_LENGTH): New
+       * config/tc-h8300.c (dwarf2dbg.h): Include 
+       (md_pseudo_table): Handle .loc and .file
+       (md_assemble): Call dwarf2_emit_insn if BFD_ASSEMBLER.
+       * Makefile.am: Add dependency on dwarf2dbg.h for h8300 targets.
+       * Makefile.in: Regenerate.
+
 2003-04-24 Dhananjay Deshpande <dhananjayd@kpitcummins.com> 
 
        * config/tc-h8300.c (Nmode, h8300hnmode, h8300snmode): New.
index 76665bdb8207621d2e563769db05e7c3575729f9..24d7dd2796e11cfb3870889aaabbdaeaabd52f55 100644 (file)
@@ -1099,12 +1099,13 @@ DEPTC_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
   $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \
   $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \
-  $(INCDIR)/safe-ctype.h
+  $(INCDIR)/safe-ctype.h dwarf2dbg.h 
 DEPTC_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
   $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \
   subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \
-  $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h
+  $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h \
+  dwarf2dbg.h 
 DEPTC_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
   $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \
index 9f18f7fbdf819764d802158d473be830ea469f35..bb645a522337d0bd279a7f9be2d5b0a81de0e4a9 100644 (file)
@@ -825,13 +825,14 @@ DEPTC_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
   $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \
   $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \
   $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \
-  $(INCDIR)/safe-ctype.h
+  $(INCDIR)/safe-ctype.h dwarf2dbg.h 
 
 DEPTC_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
   $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \
   subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \
-  $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h
+  $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h \
+  dwarf2dbg.h 
 
 DEPTC_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \
   $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \
index 037a84ca2a47bcbe2bbd034250bc7cd0faf60782..280a7f6d322d53990b04d3de90db68d244d171b4 100644 (file)
 #include "as.h"
 #include "subsegs.h"
 #include "bfd.h"
+
+#ifdef BFD_ASSEMBLER
+#include "dwarf2dbg.h"
+#endif
+
 #define DEFINE_TABLE
 #define h8_opcodes ops
 #include "opcode/h8300.h"
@@ -146,6 +151,11 @@ const pseudo_typeS md_pseudo_table[] =
   {"sbranch", sbranch, L_8},
   {"lbranch", sbranch, L_16},
 
+#ifdef BFD_ASSEMBLER
+  {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
+  {"loc", dwarf2_directive_loc, 0 },
+#endif
+
   {"int", pint, 0},
   {"data.b", cons, 1},
   {"data.w", cons, 2},
@@ -1406,6 +1416,10 @@ md_assemble (str)
     }
 
   build_bytes (instruction, operand);
+
+#ifdef BFD_ASSEMBLER
+  dwarf2_emit_insn (instruction->length);
+#endif
 }
 
 #ifndef BFD_ASSEMBLER
index e09e506cd6f6aee92f2d1eba8339a33758b5d1a6..520ebafcef08d8ca6df6886ad8c07aa99a528c3a 100644 (file)
@@ -58,6 +58,9 @@ extern void tc_reloc_mangle
    visible symbols can be overridden.  */
 #define EXTERN_FORCE_RELOC 0
 
+/* Minimum instruction is of 16 bits.  */
+#define DWARF2_LINE_MIN_INSN_LENGTH 2
+
 #ifdef OBJ_ELF
 /* Provide mappings from the original H8 COFF relocation names to
    their corresponding BFD relocation names.  This allows us to use