From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100622 invoked by alias); 18 Jul 2017 09:47:27 -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 99915 invoked by uid 89); 18 Jul 2017 09:47:26 -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=H*r:sk:static. X-HELO: mail-it0-f47.google.com Received: from mail-it0-f47.google.com (HELO mail-it0-f47.google.com) (209.85.214.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Jul 2017 09:47:25 +0000 Received: by mail-it0-f47.google.com with SMTP id v127so851550itd.0 for ; Tue, 18 Jul 2017 02:47:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :user-agent:mime-version:content-transfer-encoding; bh=nUMdlNMHhoNKgVOvkwHH4wcK34N4R3ocmzqvZB0Fr5M=; b=S2kJcjXcgPbrZWEJrRTP72Nr2rfDCglWOkUa8k96G1BZVw+p/S1uubac3Zsj4kpApV +2TCaDDdYaIxwjFkCAUVYeLbwNBeN3wIZk5DAD2lkc1WXbOV11xnBEjQFLLvrLWjDeVC vzUuwifYwCBmdoHK2vVwTmwRcAPO9fwVLvwymV2FpP4zrYqqXc/8yW+xYe7Vzj5uOVq1 riqe/y0Crbn1o4/qPsJ6O0gkp742ayI52R2Lo2XQd/muqft1+k0tkLxSwblyl4odviSr +cxCF74zENSk03WAJH4igVAVfVifYOTmKe+3rxFWR2kFEE74XF0cYzmJy/zHwdwahi/4 koKA== X-Gm-Message-State: AIVw113n4A1+BgDC/OSylXnMiFNjwatSD5loLwstezPG0cKYMCmrOSxe GhyLoWX/0jVt6w== X-Received: by 10.36.71.79 with SMTP id t76mr1193598itb.118.1500371243320; Tue, 18 Jul 2017 02:47:23 -0700 (PDT) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id j96sm930185ioo.49.2017.07.18.02.47.21 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 18 Jul 2017 02:47:22 -0700 (PDT) From: Yao Qi To: Alan Hayward Cc: "gdb-patches\@sourceware.org" , nd Subject: Re: [RFC] Replace regcache readonly flag with detached flag References: <8637a0r9mq.fsf@gmail.com> <298BA45B-4570-4A16-9C21-95F5A068F93C@arm.com> <86o9snoxtc.fsf@gmail.com> <47F3EFED-94A1-4D7E-AA0A-AF6B9954D397@arm.com> Date: Tue, 18 Jul 2017 09:47:00 -0000 Message-ID: <868tjmrs9m.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00246.txt.bz2 Alan Hayward writes: Hi Alan, > In your regcache_1 constructor, you only NEW the cooked registers if the > regcache is readonly. > http://people.linaro.org/~yao.qi/gdb/doxy/regcache-split/gdb-xref/classre= gcache__1.html#acef3ef3bc85269cf04728901b4f28ee8 > In my version I only NEW the cooked registers in a detached register cach= e. We can change regcache_1 constructor if it is wrong. I am not saying my patches are correct, let's commit them. When I reviewed your patch, I thought it is better to split regcache, then, I spent one day writing the code to make sure the idea of splitting regcache makes sense. I post the doxygen link rather than patches, because my code is still poor, but I think the doxygen is sufficient to show the design. > > As I understand it, the cooked registers exist because on some architectu= res > extra state needs saving in the cooked registers (code comment: "some > architectures > need to save/restore `cooked registers that live in memory.=E2=80=9D). > > Therefore the cooked register state needs to be a property of detached > and not of > readonly. > m_registers and m_register_status are fields of detached regcache, we can definitely save cooked register state in detached regcache. > > A different issue is that we treat save/restore differently. > In your code one of the recaches has to be both read-only (checking > via gdb_assert) and detached. > In my code the check is that the regcache is detached or > not. Read-only is not relevant. It is read-only in my code, but it doesn't have to be. I don't see any show-stoppers in the design of splitting regcache. The attributes "detached" and "read-only" are orthogonal in design. Do you have some comments on the overall design rather than the code details? I'll rewrite my patches, and post them. It is unfortunate that it is hard to review the overall design without the code. --=20 Yao (=E9=BD=90=E5=B0=A7)