From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26109 invoked by alias); 21 Oct 2008 18:12:20 -0000 Received: (qmail 26100 invoked by uid 22791); 21 Oct 2008 18:12:19 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.17.161) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 21 Oct 2008 18:11:36 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id m9LIBXmZ023945 for ; Tue, 21 Oct 2008 18:11:33 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.1) with ESMTP id m9LIBX173989570 for ; Tue, 21 Oct 2008 20:11:33 +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 m9LIBWLI020180 for ; Tue, 21 Oct 2008 20:11:33 +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 m9LIBW3I020177; Tue, 21 Oct 2008 20:11:32 +0200 Message-Id: <200810211811.m9LIBW3I020177@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 21 Oct 2008 20:11:32 +0200 Subject: Re: [RFC/RFA] add struct parse_context to all command functions To: tromey@redhat.com Date: Tue, 21 Oct 2008 18:12:00 -0000 From: "Ulrich Weigand" Cc: brobecker@adacore.com (Joel Brobecker), gdb-patches@sourceware.org In-Reply-To: from "Tom Tromey" at Oct 20, 2008 07:20:58 PM X-Mailer: ELM [version 2.5 PL2] 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: 2008-10/txt/msg00511.txt.bz2 Tom Tromey wrote: > Also, why pass in this particular subset of globals? There are lots > of globals in gdb, used all over. My view is that commands are by > their nature singletons (unless you want to support multiple CLIs at > once of course :-) and so would reasonably access global state even in > a design from scratch. IOW, I think it would make sense to only > bother with global-elimination for layers underneath the command > functions. I think it does make sense to make the context where a command is executed more explicit, so that at some point in the future we might actually be able to do something like "execute command X on thread Y" transparently without having to switch global state. Of course, more than just Joel's patch will be needed to achieve this ... > FWIW I also have a vaguely similar reorganization in the wings. I > removed all accesses to global variables from the value_print and > val_print hierarchy, in favor of a "print options" argument. So, my > interest in this sort of thing is not totally academic. Great! I was just about to start implementing something along those lines (to pull current_gdbarch out of the print routines) ... Do you already have a version of that patch you could share? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com