From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129654 invoked by alias); 12 Dec 2016 20:47:36 -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 129606 invoked by uid 89); 12 Dec 2016 20:47:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=UD:regcache.h, regcacheh, regcache.h, 4417 X-HELO: mail-wj0-f196.google.com Received: from mail-wj0-f196.google.com (HELO mail-wj0-f196.google.com) (209.85.210.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Dec 2016 20:47:25 +0000 Received: by mail-wj0-f196.google.com with SMTP id kp2so13528806wjc.0 for ; Mon, 12 Dec 2016 12:47:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+OhXY4DCy87G7/HPZWx0ptthGUO8A0JtoRJUaNwsyyY=; b=M+EN+AyKtjHyKaMIe1EyUvTRXAY4iTlwNYg2ooH7EdMWigerXhY4YW3lNHbC+Xx1Hy vxxqbIS2mCLjOQSjLuXgj7yEFcF12Cm6CoCVab4c99+k1iyFHZKST1RgyNd/fEgNLtSe igN2UkKlp3gIcS08k1ZrAHVSAP2lFUwB59XkfMXkAZ00Lgz206WeRC9rtbakH3JNUlvb pT/hmkGWBCfzfvbBoXQpaNWj4n6LslAvSbVOslwIfzkkDPqcDEP5usOJ1Lr+hnzZje/T 7wpT0skaPg6zwuRzegl9U/P8o1G+G8GcNKoIX7sL/c28Y/UkaNZssHBrlDchKmwjPkYB s4GQ== X-Gm-Message-State: AKaTC03uy12iIzl3kRzeZtovCO52/vBkSmTwM2/zENJvDfhRyaa0swSq/2qnf6/xTlN3uw== X-Received: by 10.194.88.3 with SMTP id bc3mr41225416wjb.143.1481575643525; Mon, 12 Dec 2016 12:47:23 -0800 (PST) Received: from localhost ([2a02:c7d:8e80:c00:89bd:572f:4d79:35ea]) by smtp.gmail.com with ESMTPSA id b15sm37275096wma.5.2016.12.12.12.47.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Dec 2016 12:47:23 -0800 (PST) Date: Mon, 12 Dec 2016 20:47:00 -0000 From: Yao Qi To: Alan Hayward Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/8] AARCH64 SVE: Add gdbarch methods Message-ID: <20161212204717.gaw2b77noo3i43h6@localhost> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20161104 (1.7.1) X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00275.txt.bz2 On 16-12-05 12:26:43, Alan Hayward wrote: > This is part of a series adding AARCH64 SVE support to gdb and gdbserver. > > This patch simply adds two gdbarch methods: > target_description_changed_p () > target_get_tdep_info () We need more rationale on why do we add these two new gdbarch methods. > > In a later patch, the aarch64 version of these methods will need to access > regcache as a VEC(cached_reg_t). > > These method will remain unused until a later patch in the series. Could you add the code using these gdbarch methods in the same patch? It is odd to add a function in one patch, and use it in another. > > Tested on x86 and aarch64. > Ok to commit? > > Alan. > > > > diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c > index > 6b95d7c8654521bb58d3af32d898b23380320915..aba7a8525529102d01e3c7cd282a9ee79 > 3d643fe 100644 > --- a/gdb/aarch64-tdep.c > +++ b/gdb/aarch64-tdep.c > @@ -44,23 +44,17 @@ > #include "infcall.h" > #include "ax.h" > #include "ax-gdb.h" > - > #include "aarch64-tdep.h" > - > #include "elf-bfd.h" > #include "elf/aarch64.h" > - > #include "vec.h" > - > #include "record.h" > #include "record-full.h" > - > #include "features/aarch64.c" > - > #include "arch/aarch64-insn.h" > - Is it intended to remove these blank lines? > #include "opcode/aarch64.h" > #include > +#include "remote.h" > > #define submask(x) ((1L << ((x) + 1)) - 1) > #define bit(obj,st) (((obj) >> (st)) & 1) > @@ -2643,6 +2637,24 @@ aarch64_displaced_step_hw_singlestep (struct > gdbarch *gdbarch, > return 1; > } > > +/* Implement the "target_description_changed_p" gdbarch method. */ A blank line is needed. > +static int > +aarch64_target_description_changed_p (struct gdbarch *gdbarch, > + ptid_t ptid, > + void *registers) > +{ > + VEC(cached_reg_t) *registerlist = (VEC(cached_reg_t)*)registers; > + return 0; > +} > + > +/* Implement the "target_get_tdep_info" gdbarch method. */ > +void * > +aarch64_target_get_tdep_info (void *registers) > +{ Likewise. > + VEC(cached_reg_t) *regcache = (VEC(cached_reg_t)*)registers; > + return NULL; > +} > + > diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh > index > ba57008300d2e463f67bab6561f76908f0933dfb..1eaea537a985ddda6208199feabd8d14e > 91e837c 100755 > --- a/gdb/gdbarch.sh > +++ b/gdb/gdbarch.sh > @@ -1163,6 +1163,12 @@ m:const char > *:gnu_triplet_regexp:void:::default_gnu_triplet_regexp::0 > # each address in memory. > m:int:addressable_memory_unit_size:void:::default_addressable_memory_unit_ > size::0 > > +# Given a list of registers, check if the target description has changed. > +m:int:target_description_changed_p:ptid_t ptid, void *registers:ptid, > registers::default_target_description_changed_p::0 > + > +# Given a list of registers, return a tdep info. > +f:void*:target_get_tdep_info:void > *registers:registers::default_target_get_tdep_info::0 More documentation on these two methods are needed. > + > EOF > } > > diff --git a/gdb/remote.h b/gdb/remote.h > index > 75e7e670ea1cde00897ef2a3c402161b76b9b564..ffd1758efc5e3b7e5244b599b288fa8d0 > 1c804fe 100644 > --- a/gdb/remote.h > +++ b/gdb/remote.h > @@ -23,6 +23,15 @@ > > struct target_desc; > > +typedef struct cached_reg > +{ > + int num; > + gdb_byte data[MAX_REGISTER_SIZE]; > +} cached_reg_t; > + > +DEF_VEC_O(cached_reg_t); > + > + We may need to move this structure to regcache.h, and rename it with "reg_info" for example. Then, "struct reg_info" in python/py-unwind.c can be removed. A good side-effect of this change is that we remove one usage of MAX_REGISTER_SIZE. -- Yao