headers/bsd: Add sys/queue.h.
[haiku.git] / src / kits / debugger / dwarf / CfaContext.h
blob78d224cbd23033d61de137e2bedfc212253aa27e
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef CFA_CONTEXT_H
6 #define CFA_CONTEXT_H
9 #include <ObjectList.h>
11 #include "CfaRuleSet.h"
12 #include "Types.h"
15 class CfaContext {
16 public:
17 CfaContext();
18 ~CfaContext();
20 void SetLocation(target_addr_t targetLocation,
21 target_addr_t initialLocation);
23 status_t Init(uint32 registerCount);
24 status_t SaveInitialRuleSet();
26 status_t PushRuleSet();
27 status_t PopRuleSet();
29 target_addr_t TargetLocation() const
30 { return fTargetLocation; }
32 target_addr_t Location() const
33 { return fLocation; }
34 void SetLocation(target_addr_t location);
36 uint32 CodeAlignment() const
37 { return fCodeAlignment; }
38 void SetCodeAlignment(uint32 alignment);
40 int32 DataAlignment() const
41 { return fDataAlignment; }
42 void SetDataAlignment(int32 alignment);
44 uint32 ReturnAddressRegister() const
45 { return fReturnAddressRegister; }
46 void SetReturnAddressRegister(uint32 reg);
48 CfaCfaRule* GetCfaCfaRule() const
49 { return fRuleSet->GetCfaCfaRule(); }
50 CfaRule* RegisterRule(uint32 index) const
51 { return fRuleSet->RegisterRule(index); }
53 void RestoreRegisterRule(uint32 reg);
55 private:
56 typedef BObjectList<CfaRuleSet> RuleSetList;
58 private:
59 target_addr_t fTargetLocation;
60 target_addr_t fLocation;
61 uint32 fCodeAlignment;
62 int32 fDataAlignment;
63 uint32 fReturnAddressRegister;
64 CfaRuleSet* fRuleSet;
65 CfaRuleSet* fInitialRuleSet;
66 RuleSetList fRuleSetStack;
71 #endif // CFA_CONTEXT_H