Browse Source

Fix for storage display in debugger.

cl-refactor
Gav Wood 11 years ago
parent
commit
1bc06c4db1
  1. 15
      alethzero/MainWin.cpp
  2. 1
      alethzero/MainWin.h
  3. 2
      libethereum/State.cpp

15
alethzero/MainWin.cpp

@ -1390,15 +1390,22 @@ void Main::on_debugTimeline_valueChanged()
updateDebugger();
}
QString prettyU256(eth::u256 _n)
QString Main::prettyU256(eth::u256 _n) const
{
ostringstream s;
if (_n >> 32 == 0)
s << hex << "0x" << (unsigned)_n;
else if (_n >> 200 == 0)
s << "0x" << (h160)right160(_n);
{
Address a = right160(_n);
QString n = pretty(a);
if (n.isNull())
s << "0x" << a;
else
s << "<b>" << n.toHtmlEscaped().toStdString() << "</b> (" << a.abridged() << ")";
}
else if (fromRaw((h256)_n).size())
s << "\"" << fromRaw((h256)_n).toStdString() << "\"";
return "\"" + fromRaw((h256)_n).toHtmlEscaped() + "\"";
else
s << "0x" << (h256)_n;
return QString::fromStdString(s.str());
@ -1458,7 +1465,7 @@ void Main::updateDebugger()
ostringstream out;
out << s.cur.abridged();
if (i)
out << " @0x" << hex << s.curPC;
out << " " << c_instructionInfo.at(s.inst).name << " @0x" << hex << s.curPC;
ui->callStack->addItem(QString::fromStdString(out.str()));
}
}

1
alethzero/MainWin.h

@ -140,6 +140,7 @@ private:
void updateBlockCount();
QString pretty(eth::Address _a) const;
QString prettyU256(eth::u256 _n) const;
void populateDebugger(eth::bytesConstRef r);
void initDebugger();

2
libethereum/State.cpp

@ -891,7 +891,7 @@ map<u256, u256> State::storage(Address _id) const
// Then merge cached storage over the top.
for (auto const& i: it->second.storage())
if (i.second)
ret.insert(i);
ret[i.first] = i.second;
else
ret.erase(i.first);
}

Loading…
Cancel
Save