From patchwork Fri Dec 5 08:43:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Udma X-Patchwork-Id: 4077 Received: (qmail 16280 invoked by alias); 5 Dec 2014 08:43:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 16264 invoked by uid 89); 5 Dec 2014 08:43:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_40, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: na01-by2-obe.outbound.protection.outlook.com Received: from mail-by2on0117.outbound.protection.outlook.com (HELO na01-by2-obe.outbound.protection.outlook.com) (207.46.100.117) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 05 Dec 2014 08:43:50 +0000 Received: from BY2PR03MB175.namprd03.prod.outlook.com (10.242.36.148) by BY2PR03MB175.namprd03.prod.outlook.com (10.242.36.148) with Microsoft SMTP Server (TLS) id 15.1.26.15; Fri, 5 Dec 2014 08:43:46 +0000 Received: from BY2PR03MB175.namprd03.prod.outlook.com ([169.254.5.250]) by BY2PR03MB175.namprd03.prod.outlook.com ([169.254.5.250]) with mapi id 15.01.0026.003; Fri, 5 Dec 2014 08:43:46 +0000 From: "catalin.udma@freescale.com" To: "gdb-patches@sourceware.org" Subject: [PATCH] Fix info mem command for 32 bits host/64 bits target Date: Fri, 5 Dec 2014 08:43:46 +0000 Message-ID: x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB175; x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB175; x-forefront-prvs: 04163EF38A x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(377424004)(189002)(199003)(101416001)(107046002)(77156002)(68736005)(62966003)(92566001)(107886001)(2351001)(110136001)(33656002)(102836002)(15975445007)(54356999)(50986999)(450100001)(76576001)(31966008)(54206007)(54606007)(74316001)(122556002)(40100003)(97736003)(106356001)(120916001)(4396001)(64706001)(2656002)(66066001)(19580395003)(19580405001)(20776003)(46102003)(86362001)(21056001)(99396003)(229853001)(15395725005)(105586002)(99286002)(87936001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR03MB175; H:BY2PR03MB175.namprd03.prod.outlook.com; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-OriginatorOrg: freescale.com 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 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 --- 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);