]> git.siccegge.de Git - frida/frida.git/blobdiff - src/core/Function.cxx
Make pieces of information serialize themselves
[frida/frida.git] / src / core / Function.cxx
index 539192c5fd6f2fb2cb90e914c39acf17749d1042..1df4d1dba3b6a154c337c6d06f63bedcb3a2e6cd 100644 (file)
@@ -1,8 +1,7 @@
 #include "Function.hxx"
 #include "core/events/RenameFunctionEvent.hxx"
 #include "InformationManager.hxx"
-
-#include <iostream>
+#include "gui/qt.hxx"
 
 Function::Function(uint64_t start_address, InformationManager* manager)
        : start_address(start_address)
@@ -15,3 +14,14 @@ void Function::setName(const std::string& new_name) {
        manager->dispatch(&event);
 }
 
+void Function::serialize(QXmlStreamWriter& stream) {
+       stream.writeStartElement("function");
+       stream.writeAttribute("name", getName().c_str());
+       stream.writeAttribute("entry", QString::number(getStartAddress(), 16));
+
+       for (auto& blockentry : blocks()) {
+               blockentry.second->serialize(stream);
+       }
+
+       stream.writeEndElement(); // "function"
+}