aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-05-12 06:16:30 +0000
committerAlexandre Oliva <aoliva@redhat.com>2000-05-12 06:16:30 +0000
commite8b1cae53336a5b1fe005f05648cf1834d08726e (patch)
treee366eb4a729c7ff7f89d5f795f376ca603076250 /gas/config
parent9ee25201320def96d425eb8ac3d93aa2a61928d1 (diff)
downloadgdb-e8b1cae53336a5b1fe005f05648cf1834d08726e.zip
gdb-e8b1cae53336a5b1fe005f05648cf1834d08726e.tar.gz
gdb-e8b1cae53336a5b1fe005f05648cf1834d08726e.tar.bz2
* 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.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-mn10300.c27
-rw-r--r--gas/config/tc-mn10300.h5
2 files changed, 31 insertions, 1 deletions
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index 3514f9f..30b4139 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -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 @@ struct reg_name
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 @@ size_t md_longopts_size = sizeof(md_longopts);
/* 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 @@ keep_going:
}
}
}
+
+ 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);
+ }
}
@@ -1999,3 +2019,10 @@ 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 ffcb227..011259f 100644
--- a/gas/config/tc-mn10300.h
+++ b/gas/config/tc-mn10300.h
@@ -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));