From 17cc8b9d8871a75afa7623cf2d7eed7f5a81f115 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Fri, 24 Jun 2011 03:47:23 +0000 Subject: [PATCH] Remove an assertion and replace with safe code that emits a warning. llvm-svn: 133786 --- lldb/source/Symbol/Function.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp index 160d455a9c28..be94a112d7c4 100644 --- a/lldb/source/Symbol/Function.cpp +++ b/lldb/source/Symbol/Function.cpp @@ -305,8 +305,19 @@ Function::GetBlock (bool can_create) { SymbolContext sc; CalculateSymbolContext(&sc); - assert(sc.module_sp); - sc.module_sp->GetSymbolVendor()->ParseFunctionBlocks(sc); + if (sc.module_sp) + { + sc.module_sp->GetSymbolVendor()->ParseFunctionBlocks(sc); + } + else + { + ::fprintf (stderr, + "unable to find module shared pointer for function '%s' in %s%s%s\n", + GetName().GetCString(), + m_comp_unit->GetDirectory().GetCString(), + m_comp_unit->GetDirectory() ? "/" : "", + m_comp_unit->GetFilename().GetCString()); + } m_block.SetBlockInfoHasBeenParsed (true, true); } return m_block;