Message ID | 1413853021-4393-3-git-send-email-victor.kamensky@linaro.org |
---|---|
State | New, archived |
Headers |
Received: (qmail 12427 invoked by alias); 21 Oct 2014 00:57:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 12177 invoked by uid 89); 21 Oct 2014 00:57:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f171.google.com Received: from mail-pd0-f171.google.com (HELO mail-pd0-f171.google.com) (209.85.192.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 21 Oct 2014 00:57:27 +0000 Received: by mail-pd0-f171.google.com with SMTP id ft15so195221pdb.16 for <gdb-patches@sourceware.org>; Mon, 20 Oct 2014 17:57:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=75Nf82GKnua9fWCGd6zXCyRlwWYZ4rBpiwnL5HN6MK0=; b=JHha5Yd0mgDd1qAxpoXh54BNW32A1Sjuwp4++RrzsGhxFFrgl9XXvD+oQMqYc2VE4r W64YtE3QdzNiTND1lcHrPZNLOgPsPkmo4dBYvWGDFfUqZq/a+yEGposcTAeCGN4iGn+M hFSqrbmpz6ZkfUBfzpEGfRZ2be/gFDk+bg+GicT9QHvfUOfJEMIxjyJVcQJKwVH8fuuN atmiAshYpEM6dTOODxxXyVx4+6qltKA98NIZIJ245h4DyUqe/JNLDDJqx6QN12J8jzQp Jfix5qI8YxoVNUrLNpElCQ0cNtR5UEzmqTKNlVlicFlPZrjmEQXZIhFzvfyrVVGe6qKO UWrg== X-Gm-Message-State: ALoCoQmwnEdhlUBMQ4/dB/JD93jXvL1Kzsa4m7gDMBxzABnpgVPsu8GPj0xd8SfCtgByACuuoUkb X-Received: by 10.68.233.166 with SMTP id tx6mr1118573pbc.89.1413853045777; Mon, 20 Oct 2014 17:57:25 -0700 (PDT) Received: from kamensky-w530.cisco.com.net ([24.6.79.41]) by mx.google.com with ESMTPSA id g15sm10230692pdm.68.2014.10.20.17.57.24 for <multiple recipients> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Oct 2014 17:57:25 -0700 (PDT) From: Victor Kamensky <victor.kamensky@linaro.org> To: gdb-patches@sourceware.org Cc: victor.kamensky@linaro.org Subject: [PATCH 2/5] ARM: extract_arm_insn function need to read instrs correctly in be8 case Date: Mon, 20 Oct 2014 17:56:58 -0700 Message-Id: <1413853021-4393-3-git-send-email-victor.kamensky@linaro.org> In-Reply-To: <1413853021-4393-1-git-send-email-victor.kamensky@linaro.org> References: <1413853021-4393-1-git-send-email-victor.kamensky@linaro.org> |
Commit Message
Victor Kamensky
Oct. 21, 2014, 12:56 a.m. UTC
extract_arm_insn function needs to read instructions in gdbarch_byte_order_for_code byte order, because in case armv7b, even data is big endian, instructions are still little endian. Currently function uses gdbarch_byte_order which would be big endian in armv7b case. Because of this issue pretty much all gdb.reverse/ tests are failing with 'Process record does not support instruction' message. Fix is to change gdbarch_byte_order to gdbarch_byte_order_for_code, when passed to extract_unsigned_integer that reads instruction. --- gdb/ChangeLog | 5 +++++ gdb/arm-tdep.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
Comments
Victor Kamensky <victor.kamensky@linaro.org> writes: > Fix is to change gdbarch_byte_order to gdbarch_byte_order_for_code, > when passed to extract_unsigned_integer that reads instruction. > --- > gdb/ChangeLog | 5 +++++ > gdb/arm-tdep.c | 2 +- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index c967a93..2aef5dc 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,8 @@ > +2014-10-13 Victor Kamensky <victor.kamensky@linaro.org> > + > + * arm-tdep.c (extract_arm_insn): use dbarch_byte_order_for_code > + to read arm instruction. > + > 2014-09-30 Don Breazeal <donb@codesourcery.com> > > * inf-ptrace.c (inf_ptrace_follow_fork): Remove target-independent Looks good to me. We don't include the ChangeLog changes in the patch, because that will cause conflicts when applying your patch locally in the review. Instead, we include ChangeLog entries in the commit messages, see https://sourceware.org/gdb/wiki/ContributionChecklist#Properly_formatted_commit_messages
Yao Qi <yao@codesourcery.com> writes: >> +2014-10-13 Victor Kamensky <victor.kamensky@linaro.org> >> + >> + * arm-tdep.c (extract_arm_insn): use dbarch_byte_order_for_code s/use dbarch/Use gdbarch/ >> + to read arm instruction.
On 21 October 2014 00:54, Yao Qi <yao@codesourcery.com> wrote: > Victor Kamensky <victor.kamensky@linaro.org> writes: > >> Fix is to change gdbarch_byte_order to gdbarch_byte_order_for_code, >> when passed to extract_unsigned_integer that reads instruction. >> --- >> gdb/ChangeLog | 5 +++++ >> gdb/arm-tdep.c | 2 +- >> 2 files changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/gdb/ChangeLog b/gdb/ChangeLog >> index c967a93..2aef5dc 100644 >> --- a/gdb/ChangeLog >> +++ b/gdb/ChangeLog >> @@ -1,3 +1,8 @@ >> +2014-10-13 Victor Kamensky <victor.kamensky@linaro.org> >> + >> + * arm-tdep.c (extract_arm_insn): use dbarch_byte_order_for_code >> + to read arm instruction. >> + >> 2014-09-30 Don Breazeal <donb@codesourcery.com> >> >> * inf-ptrace.c (inf_ptrace_follow_fork): Remove target-independent > > Looks good to me. > > We don't include the ChangeLog changes in the patch, because that will > cause conflicts when applying your patch locally in the review. > Instead, we include ChangeLog entries in the commit messages, see > https://sourceware.org/gdb/wiki/ContributionChecklist#Properly_formatted_commit_messages Thanks! It is good pointer. I have not seen it before. Maybe gdb/CONTRIBUTE could mention this wiki page. I will move all proposed commit ChangeLogs as per wiki, will incorporate review comments and repost updated series. Thanks, Victor > -- > Yao (齐尧)
Hi Victor, On 10/21/2014 03:44 PM, Victor Kamensky wrote: >> > >> > We don't include the ChangeLog changes in the patch, because that will >> > cause conflicts when applying your patch locally in the review. >> > Instead, we include ChangeLog entries in the commit messages, see >> > https://sourceware.org/gdb/wiki/ContributionChecklist#Properly_formatted_commit_messages > Thanks! It is good pointer. I have not seen it before. > Maybe gdb/CONTRIBUTE could mention this wiki page. OOC, how did you find gdb/CONTRIBUTE? Was that through https://sourceware.org/gdb/contribute/ or some other means? IMO we should just move/merge the gross of the contents in the file to the web/wiki, and either delete the file, or leave just the preamble. If it stays, I think it should link to: http://www.gnu.org/software/gdb/contribute/ as that's more stable than the wiki, and then that page should link to relevant wiki pages. Thanks, Pedro Alves
On 24 October 2014 05:20, Pedro Alves <palves@redhat.com> wrote: > Hi Victor, > > On 10/21/2014 03:44 PM, Victor Kamensky wrote: >>> > >>> > We don't include the ChangeLog changes in the patch, because that will >>> > cause conflicts when applying your patch locally in the review. >>> > Instead, we include ChangeLog entries in the commit messages, see >>> > https://sourceware.org/gdb/wiki/ContributionChecklist#Properly_formatted_commit_messages >> Thanks! It is good pointer. I have not seen it before. >> Maybe gdb/CONTRIBUTE could mention this wiki page. > > OOC, how did you find gdb/CONTRIBUTE? Was that through > https://sourceware.org/gdb/contribute/ or some other means? Yes, through above link. I got to it from https://sourceware.org/gdb/ following 'contributing' (3rd) tab on top under title. Thanks, Victor > IMO we should just move/merge the gross of the contents in the > file to the web/wiki, and either delete the file, or leave just > the preamble. > > If it stays, I think it should link to: > > http://www.gnu.org/software/gdb/contribute/ > > as that's more stable than the wiki, and then that page should > link to relevant wiki pages. > > Thanks, > Pedro Alves >
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c967a93..2aef5dc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-10-13 Victor Kamensky <victor.kamensky@linaro.org> + + * arm-tdep.c (extract_arm_insn): use dbarch_byte_order_for_code + to read arm instruction. + 2014-09-30 Don Breazeal <donb@codesourcery.com> * inf-ptrace.c (inf_ptrace_follow_fork): Remove target-independent diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index e2559ec..e7a1ec5 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -13860,7 +13860,7 @@ extract_arm_insn (insn_decode_record *insn_record, uint32_t insn_size) return 1; insn_record->arm_insn = (uint32_t) extract_unsigned_integer (&buf[0], insn_size, - gdbarch_byte_order (insn_record->gdbarch)); + gdbarch_byte_order_for_code (insn_record->gdbarch)); return 0; }