aboutsummaryrefslogtreecommitdiff
path: root/sim/d10v
diff options
context:
space:
mode:
authorMichael Meissner <gnu@the-meissners.org>1996-09-19 15:02:27 +0000
committerMichael Meissner <gnu@the-meissners.org>1996-09-19 15:02:27 +0000
commit891513ee79ba7470f3eae78955b5b9c7c4631dda (patch)
tree935c4cc2ebdf5d6c8c78909f8f4367017625b528 /sim/d10v
parent74473ea10c76f56c73c1cc52bf10005dc92e3897 (diff)
downloadgdb-891513ee79ba7470f3eae78955b5b9c7c4631dda.zip
gdb-891513ee79ba7470f3eae78955b5b9c7c4631dda.tar.gz
gdb-891513ee79ba7470f3eae78955b5b9c7c4631dda.tar.bz2
Provide macros that can be overriden for the width of the PC & line number fields
Diffstat (limited to 'sim/d10v')
-rw-r--r--sim/d10v/ChangeLog3
-rw-r--r--sim/d10v/simops.c27
2 files changed, 24 insertions, 6 deletions
diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog
index 9dd536e..eb4c41a 100644
--- a/sim/d10v/ChangeLog
+++ b/sim/d10v/ChangeLog
@@ -1,5 +1,8 @@
Thu Sep 19 10:30:22 1996 Michael Meissner <meissner@tiktok.cygnus.com>
+ * simops.c (SIZE_{PC,LINE_NUMBER}): New default sizes for output.
+ (trace_input_func): Use them.
+
* Makefile.in (run): Add dependencies on libbfd.a and
libiberity.a.
diff --git a/sim/d10v/simops.c b/sim/d10v/simops.c
index ae8477d..9bfd52d 100644
--- a/sim/d10v/simops.c
+++ b/sim/d10v/simops.c
@@ -67,6 +67,14 @@ extern bfd *exec_bfd;
#define SIZE_LOCATION 20
#endif
+#ifndef SIZE_PC
+#define SIZE_PC 6
+#endif
+
+#ifndef SIZE_LINE_NUMBER
+#define SIZE_LINE_NUMBER 4
+#endif
+
static void
trace_input_func (name, in1, in2, in3)
char *name;
@@ -103,13 +111,13 @@ trace_input_func (name, in1, in2, in3)
if ((d10v_debug & DEBUG_LINE_NUMBER) == 0)
(*d10v_callback->printf_filtered) (d10v_callback,
- "0x%.6x %s: %-*s",
- (unsigned)PC, type,
+ "0x%.*x %s: %-*s",
+ SIZE_PC, (unsigned)PC,
+ type,
SIZE_INSTRUCTION, name);
else
{
- buf[0] = '\0';
if (!init_text_p)
{
init_text_p = 1;
@@ -123,6 +131,7 @@ trace_input_func (name, in1, in2, in3)
}
}
+ buf[0] = '\0';
byte_pc = (bfd_vma)PC << 2;
if (text && byte_pc >= text_start && byte_pc < text_end)
{
@@ -135,9 +144,14 @@ trace_input_func (name, in1, in2, in3)
p = buf;
if (linenumber)
{
- sprintf (p, "#%-4d ", linenumber);
+ sprintf (p, "#%-*d ", SIZE_LINE_NUMBER, linenumber);
p += strlen (p);
}
+ else
+ {
+ sprintf (p, "%-*s ", SIZE_LINE_NUMBER+1, "---");
+ p += SIZE_LINE_NUMBER+2;
+ }
if (functionname)
{
@@ -157,8 +171,9 @@ trace_input_func (name, in1, in2, in3)
}
(*d10v_callback->printf_filtered) (d10v_callback,
- "0x%.6x %s: %-*.*s %-*s",
- (unsigned)PC, type,
+ "0x%.*x %s: %-*.*s %-*s",
+ SIZE_PC, (unsigned)PC,
+ type,
SIZE_LOCATION, SIZE_LOCATION, buf,
SIZE_INSTRUCTION, name);
}