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;