This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING][PATCH] Python: Fix Python error when "Quit"ting a paged info pretty-printers
- From: Pedro Alves <palves at redhat dot com>
- To: Leonardo Boquillon <leonardo dot boquillon at tallertechnologies dot com>, gdb-patches at sourceware dot org, tom at tromey dot com
- Date: Tue, 15 Mar 2016 15:45:09 +0000
- Subject: Re: [PING][PATCH] Python: Fix Python error when "Quit"ting a paged info pretty-printers
- Authentication-results: sourceware.org; auth=none
- References: <1458046365-21110-1-git-send-email-leonardo dot boquillon at tallertechnologies dot com>
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