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: [PING][PATCH] Python: Fix Python error when "Quit"ting a paged info pretty-printers


Hi Leonardo,

On 03/15/2016 12:52 PM, Leonardo Boquillon wrote:
> Right now the "Quit" command used in the output paging is handled as an exception.
> If we issue a "Quit" while outputting the registered pretty-printers list, the
> Python handling layer will catch it and think it's a Python error.
> 
> The fix is to check if the error coming from Python is a Quit signal. If it is,
> do not handle it as an error and resume the execution normally.

I'm not sure I fully understand this, but checking the exception
message looks suspicious to me.

It'd help if this had an accompanying testcase, to clearly show what
bug this is fixing, and make sure gdb doesn't regress in future.

We have a few tests under gdb.base/ that test pagination. Maybe
it'd be possible to copy / adjust one of those?

Also, it can't possibly be right to check msg == NULL after
having used that pointer in strncmp:

> +      if (strncmp(msg, "Quit", 5))
> +	  {
> +	    if (msg == NULL)

Thanks,
Pedro Alves


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