2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2013, Rene Gollent, rene@gollent.com.
4 * Distributed under the terms of the MIT License.
7 #include "SpecificImageDebugInfo.h"
9 #include "BasicFunctionDebugInfo.h"
10 #include "DebuggerInterface.h"
11 #include "Demangler.h"
12 #include "ImageInfo.h"
13 #include "SymbolInfo.h"
16 SpecificImageDebugInfo::~SpecificImageDebugInfo()
22 SpecificImageDebugInfo::GetFunctionsFromSymbols(
23 const BObjectList
<SymbolInfo
>& symbols
,
24 BObjectList
<FunctionDebugInfo
>& functions
, DebuggerInterface
* interface
,
25 const ImageInfo
& imageInfo
, SpecificImageDebugInfo
* info
)
27 // create the function infos
28 int32 functionsAdded
= 0;
29 for (int32 i
= 0; SymbolInfo
* symbol
= symbols
.ItemAt(i
); i
++) {
30 if (symbol
->Type() != B_SYMBOL_TYPE_TEXT
)
33 FunctionDebugInfo
* function
= new(std::nothrow
) BasicFunctionDebugInfo(
34 info
, symbol
->Address(), symbol
->Size(), symbol
->Name(),
35 Demangler::Demangle(symbol
->Name()));
36 if (function
== NULL
|| !functions
.AddItem(function
)) {
38 int32 index
= functions
.CountItems() - 1;
39 for (; functionsAdded
>= 0; functionsAdded
--, index
--) {
40 function
= functions
.RemoveItemAt(index
);