diff --git a/libdevcore/CommonIO.cpp b/libdevcore/CommonIO.cpp index 4f02ea3f7..feb4121cb 100644 --- a/libdevcore/CommonIO.cpp +++ b/libdevcore/CommonIO.cpp @@ -26,67 +26,30 @@ using namespace std; using namespace dev; -std::list> dev::memDumpToList(bytes const& _b, unsigned _w) -{ - std::list> dump; - for (unsigned i = 0; i < _b.size(); i += _w) - { - stringstream ret; - std::list dumpLine; - ret << hex << setw(4) << setfill('0') << i << " "; - dumpLine.push_back(ret.str()); - ret.str(std::string()); - ret.clear(); - - for (unsigned j = i; j < i + _w; ++j) - if (j < _b.size()) - if (_b[j] >= 32 && _b[j] < 127) - if ((char)_b[j] == '<') - ret << "<"; - else if ((char)_b[j] == '&') - ret << "&"; - else - ret << (char)_b[j]; - else - ret << '?'; - else - ret << ' '; - dumpLine.push_back(ret.str()); - ret.str(std::string()); - ret.clear(); - - for (unsigned j = i; j < i + _w && j < _b.size(); ++j) - ret << setfill('0') << setw(2) << hex << (unsigned)_b[j] << " "; - dumpLine.push_back(ret.str()); - dump.push_back(dumpLine); - } - return dump; -} - -string dev::memDump(bytes const& _b, unsigned _w, bool _html) +string dev::memDump(bytes const& _bytes, unsigned _width, bool _html) { stringstream ret; if (_html) ret << "
";
-	for (unsigned i = 0; i < _b.size(); i += _w)
+	for (unsigned i = 0; i < _bytes.size(); i += _width)
 	{
 		ret << hex << setw(4) << setfill('0') << i << " ";
-		for (unsigned j = i; j < i + _w; ++j)
-			if (j < _b.size())
-				if (_b[j] >= 32 && _b[j] < 127)
-					if ((char)_b[j] == '<' && _html)
+		for (unsigned j = i; j < i + _width; ++j)
+			if (j < _bytes.size())
+				if (_bytes[j] >= 32 && _bytes[j] < 127)
+					if ((char)_bytes[j] == '<' && _html)
 						ret << "<";
-					else if ((char)_b[j] == '&' && _html)
+					else if ((char)_bytes[j] == '&' && _html)
 						ret << "&";
 					else
-						ret << (char)_b[j];
+						ret << (char)_bytes[j];
 				else
 					ret << '?';
 			else
 				ret << ' ';
 		ret << " ";
-		for (unsigned j = i; j < i + _w && j < _b.size(); ++j)
-			ret << setfill('0') << setw(2) << hex << (unsigned)_b[j] << " ";
+		for (unsigned j = i; j < i + _width && j < _bytes.size(); ++j)
+			ret << setfill('0') << setw(2) << hex << (unsigned)_bytes[j] << " ";
 		ret << "\n";
 	}
 	if (_html)
diff --git a/libdevcore/CommonIO.h b/libdevcore/CommonIO.h
index 1223646f6..d2a67921b 100644
--- a/libdevcore/CommonIO.h
+++ b/libdevcore/CommonIO.h
@@ -47,9 +47,8 @@ bytes contents(std::string const& _file);
 void writeFile(std::string const& _file, bytes const& _data);
 
 /// Nicely renders the given bytes to a string, optionally as HTML.
-std::string memDump(bytes const& _b, unsigned _w = 8, bool _html = false);
-/// Nicely renders the given bytes to a string, store the content in an array.
-std::list> memDumpToList(bytes const& _b, unsigned _w);
+/// @a _bytes: bytes array to be rendered as string. @a _width of a bytes line.
+std::string memDump(bytes const& _bytes, unsigned _width = 8, bool _html = false);
 
 // Stream I/O functions.
 // Provides templated stream I/O for all STL collections so they can be shifted on to any iostream-like interface.
diff --git a/mix/CodeEditorExtensionManager.h b/mix/CodeEditorExtensionManager.h
index 0455a1beb..fe6fbb33a 100644
--- a/mix/CodeEditorExtensionManager.h
+++ b/mix/CodeEditorExtensionManager.h
@@ -65,7 +65,6 @@ private:
 	QVector> m_features;
 	QQuickItem* m_headerView;
 	QQuickItem* m_rightView;
-	QTextDocument* m_doc;
 	AppContext* m_appContext;
 	void loadEditor(QQuickItem* _editor);
 };
