Bug 15684 - info mem command for 32 bits host/64 bits target truncates addresses
Summary: info mem command for 32 bits host/64 bits target truncates addresses
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 7.6
: P2 normal
Target Milestone: 7.9
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-26 16:39 UTC by CU
Modified: 2023-12-31 16:26 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CU 2013-06-26 16:39:49 UTC
When running gdb on 32 bits host for 64 bits target architecture, “info mem” command truncates the target address to 32 bits, like in the example below:

    (gdb) set architecture powerpc:common64
    The target architecture is assumed to be powerpc:common64
    (gdb) mem 0x100000000 0x200000000 rw
    (gdb) info mem
    Using user-defined memory regions.
    Num Enb Low Addr           High Addr          Attrs
    1   y   0x0000000000000000 0x0000000000000000 rw nocache
Comment 1 Sourceware Commits 2014-12-15 14:52:48 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".

The branch, master has been updated
       via  aacd3e8c4f5ac00f1ee41c082c2f10eb7457d04c (commit)
      from  184d64776bc16fcba7b00e5784e27f52854cc8dd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aacd3e8c4f5ac00f1ee41c082c2f10eb7457d04c

commit aacd3e8c4f5ac00f1ee41c082c2f10eb7457d04c
Author: Catalin Udma <catalin.udma@freescale.com>
Date:   Mon Dec 15 16:41:29 2014 +0200

    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>

-----------------------------------------------------------------------

Summary of changes:
 gdb/ChangeLog |    5 +++++
 gdb/memattr.c |    8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)
Comment 2 Hannes Domani 2023-12-31 16:26:48 UTC
(In reply to Sourceware Commits from comment #1)
> This is an automated email from the git hooks/post-receive script. It was
> generated because a ref change was pushed to the repository containing
> the project "gdb and binutils".
> 
> The branch, master has been updated
>        via  aacd3e8c4f5ac00f1ee41c082c2f10eb7457d04c (commit)
>       from  184d64776bc16fcba7b00e5784e27f52854cc8dd (commit)
> 
> Those revisions listed above that are new to this repository have
> not appeared on any other notification email; so we list those
> revisions in full, below.
> 
> - Log -----------------------------------------------------------------
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;
> h=aacd3e8c4f5ac00f1ee41c082c2f10eb7457d04c
> 
> commit aacd3e8c4f5ac00f1ee41c082c2f10eb7457d04c
> Author: Catalin Udma <catalin.udma@freescale.com>
> Date:   Mon Dec 15 16:41:29 2014 +0200
> 
>     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>
> 
> -----------------------------------------------------------------------
> 
> Summary of changes:
>  gdb/ChangeLog |    5 +++++
>  gdb/memattr.c |    8 ++++----
>  2 files changed, 9 insertions(+), 4 deletions(-)

Was fixed with this commit.