3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / kits / debugger / dwarf / LineNumberProgram.h
blob6ed9c7e8c3c47f8d5387b89d829d59e7245c3a2f
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef LINE_NUMBER_PROGRAM_H
6 #define LINE_NUMBER_PROGRAM_H
8 #include "DataReader.h"
9 #include "Types.h"
12 class LineNumberProgram {
13 public:
14 struct State;
16 public:
17 LineNumberProgram(uint8 addressSize);
18 ~LineNumberProgram();
20 status_t Init(const void* program, size_t programSize,
21 uint8 minInstructionLength,
22 bool defaultIsStatement, int8 lineBase,
23 uint8 lineRange, uint8 opcodeBase,
24 const uint8* standardOpcodeLengths);
26 bool IsValid() const { return fProgram != NULL; }
27 void GetInitialState(State& state) const;
28 bool GetNextRow(State& state) const;
30 private:
31 void _SetToInitial(State& state) const;
33 private:
34 const void* fProgram;
35 size_t fProgramSize;
36 uint8 fMinInstructionLength;
37 bool fDefaultIsStatement;
38 int8 fLineBase;
39 uint8 fLineRange;
40 uint8 fOpcodeBase;
41 uint8 fAddressSize;
42 const uint8* fStandardOpcodeLengths;
46 struct LineNumberProgram::State {
47 target_addr_t address;
48 int32 file;
49 int32 line;
50 int32 column;
51 bool isStatement;
52 bool isBasicBlock;
53 bool isSequenceEnd;
54 bool isPrologueEnd;
55 bool isEpilogueBegin;
56 uint32 instructionSet;
57 uint32 discriminator;
59 // when file is set to -1
60 const char* explicitFile;
61 uint32 explicitFileDirIndex;
63 DataReader dataReader;
67 #endif // LINE_NUMBER_PROGRAM_H