This is the mail archive of the 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: [patch] python: save/restore/fix error state

Jan> -	docstring = python_string_to_host_string (ds_obj);
Jan> +	{
Jan> +	  docstring = python_string_to_host_string (ds_obj);
Jan> +	  if (docstring == NULL)
Jan> +	    {
Jan> +	      xfree (cmd_name);
Jan> +	      xfree (pfx_name);
Jan> +	      return -1;

It seems to me that inability to convert the docstring shouldn't be a
fatal problem for command registration.  We can just fall back to the
no-docstring code.

This occurs a couple of times.

Jan> -	self->value.stringval = python_string_to_host_string (value);
Jan> +	{
Jan> +	  self->value.stringval = python_string_to_host_string (value);
Jan> +	  if (self->value.stringval == NULL)
Jan> +	    return -1;
Jan> +	}

I think this should probably convert to a temporary variable before
assigning to self->value.

The rest looks good to me.  Thanks for doing this.

We were recently kicking around the idea of using Cython to write this
layer.  It has one nice advantage over doing it by hand: it handles
reference counting and error checking automatically.  It isn't clear it
can be made to work for gdb, though :(


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