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: [PATCH] Fix Python completion when using the "complete" command


On Wednesday, April 08 2015, Doug Evans wrote:

>  > +  resultobj = PyObject_CallMethodObjArgs ((PyObject *) obj, complete_cst,
>  > +					  textobj, wordobj, NULL);
>  > +  Py_DECREF (textobj);
>  > +  Py_DECREF (wordobj);
>  > +  if (!resultobj)
>  > +    {
>  > +      /* Just swallow errors here.  */
>  > +      PyErr_Clear ();
>  >      }
>
> I realize this is just copying the previous code,
> but does swallowing errors here make it hard to debug problems
> in the completer function?
> Is this something we want to address in a future patch?

Thanks for the review, Doug.

You have a valid point: swallowing errors in this part of the code does
make it hard to debug problems in the user-provided completer
functions.  And a small hack in the code proved me that it should be
fairly easy to print the error instead, just like cmdpy_function already
does.  I will see if I can prepare a patch to do that.

Meanwhile, I pushed the current patch upstream.

  <https://sourceware.org/ml/gdb-cvs/2015-04/msg00062.html>
  6d62641c832525382336c1b04731d85cb6c398e7

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/


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