From patchwork Mon Oct 27 03:14:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Kamensky X-Patchwork-Id: 3389 Received: (qmail 9304 invoked by alias); 27 Oct 2014 03:14: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 9201 invoked by uid 89); 27 Oct 2014 03:14:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f49.google.com Received: from mail-pa0-f49.google.com (HELO mail-pa0-f49.google.com) (209.85.220.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 27 Oct 2014 03:14:52 +0000 Received: by mail-pa0-f49.google.com with SMTP id lj1so425006pab.8 for ; Sun, 26 Oct 2014 20:14:50 -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=Al9FWsWqu2N4rOpM/0ecpksRr1ZsYwgT2hcsGYlpWIA=; b=Ki/bGrqDWLupGyXkp/U3j5mvGzU8CX10s8fO8LBP+qfEokwsbW2cCs/7UFdCypR4Vk oDBvSQtQ1kzCex36gdhoYvjfsMredR6/CFautS1An+TBiqqr1mLhQCbckTHM63CtbkEB P9dYAf8AALGuzz3PkYFyII8awZlStBFpY58p67Cl3KXa/UEbiw1Zwhb9Jdh//5xfmlYk oQ/G/JhcmxWuTH8UPhxtW1IrpdTc1ka2UYXLbq418wPIo3MUUzHZKJtMOGjWeNjRS+T0 g6/5skVpUWR5of4u2pic78ys4Hk27oWVvVphhACGYpjjMu9nPRhKB/zZSzew0gdIE+Sz a3tA== X-Gm-Message-State: ALoCoQml+IyhgNqR6FvhyGPOJXD6SQdMu4mDURACkP1tgFTECaWgL4fQuAjZ6/h2IGFavQpBG9zi X-Received: by 10.70.46.137 with SMTP id v9mr21531963pdm.78.1414379690473; Sun, 26 Oct 2014 20:14:50 -0700 (PDT) Received: from kamensky-w530.cisco.com (128-107-239-233.cisco.com. [128.107.239.233]) by mx.google.com with ESMTPSA id te2sm2220682pbc.51.2014.10.26.20.14.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Oct 2014 20:14:49 -0700 (PDT) From: Victor Kamensky To: gdb-patches@sourceware.org Cc: Yao Qi , Andrew Pinski , victor.kamensky@linaro.org Subject: [PATCH 2/2] aarch64: tramp_frame_start function need to read instrs correctly in be8 case Date: Sun, 26 Oct 2014 20:14:28 -0700 Message-Id: <1414379668-5351-3-git-send-email-victor.kamensky@linaro.org> In-Reply-To: <1414379668-5351-1-git-send-email-victor.kamensky@linaro.org> References: <1414379668-5351-1-git-send-email-victor.kamensky@linaro.org> tramp_frame_start function needs to read instructions in gdbarch_byte_order_for_code byte order, because in case aarch64_be, even data is big endian, instructions are still little endian. Currently function uses gdbarch_byte_order which would be big endian in aarch64_be case. Because of this issue pretty much all tests that involve backtrace of stack with signal frame are failing on aarch64_be target. Fix is to change gdbarch_byte_order to gdbarch_byte_order_for_code, when passed to extract_unsigned_integer that reads instruction. gdb/ChangeLog: 2014-10-24 Victor Kamensky * gdb/tramp-frame.c (tramp_frame_start): Use gdbarch_byte_order_for_code to read aarch64 instruction. --- gdb/tramp-frame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/tramp-frame.c b/gdb/tramp-frame.c index 0fd6ddc..41dcd94 100644 --- a/gdb/tramp-frame.c +++ b/gdb/tramp-frame.c @@ -83,7 +83,7 @@ tramp_frame_start (const struct tramp_frame *tramp, struct frame_info *this_frame, CORE_ADDR pc) { struct gdbarch *gdbarch = get_frame_arch (this_frame); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); + enum bfd_endian byte_order = gdbarch_byte_order_for_code (gdbarch); int ti; /* Search through the trampoline for one that matches the