summary refs log tree commit diff
path: root/pkgs/development/tools/misc/gdb/32-bit-BFD_VMA-format.patch
blob: 41ce4540d2ddc87a4ff585a7311ff42fff52e204 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Fix iWerror=format build for 32-bit systems.
https://sourceware.org/pipermail/gdb-patches/2022-May/189288.html
--- a/sim/cris/sim-if.c
+++ b/sim/cris/sim-if.c
@@ -257,7 +257,8 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write)
 
       if (verbose)
 	sim_io_printf (sd,
-		       "Loading segment at 0x%" BFD_VMA_FMT "x, size 0x%lx\n",
+		       "Loading segment at 0x%" BFD_VMA_FMT "x, "
+		       "size 0x%" BFD_VMA_FMT "x\n",
 		       lma, phdr[i].p_filesz);
 
       if (bfd_seek (abfd, phdr[i].p_offset, SEEK_SET) != 0
@@ -265,7 +266,7 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write)
 	{
 	  sim_io_eprintf (sd,
 			  "%s: could not read segment at 0x%" BFD_VMA_FMT "x, "
-			  "size 0x%lx\n",
+			  "size 0x%" BFD_VMA_FMT "x\n",
 			  STATE_MY_NAME (sd), lma, phdr[i].p_filesz);
 	  free (buf);
 	  return FALSE;
@@ -275,7 +276,7 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write)
 	{
 	  sim_io_eprintf (sd,
 			  "%s: could not load segment at 0x%" BFD_VMA_FMT "x, "
-			  "size 0x%lx\n",
+			  "size 0x%" BFD_VMA_FMT "x\n",
 			  STATE_MY_NAME (sd), lma, phdr[i].p_filesz);
 	  free (buf);
 	  return FALSE;
@@ -572,7 +573,8 @@ cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd)
 	 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%" BFD_VMA_FMT "x,0x%lx",
+      sim_do_commandf (sd, "memory region 0x%" BFD_VMA_FMT "x,"
+		       "0x%" BFD_VMA_FMT "x",
 		       interp_load_addr, interpsiz);
 
       /* Now that memory for the interpreter is defined, load it.  */
--- a/sim/m32c/syscalls.c
+++ b/sim/m32c/syscalls.c
@@ -299,8 +299,8 @@ m32c_syscall (int id)
 
 	rv = gettimeofday (&tv, 0);
 	if (trace)
-	  printf ("gettimeofday: %ld sec %ld usec to 0x%x\n", tv.tv_sec,
-		  tv.tv_usec, tvaddr);
+	  printf ("gettimeofday: %lld sec %lld usec to 0x%x\n",
+		  (long long)tv.tv_sec, (long long)tv.tv_usec, tvaddr);
 	mem_put_si (tvaddr, tv.tv_sec);
 	mem_put_si (tvaddr + 4, tv.tv_usec);
 	put_reg (r0, rv);
--- a/sim/rx/syscalls.c
+++ b/sim/rx/syscalls.c
@@ -270,8 +270,8 @@ rx_syscall (int id)
 
 	rv = gettimeofday (&tv, 0);
 	if (trace)
-	  printf ("gettimeofday: %ld sec %ld usec to 0x%x\n", tv.tv_sec,
-		  tv.tv_usec, tvaddr);
+	  printf ("gettimeofday: %lld sec %lld usec to 0x%x\n",
+		  (long long)tv.tv_sec, (long long)tv.tv_usec, tvaddr);
 	mem_put_si (tvaddr, tv.tv_sec);
 	mem_put_si (tvaddr + 4, tv.tv_usec);
 	put_reg (1, rv);