From 90011666aa94e5791ef1ec7a772e38dc28bb8c15 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 27 Jun 2009 16:43:07 +0000 Subject: [PATCH] GetFunctions(): Ignore non-function symbols. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31270 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/debugger/debug_info/DebuggerDebugInfo.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/apps/debugger/debug_info/DebuggerDebugInfo.cpp b/src/apps/debugger/debug_info/DebuggerDebugInfo.cpp index 8a6875b3af..387f16cb7d 100644 --- a/src/apps/debugger/debug_info/DebuggerDebugInfo.cpp +++ b/src/apps/debugger/debug_info/DebuggerDebugInfo.cpp @@ -53,19 +53,25 @@ DebuggerDebugInfo::GetFunctions(BObjectList& functions) symbols.SortItems(&_CompareSymbols); // create the function infos + int32 functionsAdded = 0; for (int32 i = 0; SymbolInfo* symbol = symbols.ItemAt(i); i++) { + if (symbol->Type() != B_SYMBOL_TYPE_TEXT) + continue; + FunctionDebugInfo* function = new(std::nothrow) BasicFunctionDebugInfo( this, symbol->Address(), symbol->Size(), symbol->Name(), Demangler::Demangle(symbol->Name())); if (function == NULL || !functions.AddItem(function)) { delete function; int32 index = functions.CountItems() - 1; - for (i--; i >= 0; i--, index--) { + for (; functionsAdded >= 0; functionsAdded--, index--) { function = functions.RemoveItemAt(index); delete function; } return B_NO_MEMORY; } + + functionsAdded++; } return B_OK;