diff --git a/mix/DebuggingStateWrapper.cpp b/mix/DebuggingStateWrapper.cpp
index 60f78fa42..85179e84b 100644
--- a/mix/DebuggingStateWrapper.cpp
+++ b/mix/DebuggingStateWrapper.cpp
@@ -110,7 +110,7 @@ QStringList DebuggingStateWrapper::debugStorage()
 
 QVariantList DebuggingStateWrapper::debugMemory()
 {
-	std::list> dump = memDumpToList(m_state.memory, 16);
+	std::vector> dump = memDumpToList(m_state.memory, 16);
 	QStringList filled;
 	filled.append(" ");
 	filled.append(" ");
@@ -120,7 +120,7 @@ QVariantList DebuggingStateWrapper::debugMemory()
 
 QVariantList DebuggingStateWrapper::debugCallData()
 {
-	std::list> dump = memDumpToList(m_data, 16);
+	std::vector> dump = memDumpToList(m_data, 16);
 	QStringList filled;
 	filled.append(" ");
 	filled.append(" ");
@@ -128,13 +128,45 @@ QVariantList DebuggingStateWrapper::debugCallData()
 	return fillList(qVariantDump(dump), QVariant(filled));
 }
 
-QVariantList DebuggingStateWrapper::qVariantDump(std::list> const& _dump)
+std::vector> DebuggingStateWrapper::memDumpToList(bytes const& _bytes, unsigned _width)
+{
+	std::vector> dump;
+	for (unsigned i = 0; i < _bytes.size(); i += _width)
+	{
+		std::stringstream ret;
+		std::vector dumpLine;
+		ret << std::hex << std::setw(4) << std::setfill('0') << i << " ";
+		dumpLine.push_back(ret.str());
+		ret.str(std::string());
+		ret.clear();
+
+		for (unsigned j = i; j < i + _width; ++j)
+			if (j < _bytes.size())
+				if (_bytes[j] >= 32 && _bytes[j] < 127)
+					ret << (char)_bytes[j];
+				else
+					ret << '?';
+			else
+				ret << ' ';
+		dumpLine.push_back(ret.str());
+		ret.str(std::string());
+		ret.clear();
+
+		for (unsigned j = i; j < i + _width && j < _bytes.size(); ++j)
+			ret << std::setfill('0') << std::setw(2) << std::hex << (unsigned)_bytes[j] << " ";
+		dumpLine.push_back(ret.str());
+		dump.push_back(dumpLine);
+	}
+	return dump;
+}
+
+QVariantList DebuggingStateWrapper::qVariantDump(std::vector> const& _dump)
 {
 	QVariantList ret;
-	for (std::list line: _dump)
+	for (std::vector const& line: _dump)
 	{
 		QStringList qLine;
-		for (std::string cell: line)
+		for (std::string const& cell: line)
 			qLine.push_back(QString::fromStdString(cell));
 		ret.append(QVariant(qLine));
 	}
@@ -185,9 +217,7 @@ QString DebuggingStateWrapper::headerInfo()
 
 QString DebuggingStateWrapper::instruction()
 {
-	std::ostringstream ss;
-	ss << dev::eth::instructionInfo(m_state.inst).name;
-	return QString::fromStdString(ss.str());
+	return QString::fromStdString(dev::eth::instructionInfo(m_state.inst).name);
 }
 
 QString DebuggingStateWrapper::endOfDebug()
diff --git a/mix/DebuggingStateWrapper.h b/mix/DebuggingStateWrapper.h
index a46a2fcd2..010db9af7 100644
--- a/mix/DebuggingStateWrapper.h
+++ b/mix/DebuggingStateWrapper.h
@@ -136,7 +136,11 @@ private:
 	bytes m_data;
 	QStringList fillList(QStringList& _list, QString const& _emptyValue);
 	QVariantList fillList(QVariantList _list, QVariant const& _emptyValue);
-	QVariantList qVariantDump(std::list> const& _dump);
+	QVariantList qVariantDump(std::vector> const& _dump);
+	/// Nicely renders the given bytes to a string, store the content in an array.
+	/// @a _bytes: bytes array to be rendered as string. @a _width of a bytes line.
+	std::vector> memDumpToList(bytes const& _bytes, unsigned _width);
+
 };
 
 }
diff --git a/mix/qml.qrc b/mix/qml.qrc
index 44589e70d..344fcaa22 100644
--- a/mix/qml.qrc
+++ b/mix/qml.qrc
@@ -10,7 +10,6 @@
         qml/ProjectList.qml
         qml/StateDialog.qml
         qml/StateList.qml
-        qml/js/main.js
         qml/img/jumpintoback.png
         qml/img/jumpintoforward.png
         qml/img/jumpoutback.png
