This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Re: [RFC][patch 1/9] initial Python support
- From: Tom Tromey <tromey at redhat dot com>
- To: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Tue, 15 Jul 2008 11:19:30 -0600
- Subject: Re: [RFA] Re: [RFC][patch 1/9] initial Python support
- References: <20080429155212.444237503@br.ibm.com> <20080429155304.288626880@br.ibm.com> <20080528205921.GA2969@caradoc.them.org> <20080615181833.uxmo25mg0kko40kw@imap.linux.ibm.com> <1216107418.14956.27.camel@localhost.localdomain>
- Reply-to: tromey at redhat dot com
>>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:
This patch had a couple of problems I didn't have time to fix up
yesterday. I'm sorry about this ... I knew of them but didn't get the
message out on time.
Thiago> + if (list->control_type == python_control)
Thiago> + {
Thiago> + ui_out_field_string (uiout, NULL, "python");
Thiago> + print_command_lines (uiout, *list->body_list, depth + 1);
Thiago> + if (depth)
Thiago> + ui_out_spaces (uiout, 2 * depth);
Thiago> + ui_out_field_string (uiout, NULL, "end");
Thiago> + ui_out_text (uiout, "\n");
Thiago> + list = list->next;
Thiago> + continue;
We should probably explicitly *not* indent python command bodies
somehow.
Thiago> +@node Python
Thiago> +@chapter Scripting @value{GDBN} using Python
Thiago> +@cindex Python
I forgot to document the new 'python-stack' variable. (This one I
just realized this morning...)
Thiago> +
Thiago> +void
Thiago> +eval_python_from_control_command (struct command_line *cmd)
Thiago> +{
This function needs a comment.
Thiago> + char *tmpbuf = xstrprintf ("Type python script");
Thiago> + struct cleanup *cleanups = make_cleanup (xfree, tmpbuf);
Thiago> + struct command_line *l = get_command_line (python_control, "");
Thiago> + cleanups = make_cleanup_free_command_lines (&l);
Thiago> + execute_control_command_suppressed (l);
Thiago> + do_cleanups (cleanups);
Here we allocate a temporary string for no good reason (we can just
use a string constant afaik); then we don't actually print it as a
prompt. Whoops. I think I didn't quite finish a change
here... though I don't really remember.
How can we change our development process in git to make this work
simpler for you?
Tom