From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 495 invoked by alias); 9 Sep 2013 21:09:47 -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 479 invoked by uid 89); 9 Sep 2013 21:09:46 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2013 21:09:46 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r89L9gMN001781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Sep 2013 17:09:42 -0400 Received: from barimba (ovpn-113-132.phx2.redhat.com [10.3.113.132]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r89L9fUd005500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 9 Sep 2013 17:09:42 -0400 From: Tom Tromey To: Doug Evans Cc: gdb-patches@sourceware.org Subject: Re: beginnings of Guile support References: Date: Mon, 09 Sep 2013 21:09:00 -0000 In-Reply-To: (Doug Evans's message of "Fri, 6 Sep 2013 08:35:10 -0700") Message-ID: <871u4xhfca.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-09/txt/msg00314.txt.bz2 >>>>> "Doug" == Doug Evans writes: Doug> As a personal project, I'm adding scheme scripting to gdb. I'd rather not put this in. I think multiple scripting languages fragments the user community and leads to hard-to-debug problems. It also requires difficult cross-language integration. Your patch skips the hard bits, but I think that is cheating -- those have to be fixed first. Doug> To try to plug scheme in cleanly I've created scripting.[ch] as Doug> the interface between gdb and python/scheme. The current interface uses "slang" as a name, but that is the name of an existing scripting language. I think another name would be preferable in case someone wants to add slang scripting. Doug> +slang_sourcer_func * Doug> +get_slang_sourcer (const char *file) Doug> +{ Doug> + if (has_extension (file, ".py")) Doug> + { Doug> +#ifdef HAVE_PYTHON Doug> + return python_scripting_interface.source_script; Doug> +#else Doug> + return source_python_unsupported; Doug> +#endif I think there are too many #ifs of this form. It means the abstraction is incomplete. Doug> /* Variables used to pass information between the Breakpoint Doug> constructor and the breakpoint-created hook function. */ Doug> -breakpoint_object *bppy_pending_object; Doug> +gdbpy_breakpoint_object *bppy_pending_object; Renamings ought to be separate patches. Doug> -/* Helper function that overrides this Python object's Doug> - PyObject_GenericSetAttr to allow extra validation of the attribute Doug> - being set. */ Doug> - Doug> -static int Doug> -local_setattro (PyObject *self, PyObject *name, PyObject *v) Doug> -{ Doug> - breakpoint_object *obj = (breakpoint_object *) self; [...] I'm not sure why this was deleted, but it also seems like it ought to be a separate patch, or maybe dropped. Doug> +/* INCOMPLETE TODO LIST: I skimmed the guile code, but didn't read it heavily. I think anything that calls into Guile from gdb ought to prevent continuation capture. Otherwise madness will ensue. I don't know how you do that in Guile but I didn't see anything obvious in the code. Tom