This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Enable support for generating line debug info from GAS


Hi,

Currently source listing is not displayed by h8300-elf-as with -ahl option. 
The patch below defines DWARF2_ASM_LINE_DEBUG_INFO in GCC and enables generation of line debugging info in GAS. 

Regards,
Dhananjay

Changelog

gcc/Changelog

2003-04-23 Dhananjay Deshpande <dhananjayd at kpitcummins dot com> 
	* config/h8300/elf.h (DWARF2_ASM_LINE_DEBUG_INFO): New

===========================================================================================
--- elf.h.old	Mon Jan 27 17:33:22 2003
+++ elf.h	Wed Mar 19 10:58:20 2003
@@ -25,6 +25,9 @@
 
 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
 
+/* use a more compact format for line information */
+#define DWARF2_ASM_LINE_DEBUG_INFO 1
+
 #include "dbxelf.h"
 #include "elfos.h"
===========================================================================================
 
gas/Changelog

2003-04-23 Dhananjay Deshpande <dhananjayd at kpitcummins dot 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.

===========================================================================================
--- gas/config/tc-h8300.c.orig	2003-04-23 16:19:07.000000000 +0530
+++ gas/config/tc-h8300.c	2003-04-23 16:16:05.000000000 +0530
@@ -34,6 +34,8 @@
 #include "elf/h8.h"
 #endif
 
+#include "dwarf2dbg.h"
+
 const char comment_chars[] = ";";
 const char line_comment_chars[] = "#";
 const char line_separator_chars[] = "";
@@ -146,6 +148,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 +1413,10 @@ md_assemble (str)
     }
 
   build_bytes (instruction, operand);
+
+#ifdef BFD_ASSEMBLER
+  dwarf2_emit_insn (instruction->length);
+#endif
 }
 
 #ifndef BFD_ASSEMBLER
--- gas/config/tc-h8300.h.orig	2003-04-23 16:19:20.000000000 +0530
+++ gas/config/tc-h8300.h	2003-04-23 16:16:05.000000000 +0530
@@ -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

===========================================================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]