From d07ed419cf333c92f5b7376c2f97a899b7359161 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 12 Jul 2011 20:59:03 +0000 Subject: [PATCH] gdb/ Fix occasional crash of CTRL-C during DWARF read in. * dwarf2read.c (dwarf2_mark_helper): Return on NULL CU. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2read.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dffd058e641..60452ba730e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-07-12 Jan Kratochvil + + Fix occasional crash of CTRL-C during DWARF read in. + * dwarf2read.c (dwarf2_mark_helper): Return on NULL CU. + 2011-07-11 Tom Tromey * regcache.c (struct regcache_descr): Fix typo. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index a5bf1f7eb3f..fde5b6a1153 100644 --- 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 it 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; -- 2.30.2