From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72120 invoked by alias); 9 Aug 2017 15:43:16 -0000 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 Received: (qmail 72100 invoked by uid 89); 9 Aug 2017 15:43:15 -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 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 15:43:14 +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 BC4282B; Wed, 9 Aug 2017 08:43:12 -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 430AC3F577; Wed, 9 Aug 2017 08:43:12 -0700 (PDT) Subject: Re: [AArch64][5/6] Implement gdbarch_core_read_description From: Jiong Wang To: Yao Qi Cc: GDB References: <864ltgzuqc.fsf@gmail.com> <2848920b-e1be-0c00-d9f6-4737055e33a1@foss.arm.com> Message-ID: <5b77a77e-e0e0-a420-6f8e-ae8c3e967d68@foss.arm.com> Date: Wed, 09 Aug 2017 15:43:00 -0000 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: <2848920b-e1be-0c00-d9f6-4737055e33a1@foss.arm.com> Content-Type: multipart/mixed; boundary="------------78251207E91FB313E5929226" X-SW-Source: 2017-08/txt/msg00186.txt.bz2 This is a multi-part message in MIME format. --------------78251207E91FB313E5929226 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 948 On 09/08/17 15:57, Jiong Wang wrote: > >> This patch doesn't depend on other patches, so it can go in now. >> > I had committed this patch after addressing all comments, but just reverted. > > it's my bad haven't give it a quick build. It depends on AT_HWCAP defined in patch 1 and the value needs to be synced with kernel... > Sorry, the issue should be two header files are missing. "auxv.h" to declare target_auxv_search and "elf/common.h" to define AT_HWCAP (I miss read the buildbot error message as something like missing "HWCAP_APIA"...) This patch was splitted from patch 6, I forget to move those two header files to this patch. Attached patch fixed this and passed gdb cross build, OK for master? gdb/ 2017-08-09 Jiong Wang * aarch64-linux-tdep.c: Include "auxv.h" and "elf/common.h". (aarch64_linux_core_read_description): New function. (aarch64_linux_init_abi): Register gdbarch_core_read_description. --------------78251207E91FB313E5929226 Content-Type: text/x-patch; name="k.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="k.patch" Content-length: 1273 diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index d2ca70a..847454f 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -45,6 +45,8 @@ #include "record-full.h" #include "linux-record.h" +#include "auxv.h" +#include "elf/common.h" /* Signal frame handling. @@ -231,6 +233,20 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, NULL, cb_data); } +/* Implement the "core_read_description" gdbarch method. */ + +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 +1034,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); --------------78251207E91FB313E5929226--