From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21420 invoked by alias); 28 Apr 2011 19:22:59 -0000 Received: (qmail 21400 invoked by uid 22791); 28 Apr 2011 19:22:58 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nm5-vm3.bullet.mail.ne1.yahoo.com (HELO nm5-vm3.bullet.mail.ne1.yahoo.com) (98.138.91.135) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 28 Apr 2011 19:22:44 +0000 Received: from [98.138.90.55] by nm5.bullet.mail.ne1.yahoo.com with NNFMP; 28 Apr 2011 19:22:43 -0000 Received: from [98.138.89.197] by tm8.bullet.mail.ne1.yahoo.com with NNFMP; 28 Apr 2011 19:22:43 -0000 Received: from [127.0.0.1] by omp1055.mail.ne1.yahoo.com with NNFMP; 28 Apr 2011 19:22:43 -0000 Received: (qmail 61142 invoked by uid 60001); 28 Apr 2011 19:22:42 -0000 Message-ID: <727567.12089.qm@web112511.mail.gq1.yahoo.com> Received: from [123.238.92.202] by web112511.mail.gq1.yahoo.com via HTTP; Thu, 28 Apr 2011 12:22:42 PDT References: <341905.10459.qm@web112513.mail.gq1.yahoo.com> <208397.95006.qm@web112517.mail.gq1.yahoo.com> <4DA27006.1080607@codesourcery.com> <763549.92092.qm@web112506.mail.gq1.yahoo.com> <335149.24692.qm@web112515.mail.gq1.yahoo.com> <592215.58786.qm@web112508.mail.gq1.yahoo.com> <172713.29831.qm__351.089161313389$1303740245$gmane$org@web112503.mail.gq1.yahoo.com> <136943.43839.qm@web112518.mail.gq1.yahoo.com> Date: Thu, 28 Apr 2011 19:22:00 -0000 From: paawan oza Subject: Re: [PATCH] arm reversible : To: Tom Tromey Cc: =?iso-8859-1?Q?Petr_Hluz=EDn?= , gdb@sourceware.org, gdb-patches@sourceware.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2011-04/txt/msg00549.txt.bz2 but whole operation happens on target memory, so=20 after=20 GET_REG_VAL (reg_cache, ARM_PC_REGNUM, &u_buf.buf[0]); we get scalar u_buf.s_word again in big-endian. + start_address =3D u_buf.s_word - \ + (4 * (bit (thumb_insn_r->arm_insn, 8) + register_count)= ) ; and above math is again in target memory in big endian machine and record i= s=20 saved to target memory. I think it never gets fetched to host for any reason, Am I thinking correct? Regards, Oza. ----- Original Message ---- From: Tom Tromey To: paawan oza Cc: Petr Hluz=EDn ; gdb@sourceware.org;=20 gdb-patches@sourceware.org Sent: Fri, April 29, 2011 12:30:05 AM Subject: Re: [PATCH] arm reversible : >>>>> "Oza" =3D=3D paawan oza writes: Tom> It seems to me that extract_typed_address or something similar would be Tom> better. Oza> 1) are suggesting to use something else than unions ? whatever you ha= ve=20 Oza> described about union is right. Oza> 2) why could I use extract_typed_address instead of direct assignment= ? extract_typed_address handles endianess and conversion from "array of bytes" to "host scalar". Oza> 3) in my understanding cross debug would not affect endianess Oza> because all the record saving done on target memory and played back Oza> in target memory. they never get fetched to host machine I think. Oza> please clarify how would it affect host/target endianness issue ? Here is a snippet from the patch: + GET_REG_VAL (reg_cache, ARM_PC_REGNUM, &u_buf.buf[0]); [...] + start_address =3D u_buf.s_word - \ + (4 * (bit (thumb_insn_r->arm_insn, 8) + register_count)= ) ; Here, this fetches the raw register bits from the cache, which, IIUC, are in target order. Then it uses the union to turn this into a scalar, and does math on the scalar value. So, if the host and target endianness differ, you will get the wrong result. Maybe I am missing something here? Tom