|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
|
3 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #ifndef LulDwarfSummariser_h |
|
8 #define LulDwarfSummariser_h |
|
9 |
|
10 #include "LulMainInt.h" |
|
11 |
|
12 namespace lul { |
|
13 |
|
14 class Summariser |
|
15 { |
|
16 public: |
|
17 Summariser(SecMap* aSecMap, uintptr_t aTextBias, void(*aLog)(const char*)); |
|
18 |
|
19 void Entry(uintptr_t aAddress, uintptr_t aLength); |
|
20 void End(); |
|
21 void Rule(uintptr_t aAddress, |
|
22 int aNewReg, int aOldReg, intptr_t aOffset, bool aDeref); |
|
23 |
|
24 private: |
|
25 // The SecMap in which we park the finished summaries (RuleSets). |
|
26 SecMap* mSecMap; |
|
27 |
|
28 // Running state for the current summary (RuleSet) under construction. |
|
29 RuleSet mCurrRules; |
|
30 |
|
31 // The start of the address range to which the RuleSet under |
|
32 // construction applies. |
|
33 uintptr_t mCurrAddr; |
|
34 |
|
35 // The highest address, plus one, for which the RuleSet under |
|
36 // construction could possibly apply. If there are no further |
|
37 // incoming events then mCurrRules will eventually be emitted |
|
38 // as-is, for the range mCurrAddr.. mMax1Addr - 1, if that is |
|
39 // nonempty. |
|
40 uintptr_t mMax1Addr; |
|
41 |
|
42 // The bias value (to add to the SVMAs, to get AVMAs) to be used |
|
43 // when adding entries into mSecMap. |
|
44 uintptr_t mTextBias; |
|
45 |
|
46 // A logging sink, for debugging. |
|
47 void (*mLog)(const char* aFmt); |
|
48 }; |
|
49 |
|
50 } // namespace lul |
|
51 |
|
52 #endif // LulDwarfSummariser_h |