Use function debug data.

This commit is contained in:
chriseth
2021-09-22 11:11:51 +02:00
parent e6f0fe8ae3
commit 2741175507
3 changed files with 14 additions and 10 deletions
+9
View File
@@ -38,6 +38,7 @@
#include <fstream>
#include <range/v3/algorithm/any_of.hpp>
#include <range/v3/view/enumerate.hpp>
using namespace std;
using namespace solidity;
@@ -761,8 +762,16 @@ LinkerObject const& Assembly::assemble() const
for (auto const& [name, tagInfo]: m_namedTags)
{
size_t position = m_tagPositionsInBytecode.at(tagInfo.id);
optional<size_t> tagIndex;
for (auto&& [index, item]: m_items | ranges::views::enumerate)
if (item.type() == Tag && static_cast<size_t>(item.data()) == tagInfo.id)
{
tagIndex = index;
break;
}
ret.functionDebugData[name] = {
position == numeric_limits<size_t>::max() ? nullopt : optional<size_t>{position},
tagIndex,
tagInfo.sourceID,
tagInfo.params,
tagInfo.returns