vfs: check userland buffers before reading them.
[haiku.git] / src / kits / debugger / model / Statement.cpp
blob62dd7991d3a354bd344752d5fdc3a206013748e8
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
6 #include "Statement.h"
9 // #pragma mark - Statement
12 Statement::~Statement()
17 // #pragma mark - AbstractStatement
20 AbstractStatement::AbstractStatement(const SourceLocation& start)
22 fStart(start)
27 SourceLocation
28 AbstractStatement::StartSourceLocation() const
30 return fStart;
34 // #pragma mark - ContiguousStatement
37 ContiguousStatement::ContiguousStatement(const SourceLocation& start,
38 const TargetAddressRange& range)
40 AbstractStatement(start),
41 fRange(range)
46 TargetAddressRange
47 ContiguousStatement::CoveringAddressRange() const
49 return fRange;
53 int32
54 ContiguousStatement::CountAddressRanges() const
56 return 1;
60 TargetAddressRange
61 ContiguousStatement::AddressRangeAt(int32 index) const
63 return index == 0 ? fRange : TargetAddressRange();
67 bool
68 ContiguousStatement::ContainsAddress(target_addr_t address) const
70 return fRange.Contains(address);