This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: beginnings of Guile support
- From: Tom Tromey <tromey at redhat dot com>
- To: Doug Evans <dje at sceeck dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 09 Sep 2013 15:09:41 -0600
- Subject: Re: beginnings of Guile support
- Authentication-results: sourceware.org; auth=none
- References: <CAEei7h90tuXtBzVbNjtLQkv6ECA+EsdkYmt==MEMJcUf3m-bcA at mail dot gmail dot com>
>>>>> "Doug" == Doug Evans <dje@sceeck.org> 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