Re: [dwarf2_mark_helper patch] Re: [PATCH] Make interrupting tab-completion safe.

Sterling Augustine
2011-07-12T16:21:04Z

FWIW, this patch works great for me. Thanks.

Sterling

On Tue, Jul 12, 2011 at 4:14 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
...

> gdb/
> 2011-07-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
>
>        Fix occasional crash of CTRL-C during DWARF read in.
>        * dwarf2read.c (dwarf2_mark_helper): Return on NULL CU.
>
> --- a/gdb/dwarf2read.c
> +++ b/gdb/dwarf2read.c
> @@ -15455,6 +15455,13 @@ dwarf2_mark_helper (void **slot, void *data)
>   struct dwarf2_per_cu_data *per_cu;
>
>   per_cu = (struct dwarf2_per_cu_data *) *slot;
> +
> +  /* cu->dependencies references may not yet have been ever read if QUIT aborts
> +     reading of the chain.  As such dependencies remain valid there is not much
> +     useful to track and undo them during QUIT cleanups.  */
> +  if (per_cu->cu == NULL)
> +    return 1;
> +
>   if (per_cu->cu->mark)
>     return 1;
>   per_cu->cu->mark = 1;
>