* Moved the data location resolution methods from StackFrameDebugInfo to the
respective Type classes. StackFrameDebugInfo is pretty much out of work now,
but maybe something comes up later.
* Renamed GlobalTypeLookupContext to GlobalTypeCache and renamed its methods.
* A TeamDebugInfo does now have a GlobalTypeCache which is used for resolving
types. Formerly it was created per stack frame, so all types had to be
resolved after each single step. Single-stepping is usably fast again.
The disadvantage is that DWARF theoretically allows types properties to
depend on instruction/frame/frame base pointer and we don't support that
anymore. I can't think of a reasonable application for that feature, though.
* Refactored DwarfStackFrameDebugInfo:
- Moved the type classes into new DwarfTypes.{h,cpp}.
- Moved the creation of types into new class DwarfTypeFactory.
- Added class DwarfTypeContext which bundles all the dependencies of the type
classes.
* Made DwarfFile a BReferenceable.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33495 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -32,6 +32,8 @@ SourceHdrs
|
|||||||
DwarfImageDebugInfo.cpp
|
DwarfImageDebugInfo.cpp
|
||||||
DwarfStackFrameDebugInfo.cpp
|
DwarfStackFrameDebugInfo.cpp
|
||||||
DwarfTeamDebugInfo.cpp
|
DwarfTeamDebugInfo.cpp
|
||||||
|
DwarfTypeFactory.cpp
|
||||||
|
DwarfTypes.cpp
|
||||||
: [ FDirName $(SUBDIR) dwarf ]
|
: [ FDirName $(SUBDIR) dwarf ]
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -62,6 +64,8 @@ Application Debugger :
|
|||||||
DwarfImageDebugInfo.cpp
|
DwarfImageDebugInfo.cpp
|
||||||
DwarfStackFrameDebugInfo.cpp
|
DwarfStackFrameDebugInfo.cpp
|
||||||
DwarfTeamDebugInfo.cpp
|
DwarfTeamDebugInfo.cpp
|
||||||
|
DwarfTypeFactory.cpp
|
||||||
|
DwarfTypes.cpp
|
||||||
Function.cpp
|
Function.cpp
|
||||||
FunctionDebugInfo.cpp
|
FunctionDebugInfo.cpp
|
||||||
FunctionInstance.cpp
|
FunctionInstance.cpp
|
||||||
|
|||||||
+10
-13
@@ -634,8 +634,7 @@ GetStackFrameValueJob::_GetValue()
|
|||||||
ValuePieceLocation piece = location->PieceAt(0);
|
ValuePieceLocation piece = location->PieceAt(0);
|
||||||
if (piece.type == VALUE_PIECE_LOCATION_MEMORY) {
|
if (piece.type == VALUE_PIECE_LOCATION_MEMORY) {
|
||||||
ValueLocation* dataLocation;
|
ValueLocation* dataLocation;
|
||||||
error = fStackFrame->DebugInfo()->ResolveObjectDataLocation(
|
error = type->ResolveObjectDataLocation(*location, dataLocation);
|
||||||
fStackFrame, type, *location, dataLocation);
|
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
@@ -866,9 +865,8 @@ GetStackFrameValueJob::_ResolveTypeAndLocation(Type*& _type,
|
|||||||
// The parent's location refers to the location of the complete
|
// The parent's location refers to the location of the complete
|
||||||
// object. We want to extract the location of a member.
|
// object. We want to extract the location of a member.
|
||||||
ValueLocation* location;
|
ValueLocation* location;
|
||||||
error = fStackFrame->DebugInfo()->ResolveBaseTypeLocation(
|
error = compoundType->ResolveBaseTypeLocation(baseType,
|
||||||
fStackFrame, parentType, baseType, *parentLocation,
|
*parentLocation, location);
|
||||||
location);
|
|
||||||
if (error != B_OK) {
|
if (error != B_OK) {
|
||||||
TRACE_LOCALS("GetStackFrameValueJob::"
|
TRACE_LOCALS("GetStackFrameValueJob::"
|
||||||
"_ResolveTypeAndLocation(): TYPE_COMPOUND: "
|
"_ResolveTypeAndLocation(): TYPE_COMPOUND: "
|
||||||
@@ -895,9 +893,8 @@ GetStackFrameValueJob::_ResolveTypeAndLocation(Type*& _type,
|
|||||||
// The parent's location refers to the location of the complete
|
// The parent's location refers to the location of the complete
|
||||||
// object. We want to extract the location of a member.
|
// object. We want to extract the location of a member.
|
||||||
ValueLocation* location;
|
ValueLocation* location;
|
||||||
error = fStackFrame->DebugInfo()->ResolveDataMemberLocation(
|
error = compoundType->ResolveDataMemberLocation(dataMember,
|
||||||
fStackFrame, parentType, dataMember, *parentLocation,
|
*parentLocation, location);
|
||||||
location);
|
|
||||||
if (error != B_OK) {
|
if (error != B_OK) {
|
||||||
TRACE_LOCALS("GetStackFrameValueJob::"
|
TRACE_LOCALS("GetStackFrameValueJob::"
|
||||||
"_ResolveTypeAndLocation(): TYPE_COMPOUND: "
|
"_ResolveTypeAndLocation(): TYPE_COMPOUND: "
|
||||||
@@ -931,8 +928,8 @@ GetStackFrameValueJob::_ResolveTypeAndLocation(Type*& _type,
|
|||||||
// resolve the location
|
// resolve the location
|
||||||
Type* type = dynamic_cast<AddressType*>(parentType)->BaseType();
|
Type* type = dynamic_cast<AddressType*>(parentType)->BaseType();
|
||||||
ValueLocation* location;
|
ValueLocation* location;
|
||||||
error = fStackFrame->DebugInfo()->ResolveObjectDataLocation(
|
error = type->ResolveObjectDataLocation(parentValue.ToUInt64(),
|
||||||
fStackFrame, type, parentValue.ToUInt64(), location);
|
location);
|
||||||
if (error != B_OK) {
|
if (error != B_OK) {
|
||||||
TRACE_LOCALS("GetStackFrameValueJob::"
|
TRACE_LOCALS("GetStackFrameValueJob::"
|
||||||
"_ResolveTypeAndLocation(): "
|
"_ResolveTypeAndLocation(): "
|
||||||
@@ -967,12 +964,12 @@ GetStackFrameValueJob::_ResolveTypeAndLocation(Type*& _type,
|
|||||||
|
|
||||||
// resolve the element location
|
// resolve the element location
|
||||||
ValueLocation* location;
|
ValueLocation* location;
|
||||||
error = fStackFrame->DebugInfo()->ResolveArrayElementLocation(
|
error = arrayType->ResolveElementLocation(indexPath,
|
||||||
fStackFrame, arrayType, indexPath, *parentLocation, location);
|
*parentLocation, location);
|
||||||
if (error != B_OK) {
|
if (error != B_OK) {
|
||||||
TRACE_LOCALS("GetStackFrameValueJob::"
|
TRACE_LOCALS("GetStackFrameValueJob::"
|
||||||
"_ResolveTypeAndLocation(): TYPE_ARRAY: "
|
"_ResolveTypeAndLocation(): TYPE_ARRAY: "
|
||||||
"ResolveArrayElementLocation() failed: %s\n",
|
"ResolveElementLocation() failed: %s\n",
|
||||||
strerror(error));
|
strerror(error));
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ ArchitectureX86::CreateStackFrame(Image* image, FunctionDebugInfo* function,
|
|||||||
|
|
||||||
// create the stack frame
|
// create the stack frame
|
||||||
StackFrameDebugInfo* stackFrameDebugInfo
|
StackFrameDebugInfo* stackFrameDebugInfo
|
||||||
= new(std::nothrow) NoOpStackFrameDebugInfo(this);
|
= new(std::nothrow) NoOpStackFrameDebugInfo;
|
||||||
if (stackFrameDebugInfo == NULL)
|
if (stackFrameDebugInfo == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<StackFrameDebugInfo> stackFrameDebugInfoReference(
|
Reference<StackFrameDebugInfo> stackFrameDebugInfoReference(
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ DebuggerImageDebugInfo::GetFunctions(BObjectList<FunctionDebugInfo>& functions)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
DebuggerImageDebugInfo::GetType(GlobalTypeLookupContext* context,
|
DebuggerImageDebugInfo::GetType(GlobalTypeCache* cache,
|
||||||
const BString& name, Type*& _type)
|
const BString& name, Type*& _type)
|
||||||
{
|
{
|
||||||
return B_UNSUPPORTED;
|
return B_UNSUPPORTED;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public:
|
|||||||
|
|
||||||
virtual status_t GetFunctions(
|
virtual status_t GetFunctions(
|
||||||
BObjectList<FunctionDebugInfo>& functions);
|
BObjectList<FunctionDebugInfo>& functions);
|
||||||
virtual status_t GetType(GlobalTypeLookupContext* context,
|
virtual status_t GetType(GlobalTypeCache* cache,
|
||||||
const BString& name, Type*& _type);
|
const BString& name, Type*& _type);
|
||||||
virtual status_t CreateFrame(Image* image,
|
virtual status_t CreateFrame(Image* image,
|
||||||
FunctionInstance* functionInstance,
|
FunctionInstance* functionInstance,
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
#include "DwarfFunctionDebugInfo.h"
|
#include "DwarfFunctionDebugInfo.h"
|
||||||
#include "DwarfStackFrameDebugInfo.h"
|
#include "DwarfStackFrameDebugInfo.h"
|
||||||
#include "DwarfTargetInterface.h"
|
#include "DwarfTargetInterface.h"
|
||||||
|
#include "DwarfTypeFactory.h"
|
||||||
|
#include "DwarfTypes.h"
|
||||||
#include "DwarfUtils.h"
|
#include "DwarfUtils.h"
|
||||||
#include "ElfFile.h"
|
#include "ElfFile.h"
|
||||||
#include "FileManager.h"
|
#include "FileManager.h"
|
||||||
@@ -201,7 +203,8 @@ struct DwarfImageDebugInfo::EntryListWrapper {
|
|||||||
|
|
||||||
DwarfImageDebugInfo::DwarfImageDebugInfo(const ImageInfo& imageInfo,
|
DwarfImageDebugInfo::DwarfImageDebugInfo(const ImageInfo& imageInfo,
|
||||||
Architecture* architecture, TeamMemory* teamMemory,
|
Architecture* architecture, TeamMemory* teamMemory,
|
||||||
FileManager* fileManager, GlobalTypeLookup* typeLookup, DwarfFile* file)
|
FileManager* fileManager, GlobalTypeLookup* typeLookup,
|
||||||
|
GlobalTypeCache* typeCache, DwarfFile* file)
|
||||||
:
|
:
|
||||||
fLock("dwarf image debug info"),
|
fLock("dwarf image debug info"),
|
||||||
fImageInfo(imageInfo),
|
fImageInfo(imageInfo),
|
||||||
@@ -209,15 +212,20 @@ DwarfImageDebugInfo::DwarfImageDebugInfo(const ImageInfo& imageInfo,
|
|||||||
fTeamMemory(teamMemory),
|
fTeamMemory(teamMemory),
|
||||||
fFileManager(fileManager),
|
fFileManager(fileManager),
|
||||||
fTypeLookup(typeLookup),
|
fTypeLookup(typeLookup),
|
||||||
|
fTypeCache(typeCache),
|
||||||
fFile(file),
|
fFile(file),
|
||||||
fTextSegment(NULL),
|
fTextSegment(NULL),
|
||||||
fRelocationDelta(0)
|
fRelocationDelta(0)
|
||||||
{
|
{
|
||||||
|
fFile->AcquireReference();
|
||||||
|
fTypeCache->AcquireReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DwarfImageDebugInfo::~DwarfImageDebugInfo()
|
DwarfImageDebugInfo::~DwarfImageDebugInfo()
|
||||||
{
|
{
|
||||||
|
fFile->ReleaseReference();
|
||||||
|
fTypeCache->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -354,7 +362,7 @@ DwarfImageDebugInfo::GetFunctions(BObjectList<FunctionDebugInfo>& functions)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
DwarfImageDebugInfo::GetType(GlobalTypeLookupContext* context,
|
DwarfImageDebugInfo::GetType(GlobalTypeCache* cache,
|
||||||
const BString& name, Type*& _type)
|
const BString& name, Type*& _type)
|
||||||
{
|
{
|
||||||
int32 registerCount = fArchitecture->CountRegisters();
|
int32 registerCount = fArchitecture->CountRegisters();
|
||||||
@@ -374,8 +382,8 @@ DwarfImageDebugInfo::GetType(GlobalTypeLookupContext* context,
|
|||||||
// iterate through all compilation units
|
// iterate through all compilation units
|
||||||
for (int32 i = 0; CompilationUnit* unit = fFile->CompilationUnitAt(i);
|
for (int32 i = 0; CompilationUnit* unit = fFile->CompilationUnitAt(i);
|
||||||
i++) {
|
i++) {
|
||||||
DwarfStackFrameDebugInfo* stackFrameDebugInfo = NULL;
|
DwarfTypeContext* typeContext = NULL;
|
||||||
Reference<DwarfStackFrameDebugInfo> stackFrameDebugInfoReference;
|
Reference<DwarfTypeContext> typeContextReference;
|
||||||
|
|
||||||
// iterate through all types of the compilation unit
|
// iterate through all types of the compilation unit
|
||||||
for (DebugInfoEntryList::ConstIterator it
|
for (DebugInfoEntryList::ConstIterator it
|
||||||
@@ -390,23 +398,20 @@ DwarfImageDebugInfo::GetType(GlobalTypeLookupContext* context,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// The name matches and the entry is not just a declaration --
|
// The name matches and the entry is not just a declaration --
|
||||||
// create the type. First create the StackFrameDebugInfo lazily.
|
// create the type. First create the type context lazily.
|
||||||
if (stackFrameDebugInfo == NULL) {
|
if (typeContext == NULL) {
|
||||||
stackFrameDebugInfo = new(std::nothrow)
|
typeContext = new(std::nothrow)
|
||||||
DwarfStackFrameDebugInfo(fArchitecture, fFile, unit, NULL,
|
DwarfTypeContext(fArchitecture, fImageInfo.ImageID(), fFile,
|
||||||
fTypeLookup, context, 0, 0, &inputInterface, fromDwarfMap);
|
unit, NULL, 0, 0, &inputInterface, fromDwarfMap);
|
||||||
if (stackFrameDebugInfo == NULL)
|
if (typeContext == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
stackFrameDebugInfoReference.SetTo(stackFrameDebugInfo, true);
|
typeContextReference.SetTo(typeContext, true);
|
||||||
|
|
||||||
error = stackFrameDebugInfo->Init();
|
|
||||||
if (error != B_OK)
|
|
||||||
return error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the type
|
// create the type
|
||||||
Type* type;
|
DwarfType* type;
|
||||||
error = stackFrameDebugInfo->CreateType(typeEntry, type);
|
DwarfTypeFactory typeFactory(typeContext, fTypeLookup, cache);
|
||||||
|
error = typeFactory.CreateType(typeEntry, type);
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -492,24 +497,13 @@ DwarfImageDebugInfo::CreateFrame(Image* image,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// create a type lookup context
|
|
||||||
GlobalTypeLookupContext* typeLookupContext
|
|
||||||
= new(std::nothrow) GlobalTypeLookupContext;
|
|
||||||
if (typeLookupContext == NULL)
|
|
||||||
return B_NO_MEMORY;
|
|
||||||
Reference<GlobalTypeLookupContext> typeLookupContextReference(
|
|
||||||
typeLookupContext, true);
|
|
||||||
|
|
||||||
error = typeLookupContext->Init();
|
|
||||||
if (error != B_OK)
|
|
||||||
return error;
|
|
||||||
|
|
||||||
// create the stack frame debug info
|
// create the stack frame debug info
|
||||||
DIESubprogram* subprogramEntry = function->SubprogramEntry();
|
DIESubprogram* subprogramEntry = function->SubprogramEntry();
|
||||||
DwarfStackFrameDebugInfo* stackFrameDebugInfo
|
DwarfStackFrameDebugInfo* stackFrameDebugInfo
|
||||||
= new(std::nothrow) DwarfStackFrameDebugInfo(fArchitecture, fFile, unit,
|
= new(std::nothrow) DwarfStackFrameDebugInfo(fArchitecture,
|
||||||
subprogramEntry, fTypeLookup, typeLookupContext, instructionPointer,
|
fImageInfo.ImageID(), fFile, unit, subprogramEntry, fTypeLookup,
|
||||||
framePointer, inputInterface, fromDwarfMap);
|
fTypeCache, instructionPointer, framePointer, inputInterface,
|
||||||
|
fromDwarfMap);
|
||||||
if (stackFrameDebugInfo == NULL)
|
if (stackFrameDebugInfo == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
Reference<DwarfStackFrameDebugInfo> stackFrameDebugInfoReference(
|
Reference<DwarfStackFrameDebugInfo> stackFrameDebugInfoReference(
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class ElfSegment;
|
|||||||
class FileManager;
|
class FileManager;
|
||||||
class FileSourceCode;
|
class FileSourceCode;
|
||||||
class FunctionID;
|
class FunctionID;
|
||||||
|
class GlobalTypeCache;
|
||||||
class GlobalTypeLookup;
|
class GlobalTypeLookup;
|
||||||
class LocatableFile;
|
class LocatableFile;
|
||||||
class SourceCode;
|
class SourceCode;
|
||||||
@@ -36,6 +37,7 @@ public:
|
|||||||
TeamMemory* teamMemory,
|
TeamMemory* teamMemory,
|
||||||
FileManager* fileManager,
|
FileManager* fileManager,
|
||||||
GlobalTypeLookup* typeLookup,
|
GlobalTypeLookup* typeLookup,
|
||||||
|
GlobalTypeCache* typeCache,
|
||||||
DwarfFile* file);
|
DwarfFile* file);
|
||||||
virtual ~DwarfImageDebugInfo();
|
virtual ~DwarfImageDebugInfo();
|
||||||
|
|
||||||
@@ -46,7 +48,7 @@ public:
|
|||||||
|
|
||||||
virtual status_t GetFunctions(
|
virtual status_t GetFunctions(
|
||||||
BObjectList<FunctionDebugInfo>& functions);
|
BObjectList<FunctionDebugInfo>& functions);
|
||||||
virtual status_t GetType(GlobalTypeLookupContext* context,
|
virtual status_t GetType(GlobalTypeCache* cache,
|
||||||
const BString& name, Type*& _type);
|
const BString& name, Type*& _type);
|
||||||
virtual status_t CreateFrame(Image* image,
|
virtual status_t CreateFrame(Image* image,
|
||||||
FunctionInstance* functionInstance,
|
FunctionInstance* functionInstance,
|
||||||
@@ -97,6 +99,7 @@ private:
|
|||||||
TeamMemory* fTeamMemory;
|
TeamMemory* fTeamMemory;
|
||||||
FileManager* fFileManager;
|
FileManager* fFileManager;
|
||||||
GlobalTypeLookup* fTypeLookup;
|
GlobalTypeLookup* fTypeLookup;
|
||||||
|
GlobalTypeCache* fTypeCache;
|
||||||
DwarfFile* fFile;
|
DwarfFile* fFile;
|
||||||
ElfSegment* fTextSegment;
|
ElfSegment* fTextSegment;
|
||||||
target_addr_t fRelocationDelta;
|
target_addr_t fRelocationDelta;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2,39 +2,29 @@
|
|||||||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef DWARF_INTERFACE_FACTORY_H
|
#ifndef DWARF_STACK_FRAME_DEBUG_INFO_H
|
||||||
#define DWARF_INTERFACE_FACTORY_H
|
#define DWARF_STACK_FRAME_DEBUG_INFO_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <image.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
#include "StackFrameDebugInfo.h"
|
#include "StackFrameDebugInfo.h"
|
||||||
#include "Type.h"
|
|
||||||
|
|
||||||
|
|
||||||
class CompilationUnit;
|
class CompilationUnit;
|
||||||
class DIEAddressingType;
|
|
||||||
class DIEArrayType;
|
|
||||||
class DIEBaseType;
|
|
||||||
class DIECompoundType;
|
|
||||||
class DIEEnumerationType;
|
|
||||||
class DIEFormalParameter;
|
class DIEFormalParameter;
|
||||||
class DIEModifiedType;
|
|
||||||
class DIEPointerToMemberType;
|
|
||||||
class DIESubprogram;
|
class DIESubprogram;
|
||||||
class DIESubrangeType;
|
|
||||||
class DIESubroutineType;
|
|
||||||
class DIEType;
|
class DIEType;
|
||||||
class DIETypedef;
|
|
||||||
class DIEUnspecifiedType;
|
|
||||||
class DIEVariable;
|
class DIEVariable;
|
||||||
class DwarfFile;
|
class DwarfFile;
|
||||||
class DwarfTargetInterface;
|
class DwarfTargetInterface;
|
||||||
|
class DwarfTypeContext;
|
||||||
|
class DwarfTypeFactory;
|
||||||
class FunctionID;
|
class FunctionID;
|
||||||
|
class GlobalTypeCache;
|
||||||
class GlobalTypeLookup;
|
class GlobalTypeLookup;
|
||||||
class GlobalTypeLookupContext;
|
|
||||||
class LocationDescription;
|
class LocationDescription;
|
||||||
class MemberLocation;
|
|
||||||
class ObjectID;
|
class ObjectID;
|
||||||
class RegisterMap;
|
class RegisterMap;
|
||||||
class Variable;
|
class Variable;
|
||||||
@@ -43,11 +33,12 @@ class Variable;
|
|||||||
class DwarfStackFrameDebugInfo : public StackFrameDebugInfo {
|
class DwarfStackFrameDebugInfo : public StackFrameDebugInfo {
|
||||||
public:
|
public:
|
||||||
DwarfStackFrameDebugInfo(
|
DwarfStackFrameDebugInfo(
|
||||||
Architecture* architecture, DwarfFile* file,
|
Architecture* architecture,
|
||||||
|
image_id imageID, DwarfFile* file,
|
||||||
CompilationUnit* compilationUnit,
|
CompilationUnit* compilationUnit,
|
||||||
DIESubprogram* subprogramEntry,
|
DIESubprogram* subprogramEntry,
|
||||||
GlobalTypeLookup* typeLookup,
|
GlobalTypeLookup* typeLookup,
|
||||||
GlobalTypeLookupContext* typeLookupContext,
|
GlobalTypeCache* typeCache,
|
||||||
target_addr_t instructionPointer,
|
target_addr_t instructionPointer,
|
||||||
target_addr_t framePointer,
|
target_addr_t framePointer,
|
||||||
DwarfTargetInterface* targetInterface,
|
DwarfTargetInterface* targetInterface,
|
||||||
@@ -56,28 +47,6 @@ public:
|
|||||||
|
|
||||||
status_t Init();
|
status_t Init();
|
||||||
|
|
||||||
virtual status_t ResolveObjectDataLocation(
|
|
||||||
StackFrame* stackFrame, Type* type,
|
|
||||||
const ValueLocation& objectLocation,
|
|
||||||
ValueLocation*& _location);
|
|
||||||
virtual status_t ResolveBaseTypeLocation(
|
|
||||||
StackFrame* stackFrame, Type* type,
|
|
||||||
BaseType* baseType,
|
|
||||||
const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location);
|
|
||||||
virtual status_t ResolveDataMemberLocation(
|
|
||||||
StackFrame* stackFrame, Type* type,
|
|
||||||
DataMember* member,
|
|
||||||
const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location);
|
|
||||||
virtual status_t ResolveArrayElementLocation(
|
|
||||||
StackFrame* stackFrame, ArrayType* type,
|
|
||||||
const ArrayIndexPath& indexPath,
|
|
||||||
const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location);
|
|
||||||
|
|
||||||
status_t CreateType(DIEType* typeEntry, Type*& _type);
|
|
||||||
// returns reference
|
|
||||||
status_t CreateParameter(FunctionID* functionID,
|
status_t CreateParameter(FunctionID* functionID,
|
||||||
DIEFormalParameter* parameterEntry,
|
DIEFormalParameter* parameterEntry,
|
||||||
Variable*& _parameter);
|
Variable*& _parameter);
|
||||||
@@ -90,102 +59,22 @@ public:
|
|||||||
private:
|
private:
|
||||||
struct DwarfFunctionParameterID;
|
struct DwarfFunctionParameterID;
|
||||||
struct DwarfLocalVariableID;
|
struct DwarfLocalVariableID;
|
||||||
struct DwarfType;
|
|
||||||
struct DwarfInheritance;
|
|
||||||
struct DwarfDataMember;
|
|
||||||
struct DwarfEnumerationValue;
|
|
||||||
struct DwarfArrayDimension;
|
|
||||||
struct DwarfFunctionParameter;
|
|
||||||
struct DwarfPrimitiveType;
|
|
||||||
struct DwarfCompoundType;
|
|
||||||
struct DwarfModifiedType;
|
|
||||||
struct DwarfTypedefType;
|
|
||||||
struct DwarfAddressType;
|
|
||||||
struct DwarfEnumerationType;
|
|
||||||
struct DwarfSubrangeType;
|
|
||||||
struct DwarfArrayType;
|
|
||||||
struct DwarfUnspecifiedType;
|
|
||||||
struct DwarfFunctionType;
|
|
||||||
struct DwarfPointerToMemberType;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
status_t _ResolveDataMemberLocation(
|
|
||||||
StackFrame* stackFrame,
|
|
||||||
DwarfCompoundType* type,
|
|
||||||
Type* memberType,
|
|
||||||
const MemberLocation* memberLocation,
|
|
||||||
const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location);
|
|
||||||
// returns a new location
|
|
||||||
|
|
||||||
status_t _CreateType(DIEType* typeEntry,
|
|
||||||
DwarfType*& _type);
|
|
||||||
status_t _CreateTypeInternal(const BString& name,
|
|
||||||
DIEType* typeEntry, DwarfType*& _type);
|
|
||||||
|
|
||||||
status_t _CreateCompoundType(const BString& name,
|
|
||||||
DIECompoundType* typeEntry,
|
|
||||||
DwarfType*& _type);
|
|
||||||
status_t _CreatePrimitiveType(const BString& name,
|
|
||||||
DIEBaseType* typeEntry,
|
|
||||||
DwarfType*& _type);
|
|
||||||
status_t _CreateAddressType(const BString& name,
|
|
||||||
DIEAddressingType* typeEntry,
|
|
||||||
address_type_kind addressKind,
|
|
||||||
DwarfType*& _type);
|
|
||||||
status_t _CreateModifiedType(const BString& name,
|
|
||||||
DIEModifiedType* typeEntry,
|
|
||||||
uint32 modifiers, DwarfType*& _type);
|
|
||||||
status_t _CreateTypedefType(const BString& name,
|
|
||||||
DIETypedef* typeEntry, DwarfType*& _type);
|
|
||||||
status_t _CreateArrayType(const BString& name,
|
|
||||||
DIEArrayType* typeEntry,
|
|
||||||
DwarfType*& _type);
|
|
||||||
status_t _CreateEnumerationType(const BString& name,
|
|
||||||
DIEEnumerationType* typeEntry,
|
|
||||||
DwarfType*& _type);
|
|
||||||
status_t _CreateSubrangeType(const BString& name,
|
|
||||||
DIESubrangeType* typeEntry,
|
|
||||||
DwarfType*& _type);
|
|
||||||
status_t _CreateUnspecifiedType(const BString& name,
|
|
||||||
DIEUnspecifiedType* typeEntry,
|
|
||||||
DwarfType*& _type);
|
|
||||||
status_t _CreateFunctionType(const BString& name,
|
|
||||||
DIESubroutineType* typeEntry,
|
|
||||||
DwarfType*& _type);
|
|
||||||
status_t _CreatePointerToMemberType(const BString& name,
|
|
||||||
DIEPointerToMemberType* typeEntry,
|
|
||||||
DwarfType*& _type);
|
|
||||||
|
|
||||||
status_t _CreateVariable(ObjectID* id,
|
status_t _CreateVariable(ObjectID* id,
|
||||||
const BString& name, DIEType* typeEntry,
|
const BString& name, DIEType* typeEntry,
|
||||||
LocationDescription* locationDescription,
|
LocationDescription* locationDescription,
|
||||||
Variable*& _variable);
|
Variable*& _variable);
|
||||||
|
|
||||||
status_t _ResolveTypedef(DIETypedef* entry,
|
|
||||||
DIEType*& _baseTypeEntry);
|
|
||||||
status_t _ResolveTypeByteSize(DIEType* typeEntry,
|
|
||||||
uint64& _size);
|
|
||||||
|
|
||||||
status_t _ResolveLocation(
|
|
||||||
const LocationDescription* description,
|
|
||||||
target_addr_t objectAddress, Type* type,
|
|
||||||
ValueLocation& _location);
|
|
||||||
|
|
||||||
template<typename EntryType>
|
template<typename EntryType>
|
||||||
static DIEType* _GetDIEType(EntryType* entry);
|
static DIEType* _GetDIEType(EntryType* entry);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DwarfFile* fFile;
|
DwarfTypeContext* fTypeContext;
|
||||||
CompilationUnit* fCompilationUnit;
|
|
||||||
DIESubprogram* fSubprogramEntry;
|
|
||||||
GlobalTypeLookup* fTypeLookup;
|
GlobalTypeLookup* fTypeLookup;
|
||||||
GlobalTypeLookupContext* fTypeLookupContext;
|
GlobalTypeCache* fTypeCache;
|
||||||
target_addr_t fInstructionPointer;
|
DwarfTypeFactory* fTypeFactory;
|
||||||
target_addr_t fFramePointer;
|
|
||||||
DwarfTargetInterface* fTargetInterface;
|
|
||||||
RegisterMap* fFromDwarfRegisterMap;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // DWARF_INTERFACE_FACTORY_H
|
#endif // DWARF_STACK_FRAME_DEBUG_INFO_H
|
||||||
|
|||||||
@@ -9,26 +9,31 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "DwarfFile.h"
|
||||||
#include "DwarfImageDebugInfo.h"
|
#include "DwarfImageDebugInfo.h"
|
||||||
#include "DwarfManager.h"
|
#include "DwarfManager.h"
|
||||||
|
#include "GlobalTypeLookup.h"
|
||||||
#include "LocatableFile.h"
|
#include "LocatableFile.h"
|
||||||
|
|
||||||
|
|
||||||
DwarfTeamDebugInfo::DwarfTeamDebugInfo(Architecture* architecture,
|
DwarfTeamDebugInfo::DwarfTeamDebugInfo(Architecture* architecture,
|
||||||
TeamMemory* teamMemory, FileManager* fileManager,
|
TeamMemory* teamMemory, FileManager* fileManager,
|
||||||
GlobalTypeLookup* typeLookup)
|
GlobalTypeLookup* typeLookup, GlobalTypeCache* typeCache)
|
||||||
:
|
:
|
||||||
fArchitecture(architecture),
|
fArchitecture(architecture),
|
||||||
fTeamMemory(teamMemory),
|
fTeamMemory(teamMemory),
|
||||||
fFileManager(fileManager),
|
fFileManager(fileManager),
|
||||||
fManager(NULL),
|
fManager(NULL),
|
||||||
fTypeLookup(typeLookup)
|
fTypeLookup(typeLookup),
|
||||||
|
fTypeCache(typeCache)
|
||||||
{
|
{
|
||||||
|
fTypeCache->AcquireReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DwarfTeamDebugInfo::~DwarfTeamDebugInfo()
|
DwarfTeamDebugInfo::~DwarfTeamDebugInfo()
|
||||||
{
|
{
|
||||||
|
fTypeCache->ReleaseReference();
|
||||||
delete fManager;
|
delete fManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,14 +65,18 @@ DwarfTeamDebugInfo::CreateImageDebugInfo(const ImageInfo& imageInfo,
|
|||||||
// try to load the DWARF file
|
// try to load the DWARF file
|
||||||
DwarfFile* file;
|
DwarfFile* file;
|
||||||
status_t error = fManager->LoadFile(filePath, file);
|
status_t error = fManager->LoadFile(filePath, file);
|
||||||
if (error == B_OK)
|
if (error != B_OK)
|
||||||
error = fManager->FinishLoading();
|
return error;
|
||||||
|
Reference<DwarfFile> fileReference(file, true);
|
||||||
|
|
||||||
|
error = fManager->FinishLoading();
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
// create the image debug info
|
// create the image debug info
|
||||||
DwarfImageDebugInfo* debugInfo = new(std::nothrow) DwarfImageDebugInfo(
|
DwarfImageDebugInfo* debugInfo = new(std::nothrow) DwarfImageDebugInfo(
|
||||||
imageInfo, fArchitecture, fTeamMemory, fFileManager, fTypeLookup, file);
|
imageInfo, fArchitecture, fTeamMemory, fFileManager, fTypeLookup,
|
||||||
|
fTypeCache, file);
|
||||||
if (debugInfo == NULL)
|
if (debugInfo == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class Architecture;
|
|||||||
class DwarfManager;
|
class DwarfManager;
|
||||||
class FileManager;
|
class FileManager;
|
||||||
class ImageInfo;
|
class ImageInfo;
|
||||||
|
class GlobalTypeCache;
|
||||||
class GlobalTypeLookup;
|
class GlobalTypeLookup;
|
||||||
class TeamMemory;
|
class TeamMemory;
|
||||||
|
|
||||||
@@ -21,7 +22,8 @@ public:
|
|||||||
DwarfTeamDebugInfo(Architecture* architecture,
|
DwarfTeamDebugInfo(Architecture* architecture,
|
||||||
TeamMemory* teamMemory,
|
TeamMemory* teamMemory,
|
||||||
FileManager* fileManager,
|
FileManager* fileManager,
|
||||||
GlobalTypeLookup* typeLookup);
|
GlobalTypeLookup* typeLookup,
|
||||||
|
GlobalTypeCache* typeCache);
|
||||||
virtual ~DwarfTeamDebugInfo();
|
virtual ~DwarfTeamDebugInfo();
|
||||||
|
|
||||||
status_t Init();
|
status_t Init();
|
||||||
@@ -36,6 +38,7 @@ private:
|
|||||||
FileManager* fFileManager;
|
FileManager* fFileManager;
|
||||||
DwarfManager* fManager;
|
DwarfManager* fManager;
|
||||||
GlobalTypeLookup* fTypeLookup;
|
GlobalTypeLookup* fTypeLookup;
|
||||||
|
GlobalTypeCache* fTypeCache;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,117 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef DWARF_TYPE_FACTORY_H
|
||||||
|
#define DWARF_TYPE_FACTORY_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <String.h>
|
||||||
|
|
||||||
|
#include "Type.h"
|
||||||
|
|
||||||
|
|
||||||
|
class CompilationUnit;
|
||||||
|
class DIEAddressingType;
|
||||||
|
class DIEArrayType;
|
||||||
|
class DIEBaseType;
|
||||||
|
class DIECompoundType;
|
||||||
|
class DIEEnumerationType;
|
||||||
|
class DIEFormalParameter;
|
||||||
|
class DIEModifiedType;
|
||||||
|
class DIEPointerToMemberType;
|
||||||
|
class DIESubprogram;
|
||||||
|
class DIESubrangeType;
|
||||||
|
class DIESubroutineType;
|
||||||
|
class DIEType;
|
||||||
|
class DIETypedef;
|
||||||
|
class DIEUnspecifiedType;
|
||||||
|
class DwarfAddressType;
|
||||||
|
class DwarfArrayDimension;
|
||||||
|
class DwarfArrayType;
|
||||||
|
class DwarfCompoundType;
|
||||||
|
class DwarfDataMember;
|
||||||
|
class DwarfEnumerationType;
|
||||||
|
class DwarfEnumerationValue;
|
||||||
|
class DwarfFile;
|
||||||
|
class DwarfFunctionParameter;
|
||||||
|
class DwarfFunctionType;
|
||||||
|
class DwarfInheritance;
|
||||||
|
class DwarfModifiedType;
|
||||||
|
class DwarfPointerToMemberType;
|
||||||
|
class DwarfPrimitiveType;
|
||||||
|
class DwarfSubrangeType;
|
||||||
|
class DwarfTargetInterface;
|
||||||
|
class DwarfType;
|
||||||
|
class DwarfTypeContext;
|
||||||
|
class DwarfTypedefType;
|
||||||
|
class DwarfUnspecifiedType;
|
||||||
|
class GlobalTypeCache;
|
||||||
|
class GlobalTypeLookup;
|
||||||
|
class LocationDescription;
|
||||||
|
class MemberLocation;
|
||||||
|
class RegisterMap;
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfTypeFactory {
|
||||||
|
public:
|
||||||
|
DwarfTypeFactory(DwarfTypeContext* typeContext,
|
||||||
|
GlobalTypeLookup* typeLookup,
|
||||||
|
GlobalTypeCache* typeCache);
|
||||||
|
~DwarfTypeFactory();
|
||||||
|
|
||||||
|
status_t CreateType(DIEType* typeEntry,
|
||||||
|
DwarfType*& _type);
|
||||||
|
// returns reference
|
||||||
|
|
||||||
|
private:
|
||||||
|
status_t _CreateTypeInternal(const BString& name,
|
||||||
|
DIEType* typeEntry, DwarfType*& _type);
|
||||||
|
|
||||||
|
status_t _CreateCompoundType(const BString& name,
|
||||||
|
DIECompoundType* typeEntry,
|
||||||
|
DwarfType*& _type);
|
||||||
|
status_t _CreatePrimitiveType(const BString& name,
|
||||||
|
DIEBaseType* typeEntry,
|
||||||
|
DwarfType*& _type);
|
||||||
|
status_t _CreateAddressType(const BString& name,
|
||||||
|
DIEAddressingType* typeEntry,
|
||||||
|
address_type_kind addressKind,
|
||||||
|
DwarfType*& _type);
|
||||||
|
status_t _CreateModifiedType(const BString& name,
|
||||||
|
DIEModifiedType* typeEntry,
|
||||||
|
uint32 modifiers, DwarfType*& _type);
|
||||||
|
status_t _CreateTypedefType(const BString& name,
|
||||||
|
DIETypedef* typeEntry, DwarfType*& _type);
|
||||||
|
status_t _CreateArrayType(const BString& name,
|
||||||
|
DIEArrayType* typeEntry,
|
||||||
|
DwarfType*& _type);
|
||||||
|
status_t _CreateEnumerationType(const BString& name,
|
||||||
|
DIEEnumerationType* typeEntry,
|
||||||
|
DwarfType*& _type);
|
||||||
|
status_t _CreateSubrangeType(const BString& name,
|
||||||
|
DIESubrangeType* typeEntry,
|
||||||
|
DwarfType*& _type);
|
||||||
|
status_t _CreateUnspecifiedType(const BString& name,
|
||||||
|
DIEUnspecifiedType* typeEntry,
|
||||||
|
DwarfType*& _type);
|
||||||
|
status_t _CreateFunctionType(const BString& name,
|
||||||
|
DIESubroutineType* typeEntry,
|
||||||
|
DwarfType*& _type);
|
||||||
|
status_t _CreatePointerToMemberType(const BString& name,
|
||||||
|
DIEPointerToMemberType* typeEntry,
|
||||||
|
DwarfType*& _type);
|
||||||
|
|
||||||
|
status_t _ResolveTypedef(DIETypedef* entry,
|
||||||
|
DIEType*& _baseTypeEntry);
|
||||||
|
status_t _ResolveTypeByteSize(DIEType* typeEntry,
|
||||||
|
uint64& _size);
|
||||||
|
|
||||||
|
private:
|
||||||
|
DwarfTypeContext* fTypeContext;
|
||||||
|
GlobalTypeLookup* fTypeLookup;
|
||||||
|
GlobalTypeCache* fTypeCache;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // DWARF_TYPE_FACTORY_H
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,526 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef DWARF_TYPES_H
|
||||||
|
#define DWARF_TYPES_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <String.h>
|
||||||
|
|
||||||
|
#include <ObjectList.h>
|
||||||
|
#include <Referenceable.h>
|
||||||
|
|
||||||
|
#include "Type.h"
|
||||||
|
|
||||||
|
|
||||||
|
class Architecture;
|
||||||
|
class CompilationUnit;
|
||||||
|
class DIEAddressingType;
|
||||||
|
class DIEArrayType;
|
||||||
|
class DIEBaseType;
|
||||||
|
class DIECompoundType;
|
||||||
|
class DIEEnumerationType;
|
||||||
|
class DIEEnumerator;
|
||||||
|
class DIEFormalParameter;
|
||||||
|
class DIEInheritance;
|
||||||
|
class DIEMember;
|
||||||
|
class DIEModifiedType;
|
||||||
|
class DIEPointerToMemberType;
|
||||||
|
class DIESubprogram;
|
||||||
|
class DIESubrangeType;
|
||||||
|
class DIESubroutineType;
|
||||||
|
class DIEType;
|
||||||
|
class DIETypedef;
|
||||||
|
class DIEUnspecifiedType;
|
||||||
|
class DwarfFile;
|
||||||
|
class DwarfTargetInterface;
|
||||||
|
struct LocationDescription;
|
||||||
|
struct MemberLocation;
|
||||||
|
class RegisterMap;
|
||||||
|
class ValueLocation;
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfTypeContext : public BReferenceable {
|
||||||
|
public:
|
||||||
|
DwarfTypeContext(Architecture* architecture,
|
||||||
|
image_id imageID, DwarfFile* file,
|
||||||
|
CompilationUnit* compilationUnit,
|
||||||
|
DIESubprogram* subprogramEntry,
|
||||||
|
target_addr_t instructionPointer,
|
||||||
|
target_addr_t framePointer,
|
||||||
|
DwarfTargetInterface* targetInterface,
|
||||||
|
RegisterMap* fromDwarfRegisterMap);
|
||||||
|
~DwarfTypeContext();
|
||||||
|
|
||||||
|
Architecture* GetArchitecture() const
|
||||||
|
{ return fArchitecture; }
|
||||||
|
image_id ImageID() const
|
||||||
|
{ return fImageID; }
|
||||||
|
DwarfFile* File() const
|
||||||
|
{ return fFile; }
|
||||||
|
CompilationUnit* GetCompilationUnit() const
|
||||||
|
{ return fCompilationUnit; }
|
||||||
|
DIESubprogram* SubprogramEntry() const
|
||||||
|
{ return fSubprogramEntry; }
|
||||||
|
target_addr_t InstructionPointer() const
|
||||||
|
{ return fInstructionPointer; }
|
||||||
|
target_addr_t FramePointer() const
|
||||||
|
{ return fFramePointer; }
|
||||||
|
DwarfTargetInterface* TargetInterface() const
|
||||||
|
{ return fTargetInterface; }
|
||||||
|
RegisterMap* FromDwarfRegisterMap() const
|
||||||
|
{ return fFromDwarfRegisterMap; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
Architecture* fArchitecture;
|
||||||
|
image_id fImageID;
|
||||||
|
DwarfFile* fFile;
|
||||||
|
CompilationUnit* fCompilationUnit;
|
||||||
|
DIESubprogram* fSubprogramEntry;
|
||||||
|
target_addr_t fInstructionPointer;
|
||||||
|
target_addr_t fFramePointer;
|
||||||
|
DwarfTargetInterface* fTargetInterface;
|
||||||
|
RegisterMap* fFromDwarfRegisterMap;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfType : public virtual Type {
|
||||||
|
public:
|
||||||
|
DwarfType(DwarfTypeContext* typeContext,
|
||||||
|
const BString& name);
|
||||||
|
~DwarfType();
|
||||||
|
|
||||||
|
virtual image_id ImageID() const;
|
||||||
|
virtual const char* Name() const;
|
||||||
|
virtual target_size_t ByteSize() const;
|
||||||
|
|
||||||
|
virtual status_t ResolveObjectDataLocation(
|
||||||
|
const ValueLocation& objectLocation,
|
||||||
|
ValueLocation*& _location);
|
||||||
|
virtual status_t ResolveObjectDataLocation(
|
||||||
|
target_addr_t objectAddress,
|
||||||
|
ValueLocation*& _location);
|
||||||
|
|
||||||
|
DwarfTypeContext* TypeContext() const
|
||||||
|
{ return fTypeContext; }
|
||||||
|
|
||||||
|
void SetByteSize(target_size_t size)
|
||||||
|
{ fByteSize = size; }
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const = 0;
|
||||||
|
|
||||||
|
status_t ResolveLocation(DwarfTypeContext* typeContext,
|
||||||
|
const LocationDescription* description,
|
||||||
|
target_addr_t objectAddress,
|
||||||
|
ValueLocation& _location);
|
||||||
|
|
||||||
|
private:
|
||||||
|
DwarfTypeContext* fTypeContext;
|
||||||
|
BString fName;
|
||||||
|
target_size_t fByteSize;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfInheritance : public BaseType {
|
||||||
|
public:
|
||||||
|
DwarfInheritance(DIEInheritance* entry,
|
||||||
|
DwarfType* type);
|
||||||
|
~DwarfInheritance();
|
||||||
|
|
||||||
|
virtual Type* GetType() const;
|
||||||
|
|
||||||
|
DwarfType* GetDwarfType() const
|
||||||
|
{ return fType; }
|
||||||
|
DIEInheritance* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIEInheritance* fEntry;
|
||||||
|
DwarfType* fType;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfDataMember : public DataMember {
|
||||||
|
public:
|
||||||
|
DwarfDataMember(DIEMember* entry,
|
||||||
|
const BString& name, DwarfType* type);
|
||||||
|
~DwarfDataMember();
|
||||||
|
|
||||||
|
virtual const char* Name() const;
|
||||||
|
virtual Type* GetType() const;
|
||||||
|
|
||||||
|
DwarfType* GetDwarfType() const
|
||||||
|
{ return fType; }
|
||||||
|
DIEMember* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIEMember* fEntry;
|
||||||
|
BString fName;
|
||||||
|
DwarfType* fType;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfEnumerationValue : public EnumerationValue {
|
||||||
|
public:
|
||||||
|
DwarfEnumerationValue(DIEEnumerator* entry,
|
||||||
|
const BString& name, const BVariant& value);
|
||||||
|
~DwarfEnumerationValue();
|
||||||
|
|
||||||
|
virtual const char* Name() const;
|
||||||
|
virtual BVariant Value() const;
|
||||||
|
|
||||||
|
DIEEnumerator* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIEEnumerator* fEntry;
|
||||||
|
BString fName;
|
||||||
|
BVariant fValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfArrayDimension : public ArrayDimension {
|
||||||
|
public:
|
||||||
|
DwarfArrayDimension(DwarfType* type);
|
||||||
|
~DwarfArrayDimension();
|
||||||
|
|
||||||
|
virtual Type* GetType() const;
|
||||||
|
|
||||||
|
DwarfType* GetDwarfType() const
|
||||||
|
{ return fType; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DwarfType* fType;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfFunctionParameter : public FunctionParameter {
|
||||||
|
public:
|
||||||
|
DwarfFunctionParameter(
|
||||||
|
DIEFormalParameter* entry,
|
||||||
|
const BString& name, DwarfType* type);
|
||||||
|
~DwarfFunctionParameter();
|
||||||
|
|
||||||
|
virtual const char* Name() const;
|
||||||
|
virtual Type* GetType() const;
|
||||||
|
|
||||||
|
DIEFormalParameter* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIEFormalParameter* fEntry;
|
||||||
|
BString fName;
|
||||||
|
DwarfType* fType;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfPrimitiveType : public PrimitiveType, public DwarfType {
|
||||||
|
public:
|
||||||
|
DwarfPrimitiveType(
|
||||||
|
DwarfTypeContext* typeContext,
|
||||||
|
const BString& name, DIEBaseType* entry,
|
||||||
|
uint32 typeConstant);
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const;
|
||||||
|
virtual uint32 TypeConstant() const;
|
||||||
|
|
||||||
|
DIEBaseType* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIEBaseType* fEntry;
|
||||||
|
uint32 fTypeConstant;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfCompoundType : public CompoundType, public DwarfType {
|
||||||
|
public:
|
||||||
|
DwarfCompoundType(DwarfTypeContext* typeContext,
|
||||||
|
const BString& name, DIECompoundType* entry);
|
||||||
|
~DwarfCompoundType();
|
||||||
|
|
||||||
|
virtual int32 CountBaseTypes() const;
|
||||||
|
virtual BaseType* BaseTypeAt(int32 index) const;
|
||||||
|
|
||||||
|
virtual int32 CountDataMembers() const;
|
||||||
|
virtual DataMember* DataMemberAt(int32 index) const;
|
||||||
|
|
||||||
|
virtual status_t ResolveBaseTypeLocation(BaseType* _baseType,
|
||||||
|
const ValueLocation& parentLocation,
|
||||||
|
ValueLocation*& _location);
|
||||||
|
virtual status_t ResolveDataMemberLocation(DataMember* _member,
|
||||||
|
const ValueLocation& parentLocation,
|
||||||
|
ValueLocation*& _location);
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const;
|
||||||
|
|
||||||
|
DIECompoundType* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
bool AddInheritance(DwarfInheritance* inheritance);
|
||||||
|
bool AddDataMember(DwarfDataMember* member);
|
||||||
|
|
||||||
|
private:
|
||||||
|
typedef BObjectList<DwarfDataMember> DataMemberList;
|
||||||
|
typedef BObjectList<DwarfInheritance> InheritanceList;
|
||||||
|
|
||||||
|
private:
|
||||||
|
status_t _ResolveDataMemberLocation(
|
||||||
|
DwarfType* memberType,
|
||||||
|
const MemberLocation* memberLocation,
|
||||||
|
const ValueLocation& parentLocation,
|
||||||
|
ValueLocation*& _location);
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIECompoundType* fEntry;
|
||||||
|
InheritanceList fInheritances;
|
||||||
|
DataMemberList fDataMembers;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfArrayType : public ArrayType, public DwarfType {
|
||||||
|
public:
|
||||||
|
DwarfArrayType(DwarfTypeContext* typeContext,
|
||||||
|
const BString& name, DIEArrayType* entry,
|
||||||
|
DwarfType* baseType);
|
||||||
|
~DwarfArrayType();
|
||||||
|
|
||||||
|
virtual Type* BaseType() const;
|
||||||
|
|
||||||
|
virtual int32 CountDimensions() const;
|
||||||
|
virtual ArrayDimension* DimensionAt(int32 index) const;
|
||||||
|
|
||||||
|
virtual status_t ResolveElementLocation(
|
||||||
|
const ArrayIndexPath& indexPath,
|
||||||
|
const ValueLocation& parentLocation,
|
||||||
|
ValueLocation*& _location);
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const;
|
||||||
|
|
||||||
|
bool AddDimension(DwarfArrayDimension* dimension);
|
||||||
|
|
||||||
|
DwarfArrayDimension* DwarfDimensionAt(int32 index) const
|
||||||
|
{ return fDimensions.ItemAt(index); }
|
||||||
|
DIEArrayType* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
typedef BObjectList<DwarfArrayDimension> DimensionList;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIEArrayType* fEntry;
|
||||||
|
DwarfType* fBaseType;
|
||||||
|
DimensionList fDimensions;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfModifiedType : public ModifiedType, public DwarfType {
|
||||||
|
public:
|
||||||
|
DwarfModifiedType(DwarfTypeContext* typeContext,
|
||||||
|
const BString& name, DIEModifiedType* entry,
|
||||||
|
uint32 modifiers, DwarfType* baseType);
|
||||||
|
~DwarfModifiedType();
|
||||||
|
|
||||||
|
virtual uint32 Modifiers() const;
|
||||||
|
virtual Type* BaseType() const;
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const;
|
||||||
|
|
||||||
|
DIEModifiedType* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIEModifiedType* fEntry;
|
||||||
|
uint32 fModifiers;
|
||||||
|
DwarfType* fBaseType;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfTypedefType : public TypedefType, public DwarfType {
|
||||||
|
public:
|
||||||
|
DwarfTypedefType(DwarfTypeContext* typeContext,
|
||||||
|
const BString& name, DIETypedef* entry,
|
||||||
|
DwarfType* baseType);
|
||||||
|
~DwarfTypedefType();
|
||||||
|
|
||||||
|
virtual Type* BaseType() const;
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const;
|
||||||
|
|
||||||
|
DIETypedef* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIETypedef* fEntry;
|
||||||
|
DwarfType* fBaseType;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfAddressType : public AddressType, public DwarfType {
|
||||||
|
public:
|
||||||
|
DwarfAddressType(DwarfTypeContext* typeContext,
|
||||||
|
const BString& name,
|
||||||
|
DIEAddressingType* entry,
|
||||||
|
address_type_kind addressKind,
|
||||||
|
DwarfType* baseType);
|
||||||
|
~DwarfAddressType();
|
||||||
|
|
||||||
|
virtual address_type_kind AddressKind() const;
|
||||||
|
virtual Type* BaseType() const;
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const;
|
||||||
|
|
||||||
|
DIEAddressingType* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIEAddressingType* fEntry;
|
||||||
|
address_type_kind fAddressKind;
|
||||||
|
DwarfType* fBaseType;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfEnumerationType : public EnumerationType, public DwarfType {
|
||||||
|
public:
|
||||||
|
DwarfEnumerationType(
|
||||||
|
DwarfTypeContext* typeContext,
|
||||||
|
const BString& name,
|
||||||
|
DIEEnumerationType* entry,
|
||||||
|
DwarfType* baseType);
|
||||||
|
~DwarfEnumerationType();
|
||||||
|
|
||||||
|
virtual Type* BaseType() const;
|
||||||
|
|
||||||
|
virtual int32 CountValues() const;
|
||||||
|
virtual EnumerationValue* ValueAt(int32 index) const;
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const;
|
||||||
|
|
||||||
|
bool AddValue(DwarfEnumerationValue* value);
|
||||||
|
|
||||||
|
DIEEnumerationType* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
typedef BObjectList<DwarfEnumerationValue> ValueList;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIEEnumerationType* fEntry;
|
||||||
|
DwarfType* fBaseType;
|
||||||
|
ValueList fValues;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfSubrangeType : public SubrangeType, public DwarfType {
|
||||||
|
public:
|
||||||
|
DwarfSubrangeType(DwarfTypeContext* typeContext,
|
||||||
|
const BString& name, DIESubrangeType* entry,
|
||||||
|
DwarfType* baseType,
|
||||||
|
const BVariant& lowerBound,
|
||||||
|
const BVariant& upperBound);
|
||||||
|
~DwarfSubrangeType();
|
||||||
|
|
||||||
|
virtual Type* BaseType() const;
|
||||||
|
|
||||||
|
virtual BVariant LowerBound() const;
|
||||||
|
virtual BVariant UpperBound() const;
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const;
|
||||||
|
|
||||||
|
DIESubrangeType* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIESubrangeType* fEntry;
|
||||||
|
DwarfType* fBaseType;
|
||||||
|
BVariant fLowerBound;
|
||||||
|
BVariant fUpperBound;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct DwarfUnspecifiedType : public UnspecifiedType, public DwarfType {
|
||||||
|
public:
|
||||||
|
DwarfUnspecifiedType(
|
||||||
|
DwarfTypeContext* typeContext,
|
||||||
|
const BString& name,
|
||||||
|
DIEUnspecifiedType* entry);
|
||||||
|
// entry may be NULL
|
||||||
|
~DwarfUnspecifiedType();
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const;
|
||||||
|
|
||||||
|
DIEUnspecifiedType* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIEUnspecifiedType* fEntry;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfFunctionType : public FunctionType, public DwarfType {
|
||||||
|
public:
|
||||||
|
DwarfFunctionType(DwarfTypeContext* typeContext,
|
||||||
|
const BString& name,
|
||||||
|
DIESubroutineType* entry,
|
||||||
|
DwarfType* returnType);
|
||||||
|
~DwarfFunctionType();
|
||||||
|
|
||||||
|
virtual Type* ReturnType() const;
|
||||||
|
|
||||||
|
virtual int32 CountParameters() const;
|
||||||
|
virtual FunctionParameter* ParameterAt(int32 index) const;
|
||||||
|
|
||||||
|
virtual bool HasVariableArguments() const;
|
||||||
|
void SetHasVariableArguments(bool hasVarArgs);
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const;
|
||||||
|
|
||||||
|
bool AddParameter(DwarfFunctionParameter* parameter);
|
||||||
|
|
||||||
|
DwarfFunctionParameter* DwarfParameterAt(int32 index) const
|
||||||
|
{ return fParameters.ItemAt(index); }
|
||||||
|
|
||||||
|
DIESubroutineType* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
typedef BObjectList<DwarfFunctionParameter> ParameterList;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIESubroutineType* fEntry;
|
||||||
|
DwarfType* fReturnType;
|
||||||
|
ParameterList fParameters;
|
||||||
|
bool fHasVariableArguments;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DwarfPointerToMemberType : public PointerToMemberType, public DwarfType {
|
||||||
|
public:
|
||||||
|
DwarfPointerToMemberType(
|
||||||
|
DwarfTypeContext* typeContext,
|
||||||
|
const BString& name,
|
||||||
|
DIEPointerToMemberType* entry,
|
||||||
|
DwarfCompoundType* containingType,
|
||||||
|
DwarfType* baseType);
|
||||||
|
~DwarfPointerToMemberType();
|
||||||
|
|
||||||
|
virtual CompoundType* ContainingType() const;
|
||||||
|
virtual Type* BaseType() const;
|
||||||
|
|
||||||
|
virtual DIEType* GetDIEType() const;
|
||||||
|
|
||||||
|
DIEPointerToMemberType* Entry() const
|
||||||
|
{ return fEntry; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
DIEPointerToMemberType* fEntry;
|
||||||
|
DwarfCompoundType* fContainingType;
|
||||||
|
DwarfType* fBaseType;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // DWARF_TYPES_H
|
||||||
@@ -10,11 +10,13 @@
|
|||||||
|
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
|
#include <AutoLocker.h>
|
||||||
|
|
||||||
#include "StringUtils.h"
|
#include "StringUtils.h"
|
||||||
#include "Type.h"
|
#include "Type.h"
|
||||||
|
|
||||||
|
|
||||||
struct GlobalTypeLookupContext::TypeEntry {
|
struct GlobalTypeCache::TypeEntry {
|
||||||
BString name;
|
BString name;
|
||||||
Type* type;
|
Type* type;
|
||||||
TypeEntry* fNext;
|
TypeEntry* fNext;
|
||||||
@@ -34,7 +36,7 @@ struct GlobalTypeLookupContext::TypeEntry {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct GlobalTypeLookupContext::TypeEntryHashDefinition {
|
struct GlobalTypeCache::TypeEntryHashDefinition {
|
||||||
typedef const BString KeyType;
|
typedef const BString KeyType;
|
||||||
typedef TypeEntry ValueType;
|
typedef TypeEntry ValueType;
|
||||||
|
|
||||||
@@ -60,22 +62,22 @@ struct GlobalTypeLookupContext::TypeEntryHashDefinition {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - GlobalTypeLookupContext
|
// #pragma mark - GlobalTypeCache
|
||||||
|
|
||||||
|
|
||||||
GlobalTypeLookupContext::GlobalTypeLookupContext()
|
GlobalTypeCache::GlobalTypeCache()
|
||||||
:
|
:
|
||||||
fLock("global type lookup"),
|
fLock("global type lookup"),
|
||||||
fCachedTypes(NULL)
|
fTypes(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GlobalTypeLookupContext::~GlobalTypeLookupContext()
|
GlobalTypeCache::~GlobalTypeCache()
|
||||||
{
|
{
|
||||||
// release all cached type references
|
// release all cached type references
|
||||||
if (fCachedTypes != NULL) {
|
if (fTypes != NULL) {
|
||||||
TypeEntry* entry = fCachedTypes->Clear(true);
|
TypeEntry* entry = fTypes->Clear(true);
|
||||||
while (entry != NULL) {
|
while (entry != NULL) {
|
||||||
TypeEntry* nextEntry = entry->fNext;
|
TypeEntry* nextEntry = entry->fNext;
|
||||||
delete entry;
|
delete entry;
|
||||||
@@ -86,32 +88,32 @@ GlobalTypeLookupContext::~GlobalTypeLookupContext()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
GlobalTypeLookupContext::Init()
|
GlobalTypeCache::Init()
|
||||||
{
|
{
|
||||||
status_t error = fLock.InitCheck();
|
status_t error = fLock.InitCheck();
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
fCachedTypes = new(std::nothrow) TypeTable;
|
fTypes = new(std::nothrow) TypeTable;
|
||||||
if (fCachedTypes == NULL)
|
if (fTypes == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
return fCachedTypes->Init();
|
return fTypes->Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Type*
|
Type*
|
||||||
GlobalTypeLookupContext::CachedType(const BString& name) const
|
GlobalTypeCache::GetType(const BString& name) const
|
||||||
{
|
{
|
||||||
TypeEntry* typeEntry = fCachedTypes->Lookup(name);
|
TypeEntry* typeEntry = fTypes->Lookup(name);
|
||||||
return typeEntry != NULL ? typeEntry->type : NULL;
|
return typeEntry != NULL ? typeEntry->type : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
GlobalTypeLookupContext::AddCachedType(const BString& name, Type* type)
|
GlobalTypeCache::AddType(const BString& name, Type* type)
|
||||||
{
|
{
|
||||||
TypeEntry* typeEntry = fCachedTypes->Lookup(name);
|
TypeEntry* typeEntry = fTypes->Lookup(name);
|
||||||
if (typeEntry != NULL)
|
if (typeEntry != NULL)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
@@ -119,21 +121,36 @@ GlobalTypeLookupContext::AddCachedType(const BString& name, Type* type)
|
|||||||
if (typeEntry == NULL)
|
if (typeEntry == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
fCachedTypes->Insert(typeEntry);
|
fTypes->Insert(typeEntry);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
GlobalTypeLookupContext::RemoveCachedType(const BString& name)
|
GlobalTypeCache::RemoveType(const BString& name)
|
||||||
{
|
{
|
||||||
if (TypeEntry* typeEntry = fCachedTypes->Lookup(name)) {
|
if (TypeEntry* typeEntry = fTypes->Lookup(name)) {
|
||||||
fCachedTypes->Remove(typeEntry);
|
fTypes->Remove(typeEntry);
|
||||||
delete typeEntry;
|
delete typeEntry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
GlobalTypeCache::RemoveTypes(image_id imageID)
|
||||||
|
{
|
||||||
|
AutoLocker<GlobalTypeCache> locker(this);
|
||||||
|
|
||||||
|
for (TypeTable::Iterator it = fTypes->GetIterator();
|
||||||
|
TypeEntry* typeEntry = it.Next();) {
|
||||||
|
if (typeEntry->type->ImageID() == imageID) {
|
||||||
|
fTypes->RemoveUnchecked(typeEntry);
|
||||||
|
delete typeEntry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - GlobalTypeLookup
|
// #pragma mark - GlobalTypeLookup
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#define GLOBAL_TYPE_LOOKUP_H
|
#define GLOBAL_TYPE_LOOKUP_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <image.h>
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
|
|
||||||
#include <Referenceable.h>
|
#include <Referenceable.h>
|
||||||
@@ -16,20 +17,23 @@ class BString;
|
|||||||
class Type;
|
class Type;
|
||||||
|
|
||||||
|
|
||||||
class GlobalTypeLookupContext : public Referenceable {
|
class GlobalTypeCache : public Referenceable {
|
||||||
public:
|
public:
|
||||||
GlobalTypeLookupContext();
|
GlobalTypeCache();
|
||||||
~GlobalTypeLookupContext();
|
~GlobalTypeCache();
|
||||||
|
|
||||||
status_t Init();
|
status_t Init();
|
||||||
|
|
||||||
inline bool Lock();
|
inline bool Lock();
|
||||||
inline void Unlock();
|
inline void Unlock();
|
||||||
|
|
||||||
// context must be locked
|
// cache must be locked
|
||||||
Type* CachedType(const BString& name) const;
|
Type* GetType(const BString& name) const;
|
||||||
status_t AddCachedType(const BString& name, Type* type);
|
status_t AddType(const BString& name, Type* type);
|
||||||
void RemoveCachedType(const BString& name);
|
void RemoveType(const BString& name);
|
||||||
|
|
||||||
|
// cache locked by method
|
||||||
|
void RemoveTypes(image_id imageID);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct TypeEntry;
|
struct TypeEntry;
|
||||||
@@ -39,7 +43,7 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
BLocker fLock;
|
BLocker fLock;
|
||||||
TypeTable* fCachedTypes;
|
TypeTable* fTypes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -47,21 +51,21 @@ class GlobalTypeLookup {
|
|||||||
public:
|
public:
|
||||||
virtual ~GlobalTypeLookup();
|
virtual ~GlobalTypeLookup();
|
||||||
|
|
||||||
virtual status_t GetType(GlobalTypeLookupContext* context,
|
virtual status_t GetType(GlobalTypeCache* cache,
|
||||||
const BString& name, Type*& _type) = 0;
|
const BString& name, Type*& _type) = 0;
|
||||||
// returns a reference
|
// returns a reference
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
GlobalTypeLookupContext::Lock()
|
GlobalTypeCache::Lock()
|
||||||
{
|
{
|
||||||
return fLock.Lock();
|
return fLock.Lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
GlobalTypeLookupContext::Unlock()
|
GlobalTypeCache::Unlock()
|
||||||
{
|
{
|
||||||
fLock.Unlock();
|
fLock.Unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,12 +76,12 @@ ImageDebugInfo::FinishInit()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
ImageDebugInfo::GetType(GlobalTypeLookupContext* context, const BString& name,
|
ImageDebugInfo::GetType(GlobalTypeCache* cache, const BString& name,
|
||||||
Type*& _type)
|
Type*& _type)
|
||||||
{
|
{
|
||||||
for (int32 i = 0; SpecificImageDebugInfo* specificInfo
|
for (int32 i = 0; SpecificImageDebugInfo* specificInfo
|
||||||
= fSpecificInfos.ItemAt(i); i++) {
|
= fSpecificInfos.ItemAt(i); i++) {
|
||||||
status_t error = specificInfo->GetType(context, name, _type);
|
status_t error = specificInfo->GetType(cache, name, _type);
|
||||||
if (error == B_OK || error == B_NO_MEMORY)
|
if (error == B_OK || error == B_NO_MEMORY)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class DebuggerInterface;
|
|||||||
class FileSourceCode;
|
class FileSourceCode;
|
||||||
class FunctionDebugInfo;
|
class FunctionDebugInfo;
|
||||||
class FunctionInstance;
|
class FunctionInstance;
|
||||||
class GlobalTypeLookupContext;
|
class GlobalTypeCache;
|
||||||
class LocatableFile;
|
class LocatableFile;
|
||||||
class SpecificImageDebugInfo;
|
class SpecificImageDebugInfo;
|
||||||
class Type;
|
class Type;
|
||||||
@@ -36,7 +36,7 @@ public:
|
|||||||
bool AddSpecificInfo(SpecificImageDebugInfo* info);
|
bool AddSpecificInfo(SpecificImageDebugInfo* info);
|
||||||
status_t FinishInit();
|
status_t FinishInit();
|
||||||
|
|
||||||
status_t GetType(GlobalTypeLookupContext* context,
|
status_t GetType(GlobalTypeCache* cache,
|
||||||
const BString& name, Type*& _type);
|
const BString& name, Type*& _type);
|
||||||
// returns a reference
|
// returns a reference
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
#include "NoOpStackFrameDebugInfo.h"
|
#include "NoOpStackFrameDebugInfo.h"
|
||||||
|
|
||||||
|
|
||||||
NoOpStackFrameDebugInfo::NoOpStackFrameDebugInfo(Architecture* architecture)
|
NoOpStackFrameDebugInfo::NoOpStackFrameDebugInfo()
|
||||||
:
|
:
|
||||||
StackFrameDebugInfo(architecture)
|
StackFrameDebugInfo()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,38 +17,3 @@ NoOpStackFrameDebugInfo::NoOpStackFrameDebugInfo(Architecture* architecture)
|
|||||||
NoOpStackFrameDebugInfo::~NoOpStackFrameDebugInfo()
|
NoOpStackFrameDebugInfo::~NoOpStackFrameDebugInfo()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
NoOpStackFrameDebugInfo::ResolveObjectDataLocation(StackFrame* stackFrame,
|
|
||||||
Type* type, const ValueLocation& objectLocation, ValueLocation*& _location)
|
|
||||||
{
|
|
||||||
return B_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
NoOpStackFrameDebugInfo::ResolveBaseTypeLocation(StackFrame* stackFrame,
|
|
||||||
Type* type, BaseType* baseType, const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location)
|
|
||||||
{
|
|
||||||
return B_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
NoOpStackFrameDebugInfo::ResolveDataMemberLocation(StackFrame* stackFrame,
|
|
||||||
Type* type, DataMember* member, const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location)
|
|
||||||
{
|
|
||||||
return B_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
NoOpStackFrameDebugInfo::ResolveArrayElementLocation(StackFrame* stackFrame,
|
|
||||||
ArrayType* type, const ArrayIndexPath& indexPath,
|
|
||||||
const ValueLocation& parentLocation, ValueLocation*& _location)
|
|
||||||
{
|
|
||||||
return B_UNSUPPORTED;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -11,29 +11,9 @@
|
|||||||
|
|
||||||
class NoOpStackFrameDebugInfo : public StackFrameDebugInfo {
|
class NoOpStackFrameDebugInfo : public StackFrameDebugInfo {
|
||||||
public:
|
public:
|
||||||
NoOpStackFrameDebugInfo(
|
NoOpStackFrameDebugInfo();
|
||||||
Architecture* architecture);
|
|
||||||
virtual ~NoOpStackFrameDebugInfo();
|
virtual ~NoOpStackFrameDebugInfo();
|
||||||
|
|
||||||
virtual status_t ResolveObjectDataLocation(
|
|
||||||
StackFrame* stackFrame, Type* type,
|
|
||||||
const ValueLocation& objectLocation,
|
|
||||||
ValueLocation*& _location);
|
|
||||||
virtual status_t ResolveBaseTypeLocation(
|
|
||||||
StackFrame* stackFrame, Type* type,
|
|
||||||
BaseType* baseType,
|
|
||||||
const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location);
|
|
||||||
virtual status_t ResolveDataMemberLocation(
|
|
||||||
StackFrame* stackFrame, Type* type,
|
|
||||||
DataMember* member,
|
|
||||||
const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location);
|
|
||||||
virtual status_t ResolveArrayElementLocation(
|
|
||||||
StackFrame* stackFrame, ArrayType* type,
|
|
||||||
const ArrayIndexPath& indexPath,
|
|
||||||
const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class DebuggerInterface;
|
|||||||
class FileSourceCode;
|
class FileSourceCode;
|
||||||
class FunctionDebugInfo;
|
class FunctionDebugInfo;
|
||||||
class FunctionInstance;
|
class FunctionInstance;
|
||||||
class GlobalTypeLookupContext;
|
class GlobalTypeCache;
|
||||||
class Image;
|
class Image;
|
||||||
class LocatableFile;
|
class LocatableFile;
|
||||||
class SourceLanguage;
|
class SourceLanguage;
|
||||||
@@ -40,7 +40,7 @@ public:
|
|||||||
= 0;
|
= 0;
|
||||||
// returns references
|
// returns references
|
||||||
|
|
||||||
virtual status_t GetType(GlobalTypeLookupContext* context,
|
virtual status_t GetType(GlobalTypeCache* cache,
|
||||||
const BString& name, Type*& _type) = 0;
|
const BString& name, Type*& _type) = 0;
|
||||||
// returns a reference
|
// returns a reference
|
||||||
|
|
||||||
|
|||||||
@@ -10,35 +10,11 @@
|
|||||||
#include "ValueLocation.h"
|
#include "ValueLocation.h"
|
||||||
|
|
||||||
|
|
||||||
StackFrameDebugInfo::StackFrameDebugInfo(Architecture* architecture)
|
StackFrameDebugInfo::StackFrameDebugInfo()
|
||||||
:
|
|
||||||
fArchitecture(architecture)
|
|
||||||
{
|
{
|
||||||
fArchitecture->AcquireReference();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
StackFrameDebugInfo::~StackFrameDebugInfo()
|
StackFrameDebugInfo::~StackFrameDebugInfo()
|
||||||
{
|
{
|
||||||
fArchitecture->ReleaseReference();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
StackFrameDebugInfo::ResolveObjectDataLocation(StackFrame* stackFrame,
|
|
||||||
Type* type, target_addr_t objectAddress, ValueLocation*& _location)
|
|
||||||
{
|
|
||||||
ValuePieceLocation piece;
|
|
||||||
piece.SetToMemory(objectAddress);
|
|
||||||
piece.SetSize(0);
|
|
||||||
// We set the piece size to 0 as an indicator that the size has to be
|
|
||||||
// set.
|
|
||||||
// TODO: We could set the byte size from type, but that may not be
|
|
||||||
// accurate. We may want to add bit offset and size to Type.
|
|
||||||
|
|
||||||
ValueLocation location(fArchitecture->IsBigEndian());
|
|
||||||
if (!location.AddPiece(piece))
|
|
||||||
return B_NO_MEMORY;
|
|
||||||
|
|
||||||
return ResolveObjectDataLocation(stackFrame, type, location, _location);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,40 +23,8 @@ class ValueLocation;
|
|||||||
|
|
||||||
class StackFrameDebugInfo : public Referenceable {
|
class StackFrameDebugInfo : public Referenceable {
|
||||||
public:
|
public:
|
||||||
StackFrameDebugInfo(Architecture* architecture);
|
StackFrameDebugInfo();
|
||||||
virtual ~StackFrameDebugInfo();
|
virtual ~StackFrameDebugInfo();
|
||||||
|
|
||||||
virtual status_t ResolveObjectDataLocation(
|
|
||||||
StackFrame* stackFrame, Type* type,
|
|
||||||
const ValueLocation& objectLocation,
|
|
||||||
ValueLocation*& _location) = 0;
|
|
||||||
// returns a reference
|
|
||||||
status_t ResolveObjectDataLocation(
|
|
||||||
StackFrame* stackFrame, Type* type,
|
|
||||||
target_addr_t objectAddress,
|
|
||||||
ValueLocation*& _location);
|
|
||||||
// returns a reference
|
|
||||||
virtual status_t ResolveBaseTypeLocation(
|
|
||||||
StackFrame* stackFrame, Type* type,
|
|
||||||
BaseType* baseType,
|
|
||||||
const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location) = 0;
|
|
||||||
// returns a reference
|
|
||||||
virtual status_t ResolveDataMemberLocation(
|
|
||||||
StackFrame* stackFrame, Type* type,
|
|
||||||
DataMember* member,
|
|
||||||
const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location) = 0;
|
|
||||||
// returns a reference
|
|
||||||
virtual status_t ResolveArrayElementLocation(
|
|
||||||
StackFrame* stackFrame, ArrayType* type,
|
|
||||||
const ArrayIndexPath& indexPath,
|
|
||||||
const ValueLocation& parentLocation,
|
|
||||||
ValueLocation*& _location) = 0;
|
|
||||||
// returns a reference
|
|
||||||
|
|
||||||
protected:
|
|
||||||
Architecture* fArchitecture;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -258,13 +258,17 @@ TeamDebugInfo::TeamDebugInfo(DebuggerInterface* debuggerInterface,
|
|||||||
fFileManager(fileManager),
|
fFileManager(fileManager),
|
||||||
fSpecificInfos(10, true),
|
fSpecificInfos(10, true),
|
||||||
fFunctions(NULL),
|
fFunctions(NULL),
|
||||||
fSourceFiles(NULL)
|
fSourceFiles(NULL),
|
||||||
|
fTypeCache(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TeamDebugInfo::~TeamDebugInfo()
|
TeamDebugInfo::~TeamDebugInfo()
|
||||||
{
|
{
|
||||||
|
if (fTypeCache != NULL)
|
||||||
|
fTypeCache->ReleaseReference();
|
||||||
|
|
||||||
if (fSourceFiles != NULL) {
|
if (fSourceFiles != NULL) {
|
||||||
SourceFileEntry* entry = fSourceFiles->Clear(true);
|
SourceFileEntry* entry = fSourceFiles->Clear(true);
|
||||||
while (entry != NULL) {
|
while (entry != NULL) {
|
||||||
@@ -315,12 +319,21 @@ TeamDebugInfo::Init()
|
|||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
// create a type cache
|
||||||
|
fTypeCache = new(std::nothrow) GlobalTypeCache;
|
||||||
|
if (fTypeCache == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
|
error = fTypeCache->Init();
|
||||||
|
if (error != B_OK)
|
||||||
|
return error;
|
||||||
|
|
||||||
// Create specific infos for all types of debug info we support, in
|
// Create specific infos for all types of debug info we support, in
|
||||||
// descending order of expressiveness.
|
// descending order of expressiveness.
|
||||||
|
|
||||||
// DWARF
|
// DWARF
|
||||||
DwarfTeamDebugInfo* dwarfInfo = new(std::nothrow) DwarfTeamDebugInfo(
|
DwarfTeamDebugInfo* dwarfInfo = new(std::nothrow) DwarfTeamDebugInfo(
|
||||||
fArchitecture, fDebuggerInterface, fFileManager, this);
|
fArchitecture, fDebuggerInterface, fFileManager, this, fTypeCache);
|
||||||
if (dwarfInfo == NULL || !fSpecificInfos.AddItem(dwarfInfo)) {
|
if (dwarfInfo == NULL || !fSpecificInfos.AddItem(dwarfInfo)) {
|
||||||
delete dwarfInfo;
|
delete dwarfInfo;
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
@@ -348,19 +361,19 @@ TeamDebugInfo::Init()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
TeamDebugInfo::GetType(GlobalTypeLookupContext* context, const BString& name,
|
TeamDebugInfo::GetType(GlobalTypeCache* cache, const BString& name,
|
||||||
Type*& _type)
|
Type*& _type)
|
||||||
{
|
{
|
||||||
// maybe the type is already cached
|
// maybe the type is already cached
|
||||||
AutoLocker<GlobalTypeLookupContext> contextLocker(context);
|
AutoLocker<GlobalTypeCache> cacheLocker(cache);
|
||||||
Type* type = context->CachedType(name);
|
Type* type = cache->GetType(name);
|
||||||
if (type != NULL) {
|
if (type != NULL) {
|
||||||
type->AcquireReference();
|
type->AcquireReference();
|
||||||
_type = type;
|
_type = type;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
contextLocker.Unlock();
|
cacheLocker.Unlock();
|
||||||
|
|
||||||
// Clone the image list and get references to the images, so we can iterate
|
// Clone the image list and get references to the images, so we can iterate
|
||||||
// through them without locking.
|
// through them without locking.
|
||||||
@@ -377,7 +390,7 @@ TeamDebugInfo::GetType(GlobalTypeLookupContext* context, const BString& name,
|
|||||||
// get the type
|
// get the type
|
||||||
status_t error = B_ENTRY_NOT_FOUND;
|
status_t error = B_ENTRY_NOT_FOUND;
|
||||||
for (int32 i = 0; ImageDebugInfo* imageDebugInfo = images.ItemAt(i); i++) {
|
for (int32 i = 0; ImageDebugInfo* imageDebugInfo = images.ItemAt(i); i++) {
|
||||||
error = imageDebugInfo->GetType(context, name, type);
|
error = imageDebugInfo->GetType(cache, name, type);
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
_type = type;
|
_type = type;
|
||||||
break;
|
break;
|
||||||
@@ -621,6 +634,9 @@ TeamDebugInfo::RemoveImageDebugInfo(ImageDebugInfo* imageDebugInfo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove cached types from that image
|
||||||
|
fTypeCache->RemoveTypes(imageDebugInfo->GetImageInfo().ImageID());
|
||||||
|
|
||||||
fImages.RemoveItem(imageDebugInfo);
|
fImages.RemoveItem(imageDebugInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public:
|
|||||||
|
|
||||||
status_t Init();
|
status_t Init();
|
||||||
|
|
||||||
virtual status_t GetType(GlobalTypeLookupContext* context,
|
virtual status_t GetType(GlobalTypeCache* cache,
|
||||||
const BString& name, Type*& _type);
|
const BString& name, Type*& _type);
|
||||||
|
|
||||||
status_t LoadImageDebugInfo(const ImageInfo& imageInfo,
|
status_t LoadImageDebugInfo(const ImageInfo& imageInfo,
|
||||||
@@ -91,6 +91,7 @@ private:
|
|||||||
ImageList fImages;
|
ImageList fImages;
|
||||||
FunctionTable* fFunctions;
|
FunctionTable* fFunctions;
|
||||||
SourceFileTable* fSourceFiles;
|
SourceFileTable* fSourceFiles;
|
||||||
|
GlobalTypeCache* fTypeCache;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <ObjectList.h>
|
#include <ObjectList.h>
|
||||||
|
#include <Referenceable.h>
|
||||||
#include <util/DoublyLinkedList.h>
|
#include <util/DoublyLinkedList.h>
|
||||||
|
|
||||||
#include "DebugInfoEntries.h"
|
#include "DebugInfoEntries.h"
|
||||||
@@ -25,7 +26,8 @@ class TargetAddressRangeList;
|
|||||||
class ValueLocation;
|
class ValueLocation;
|
||||||
|
|
||||||
|
|
||||||
class DwarfFile : public DoublyLinkedListLinkImpl<DwarfFile> {
|
class DwarfFile : public BReferenceable,
|
||||||
|
public DoublyLinkedListLinkImpl<DwarfFile> {
|
||||||
public:
|
public:
|
||||||
DwarfFile();
|
DwarfFile();
|
||||||
~DwarfFile();
|
~DwarfFile();
|
||||||
|
|||||||
@@ -48,7 +48,9 @@ DwarfManager::LoadFile(const char* fileName, DwarfFile*& _file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fFiles.Add(file);
|
fFiles.Add(file);
|
||||||
|
// we keep the initial reference for ourselves
|
||||||
|
|
||||||
|
file->AcquireReference();
|
||||||
_file = file;
|
_file = file;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public:
|
|||||||
|
|
||||||
status_t LoadFile(const char* fileName,
|
status_t LoadFile(const char* fileName,
|
||||||
DwarfFile*& _file);
|
DwarfFile*& _file);
|
||||||
|
// returns a reference
|
||||||
status_t FinishLoading();
|
status_t FinishLoading();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#define TYPE_H
|
#define TYPE_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <image.h>
|
||||||
|
|
||||||
#include <Referenceable.h>
|
#include <Referenceable.h>
|
||||||
#include <Variant.h>
|
#include <Variant.h>
|
||||||
|
|
||||||
@@ -42,7 +44,9 @@ enum {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class ArrayIndexPath;
|
||||||
class Type;
|
class Type;
|
||||||
|
class ValueLocation;
|
||||||
|
|
||||||
|
|
||||||
class BaseType : public Referenceable {
|
class BaseType : public Referenceable {
|
||||||
@@ -95,11 +99,21 @@ class Type : public Referenceable {
|
|||||||
public:
|
public:
|
||||||
virtual ~Type();
|
virtual ~Type();
|
||||||
|
|
||||||
|
virtual image_id ImageID() const = 0;
|
||||||
virtual const char* Name() const = 0;
|
virtual const char* Name() const = 0;
|
||||||
virtual type_kind Kind() const = 0;
|
virtual type_kind Kind() const = 0;
|
||||||
virtual target_size_t ByteSize() const = 0;
|
virtual target_size_t ByteSize() const = 0;
|
||||||
virtual Type* ResolveRawType() const;
|
virtual Type* ResolveRawType() const;
|
||||||
// strips modifiers and typedefs
|
// strips modifiers and typedefs
|
||||||
|
|
||||||
|
virtual status_t ResolveObjectDataLocation(
|
||||||
|
const ValueLocation& objectLocation,
|
||||||
|
ValueLocation*& _location) = 0;
|
||||||
|
// returns a reference
|
||||||
|
virtual status_t ResolveObjectDataLocation(
|
||||||
|
target_addr_t objectAddress,
|
||||||
|
ValueLocation*& _location) = 0;
|
||||||
|
// returns a reference
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -124,6 +138,15 @@ public:
|
|||||||
|
|
||||||
virtual int32 CountDataMembers() const = 0;
|
virtual int32 CountDataMembers() const = 0;
|
||||||
virtual DataMember* DataMemberAt(int32 index) const = 0;
|
virtual DataMember* DataMemberAt(int32 index) const = 0;
|
||||||
|
|
||||||
|
virtual status_t ResolveBaseTypeLocation(BaseType* baseType,
|
||||||
|
const ValueLocation& parentLocation,
|
||||||
|
ValueLocation*& _location) = 0;
|
||||||
|
// returns a reference
|
||||||
|
virtual status_t ResolveDataMemberLocation(DataMember* member,
|
||||||
|
const ValueLocation& parentLocation,
|
||||||
|
ValueLocation*& _location) = 0;
|
||||||
|
// returns a reference
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -199,6 +222,12 @@ public:
|
|||||||
|
|
||||||
virtual int32 CountDimensions() const = 0;
|
virtual int32 CountDimensions() const = 0;
|
||||||
virtual ArrayDimension* DimensionAt(int32 index) const = 0;
|
virtual ArrayDimension* DimensionAt(int32 index) const = 0;
|
||||||
|
|
||||||
|
virtual status_t ResolveElementLocation(
|
||||||
|
const ArrayIndexPath& indexPath,
|
||||||
|
const ValueLocation& parentLocation,
|
||||||
|
ValueLocation*& _location) = 0;
|
||||||
|
// returns a reference
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user