From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25076 invoked by alias); 4 Mar 2013 04:13:22 -0000 Received: (qmail 25066 invoked by uid 22791); 4 Mar 2013 04:13:20 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Mar 2013 04:12:49 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UCMlc-0003nP-NP from Hui_Zhu@mentor.com for gdb-patches@sourceware.org; Sun, 03 Mar 2013 20:12:48 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sun, 3 Mar 2013 20:12:48 -0800 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Sun, 3 Mar 2013 20:12:47 -0800 Message-ID: <51341F3D.2030608@mentor.com> Date: Mon, 04 Mar 2013 04:13:00 -0000 From: Hui Zhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20130126 Thunderbird/19.0 MIME-Version: 1.0 To: CC: Subject: [PATCH] Fix byte_order issue of traceframe_info of tfile Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2013-03/txt/msg00077.txt.bz2 Hi, The function build_traceframe_info doesn't convert the byte_order. So if the tfile is read from different byte_order arch. It will get error. This patch will fix this issue. Thanks, Hui 2013-03-04 Luis Machado * tracepoint.c (build_traceframe_info): Add code for byte order. --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -4705,7 +4705,14 @@ build_traceframe_info (char blocktype, v unsigned short mlen; tfile_read ((gdb_byte *) &maddr, 8); + maddr = extract_unsigned_integer ((gdb_byte *) &maddr, 8, + gdbarch_byte_order + (target_gdbarch ())); tfile_read ((gdb_byte *) &mlen, 2); + mlen = (unsigned short) + extract_unsigned_integer ((gdb_byte *) &mlen, + 2, gdbarch_byte_order + (target_gdbarch ())); r = VEC_safe_push (mem_range_s, info->memory, NULL);