This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: gdb 7.6: Fix info mem command for 32 bits host/64 bits target
- From: Udma Catalin-Dan-B32721 <B32721 at freescale dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 27 Jun 2013 08:19:19 +0000
- Subject: RE: gdb 7.6: Fix info mem command for 32 bits host/64 bits target
- References: <FE751157F0442848A159F3AB4CB1F55B3D9FE8 at 039-SN1MPN1-001 dot 039d dot mgd dot msft dot net> <51CB116D dot 7060009 at redhat dot com>
Hi,
Re-sending the patch including: bug entry, changeLog and the patch.
Regards,
Catalin
Bug entry:
http://sourceware.org/bugzilla/show_bug.cgi?id=15684
gdb/ChangeLog:
2013-06-26 Catalin Udma <catalin.udma@freescale.com>
* memattr.c (mem_info_command): Fix info mem command
for 32 bits host/64 bits target by removing incorrect cast
Patch:
Subject: [PATCH] Fix info mem command for 32 bits host/64 bits target
When running gdb on 32 bits host for 64 bits target, info mem command
truncates the target address to 32 bits, like in the example below
(gdb) set architecture powerpc:common64
(gdb) mem 0x100000000 0x200000000 rw
(gdb) info mem
1 y 0x0000000000000000 0x0000000000000000 rw nocache
Signed-off-by: Catalin Udma <catalin.udma@freescale.com>
---
--- gdb/memattr.c.orig 2013-06-27 17:28:20.000000000 +0300
+++ gdb/memattr.c 2013-06-27 17:29:16.000000000 +0300
@@ -447,9 +447,9 @@
m->number,
m->enabled_p ? 'y' : 'n');
if (gdbarch_addr_bit (target_gdbarch ()) <= 32)
- tmp = hex_string_custom ((unsigned long) m->lo, 8);
+ tmp = hex_string_custom (m->lo, 8);
else
- tmp = hex_string_custom ((unsigned long) m->lo, 16);
+ tmp = hex_string_custom (m->lo, 16);
printf_filtered ("%s ", tmp);
@@ -458,14 +458,14 @@
if (m->hi == 0)
tmp = "0x100000000";
else
- tmp = hex_string_custom ((unsigned long) m->hi, 8);
+ tmp = hex_string_custom (m->hi, 8);
}
else
{
if (m->hi == 0)
tmp = "0x10000000000000000";
else
- tmp = hex_string_custom ((unsigned long) m->hi, 16);
+ tmp = hex_string_custom (m->hi, 16);
}
printf_filtered ("%s ", tmp);