From patchwork Wed Aug 9 12:18:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiong Wang X-Patchwork-Id: 22037 Received: (qmail 46336 invoked by alias); 9 Aug 2017 12:18:10 -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 46273 invoked by uid 89); 9 Aug 2017 12:18:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Aug 2017 12:18:07 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3139080D for ; Wed, 9 Aug 2017 05:18:06 -0700 (PDT) Received: from [10.2.206.198] (e104437-lin.cambridge.arm.com [10.2.206.198]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8AC613F540 for ; Wed, 9 Aug 2017 05:18:05 -0700 (PDT) From: Jiong Wang Subject: [AArch64][5/6] Implement gdbarch_core_read_description References: To: GDB Message-ID: Date: Wed, 9 Aug 2017 13:18:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Currently, AArch64 only have one target description which is tdesc_aarch64. So, we haven't implemented any target description detetion mechanism for core file. This patch is an initial implement of core_read_description method. The "pauth" feature or any future feature can use this to conditionally return selected description. gdb/ 2017-08-09 Jiong Wang * aarch64-linux-tdep.c (aarch64_linux_core_read_description): New function. (aarch64_linux_init_abi): Register gdbarch_core_read_description. diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index d2ca70a..ec6125a 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -231,6 +231,20 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, NULL, cb_data); } +/* Determine target description from core file. */ + +static const struct target_desc * +aarch64_linux_core_read_description (struct gdbarch *gdbarch, + struct target_ops *target, bfd *abfd) +{ + CORE_ADDR aarch64_hwcap = 0; + + if (target_auxv_search (target, AT_HWCAP, &aarch64_hwcap) != 1) + return NULL; + + return tdesc_aarch64; +} + /* Implementation of `gdbarch_stap_is_single_operand', as defined in gdbarch.h. */ @@ -1018,6 +1032,8 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_iterate_over_regset_sections (gdbarch, aarch64_linux_iterate_over_regset_sections); + set_gdbarch_core_read_description + (gdbarch, aarch64_linux_core_read_description); /* SystemTap related. */ set_gdbarch_stap_integer_prefixes (gdbarch, stap_integer_prefixes);