GetFunctions(): Ignore non-function symbols.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31270 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-06-27 16:43:07 +00:00
parent fa982a133f
commit 90011666aa
@@ -53,19 +53,25 @@ DebuggerDebugInfo::GetFunctions(BObjectList<FunctionDebugInfo>& functions)
symbols.SortItems(&_CompareSymbols); symbols.SortItems(&_CompareSymbols);
// create the function infos // create the function infos
int32 functionsAdded = 0;
for (int32 i = 0; SymbolInfo* symbol = symbols.ItemAt(i); i++) { for (int32 i = 0; SymbolInfo* symbol = symbols.ItemAt(i); i++) {
if (symbol->Type() != B_SYMBOL_TYPE_TEXT)
continue;
FunctionDebugInfo* function = new(std::nothrow) BasicFunctionDebugInfo( FunctionDebugInfo* function = new(std::nothrow) BasicFunctionDebugInfo(
this, symbol->Address(), symbol->Size(), symbol->Name(), this, symbol->Address(), symbol->Size(), symbol->Name(),
Demangler::Demangle(symbol->Name())); Demangler::Demangle(symbol->Name()));
if (function == NULL || !functions.AddItem(function)) { if (function == NULL || !functions.AddItem(function)) {
delete function; delete function;
int32 index = functions.CountItems() - 1; int32 index = functions.CountItems() - 1;
for (i--; i >= 0; i--, index--) { for (; functionsAdded >= 0; functionsAdded--, index--) {
function = functions.RemoveItemAt(index); function = functions.RemoveItemAt(index);
delete function; delete function;
} }
return B_NO_MEMORY; return B_NO_MEMORY;
} }
functionsAdded++;
} }
return B_OK; return B_OK;