Added StatementAtAddress() returning the statement at a given target address.
Needs optimization (iterates through all statements ATM). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31169 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -53,6 +53,19 @@ SourceCode::StatementAt(int32 index) const
|
||||
}
|
||||
|
||||
|
||||
Statement*
|
||||
SourceCode::StatementAtAddress(target_addr_t address) const
|
||||
{
|
||||
// TODO: Optimize!
|
||||
for (int32 i = 0; Statement* statement = fStatements.ItemAt(i); i++) {
|
||||
if (statement->ContainsAddress(address))
|
||||
return statement;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SourceCode::AddLine(const char* _line)
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@ public:
|
||||
|
||||
int32 CountStatements() const;
|
||||
Statement* StatementAt(int32 index) const;
|
||||
Statement* StatementAtAddress(target_addr_t address) const;
|
||||
|
||||
bool AddLine(const char* line);
|
||||
// clones
|
||||
|
||||
Reference in New Issue
Block a user