vfs: check userland buffers before reading them.
[haiku.git] / headers / private / debugger / model / SourceCode.h
blob46480328124943c5a23fdb47be426dd77737723b
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef SOURCE_CODE_H
6 #define SOURCE_CODE_H
9 #include <Referenceable.h>
11 #include "LineDataSource.h"
12 #include "TargetAddressRange.h"
15 class LocatableFile;
16 class SourceLanguage;
17 class SourceLocation;
18 class Statement;
21 class SourceCode : public LineDataSource {
22 public:
23 virtual ~SourceCode();
25 // Locking needed for GetStatementLocationRange(), since that might use
26 // mutable data.
27 virtual bool Lock() = 0;
28 virtual void Unlock() = 0;
30 virtual SourceLanguage* GetSourceLanguage() const = 0;
32 virtual bool GetStatementLocationRange(
33 const SourceLocation& location,
34 SourceLocation& _start,
35 SourceLocation& _end) const = 0;
37 virtual LocatableFile* GetSourceFile() const = 0;
41 #endif // SOURCE_CODE_H