- DwarfUtils::GetDeclarationLocation(): Line/column numbers are one-based. - Added line number program interpretation (LineNumberProgram). * FunctionDebugInfo: Return the source file (LocatableFile) instead of the file name. * FileManager/LocatableEntry: Fixed handling when a LocatableEntry is unreferenced. There was a race condition before, since an unreferenced entry could be referenced and unreferenced again before removing it from the hash table, which could lead to double deletion. Now we never reuse an unreferenced entry and just remove it from the hash table when encountering one. * FileManager/SourceFile: Added class SourceFile which loads a source file from disk and slices it into lines. Managed by FileManager. * Added class FileSourceCode, a SourceCode implementation using a SourceFile as line provider. The statement management works pretty much exactly as in DissassembledCode. * DwarfImageDebugInfo: Implemented LoadSourceCode for real. It creates a FileSourceCode and uses the DWARF line number information for the statement information. This basically gets the source level view going, though there are still several problems -- stepping doesn't work perfectly yet, the source isn't found for all functions, there's no handling of duplicate functions (no idea why gcc generates them in the first place), etc. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31382 a95241bf-73f2-0310-859d-f6bbb57e9c96
85 lines
1.3 KiB
C++
85 lines
1.3 KiB
C++
/*
|
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
|
|
#include "BasicFunctionDebugInfo.h"
|
|
|
|
#include "SpecificImageDebugInfo.h"
|
|
|
|
|
|
BasicFunctionDebugInfo::BasicFunctionDebugInfo(
|
|
SpecificImageDebugInfo* debugInfo, target_addr_t address,
|
|
target_size_t size, const BString& name, const BString& prettyName)
|
|
:
|
|
fImageDebugInfo(debugInfo),
|
|
fAddress(address),
|
|
fSize(size),
|
|
fName(name),
|
|
fPrettyName(prettyName)
|
|
{
|
|
fImageDebugInfo->AddReference();
|
|
}
|
|
|
|
|
|
BasicFunctionDebugInfo::~BasicFunctionDebugInfo()
|
|
{
|
|
fImageDebugInfo->RemoveReference();
|
|
}
|
|
|
|
|
|
SpecificImageDebugInfo*
|
|
BasicFunctionDebugInfo::GetSpecificImageDebugInfo() const
|
|
{
|
|
return fImageDebugInfo;
|
|
}
|
|
|
|
|
|
target_addr_t
|
|
BasicFunctionDebugInfo::Address() const
|
|
{
|
|
return fAddress;
|
|
}
|
|
|
|
|
|
target_size_t
|
|
BasicFunctionDebugInfo::Size() const
|
|
{
|
|
return fSize;
|
|
}
|
|
|
|
|
|
const char*
|
|
BasicFunctionDebugInfo::Name() const
|
|
{
|
|
return fName.String();
|
|
}
|
|
|
|
|
|
const char*
|
|
BasicFunctionDebugInfo::PrettyName() const
|
|
{
|
|
return fPrettyName.String();
|
|
}
|
|
|
|
|
|
LocatableFile*
|
|
BasicFunctionDebugInfo::SourceFile() const
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
|
|
SourceLocation
|
|
BasicFunctionDebugInfo::SourceStartLocation() const
|
|
{
|
|
return SourceLocation();
|
|
}
|
|
|
|
|
|
SourceLocation
|
|
BasicFunctionDebugInfo::SourceEndLocation() const
|
|
{
|
|
return SourceLocation();
|
|
}
|