mips-tdep.c: Wrong signness for local holding PC register.
authorPedro Alves <palves@redhat.com>
Fri, 19 Apr 2013 15:21:24 +0000 (15:21 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 19 Apr 2013 15:21:24 +0000 (15:21 +0000)
Addresses on MIPS are signed, and we're indeed using
regcache_cooked_read_signed to read the PC, but, we're passing it the
address of an unsigned variable, which triggers a -Wpointer-sign
warning.  I've chosen to change the variable's type.  I believe this
will end up being the same (though I can't test it).

gdb/
2013-04-19  Pedro Alves  <palves@redhat.com>

* mips-tdep.c (mips_read_pc): Change local 'pc' type to LONGEST.

gdb/ChangeLog
gdb/mips-tdep.c

index cfd5449e02326ba47e1f8d7ab115d4c9a15737cc..9314749344faa916ed77ef835785c95f21dbd1ea 100644 (file)
@@ -1,3 +1,7 @@
+2013-04-19  Pedro Alves  <palves@redhat.com>
+
+       * mips-tdep.c (mips_read_pc): Change local 'pc' type to LONGEST.
+
 2013-04-19  Pedro Alves  <palves@redhat.com>
 
        * mep-tdep.c (mep_get_insn): Change 'insn' parameter type to
index 8e5d5d2cd8427c0eef095b99f408b38e9af04dd9..245ffd6bb4bafc1edb1acd08faf54890d2e0811d 100644 (file)
@@ -1245,7 +1245,7 @@ static CORE_ADDR
 mips_read_pc (struct regcache *regcache)
 {
   int regnum = gdbarch_pc_regnum (get_regcache_arch (regcache));
-  ULONGEST pc;
+  LONGEST pc;
 
   regcache_cooked_read_signed (regcache, regnum, &pc);
   if (is_compact_addr (pc))
This page took 0.038099 seconds and 4 git commands to generate.