Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix info mem command for 32 bits host/64 bits target
@ 2014-12-05  8:43 catalin.udma
  2014-12-05 11:21 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: catalin.udma @ 2014-12-05  8:43 UTC (permalink / raw)
  To: gdb-patches

Hi,
I follow-up for an old patch that I've noticed it's not pushed yet.
Please see below the reference to previous conversation, bug entry and
the updated patch.

This is the latest conversation for this patch:
https://sourceware.org/ml/gdb-patches/2013-06/msg00806.html

Bug entry:
http://sourceware.org/bugzilla/show_bug.cgi?id=15684


gdb/ChangeLog:

2014-11-05  Catalin Udma  <catalin.udma@freescale.com>

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


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 |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/memattr.c b/gdb/memattr.c
index 25e4554..9d2a2d4 100644
--- a/gdb/memattr.c
+++ b/gdb/memattr.c
@@ -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);
-- 
1.7.8


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix info mem command for 32 bits host/64 bits target
  2014-12-05  8:43 [PATCH] Fix info mem command for 32 bits host/64 bits target catalin.udma
@ 2014-12-05 11:21 ` Pedro Alves
  0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2014-12-05 11:21 UTC (permalink / raw)
  To: catalin.udma, gdb-patches

On 12/05/2014 08:43 AM, catalin.udma@freescale.com wrote:
> Hi,
> I follow-up for an old patch that I've noticed it's not pushed yet.
> Please see below the reference to previous conversation, bug entry and
> the updated patch.
> 
> This is the latest conversation for this patch:
> https://sourceware.org/ml/gdb-patches/2013-06/msg00806.html
> 
> Bug entry:
> http://sourceware.org/bugzilla/show_bug.cgi?id=15684
> 
> 
> gdb/ChangeLog:
> 
> 2014-11-05  Catalin Udma  <catalin.udma@freescale.com>
> 
> 	PR gdb/15684
> 	* memattr.c (mem_info_command): Remove "unsigned long" casts.

OK, please push.

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-05 11:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-05  8:43 [PATCH] Fix info mem command for 32 bits host/64 bits target catalin.udma
2014-12-05 11:21 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox