From 9853dc470c5974e47276ec9d359fe0f542b3f663 Mon Sep 17 00:00:00 2001 From: Xiaozhu Meng Date: Tue, 27 Dec 2016 14:00:21 -0600 Subject: [PATCH] Line table can exists, but does not contain any entry --- symtabAPI/src/Object-elf.C | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/symtabAPI/src/Object-elf.C b/symtabAPI/src/Object-elf.C index ea6b286a45..1dabb837b4 100644 --- a/symtabAPI/src/Object-elf.C +++ b/symtabAPI/src/Object-elf.C @@ -4361,7 +4361,12 @@ void Object::parseLineInfoForCU(Dwarf_Die cuDIE, LineInformation* li_for_module) size_t offset = strings->size(); Dwarf_Signed filecount; status = dwarf_srcfiles(cuDIE, &files, &filecount, &ignored); - assert( status == DW_DLV_OK ); + if (status != DW_DLV_OK ) + { + // It could happen the line table is present, + // but there is no line in the table + return; + } // dwarf_line_srcfileno == 0 means unknown; 1...n means files[0...n-1] // so we ensure that we're adding a block of unknown, 1...n to the string table // and that offset + dwarf_line_srcfileno points to the correct string