Broken build: rs6000-tdep.c: 32-bit host --enable-targets=all --enable-64-bit-bfd [Re: [PATCH 2/3 v4] Process record support for PowerPC]

Message ID 54BB3AC2.6050507@gmail.com
State New, archived
Headers

Commit Message

Wei-cheng, Wang Jan. 18, 2015, 4:46 a.m. UTC
  On 2015/1/18 上午 05:20, Jan Kratochvil wrote:> On Sat, 17 Jan 2015 19:53:42 +0100, Joel Brobecker wrote:
 > cc1: all warnings being treated as errors
 > Makefile:1112: recipe for target 'rs6000-tdep.o' failed

Hi,

Here is the fix.  Ok to commit?

2015-01-18  Wei-cheng Wang  <cole945@gmail.com>

	* rs6000-tdep.c (ppc_process_record_op4, ppc_process_record_op19,
	ppc_process_record_op31, ppc_process_record_op59,
	ppc_process_record_op60, ppc_process_record_op63,
	ppc_process_record): Fix -Wformat warning.
	* rs6000-tdep.c (rs6000_epilogue_frame_cache, ppc_process_record_op60):
	Remove unused variables.
  

Comments

Jan Kratochvil Jan. 18, 2015, 6:59 a.m. UTC | #1
On Sun, 18 Jan 2015 05:46:58 +0100, Wei-cheng Wang wrote:
> Here is the fix.  Ok to commit?
[...]
> +  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %08x "
> +		      "at 0x%lx, 4-%d.\n", insn, (unsigned long) addr, ext);

That AFAIK does not work on 64-bit MS-Windows where CORE_ADDR is 64-bit but
long is 32-bit there.

GDB has paddress(), core_addr_to_string() and hex_string() instead while the
codebase uses these three interchangeably.  But the codebase uses even the
%lx+long form.


Jan
  

Patch

diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 75811d1..0e3c941 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -3356,7 +3356,6 @@  rs6000_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
    struct rs6000_frame_cache *cache;
    struct gdbarch *gdbarch = get_frame_arch (this_frame);
    struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-  CORE_ADDR sp;

    if (*this_cache)
      return *this_cache;
@@ -3957,8 +3956,8 @@  ppc_process_record_op4 (struct gdbarch *gdbarch, struct regcache *regcache,
        return 0;
      }

-  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record "
-		      "%08x at %08lx, 4-%d.\n", insn, addr, ext);
+  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %08x "
+		      "at 0x%lx, 4-%d.\n", insn, (unsigned long) addr, ext);
    return -1;
  }

@@ -4000,8 +3999,8 @@  ppc_process_record_op19 (struct gdbarch *gdbarch, struct regcache *regcache,
        return 0;
      }

-  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record "
-		      "%08x at %08lx, 19-%d.\n", insn, addr, ext);
+  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %08x "
+		      "at 0x%lx, 19-%d.\n", insn, (unsigned long) addr, ext);
    return -1;
  }

@@ -4458,7 +4457,8 @@  ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache,
      case 878:		/* Transaction Abort Doubleword Conditional Immediate */
      case 910:		/* Transaction Abort */
        fprintf_unfiltered (gdb_stdlog, "Cannot record Transaction instructions. "
-			  "%08x at %08lx, 31-%d.\n", insn, addr, ext);
+			  "%08x at 0x%lx, 31-%d.\n",
+			  insn, (unsigned long) addr, ext);
        return -1;

      case 1014:		/* Data Cache Block set to Zero */
@@ -4477,8 +4477,8 @@  ppc_process_record_op31 (struct gdbarch *gdbarch, struct regcache *regcache,
      }

  UNKNOWN_OP:
-  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record "
-		      "%08x at %08lx, 31-%d.\n", insn, addr, ext);
+  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %08x "
+		      "at 0x%lx, 31-%d.\n", insn, (unsigned long) addr, ext);
    return -1;
  }

@@ -4569,8 +4569,8 @@  ppc_process_record_op59 (struct gdbarch *gdbarch, struct regcache *regcache,
        return 0;
      }

-  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record "
-		      "%08x at %08lx, 59-%d.\n", insn, addr, ext);
+  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %08x "
+		      "at 0x%lx, 59-%d.\n", insn, (unsigned long) addr, ext);
    return -1;
  }

@@ -4582,7 +4582,6 @@  ppc_process_record_op60 (struct gdbarch *gdbarch, struct regcache *regcache,
  {
    struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
    int ext = PPC_EXTOP (insn);
-  int tmp;

    switch (ext >> 2)
      {
@@ -4852,8 +4851,8 @@  ppc_process_record_op60 (struct gdbarch *gdbarch, struct regcache *regcache,
        return 0;
      }

-  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record "
-		      "%08x at %08lx, 60-%d.\n", insn, addr, ext);
+  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %08x "
+		      "at 0x%lx, 60-%d.\n", insn, (unsigned long) addr, ext);
    return -1;
  }

@@ -5018,8 +5017,8 @@  ppc_process_record_op63 (struct gdbarch *gdbarch, struct regcache *regcache,

      }

-  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record "
-		      "%08x at %08lx, 59-%d.\n", insn, addr, ext);
+  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %08x "
+		      "at 0x%lx, 59-%d.\n", insn, (unsigned long) addr, ext);
    return -1;
  }

@@ -5298,8 +5297,8 @@  ppc_process_record (struct gdbarch *gdbarch, struct regcache *regcache,

      default:
  UNKNOWN_OP:
-      fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record "
-			  "%08x at %08lx, %d.\n", insn, addr, op6);
+      fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %08x "
+			  "at 0x%lx, %d.\n", insn, (unsigned long) addr, op6);
        return -1;
      }