From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4106 invoked by alias); 26 Jun 2013 15:07:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 4073 invoked by uid 89); 26 Jun 2013 15:07:30 -0000 X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from ch1ehsobe004.messaging.microsoft.com (HELO ch1outboundpool.messaging.microsoft.com) (216.32.181.184) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 26 Jun 2013 15:07:29 +0000 Received: from mail49-ch1-R.bigfish.com (10.43.68.240) by CH1EHSOBE012.bigfish.com (10.43.70.62) with Microsoft SMTP Server id 14.1.225.23; Wed, 26 Jun 2013 15:07:27 +0000 Received: from mail49-ch1 (localhost [127.0.0.1]) by mail49-ch1-R.bigfish.com (Postfix) with ESMTP id 46CE6100350 for ; Wed, 26 Jun 2013 15:07:27 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190;KIP:(null);UIP:(null);IPV:NLI;H:mail.freescale.net;RD:none;EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zz936eIzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839h8e2h8e3h947hd25hf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e1dhbe9i1155h) Received: from mail49-ch1 (localhost.localdomain [127.0.0.1]) by mail49-ch1 (MessageSwitch) id 1372259245284761_30110; Wed, 26 Jun 2013 15:07:25 +0000 (UTC) Received: from CH1EHSMHS001.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.249]) by mail49-ch1.bigfish.com (Postfix) with ESMTP id 3C83B120055 for ; Wed, 26 Jun 2013 15:07:25 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS001.bigfish.com (10.43.70.1) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 26 Jun 2013 15:07:23 +0000 Received: from 039-SN1MPN1-001.039d.mgd.msft.net ([169.254.1.74]) by 039-SN1MMR1-001.039d.mgd.msft.net ([10.84.1.13]) with mapi id 14.02.0328.011; Wed, 26 Jun 2013 15:07:22 +0000 From: Udma Catalin-Dan-B32721 To: "gdb-patches@sourceware.org" Subject: gdb 7.6: Fix info mem command for 32 bits host/64 bits target Date: Wed, 26 Jun 2013 15:10:00 -0000 Message-ID: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-SW-Source: 2013-06/txt/msg00772.txt.bz2 Hi, I found an issue with the "info mem" command when running gdb on 32 bits ho= st for 64 bits target architecture. "info mem" command truncates the target address to 32 bits, like in the exa= mple below: =A0=A0=A0 (gdb) set architecture powerpc:common64 =A0=A0=A0 The target architecture is assumed to be powerpc:common64 =A0=A0=A0 (gdb) mem 0x100000000 0x200000000 rw =A0=A0=A0 (gdb) info mem =A0=A0=A0 Using user-defined memory regions. =A0=A0=A0 Num Enb Low Addr=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 High Addr=A0=A0=A0= =A0=A0=A0=A0=A0=A0 Attrs =A0=A0=A0 1=A0=A0 y=A0=A0 0x0000000000000000 0x0000000000000000 rw nocache Please find below the proposed patch. Please let me know your comments. Regards, Catalin Subject: [PATCHH] 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=20 (gdb) mem 0x100000000 0x200000000 rw (gdb) info mem 1 y 0x0000000000000000 0x0000000000000000 rw nocache=20 Signed-off-by: Catalin Udma --- --- 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 ()) <=3D 32) - tmp =3D hex_string_custom ((unsigned long) m->lo, 8); + tmp =3D hex_string_custom ((LONGEST) m->lo, 8); else - tmp =3D hex_string_custom ((unsigned long) m->lo, 16); + tmp =3D hex_string_custom ( (LONGEST) m->lo, 16); =20=20=20=20=20=20=20 printf_filtered ("%s ", tmp); =20 @@ -458,14 +458,14 @@ if (m->hi =3D=3D 0) tmp =3D "0x100000000"; else - tmp =3D hex_string_custom ((unsigned long) m->hi, 8); + tmp =3D hex_string_custom ((LONGEST) m->hi, 8); } else { if (m->hi =3D=3D 0) tmp =3D "0x10000000000000000"; else - tmp =3D hex_string_custom ((unsigned long) m->hi, 16); + tmp =3D hex_string_custom ((LONGEST) m->hi, 16); } =20 printf_filtered ("%s ", tmp);