From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4512 invoked by alias); 3 Jun 2009 19:36:51 -0000 Received: (qmail 4501 invoked by uid 22791); 3 Jun 2009 19:36:50 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Jun 2009 19:36:43 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.14.3/8.13.8) with ESMTP id n53JaVeb082108 for ; Wed, 3 Jun 2009 19:36:31 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n53JaVEB3375354 for ; Wed, 3 Jun 2009 21:36:31 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n53JaU9B015919 for ; Wed, 3 Jun 2009 21:36:30 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id n53JaT4Z015856; Wed, 3 Jun 2009 21:36:29 +0200 Message-Id: <200906031936.n53JaT4Z015856@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 03 Jun 2009 21:36:29 +0200 Subject: Re: [RFC,v2] Yank out target_ops->to_sections To: pedro@codesourcery.com (Pedro Alves) Date: Wed, 03 Jun 2009 19:36:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <200906031726.38327.pedro@codesourcery.com> from "Pedro Alves" at Jun 03, 2009 05:26:38 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2009-06/txt/msg00048.txt.bz2 Pedro Alves wrote: > I don't think anyone disagrees with that. With my proposal, there will > be ways to get from a frame/thread/inferior/whatever to the corresponding > address/symbol space, and where possible we'll use those. However, > consider the case where you have more than one program > loaded (say, /bin/cat and /bin/echo), and haven't started execution in > either of those yet. There is no "inferior" or "thread" object yet > for any of them, and you can't distinguish with inferior_ptid=20 > either (it's null_ptid in both cases). Currently, all this state > is spread around in globals all over (e.g., even exec_bfd can be > accessed in the most twisted code paths). But, it's the "prepare to > start a new inferior" part that ends up requiring the global. Ah, I see. > I'm proposing to aggregate them somewhere, but we still need to have a > global storing a pointer to the "current context" somewhere. I agree > that ideally then this global should only be accessed at high > layers, close to the UI, and that we should only need to pass to each > major component what it really needs and handles, as arguments. > But, that really *has* to be a long term goal. Just getting rid > of a single one of those globals (by passing them in arguments) is > a *lot* of hair for practically 0 gain at this point. Since we do > have to aggregate and store these globals somewhere, I think that > I'm taking a good first step. IMO, it's much better to just switch > a pointer than to come up with the old "infrun.c|thread.c:context_switch" > mess. We can then *incrementally* clean up interfaces, as we'll > then have a clearly visible goal to achieve. Anyway, things > will surely get clearer a bit further down the line when I post > the main juicy bits for discussion. OK, thanks for the explanation ... Looking forward to your patches :-) Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com