aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2000-11-15 19:22:22 +0000
committerDJ Delorie <dj@redhat.com>2000-11-15 19:22:22 +0000
commita8761a19f49de4a9997e094ce8f65e2bb501679e (patch)
treeefb3e1e09ba8ef131d419e3a6844d718c1ea9366 /gas/config
parent296731c177fcab2fb6dd5ca4d0a308a47b67fc86 (diff)
downloadgdb-a8761a19f49de4a9997e094ce8f65e2bb501679e.zip
gdb-a8761a19f49de4a9997e094ce8f65e2bb501679e.tar.gz
gdb-a8761a19f49de4a9997e094ce8f65e2bb501679e.tar.bz2
* config/tc-v850.c: Support dwarf2.
* config/tc-v850.h: Ditto. * config/tc-v850.c (cons_fix_new_v850): Don't rely on parse_cons_expression_v850 to initialize hold_cons_reloc.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-v850.c23
-rw-r--r--gas/config/tc-v850.h5
2 files changed, 26 insertions, 2 deletions
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index f7360c7..74b0c0e 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -1,5 +1,5 @@
/* tc-v850.c -- Assembler code for the NEC V850
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation.
This file is part of GAS, the GNU Assembler.
@@ -23,6 +23,7 @@
#include "as.h"
#include "subsegs.h"
#include "opcode/v850.h"
+#include "dwarf2dbg.h"
#define AREA_ZDA 0
#define AREA_SDA 1
@@ -32,7 +33,7 @@
#define SEXT16(x) ((((x) & 0xffff) ^ (~0x7fff)) + 0x8000)
/* Temporarily holds the reloc in a cons expression. */
-static bfd_reloc_code_real_type hold_cons_reloc;
+static bfd_reloc_code_real_type hold_cons_reloc = BFD_RELOC_UNUSED;
/* Set to TRUE if we want to be pedantic about signed overflows. */
static boolean warn_signed_overflows = FALSE;
@@ -607,6 +608,8 @@ const pseudo_typeS md_pseudo_table[] =
{"call_table_text", v850_call_table_text, 0},
{"v850e", set_machine, bfd_mach_v850e},
{"v850ea", set_machine, bfd_mach_v850ea},
+ {"file", dwarf2_directive_file },
+ {"loc", dwarf2_directive_loc },
{ NULL, NULL, 0}
};
@@ -1708,6 +1711,7 @@ md_assemble (str)
int relaxable = 0;
unsigned long insn;
unsigned long insn_size;
+ unsigned long total_insn_size = 0;
char *f;
int i;
int match;
@@ -2183,6 +2187,7 @@ md_assemble (str)
md_number_to_chars (f, insn, insn_size);
md_number_to_chars (f + 2, 0, 4);
}
+ total_insn_size = insn_size;
}
else
{
@@ -2197,12 +2202,14 @@ md_assemble (str)
insn_size = 2;
f = frag_more (insn_size);
+ total_insn_size = insn_size;
md_number_to_chars (f, insn, insn_size);
if (extra_data_after_insn)
{
f = frag_more (extra_data_len);
+ total_insn_size += extra_data_len;
md_number_to_chars (f, extra_data, extra_data_len);
@@ -2276,6 +2283,9 @@ md_assemble (str)
}
input_line_pointer = saved_input_line_pointer;
+
+ if (debug_type == DEBUG_DWARF2)
+ dwarf2_generate_asm_lineno (total_insn_size);
}
/* If while processing a fixup, a reloc really needs to be created
@@ -2489,6 +2499,8 @@ cons_fix_new_v850 (frag, where, size, exp)
fix_new_exp (frag, where, size, exp, 0, hold_cons_reloc);
else
fix_new (frag, where, size, NULL, 0, 0, hold_cons_reloc);
+
+ hold_cons_reloc = BFD_RELOC_UNUSED;
}
boolean
@@ -2531,3 +2543,10 @@ v850_force_relocation (fixP)
return 0;
}
+
+void
+v850_finalize ()
+{
+ if (debug_type == DEBUG_DWARF2)
+ dwarf2_finish ();
+}
diff --git a/gas/config/tc-v850.h b/gas/config/tc-v850.h
index d26d906..2347bc9 100644
--- a/gas/config/tc-v850.h
+++ b/gas/config/tc-v850.h
@@ -89,3 +89,8 @@ extern const struct relax_type md_relax_table[];
#define MD_PCREL_FROM_SECTION(fixP,section) v850_pcrel_from_section (fixP, section)
extern long v850_pcrel_from_section ();
+
+#define md_end() v850_finalize ()
+extern void v850_finalize PARAMS ((void));
+
+#define DWARF2_LINE_MIN_INSN_LENGTH 2