From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10336 invoked by alias); 3 Jun 2013 08:47:12 -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 10314 invoked by uid 89); 3 Jun 2013 08:47:09 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_EG autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 03 Jun 2013 08:47:08 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UjQPy-0002mc-Ax from Yao_Qi@mentor.com ; Mon, 03 Jun 2013 01:47:06 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 3 Jun 2013 01:47:05 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Mon, 3 Jun 2013 01:47:06 -0700 Message-ID: <51AC582E.5050702@codesourcery.com> Date: Mon, 03 Jun 2013 08:47:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Pedro Alves CC: Subject: Re: [PATCH 01/22] [GDBserver] Multi-process + multi-arch: core + GNU/Linux x86* References: <20130530121335.15047.12654.stgit@brno.lan> <20130530121343.15047.2067.stgit@brno.lan> In-Reply-To: <20130530121343.15047.2067.stgit@brno.lan> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2013-06/txt/msg00005.txt.bz2 On 05/30/2013 08:13 PM, Pedro Alves wrote: > diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c > index 6953d0e..39eb52e 100644 > --- a/gdb/gdbserver/inferiors.c > +++ b/gdb/gdbserver/inferiors.c > @@ -102,7 +102,6 @@ add_thread (ptid_t thread_id, void *target_data) > current_inferior = new_thread; > > new_thread->target_data = target_data; > - set_inferior_regcache_data (new_thread, new_register_cache ()); After read your introduction of this patch, it looks right to me. However, we may need some comments on creating regcache lazily in the code. One paragraph in the mail is pretty good, > The threads' regcaches are now created lazilly. The old scheme where > we created each of them when we added a new thread doesn't work > anymore, because we add the main thread/lwp before we see it stop for > the first time, and it is only when we see the thread stop for the > first time that we have a chance of determining the inferior's > architecture (through the_low_target.arch_setup). Therefore when we > add the main thread we don't know which architecture/tdesc its > regcache should have. I'd like to put this paragraph somewhere in the code, which will be helpful. > diff --git a/gdb/gdbserver/regcache.h b/gdb/gdbserver/regcache.h > index ce86322..700a2fe 100644 > --- a/gdb/gdbserver/regcache.h > +++ b/gdb/gdbserver/regcache.h > @@ -21,6 +21,7 @@ > > struct inferior_list_entry; > struct thread_info; > +struct target_desc; > > /* The register exists, it has a value, but we don't know what it is. > Used when inspecting traceframes. */ > @@ -35,6 +36,9 @@ struct thread_info; > > struct regcache > { > + /* The regcache's description. */ "The regcache's target description" ? -- Yao (齐尧)