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

gdb/ChangeLog:

        PR gdb/15684
        * memattr.c (mem_info_command): Remove "unsigned long" casts.

Signed-off-by: Catalin Udma <catalin.udma@freescale.com>
This commit is contained in:
Catalin Udma 2014-12-15 16:41:29 +02:00
parent 184d64776b
commit aacd3e8c4f
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2014-12-15 Catalin Udma <catalin.udma@freescale.com>
PR gdb/15684
* memattr.c (mem_info_command): Remove "unsigned long" casts.
2014-12-13 Doug Evans <xdje42@gmail.com>
* utils.c (make_hex_string): Fix off-by-one error.

View File

@ -447,9 +447,9 @@ mem_info_command (char *args, int from_tty)
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 @@ mem_info_command (char *args, int from_tty)
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);