This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Enable Dwarf2 debugging info support for mn10300
- To: binutils at sourceware dot cygnus dot com
- Subject: Enable Dwarf2 debugging info support for mn10300
- From: Alexandre Oliva <aoliva at cygnus dot com>
- Date: 12 May 2000 03:13:25 -0300
- Organization: Cygnus Solutions, a Red Hat Company
I'm checking this in, approved by Jeff Law. Ok for the release branch
too? It would probably be a good idea, given that, in a couple of
minutes, the GCC CVS tree won't build with --target=mn10300-elf
without this patch.
Index: gas/ChangeLog
from Alexandre Oliva <aoliva@cygnus.com>
* config/tc-mn10300.h (md_end): Define.
(mn10300_finalize): Declare.
* config/tc-mn10300.c: Include dwarf2dbg.h.
(debug_line): Define.
(md_assemble): Generate dwarf2 line info.
(mn10300_finalize): New function. Finalize dwarf2 info.
Index: gas/config/tc-mn10300.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mn10300.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 tc-mn10300.h
--- gas/config/tc-mn10300.h 1999/05/03 07:28:43 1.1.1.1
+++ gas/config/tc-mn10300.h 2000/05/12 06:07:14
@@ -1,5 +1,5 @@
/* tc-mn10300.h -- Header file for tc-mn10300.c.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -48,3 +48,6 @@
/* We do relaxing in the assembler as well as the linker. */
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));
Index: gas/config/tc-mn10300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mn10300.c,v
retrieving revision 1.5
diff -u -r1.5 tc-mn10300.c
--- gas/config/tc-mn10300.c 2000/04/20 22:18:27 1.5
+++ gas/config/tc-mn10300.c 2000/05/12 06:07:14
@@ -23,6 +23,7 @@
#include "as.h"
#include "subsegs.h"
#include "opcode/mn10300.h"
+#include "dwarf2dbg.h"
/* Structure to hold information about predefined registers. */
struct reg_name
@@ -31,6 +32,8 @@
int value;
};
+struct dwarf2_line_info debug_line;
+
/* Generic assembler global variables which must be defined by all targets. */
/* Characters which always start a comment. */
@@ -118,6 +121,8 @@
/* The target specific pseudo-ops which we support. */
const pseudo_typeS md_pseudo_table[] =
{
+ { "file", dwarf2_directive_file },
+ { "loc", dwarf2_directive_loc },
{ "am30", set_arch_mach, AM30 },
{ "am33", set_arch_mach, AM33 },
{ "mn10300", set_arch_mach, MN103 },
@@ -1745,6 +1750,21 @@
}
}
}
+
+ if (debug_type == DEBUG_DWARF2)
+ {
+ bfd_vma addr;
+
+ /* 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);
+ }
}
@@ -1998,4 +2018,11 @@
as_warn (_("could not set architecture and machine"));
current_machine = mach;
+}
+
+void
+mn10300_finalize ()
+{
+ if (debug_type == DEBUG_DWARF2)
+ dwarf2_finish ();
}
--
Alexandre Oliva Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me