From a3b2a86bb7263eafa4f11a3b7cc0fb3adcfe1d39 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 17 Mar 2010 19:16:02 +0000 Subject: [PATCH] * dwarf2read.c (dwarf2_get_section_info): Handle case where no DWARF data is available. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2read.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f1e5f6a0b39..da6e1f8c1b6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-03-17 Tom Tromey + + * dwarf2read.c (dwarf2_get_section_info): Handle case where no + DWARF data is available. + 2010-03-17 Daniel Jacobowitz * symfile.c (generic_load): Reset breakpoints after loading. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index cbb742490f3..3789d09f8c1 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1397,6 +1397,16 @@ dwarf2_get_section_info (struct objfile *objfile, const char *section_name, struct dwarf2_per_objfile *data = objfile_data (objfile, dwarf2_objfile_data_key); struct dwarf2_section_info *info; + + /* We may see an objfile without any DWARF, in which case we just + return nothing. */ + if (data == NULL) + { + *sectp = NULL; + *bufp = NULL; + *sizep = 0; + return; + } if (section_is_p (section_name, EH_FRAME_SECTION)) info = &data->eh_frame; else if (section_is_p (section_name, FRAME_SECTION)) -- 2.30.2