forked from Imagelibrary/binutils-gdb
Don't bother generating trace prefix string when not tracing.
This commit is contained in:
@@ -1,3 +1,18 @@
|
|||||||
|
Sat Apr 4 01:07:06 1998 Andrew Cagney <cagney@b1.cygnus.com>
|
||||||
|
|
||||||
|
* sim-trace.c (set_trace_option_mask): Keep TRACE_ANY_P
|
||||||
|
up-to-date.
|
||||||
|
|
||||||
|
* sim-trace.h (TRACE_ANY_P): Define.
|
||||||
|
(struct _trace_data): Add trace_any_p.
|
||||||
|
|
||||||
|
start-sanitize-sky
|
||||||
|
Tue Mar 31 16:44:15 1998 Jim Lemke <jlemke@cygnus.com>
|
||||||
|
|
||||||
|
* sim-base.h: Add fp_type_opt etc to sim_state_base for
|
||||||
|
the global option "float_type".
|
||||||
|
|
||||||
|
end-sanitize-sky
|
||||||
Mon Mar 30 17:11:55 1998 Andrew Cagney <cagney@b1.cygnus.com>
|
Mon Mar 30 17:11:55 1998 Andrew Cagney <cagney@b1.cygnus.com>
|
||||||
|
|
||||||
* run.c (main): Handle all alternatives of enum sim_stop.
|
* run.c (main): Handle all alternatives of enum sim_stop.
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
Sat Apr 4 02:15:35 1998 Andrew Cagney <cagney@b1.cygnus.com>
|
||||||
|
|
||||||
|
* igen.c (print_itrace): Use TRACE_ANY_P macro to determine if any
|
||||||
|
tracing is needed.
|
||||||
|
|
||||||
|
Thu Mar 26 20:51:23 1998 Stu Grossman <grossman@bhuna.cygnus.co.uk>
|
||||||
|
|
||||||
|
* table.c (table_push): Redo, using stdio. Fixes NT native
|
||||||
|
problem with <CRLF>=><LF> translation...
|
||||||
|
|
||||||
Tue Mar 24 23:30:07 1998 Andrew Cagney <cagney@b1.cygnus.com>
|
Tue Mar 24 23:30:07 1998 Andrew Cagney <cagney@b1.cygnus.com>
|
||||||
|
|
||||||
* gen-engine.c (print_run_body): Re-extract the CIA after
|
* gen-engine.c (print_run_body): Re-extract the CIA after
|
||||||
|
|||||||
191
sim/igen/igen.c
191
sim/igen/igen.c
@@ -1,6 +1,6 @@
|
|||||||
/* This file is part of the program psim.
|
/* This file is part of the program psim.
|
||||||
|
|
||||||
Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
|
Copyright (C) 1994-1998, Andrew Cagney <cagney@highland.com.au>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -333,18 +333,15 @@ print_my_defines (lf *file,
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
print_itrace_prefix (lf *file,
|
print_itrace_prefix (lf *file)
|
||||||
const char *phase_lc)
|
|
||||||
{
|
{
|
||||||
const char *prefix = "trace_one_insn (";
|
const char *prefix = "trace_prefix (";
|
||||||
int indent = strlen (prefix);
|
int indent = strlen (prefix);
|
||||||
lf_printf (file, "%sSD, CPU, %s, TRACE_LINENUM_P (CPU), \\\n",
|
lf_printf (file, "%sSD, CPU, cia, CIA, TRACE_LINENUM_P (CPU), \\\n", prefix);
|
||||||
prefix, (options.gen.delayed_branch ? "cia.ip" : "cia"));
|
|
||||||
lf_indent (file, +indent);
|
lf_indent (file, +indent);
|
||||||
lf_printf (file, "%sitable[MY_INDEX].file, \\\n", options.prefix.itable.name);
|
lf_printf (file, "%sitable[MY_INDEX].file, \\\n", options.prefix.itable.name);
|
||||||
lf_printf (file, "%sitable[MY_INDEX].line_nr, \\\n", options.prefix.itable.name);
|
lf_printf (file, "%sitable[MY_INDEX].line_nr, \\\n", options.prefix.itable.name);
|
||||||
lf_printf (file, "\"%s\", \\\n", phase_lc);
|
lf_printf (file, "\"");
|
||||||
lf_printf (file, "\"%%-18s - ");
|
|
||||||
return indent;
|
return indent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,12 +357,6 @@ print_itrace_format (lf *file,
|
|||||||
{
|
{
|
||||||
const char *chp = assembler->format;
|
const char *chp = assembler->format;
|
||||||
chp++; /* skip the leading quote */
|
chp++; /* skip the leading quote */
|
||||||
/* prefix the format with the insn `name' */
|
|
||||||
if (pass == 2)
|
|
||||||
{
|
|
||||||
lf_printf (file, ", \\\n");
|
|
||||||
lf_printf (file, "%sitable[MY_INDEX].name", options.prefix.itable.name);
|
|
||||||
}
|
|
||||||
/* write out the format/args */
|
/* write out the format/args */
|
||||||
while (*chp != '\0')
|
while (*chp != '\0')
|
||||||
{
|
{
|
||||||
@@ -485,78 +476,82 @@ print_itrace (lf *file,
|
|||||||
insn_entry *insn,
|
insn_entry *insn,
|
||||||
int idecode)
|
int idecode)
|
||||||
{
|
{
|
||||||
/* NB: Here we escape each eoln. This is so that the the compiler
|
/* NB: Here we escape each EOLN. This is so that the the compiler
|
||||||
treats a trace function call as a single line. Consequently any
|
treats a trace function call as a single line. Consequently any
|
||||||
errors in the line are refered back to the same igen assembler
|
errors in the line are refered back to the same igen assembler
|
||||||
source line */
|
source line */
|
||||||
const char *phase = (idecode) ? "DECODE" : "INSN";
|
const char *phase = (idecode) ? "DECODE" : "INSN";
|
||||||
const char *phase_lc = (idecode) ? "decode" : "insn";
|
|
||||||
lf_printf (file, "\n");
|
lf_printf (file, "\n");
|
||||||
lf_indent_suppress (file);
|
lf_indent_suppress (file);
|
||||||
lf_printf (file, "#if defined (WITH_TRACE)\n");
|
lf_printf (file, "#if defined (WITH_TRACE)\n");
|
||||||
lf_printf (file, "/* trace the instructions execution if enabled */\n");
|
lf_printf (file, "/* generate a trace prefix if any tracing enabled */\n");
|
||||||
lf_printf (file, "if (TRACE_%s_P (CPU))\n", phase);
|
lf_printf (file, "if (TRACE_ANY_P (CPU))\n");
|
||||||
if (insn->mnemonics != NULL)
|
lf_printf (file, " {\n");
|
||||||
{
|
lf_indent (file, +4);
|
||||||
insn_mnemonic_entry *assembler = insn->mnemonics;
|
{
|
||||||
int is_first = 1;
|
if (insn->mnemonics != NULL)
|
||||||
lf_printf (file, " {\n");
|
{
|
||||||
lf_indent (file, +4);
|
insn_mnemonic_entry *assembler = insn->mnemonics;
|
||||||
do
|
int is_first = 1;
|
||||||
{
|
do
|
||||||
if (assembler->condition != NULL)
|
{
|
||||||
{
|
if (assembler->condition != NULL)
|
||||||
int indent;
|
{
|
||||||
lf_printf (file, "%sif (%s)\n",
|
int indent;
|
||||||
is_first ? "" : "else ",
|
lf_printf (file, "%sif (%s)\n",
|
||||||
assembler->condition);
|
is_first ? "" : "else ",
|
||||||
lf_indent (file, +2);
|
assembler->condition);
|
||||||
lf_print__line_ref (file, assembler->line);
|
lf_indent (file, +2);
|
||||||
indent = print_itrace_prefix (file, phase_lc);
|
lf_print__line_ref (file, assembler->line);
|
||||||
print_itrace_format (file, assembler);
|
indent = print_itrace_prefix (file);
|
||||||
lf_print__internal_ref (file);
|
print_itrace_format (file, assembler);
|
||||||
lf_indent (file, -indent);
|
lf_print__internal_ref (file);
|
||||||
lf_indent (file, -2);
|
lf_indent (file, -indent);
|
||||||
if (assembler->next == NULL)
|
|
||||||
error (assembler->line, "Missing final unconditional assembler\n");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int indent;
|
|
||||||
if (!is_first)
|
|
||||||
{
|
|
||||||
lf_printf (file, "else\n");
|
|
||||||
lf_indent (file, +2);
|
|
||||||
}
|
|
||||||
lf_print__line_ref (file, assembler->line);
|
|
||||||
indent = print_itrace_prefix (file, phase_lc);
|
|
||||||
print_itrace_format (file, assembler);
|
|
||||||
lf_print__internal_ref (file);
|
|
||||||
lf_indent (file, -indent);
|
|
||||||
if (!is_first)
|
|
||||||
lf_indent (file, -2);
|
lf_indent (file, -2);
|
||||||
if (assembler->next != NULL)
|
if (assembler->next == NULL)
|
||||||
error (assembler->line, "Unconditional assembler is not last\n");
|
error (assembler->line, "Missing final unconditional assembler\n");
|
||||||
}
|
}
|
||||||
is_first = 0;
|
else
|
||||||
assembler = assembler->next;
|
{
|
||||||
}
|
int indent;
|
||||||
while (assembler != NULL);
|
if (!is_first)
|
||||||
lf_indent (file, -4);
|
{
|
||||||
lf_printf (file, " }\n");
|
lf_printf (file, "else\n");
|
||||||
}
|
lf_indent (file, +2);
|
||||||
else
|
}
|
||||||
{
|
lf_print__line_ref (file, assembler->line);
|
||||||
int indent;
|
indent = print_itrace_prefix (file);
|
||||||
lf_indent (file, +2);
|
print_itrace_format (file, assembler);
|
||||||
lf_print__line_ref (file, insn->line);
|
lf_print__internal_ref (file);
|
||||||
indent = print_itrace_prefix (file, phase_lc);
|
lf_indent (file, -indent);
|
||||||
lf_printf (file, "?\", \\\n");
|
if (!is_first)
|
||||||
lf_printf (file, "itable[MY_INDEX].name);\n");
|
lf_indent (file, -2);
|
||||||
lf_print__internal_ref (file);
|
if (assembler->next != NULL)
|
||||||
lf_indent (file, -indent);
|
error (assembler->line, "Unconditional assembler is not last\n");
|
||||||
lf_indent (file, -2);
|
}
|
||||||
}
|
is_first = 0;
|
||||||
|
assembler = assembler->next;
|
||||||
|
}
|
||||||
|
while (assembler != NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int indent;
|
||||||
|
lf_indent (file, +2);
|
||||||
|
lf_print__line_ref (file, insn->line);
|
||||||
|
indent = print_itrace_prefix (file);
|
||||||
|
lf_printf (file, "%%s\", \\\n");
|
||||||
|
lf_printf (file, "itable[MY_INDEX].name);\n");
|
||||||
|
lf_print__internal_ref (file);
|
||||||
|
lf_indent (file, -indent);
|
||||||
|
lf_indent (file, -2);
|
||||||
|
}
|
||||||
|
lf_printf (file, "/* trace the instruction execution if enabled */\n");
|
||||||
|
lf_printf (file, "if (TRACE_%s_P (CPU))\n", phase);
|
||||||
|
lf_printf (file, " trace_generic (SD, CPU, TRACE_%s_IDX, \" %%s\", itable[MY_INDEX].name);\n", phase);
|
||||||
|
}
|
||||||
|
lf_indent (file, -4);
|
||||||
|
lf_printf (file, " }\n");
|
||||||
lf_indent_suppress (file);
|
lf_indent_suppress (file);
|
||||||
lf_printf (file, "#endif\n");
|
lf_printf (file, "#endif\n");
|
||||||
}
|
}
|
||||||
@@ -786,16 +781,12 @@ gen_idecode_h (lf *file,
|
|||||||
gen_list *entry;
|
gen_list *entry;
|
||||||
for (entry = gen->tables; entry != NULL; entry = entry->next)
|
for (entry = gen->tables; entry != NULL; entry = entry->next)
|
||||||
{
|
{
|
||||||
if (entry->model != NULL)
|
print_idecode_issue_function_header (file,
|
||||||
print_idecode_issue_function_header (file,
|
(options.gen.multi_sim
|
||||||
entry->model->name,
|
? entry->model->name
|
||||||
is_function_declaration,
|
: NULL),
|
||||||
1/*ALWAYS ONE WORD*/);
|
is_function_declaration,
|
||||||
else
|
1/*ALWAYS ONE WORD*/);
|
||||||
print_idecode_issue_function_header (file,
|
|
||||||
NULL,
|
|
||||||
is_function_declaration,
|
|
||||||
1/*ALWAYS ONE WORD*/);
|
|
||||||
}
|
}
|
||||||
if (options.gen.multi_sim)
|
if (options.gen.multi_sim)
|
||||||
{
|
{
|
||||||
@@ -838,16 +829,12 @@ gen_idecode_c (lf *file,
|
|||||||
/* output the main idecode routine */
|
/* output the main idecode routine */
|
||||||
if (!options.gen.icache)
|
if (!options.gen.icache)
|
||||||
{
|
{
|
||||||
if (entry->model != NULL)
|
print_idecode_issue_function_header (file,
|
||||||
print_idecode_issue_function_header (file,
|
(options.gen.multi_sim
|
||||||
entry->model->name,
|
? entry->model->name
|
||||||
1/*is definition*/,
|
: NULL),
|
||||||
1/*ALWAYS ONE WORD*/);
|
1/*is definition*/,
|
||||||
else
|
1/*ALWAYS ONE WORD*/);
|
||||||
print_idecode_issue_function_header (file,
|
|
||||||
NULL,
|
|
||||||
1/*is definition*/,
|
|
||||||
1/*ALWAYS ONE WORD*/);
|
|
||||||
lf_printf (file, "{\n");
|
lf_printf (file, "{\n");
|
||||||
lf_indent (file, +2);
|
lf_indent (file, +2);
|
||||||
lf_printf (file, "%sinstruction_address nia;\n",
|
lf_printf (file, "%sinstruction_address nia;\n",
|
||||||
@@ -1057,7 +1044,9 @@ main (int argc,
|
|||||||
printf (" -Werror\n");
|
printf (" -Werror\n");
|
||||||
printf ("\t Make warnings errors\n");
|
printf ("\t Make warnings errors\n");
|
||||||
printf (" -Wnodiscard\n");
|
printf (" -Wnodiscard\n");
|
||||||
printf ("\t Suppress warnings about discarded instructions\n");
|
printf ("\t Suppress warnings about discarded functions and instructions\n");
|
||||||
|
printf (" -Wnowidth\n");
|
||||||
|
printf ("\t Suppress warnings about instructions with invalid widths\n");
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
printf (" -G [!]<gen-option>\n");
|
printf (" -G [!]<gen-option>\n");
|
||||||
printf ("\t Any of the following options:\n");
|
printf ("\t Any of the following options:\n");
|
||||||
@@ -1266,6 +1255,10 @@ main (int argc,
|
|||||||
options.warn.discard = 0;
|
options.warn.discard = 0;
|
||||||
else if (strcmp (optarg, "discard") == 0)
|
else if (strcmp (optarg, "discard") == 0)
|
||||||
options.warn.discard = 1;
|
options.warn.discard = 1;
|
||||||
|
else if (strcmp (optarg, "nowidth") == 0)
|
||||||
|
options.warn.width = 0;
|
||||||
|
else if (strcmp (optarg, "width") == 0)
|
||||||
|
options.warn.width = 1;
|
||||||
else
|
else
|
||||||
error (NULL, "Unknown -W argument `%s'\n", optarg);
|
error (NULL, "Unknown -W argument `%s'\n", optarg);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user