This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Re: [RFC][patch 1/9] initial Python support


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]