- 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
This commit is contained in:
Ingo Weinhold
2009-07-03 00:56:39 +00:00
parent 92194962f6
commit 593fa6776a
28 changed files with 1249 additions and 80 deletions
+53
View File
@@ -0,0 +1,53 @@
/*
* Copyright 2009, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef FILE_SOURCE_CODE_H
#define FILE_SOURCE_CODE_H
#include <ObjectList.h>
#include "SourceCode.h"
class ContiguousStatement;
class SourceFile;
class FileSourceCode : public SourceCode {
public:
FileSourceCode(SourceFile* file);
virtual ~FileSourceCode();
status_t Init();
status_t AddStatement(ContiguousStatement* statement);
virtual int32 CountLines() const;
virtual const char* LineAt(int32 index) const;
virtual int32 CountStatements() const;
virtual Statement* StatementAt(int32 index) const;
virtual Statement* StatementAtLine(int32 index) const;
virtual Statement* StatementAtAddress(target_addr_t address) const;
virtual TargetAddressRange StatementAddressRange() const;
private:
typedef BObjectList<ContiguousStatement> StatementList;
private:
static int _CompareStatements(
const ContiguousStatement* a,
const ContiguousStatement* b);
static int _CompareAddressStatement(
const target_addr_t* address,
const ContiguousStatement* statement);
private:
SourceFile* fFile;
Statement** fLineStatements;
StatementList fStatements;
};
#endif // FILE_BASED_SOURCE_CODE_H