* Since disassembled code is actually function instance specific,

FunctionInstance does now also have a (DisassembledCode) source code
  attribute. Function keeps its attribute, but it explicitly is a
  FileSourceCode now.
* SourceCode:
  - Removed GetStatementAtLocation(). Instead DisassembledCode has a
    StatementAtLocation() now. As well as a StatementAtAddress() and
    StatementAddressRange(). Rather cast to the subclass (in two instances)
    instead of having those methods in the base class. In most cases we already
    have the subclasses now, anyway.
  - Added Lock()/Unlock(), which are implemented in FileSourceCode. The
    statement ranges are no longer immutable, so we have to lock.
* TeamDebugModel:
  - Revived GetBreakpointsInAddressRange().
  - GetBreakpointsForSourceCode(): Optimized for DisassembledCode and fixed
    in the FileSourceCode case. We need to compare with the functions' source
    file instead of their source code, since they might not have the source
    code set yet. Fixed two instances of the same problem in SourceView. Setting
    breakpoints in functions that have no associated source code yet, works now.
* Team:
  - GetStatementAtAddress(): Optimized by using the DisassembledCode, if
    available.
  - GetStatementAtSourceLocation(): If the supplied source code is
    DisassembledCode, we have to get the statement from it directly, since
    we can't get that information from the image debug info.
* TeamDebugInfo: Added LoadSourceCode() and DisassembleFunction(), the new way
  to get FileSourceCode respectively DisassembledCode. SpecificTeamDebugInfo
  has lost LoadSourceCode() and gained service methods AddSourceCodeInfo() and
  ReadCode(). This avoids unnecessary code duplication in the subclasses.
  Moreover it allows for joining source location info source files from
  different images (and compilation units) -- interesting for inline functions
  in headers.
* Adjusted LoadSourceCodeJob and TeamDebugger::FunctionSourceCodeRequested()
  accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31514 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-07-11 00:05:26 +00:00
parent 1dc94c6b69
commit 18ca318a3d
30 changed files with 564 additions and 348 deletions
+7 -4
View File
@@ -6,6 +6,9 @@
#define FILE_SOURCE_CODE_H
#include <Locker.h>
#include "Array.h"
#include "SourceCode.h"
@@ -24,6 +27,9 @@ public:
status_t AddSourceLocation(
const SourceLocation& location);
virtual bool Lock();
virtual void Unlock();
virtual int32 CountLines() const;
virtual const char* LineAt(int32 index) const;
@@ -34,16 +40,13 @@ public:
virtual LocatableFile* GetSourceFile() const;
virtual status_t GetStatementAtLocation(
const SourceLocation& location,
Statement*& _statement);
private:
int32 _FindSourceLocationIndex(
const SourceLocation& location,
bool& _foundMatch) const;
private:
BLocker fLock;
LocatableFile* fFile;
SourceFile* fSourceFile;
Array<SourceLocation> fSourceLocations;