2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef LINE_NUMBER_PROGRAM_H
6 #define LINE_NUMBER_PROGRAM_H
8 #include "DataReader.h"
12 class LineNumberProgram
{
17 LineNumberProgram(uint8 addressSize
);
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;
31 void _SetToInitial(State
& state
) const;
36 uint8 fMinInstructionLength
;
37 bool fDefaultIsStatement
;
42 const uint8
* fStandardOpcodeLengths
;
46 struct LineNumberProgram::State
{
47 target_addr_t address
;
56 uint32 instructionSet
;
59 // when file is set to -1
60 const char* explicitFile
;
61 uint32 explicitFileDirIndex
;
63 DataReader dataReader
;
67 #endif // LINE_NUMBER_PROGRAM_H