michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef LulDwarfSummariser_h michael@0: #define LulDwarfSummariser_h michael@0: michael@0: #include "LulMainInt.h" michael@0: michael@0: namespace lul { michael@0: michael@0: class Summariser michael@0: { michael@0: public: michael@0: Summariser(SecMap* aSecMap, uintptr_t aTextBias, void(*aLog)(const char*)); michael@0: michael@0: void Entry(uintptr_t aAddress, uintptr_t aLength); michael@0: void End(); michael@0: void Rule(uintptr_t aAddress, michael@0: int aNewReg, int aOldReg, intptr_t aOffset, bool aDeref); michael@0: michael@0: private: michael@0: // The SecMap in which we park the finished summaries (RuleSets). michael@0: SecMap* mSecMap; michael@0: michael@0: // Running state for the current summary (RuleSet) under construction. michael@0: RuleSet mCurrRules; michael@0: michael@0: // The start of the address range to which the RuleSet under michael@0: // construction applies. michael@0: uintptr_t mCurrAddr; michael@0: michael@0: // The highest address, plus one, for which the RuleSet under michael@0: // construction could possibly apply. If there are no further michael@0: // incoming events then mCurrRules will eventually be emitted michael@0: // as-is, for the range mCurrAddr.. mMax1Addr - 1, if that is michael@0: // nonempty. michael@0: uintptr_t mMax1Addr; michael@0: michael@0: // The bias value (to add to the SVMAs, to get AVMAs) to be used michael@0: // when adding entries into mSecMap. michael@0: uintptr_t mTextBias; michael@0: michael@0: // A logging sink, for debugging. michael@0: void (*mLog)(const char* aFmt); michael@0: }; michael@0: michael@0: } // namespace lul michael@0: michael@0: #endif // LulDwarfSummariser_h