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:
@@ -53,19 +53,25 @@ DebuggerDebugInfo::GetFunctions(BObjectList<FunctionDebugInfo>& 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;
|
||||
|
||||
Reference in New Issue
Block a user