Re: [PATCH] [gdb/python] Handle error in gdbpy_initialize_gdb_readline

Tom Tromey <[email protected]>
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
>>>>> "Tom" == Tom de Vries <[email protected]> writes:

Tom>    if (eval_python_command (code, Py_file_input) == 0)
Tom>      PyOS_ReadlineFunctionPointer = gdbpy_readline_wrapper;
Tom> +  else
Tom> +    {
Tom> +      if (PyErr_Occurred ())
Tom> +	{
Tom> +	  PyErr_Print ();
Tom> +	  PyErr_Clear ();

It's a bit more normal in the python layer to use gdbpy_print_stack,
since that respects user error-reporting settings.

Tom> +      warning (_("Disabling import readline failed, python-interactive"
Tom> +		 " command disabled"));

CLI command names in output are normally double-quoted and displayed
using command_style.

thanks,
Tom
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.