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 GDB crash in dprintf.exp


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


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