diff --git a/mix/qml/Debugger.qml b/mix/qml/Debugger.qml
index f6b4d86e9..ac449065b 100644
--- a/mix/qml/Debugger.qml
+++ b/mix/qml/Debugger.qml
@@ -133,7 +133,7 @@ Rectangle {
 						spacing: 3
 						StepActionImage
 						{
-							id: jumpoutbackaction;
+							id: jumpOutBackAction;
 							enabledStateImg: "qrc:/qml/img/jumpoutback.png"
 							disableStateImg: "qrc:/qml/img/jumpoutbackdisabled.png"
 							onClicked: Debugger.stepOutBack()
@@ -143,7 +143,7 @@ Rectangle {
 
 						StepActionImage
 						{
-							id: jumpintobackaction
+							id: jumpIntoBackAction
 							enabledStateImg: "qrc:/qml/img/jumpintoback.png"
 							disableStateImg: "qrc:/qml/img/jumpintobackdisabled.png"
 							onClicked: Debugger.stepIntoBack()
@@ -153,7 +153,7 @@ Rectangle {
 
 						StepActionImage
 						{
-							id: jumpoverbackaction
+							id: jumpOverBackAction
 							enabledStateImg: "qrc:/qml/img/jumpoverback.png"
 							disableStateImg: "qrc:/qml/img/jumpoverbackdisabled.png"
 							onClicked: Debugger.stepOverBack()
@@ -163,7 +163,7 @@ Rectangle {
 
 						StepActionImage
 						{
-							id: jumpoverforwardaction
+							id: jumpOverForwardAction
 							enabledStateImg: "qrc:/qml/img/jumpoverforward.png"
 							disableStateImg: "qrc:/qml/img/jumpoverforwarddisabled.png"
 							onClicked: Debugger.stepOverForward()
@@ -173,7 +173,7 @@ Rectangle {
 
 						StepActionImage
 						{
-							id: jumpintoforwardaction
+							id: jumpIntoForwardAction
 							enabledStateImg: "qrc:/qml/img/jumpintoforward.png"
 							disableStateImg: "qrc:/qml/img/jumpintoforwarddisabled.png"
 							onClicked: Debugger.stepIntoForward()
@@ -183,7 +183,7 @@ Rectangle {
 
 						StepActionImage
 						{
-							id: jumpoutforwardaction
+							id: jumpOutForwardAction
 							enabledStateImg: "qrc:/qml/img/jumpoutforward.png"
 							disableStateImg: "qrc:/qml/img/jumpoutforwarddisabled.png"
 							onClicked: Debugger.stepOutForward()
diff --git a/mix/qml/js/Debugger.js b/mix/qml/js/Debugger.js
index 22f94d620..43b15f27e 100644
--- a/mix/qml/js/Debugger.js
+++ b/mix/qml/js/Debugger.js
@@ -16,10 +16,10 @@ function init()
 	currentSelectedState = 0;
 	select(currentSelectedState);
 
-	jumpoutbackaction.enabled(false);
-	jumpintobackaction.enabled(false);
-	jumpintoforwardaction.enabled(false);
-	jumpoutforwardaction.enabled(false);
+	jumpOutBackAction.enabled(false);
+	jumpIntoBackAction.enabled(false);
+	jumpIntoForwardAction.enabled(false);
+	jumpOutForwardAction.enabled(false);
 }
 
 function moveSelection(incr)
@@ -41,14 +41,14 @@ function select(stateIndex)
 	completeCtxInformation(state);
 
 	if (state.instruction === "JUMP")
-		jumpintoforwardaction.enabled(true);
+		jumpIntoForwardAction.enabled(true);
 	else
-		jumpintoforwardaction.enabled(false);
+		jumpIntoForwardAction.enabled(false);
 
 	if (state.instruction === "JUMPDEST")
-		jumpintobackaction.enabled(true);
+		jumpIntoBackAction.enabled(true);
 	else
-		jumpintobackaction.enabled(false);
+		jumpIntoBackAction.enabled(false);
 }
 
 function codeStr(stateIndex)
@@ -87,8 +87,8 @@ function stepOutBack()
 	{
 		select(jumpStartingPoint);
 		jumpStartingPoint = null;
-		jumpoutbackaction.enabled(false);
-		jumpoutforwardaction.enabled(false);
+		jumpOutBackAction.enabled(false);
+		jumpOutForwardAction.enabled(false);
 	}
 }
 
@@ -142,8 +142,8 @@ function stepIntoForward()
 	{
 		jumpStartingPoint = currentSelectedState;
 		moveSelection(1);
-		jumpoutbackaction.enabled(true);
-		jumpoutforwardaction.enabled(true);
+		jumpOutBackAction.enabled(true);
+		jumpOutForwardAction.enabled(true);
 	}
 }
 
@@ -153,8 +153,8 @@ function stepOutForward()
 	{
 		stepOutBack();
 		stepOverForward();
-		jumpoutbackaction.enabled(false);
-		jumpoutforwardaction.enabled(false);
+		jumpOutBackAction.enabled(false);
+		jumpOutForwardAction.enabled(false);
 	}
 }
 
diff --git a/mix/qml/js/main.js b/mix/qml/js/main.js
deleted file mode 100644
index e69de29bb..000000000