+2021-05-04 Mike Frysinger <vapier@gentoo.org>
+
+ * cgen-trace.c (sim_disasm_perror_memory): Use BFD_VMA_FMT and drop
+ cast.
+ * sim-load.c (xprintf_bfd_vma): Delete.
+ (sim_load_file): Delete xprintf_bfd_vma calls. Use BFD_VMA_FMT.
+
2021-05-03 Simon Marchi <simon.marchi@polymtl.ca>
* hw-events.h (hw_event_queue_schedule_tracef): Use format attribute.
/* Actually, address between memaddr and memaddr + len was
out of bounds. */
info->fprintf_func (info->stream,
- "Address 0x%x is out of bounds.",
- (int) memaddr);
+ "Address 0x%" BFD_VMA_FMT "x is out of bounds.",
+ memaddr);
}
/* Disassemble using the CGEN opcode table.
static void xprintf (host_callback *, const char *, ...);
static void report_transfer_performance
(host_callback *, unsigned long, time_t, time_t);
-static void xprintf_bfd_vma (host_callback *, bfd_vma);
/* Load program PROG into the simulator using the function DO_LOAD.
If PROG_BFD is non-NULL, the file has already been opened.
lma = bfd_section_vma (s);
if (verbose_p)
{
- xprintf (callback, "Loading section %s, size 0x%lx %s ",
+ xprintf (callback,
+ "Loading section %s, size 0x%lx %s "
+ "%" BFD_VMA_FMT "x\n",
bfd_section_name (s),
(unsigned long) size,
- (lma_p ? "lma" : "vma"));
- xprintf_bfd_vma (callback, lma);
- xprintf (callback, "\n");
+ (lma_p ? "lma" : "vma"), lma);
}
data_count += size;
bfd_get_section_contents (result_bfd, s, buffer, 0, size);
if (verbose_p)
{
end_time = time (NULL);
- xprintf (callback, "Start address ");
- xprintf_bfd_vma (callback, bfd_get_start_address (result_bfd));
- xprintf (callback, "\n");
+ xprintf (callback, "Start address %" BFD_VMA_FMT "x\n",
+ bfd_get_start_address (result_bfd));
report_transfer_performance (callback, data_count, start_time, end_time);
}
xprintf (callback, "%ld bits in <1 sec", (data_count * 8));
xprintf (callback, ".\n");
}
-
-/* Print a bfd_vma.
- This is intended to handle the vagaries of 32 vs 64 bits, etc. */
-
-static void
-xprintf_bfd_vma (host_callback *callback, bfd_vma vma)
-{
- /* FIXME: for now */
- xprintf (callback, "0x%lx", (unsigned long) vma);
-}
+2021-05-04 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_create_inferior): Use BFD_VMA_FMT and drop cast.
+
2021-05-01 Mike Frysinger <vapier@gentoo.org>
* config.in, configure: Regenerate.
start_address = 0x0;
#ifdef DEBUG
if (cr16_debug)
- sim_io_printf (sd, "sim_create_inferior: PC=0x%lx\n", (long) start_address);
+ sim_io_printf (sd, "sim_create_inferior: PC=0x%" BFD_VMA_FMT "x\n",
+ start_address);
#endif
{
SIM_CPU *cpu = STATE_CPU (sd, 0);
+2021-05-04 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-if.c (cris_load_elf_file): Use BFD_VMA_FMT
+ (cris_handle_interpreter): Likewise. Delete phaddr.
+ (sim_open): Use PRIx32.
+
2021-05-01 Mike Frysinger <vapier@gentoo.org>
* config.in, configure: Regenerate.
buf = xmalloc (phdr[i].p_filesz);
if (verbose)
- sim_io_printf (sd, "Loading segment at 0x%lx, size 0x%lx\n",
+ sim_io_printf (sd,
+ "Loading segment at 0x%" BFD_VMA_FMT "x, size 0x%lx\n",
lma, phdr[i].p_filesz);
if (bfd_seek (abfd, phdr[i].p_offset, SEEK_SET) != 0
|| (bfd_bread (buf, phdr[i].p_filesz, abfd) != phdr[i].p_filesz))
{
sim_io_eprintf (sd,
- "%s: could not read segment at 0x%lx, size 0x%lx\n",
+ "%s: could not read segment at 0x%" BFD_VMA_FMT "x, "
+ "size 0x%lx\n",
STATE_MY_NAME (sd), lma, phdr[i].p_filesz);
free (buf);
return FALSE;
if (do_write (sd, lma, buf, phdr[i].p_filesz) != phdr[i].p_filesz)
{
sim_io_eprintf (sd,
- "%s: could not load segment at 0x%lx, size 0x%lx\n",
+ "%s: could not load segment at 0x%" BFD_VMA_FMT "x, "
+ "size 0x%lx\n",
STATE_MY_NAME (sd), lma, phdr[i].p_filesz);
free (buf);
return FALSE;
cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd)
{
int i, n_hdrs;
- bfd_vma phaddr;
bfd_byte buf[4];
char *interp = NULL;
struct bfd *ibfd;
memory area, so we go via a temporary area. Luckily, the
interpreter is supposed to be small, less than 0x40000
bytes. */
- sim_do_commandf (sd, "memory region 0x%lx,0x%lx",
+ sim_do_commandf (sd, "memory region 0x%" BFD_VMA_FMT "x,0x%lx",
interp_load_addr, interpsiz);
/* Now that memory for the interpreter is defined, load it. */
/* Allocate core managed memory if none specified by user. */
if (sim_core_read_buffer (sd, NULL, read_map, &c, startmem, 1) == 0)
- sim_do_commandf (sd, "memory region 0x%lx,0x%lx", startmem,
- endmem - startmem);
+ sim_do_commandf (sd, "memory region 0x%" PRIx32 "x,0x%" PRIu32 "x",
+ startmem, endmem - startmem);
/* Allocate simulator I/O managed memory if none specified by user. */
if (cris_have_900000xxif)
+2021-05-04 Mike Frysinger <vapier@gentoo.org>
+
+ * d10v_sim.h (decode_pc): Delete.
+ * interp.c (sim_create_inferior): Use BFD_VMA_FMT.
+
2021-05-01 Mike Frysinger <vapier@gentoo.org>
* config.in, configure: Regenerate.
extern uint8 *dmem_addr (SIM_DESC, SIM_CPU *, uint16 offset);
extern uint8 *imem_addr (SIM_DESC, SIM_CPU *, uint32);
-extern bfd_vma decode_pc (void);
#define RB(x) (*(dmem_addr (sd, cpu, x)))
#define SB(addr,data) ( RB(addr) = (data & 0xff))
start_address = 0xffc0 << 2;
#ifdef DEBUG
if (d10v_debug)
- sim_io_printf (sd, "sim_create_inferior: PC=0x%lx\n", (long) start_address);
+ sim_io_printf (sd, "sim_create_inferior: PC=0x%" BFD_VMA_FMT "x\n",
+ start_address);
#endif
{
SIM_CPU *cpu = STATE_CPU (sd, 0);
+2021-05-04 Mike Frysinger <vapier@gentoo.org>
+
+ * func.c (bfd_load): Use BFD_VMA_FMT.
+
2021-05-01 Mike Frysinger <vapier@gentoo.org>
* config.in, configure: Regenerate.
section_size = bfd_section_size (section);
if (sis_verbose)
- printf("\nsection %s at 0x%08lx (0x%lx bytes)",
+ printf("\nsection %s at 0x%08" BFD_VMA_FMT "x (0x%lx bytes)",
section_name, section_address, section_size);
/* Text, data or lit */
+2021-05-04 Mike Frysinger <vapier@gentoo.org>
+
+ * load.c (m32c_load): Use BFD_VMA_FMT and drop casts.
+
2021-05-02 Mike Frysinger <vapier@gentoo.org>
* m32c.opc: Include ansidecl.h.
base = bfd_section_lma (s);
if (verbose)
- fprintf (stderr, "[load a=%08x s=%08x %s]\n",
- (int) base, (int) size, bfd_section_name (s));
+ fprintf (stderr, "[load a=%08" BFD_VMA_FMT "x s=%08x %s]\n",
+ base, (int) size, bfd_section_name (s));
buf = (char *) malloc (size);
bfd_get_section_contents (prog, s, buf, 0, size);
mem_put_blk (base, buf, size);
+2021-05-04 Mike Frysinger <vapier@gentoo.org>
+
+ * load.c (rl78_load): Use BFD_VMA_FMT and drop casts.
+
2021-05-01 Mike Frysinger <vapier@gentoo.org>
* config.in, configure: Regenerate.
base = p->p_paddr;
if (verbose > 1)
- fprintf (stderr, "[load segment: lma=%08x vma=%08x size=%08x]\n",
- (int) base, (int) p->p_vaddr, (int) size);
+ fprintf (stderr,
+ "[load segment: lma=%08" BFD_VMA_FMT "x vma=%08x "
+ "size=%08" BFD_VMA_FMT "x]\n",
+ base, (int) p->p_vaddr, size);
if (callbacks)
xprintf (callbacks,
- "Loading section %s, size %#lx lma %08lx vma %08lx\n",
- find_section_name_by_offset (prog, p->p_offset),
+ "Loading section %s, size %#" BFD_VMA_FMT "x "
+ "lma %08" BFD_VMA_FMT "x vma %08lx\n",
+ find_section_name_by_offset (prog, p->p_offset),
size, base, p->p_vaddr);
buf = xmalloc (size);
if (bfd_bread (buf, size, prog) != size)
{
- fprintf (stderr, "%s: Failed to read %lx bytes\n", simname, size);
+ fprintf (stderr, "%s: Failed to read %" BFD_VMA_FMT "x bytes\n",
+ simname, size);
continue;
}
if (base > 0xeffff || base + size > 0xeffff)
{
- fprintf (stderr, "%s, Can't load image to RAM/SFR space: 0x%lx - 0x%lx\n",
+ fprintf (stderr,
+ "%s, Can't load image to RAM/SFR space: 0x%" BFD_VMA_FMT "x "
+ "- 0x%" BFD_VMA_FMT "x\n",
simname, base, base+size);
continue;
}
+2021-05-04 Mike Frysinger <vapier@gentoo.org>
+
+ * load.c (rx_load): Use BFD_VMA_FMT and drop casts.
+
2021-05-03 Simon Marchi <simon.marchi@polymtl.ca>
* trace.c (op_printf): Likewise.
base = p->p_paddr;
if (verbose > 1)
- fprintf (stderr, "[load segment: lma=%08x vma=%08x size=%08x]\n",
- (int) base, (int) p->p_vaddr, (int) size);
+ fprintf (stderr,
+ "[load segment: lma=%08" BFD_VMA_FMT "x vma=%08x "
+ "size=%08" BFD_VMA_FMT "x]\n",
+ base, (int) p->p_vaddr, size);
if (callback)
xprintf (callback,
"Loading section %s, size %#lx lma %08lx vma %08lx\n",
}
if (bfd_bread (buf, size, prog) != size)
{
- fprintf (stderr, "Failed to read %lx bytes\n", (long) size);
+ fprintf (stderr, "Failed to read %" BFD_VMA_FMT "x bytes\n", size);
continue;
}