This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix GDB crash in dprintf.exp
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Thu, 28 Jan 2016 11:47:37 +0000
- Subject: Re: [PATCH] Fix GDB crash in dprintf.exp
- Authentication-results: sourceware.org; auth=none
- References: <1452859520-19444-1-git-send-email-yao dot qi at linaro dot org>
On 01/15/2016 12:05 PM, Yao Qi wrote:
> the root cause of this problem in this case is about linespec and
> symtab which produces additional incorrect location and a NULL is added to
> bp_tgt->tcommands. I posted a patch
> https://sourceware.org/ml/gdb-patches/2015-12/msg00321.html to fix it
> in linespec (the fix causes regression), but GDB still shouldn't add
> NULL into bp_tgt->tcommands. The logic of build_target_command_list
> looks odd to me. If we get something wrong in parse_cmd_to_aexpr (it
> returns NULL), we shouldn't continue, instead we should set flag
> null_command_or_parse_error. This is what this patch does.
I agree. build_target_condition_list has the same problem though.
(we could probably merge these functions).
There's something else odd in these functions -- the first two loops
over locations don't check whether the location is enabled, and
parse the ax anyway if disabled. Isn't that odd? The last loop
that pushes the bytecode into the vec does take that into account.
> I have a vague memory that the code here was discussed before, but I
> can't find the mail in archive.
>
No idea.
Thanks,
Pedro Alves