From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5493 invoked by alias); 2 Mar 2017 09:52: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 5142 invoked by uid 89); 2 Mar 2017 09:52:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS,UNSUBSCRIBE_BODY autolearn=ham version=3.3.2 spammy=rescue, gratified, excerpts, Personal X-HELO: mail-qk0-f196.google.com Received: from mail-qk0-f196.google.com (HELO mail-qk0-f196.google.com) (209.85.220.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 Mar 2017 09:52:33 +0000 Received: by mail-qk0-f196.google.com with SMTP id n127so17455841qkf.2 for ; Thu, 02 Mar 2017 01:52:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=vQ9VdRqF6IHiUx5CjgCbQIKVP3eYVN9QAVezjUbHtPs=; b=S50AieuEb37BwwAbMEDFyAVF5CtRGrnzxmzrANA44ThOnunJWKwHAU3S2No2GDVoqP 2ATxfUloCz9m+BeBsF8VawTkebrY0ctRE23tCdkuJ9T6WRw6yUONMkQWLnY56Z/dxbMK DIp3qAjB0iRO37x5oxn3Fz011pi2+SR4ydO2gzKP4+T1330IzwrwAO4m2fkUi5Q2kQ+e 76Wc92vGnNDH4KggyCXhFqyrvd+XNT3vZ/XFoQIvQzLAT49Fwc5qlcrJJ68VB3eQW8y5 rIxlH82I1xwPp+BrxUBdbueF0xFph54oag5ADuUHSMj6TpjvWqdu+RBE6E53XUfLNMVl 9J1A== X-Gm-Message-State: AMke39mtup6++Yh5TsCtJENef1R67pChP9G7yzIK3IwNgjCXvQa7v3v2QI9X0GdHBv0BSCjJenTmrOoZr/SIyg== X-Received: by 10.55.137.7 with SMTP id l7mr16132681qkd.11.1488448351942; Thu, 02 Mar 2017 01:52:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.140.194 with HTTP; Thu, 2 Mar 2017 01:52:31 -0800 (PST) In-Reply-To: <20170301215928.GP7871@redhat.com> References: <9C2B8A71-1050-4B8B-A27A-C620E46AB9A2@arm.com> <86d1e0rkam.fsf@gmail.com> <20170301172400.GM7871@redhat.com> <20170301211039.aagkvmdlkqn7jf5u@localhost> <20170301215928.GP7871@redhat.com> From: Yao Qi Date: Thu, 02 Mar 2017 09:52:00 -0000 Message-ID: Subject: Re: [PATCH] Remove MAX_REGISTER_SIZE from sol-thread.c To: "Frank Ch. Eigler" Cc: Alan Hayward , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00018.txt.bz2 On Wed, Mar 1, 2017 at 9:59 PM, Frank Ch. Eigler wrote: > Hold on! Personal email archives to the rescue. gdb/14571 was an > internal Cygnus PRMS bug number. This was solaris 2.5.1 era. > > Here are some excerpts from emails on the topic. Please excuse the > goofy "autoethnography", I'm just so weirdly gratified to have found > some traces of this old work! > They look great. > ------------------------------------------------------------------------ > > The problem was caused by sol-thread.c's inability to write to > individual registers in the target. The updated value got lost in > sol_thread_store_registers before being written out. The following > patch corrects the problem. > - a bug in the threads/procfs code caused the register cache > to be invalidated (re-read), if not all registers were > desired to be updated Now, I understand the problem you fixed 19 years ago. That is, before we write out the new value in global buffer "registers", we have p_td_thr_getgregs call, like this, val =3D p_td_thr_getgregs (&thandle, regset); if (val !=3D TD_OK) error ("sol_thread_store_registers: td_thr_getgregs %s", td_err_string (val)); val =3D p_td_thr_getfpregs (&thandle, &fpregset); if (val !=3D TD_OK) error ("sol_thread_store_registers: td_thr_getfpregs %s", td_err_string (val)); td_thr_getgregs in thread_db calls ps_lgetregs (in sol-threads.c) which fetches registers again and save it in global buffer "registers" (in findvar.c:supply_register), so that the new value to be written out in "registers" is lost. The save/restore across td_thr_getgregs/td_thr_getfpr= egs fixes this problem. Nowadays, we don't have the global buffer any more, so the save/restore is no longer needed. --=20 Yao (=E9=BD=90=E5=B0=A7)