Apply patch from Daniel Schürmann: https://sourceforge.net/p/boomerang/bugs/78/
[boomerang.git] / boomerang / qtgui2 / DecompilerThread.h
blob12152dfe3dfa6095ebd9995604fd49b1c809d597
2 #include <QThread>
3 #undef NO_ADDRESS
4 #include "boomerang.h"
6 class MainWindow;
7 class FrontEnd;
8 class Proc;
9 class UserProc;
10 class Prog;
11 class Cluster;
12 class QTableWidget;
14 class Decompiler : public QObject, public Watcher
16 Q_OBJECT
18 public:
19 Decompiler() : QObject(), debugging(false), waiting(false)
20 { }
22 virtual void alert_decompile_debug_point(UserProc *p, const char *description);
23 virtual void alert_considering(Proc *parent, Proc *p);
24 virtual void alert_decompiling(UserProc *p);
25 virtual void alert_new(Proc *p);
26 virtual void alert_remove(Proc *p);
27 virtual void alert_update_signature(Proc *p);
29 bool getRtlForProc(const QString &name, QString &rtl);
30 const char *getSigFile(const QString &name);
31 const char *getClusterFile(const QString &name);
32 void renameProc(const QString &oldName, const QString &newName);
33 void rereadLibSignatures();
34 void getCompoundMembers(const QString &name, QTableWidget *tbl);
36 void setDebugging(bool d)
38 debugging = d;
40 void setUseDFTA(bool d);
41 void setNoDecodeChildren(bool d);
43 void addEntryPoint(ADDRESS a, const char *nam);
44 void removeEntryPoint(ADDRESS a);
46 public slots:
47 void changeInputFile(const QString &f);
48 void changeOutputPath(const QString &path);
49 void load();
50 void decode();
51 void decompile();
52 void generateCode();
53 void stopWaiting();
55 signals:
56 void loading();
57 void decoding();
58 void decompiling();
59 void generatingCode();
60 void loadCompleted();
61 void decodeCompleted();
62 void decompileCompleted();
63 void generateCodeCompleted();
65 void consideringProc(const QString &parent, const QString &name);
66 void decompilingProc(const QString &name);
67 void newUserProc(const QString &name, unsigned int addr);
68 void newLibProc(const QString &name, const QString &params);
69 void removeUserProc(const QString &name, unsigned int addr);
70 void removeLibProc(const QString &name);
71 void newCluster(const QString &name);
72 void newProcInCluster(const QString &name, const QString &cluster);
73 void newEntrypoint(unsigned int addr, const QString &name);
74 void newSection(const QString &name, unsigned int start, unsigned int end);
76 void machineType(const QString &machine);
78 void debuggingPoint(const QString &name, const QString &description);
80 protected:
82 bool debugging, waiting;
84 FrontEnd *fe;
85 Prog *prog;
87 QString filename;
89 const char *procStatus(UserProc *p);
90 void emitClusterAndChildren(Cluster *root);
92 std::vector<ADDRESS> user_entrypoints;
95 class DecompilerThread : public QThread
97 Q_OBJECT
99 public:
100 DecompilerThread() : QThread(), decompiler(NULL)
103 Decompiler *getDecompiler();
105 protected:
106 void run();
108 Decompiler *decompiler;