This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 06/26] mips-tdep.c: Wrong signness for local holding PC register.
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 11 Apr 2013 23:59:39 +0100
- Subject: [PATCH 06/26] mips-tdep.c: Wrong signness for local holding PC register.
- References: <20130411225847 dot 16791 dot 29283 dot stgit at brno dot lan>
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-11 Pedro Alves <palves@redhat.com>
* mips-tdep.c (mips_read_pc): Change local 'pc' type to LONGEST.
---
gdb/mips-tdep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 8e5d5d2..245ffd6 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -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))