]> git.siccegge.de Git - frida/frida.git/commitdiff
Change from list to vector
authorChristoph Egger <Christoph.Egger@fau.de>
Fri, 20 Mar 2015 11:46:55 +0000 (12:46 +0100)
committerChristoph Egger <Christoph.Egger@fau.de>
Fri, 20 Mar 2015 11:54:46 +0000 (12:54 +0100)
We want to index into that array so a vector is the better data structure

src/core/BasicBlock.cxx
src/core/BasicBlock.hxx
src/disassembler/Disassembler.hxx
src/disassembler/llvm/LLVMDisassembler.cxx
src/disassembler/llvm/LLVMDisassembler.hxx
src/gui/widgets/BasicBlockWidget.hxx

index 7af6bd85f47af3ebc59701c26160539c9e297dbf..a88b3995b80478f50d2dbbb0fb9b37115b072099 100644 (file)
@@ -90,6 +90,6 @@ BasicBlock* BasicBlock::deserialize(QXmlStreamReader& stream, InformationManager
        return block;
 }
 
-std::list<Instruction> BasicBlock::getInstructions() const {
+std::vector<Instruction> BasicBlock::getInstructions() const {
        return manager->getDisassembler()->getInstructions(this);
 }
index 3f877879c95942f6defc15111a69938b02948969..918f2730f9c2c6b3c27966803440b70e32bee4bd 100644 (file)
@@ -4,7 +4,7 @@
 #include <cassert>
 #include <string>
 #include <sstream>
-#include <list>
+#include <vector>
 
 class Instruction;
 class Disassembler;
@@ -36,7 +36,7 @@ public:
                return s.str();
        }
 
-       std::list<Instruction> getInstructions() const;
+       std::vector<Instruction> getInstructions() const;
        void serialize(QXmlStreamWriter& stream);
        static BasicBlock* deserialize(QXmlStreamReader& stream, InformationManager* manager);
 
index 78c67c6610ac5b75d709d2ac0b2e0d15a4058aba..ffcc889caee40f8118494cf9bd3583ac130ac466 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <string>
 #include <functional>
-#include <list>
+#include <vector>
 
 #include "Instruction.hxx"
 
@@ -24,7 +24,7 @@ public:
                                          std::function<void (uint8_t*, size_t, const std::string&,
                                                              const std::string&)> fun) = 0;
        virtual Function * disassembleFunctionAt(uint64_t address, const std::string& name = "") = 0;
-       virtual std::list<Instruction> getInstructions(const BasicBlock* block) = 0;
+       virtual std::vector<Instruction> getInstructions(const BasicBlock* block) = 0;
 };
 
 #endif
index 3023f9397d8f2339230c75c2d4e8169a91aa464d..990ed4f53c19c6f24255d2fb735d1bedb4ba8722 100644 (file)
@@ -526,8 +526,8 @@ void LLVMDisassembler<ELFT>::readSections() {
 // }
 
 template <typename ELFT>
-std::list<Instruction> LLVMDisassembler<ELFT>::getInstructions(const BasicBlock *block) {
-       std::list<Instruction> result;
+std::vector<Instruction> LLVMDisassembler<ELFT>::getInstructions(const BasicBlock *block) {
+       std::vector<Instruction> result;
        SectionRef text_section = getTextSection();
        uint64_t base_address;
        text_section.getAddress(base_address);
index a64dc2c66e451131f9187ab82ca5a70342a9e1ab..df01c9a9f41f7f781880c4941ee12d062415fc7d 100644 (file)
@@ -31,7 +31,7 @@ public:
                                                      const std::string&)> fun);
 
        Function * disassembleFunctionAt(uint64_t address, const std::string& name = "");
-       std::list<Instruction> getInstructions(const BasicBlock* block);
+       std::vector<Instruction> getInstructions(const BasicBlock* block);
 
 private:
        // http://llvm.org/docs/doxygen/html/MCObjectDisassembler_8cpp_source.html +197
index 22bc22021c43bd581a5bfa5af1b198451da24317..e3d3611703937c521a207f0b655166172d9d7111 100644 (file)
@@ -8,15 +8,12 @@
 #include <array>
 #include <memory>
 #include <log4cxx/logger.h>
-#include <list>
 
 #include "disassembler/Instruction.hxx"
 
 class Mainwindow;
 class CustomQGraphicsTextItem;
-
 class BasicBlock;
-
 class RenameFunctionEvent;
 
 class BasicBlockWidget : public QObject, public QGraphicsItem
@@ -57,7 +54,7 @@ private:
        std::unique_ptr<QGraphicsTextItem> _widget;
        QTextTable* _table;
        BasicBlock* block;
-       std::list<Instruction> instructions;
+       std::vector<Instruction> instructions;
        Mainwindow* mainwindow;
        std::vector<BasicBlockWidget*> previous;
        BasicBlockWidget* next[2];