Adding source location support to AssemblyStack and thus debugging Yul sources

This commit is contained in:
Djordje Mijovic
2020-02-25 22:19:03 +01:00
committed by chriseth
parent 44bcff42f5
commit ec083c4878
29 changed files with 136 additions and 101 deletions
+7 -2
View File
@@ -48,6 +48,8 @@ enum AssemblyItemType {
};
class Assembly;
class AssemblyItem;
using AssemblyItems = std::vector<AssemblyItem>;
class AssemblyItem
{
@@ -122,6 +124,11 @@ public:
}
bool operator!=(Instruction _instr) const { return !operator==(_instr); }
static std::string computeSourceMapping(
AssemblyItems const& _items,
std::map<std::string, unsigned> const& _sourceIndicesMap
);
/// @returns an upper bound for the number of bytes required by this item, assuming that
/// the value of a jump tag takes @a _addressLength bytes.
unsigned bytesRequired(unsigned _addressLength) const;
@@ -157,8 +164,6 @@ private:
mutable std::shared_ptr<u256> m_pushedValue;
};
using AssemblyItems = std::vector<AssemblyItem>;
inline size_t bytesRequired(AssemblyItems const& _items, size_t _addressLength)
{
size_t size = 0;