/* trace.c --- tracing output for the M32C simulator.
-Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
-Free Software Foundation, Inc.
+Copyright (C) 2005-2020 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of the GNU simulators.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
+#include "config.h"
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include "cpu.h"
#include "mem.h"
#include "load.h"
+#include "trace.h"
static int
sim_dis_read (bfd_vma memaddr, bfd_byte * ptr, unsigned int length,
int i;
struct stat s;
const char *found_filename, *slash;
+ FILE *file;
found_filename = filename;
while (1)
files = f;
f->filename = strdup (filename);
f->data = (char *) malloc (s.st_size + 2);
- FILE *file = fopen (found_filename, "rb");
+ file = fopen (found_filename, "rb");
fread (f->data, 1, s.st_size, file);
f->data[s.st_size] = 0;
fclose (file);
}
void
-sim_disasm_one ()
+sim_disasm_one (void)
{
static int initted = 0;
static asymbol **symtab = 0;
if (s->flags & SEC_CODE || code_section == 0)
{
code_section = s;
- code_base = bfd_section_lma (current_bfd, s);
+ code_base = bfd_section_lma (s);
break;
}
}