Add another comment
@@ -1,4 +1,4 | |||||
1 | 2c82d72694590cbc2aebb946667f11f60ea89afe src/SocExplorerEngine/PeripheralWidget |
|
1 | 2c82d72694590cbc2aebb946667f11f60ea89afe src/SocExplorerEngine/PeripheralWidget | |
2 | e0f25227d6283e833fbb70c5fc1bdc6c3ca8060e src/common/genericBinaryFiles |
|
2 | cc958c79ba0939809a70e63b8bac798930160243 src/common/genericBinaryFiles | |
3 | 2dce25b198558be573f56c1cf337aa95ddd666d6 src/common/lppserial |
|
3 | 2dce25b198558be573f56c1cf337aa95ddd666d6 src/common/lppserial | |
4 | 923afde9cc96bb419cf898560d080ec96991aeca src/common/qhexedit |
|
4 | 923afde9cc96bb419cf898560d080ec96991aeca src/common/qhexedit |
@@ -3,6 +3,7 | |||||
3 | contains(QT_MAJOR_VERSION, 5) { |
|
3 | contains(QT_MAJOR_VERSION, 5) { | |
4 | QT += widgets |
|
4 | QT += widgets | |
5 | QT += printsupport |
|
5 | QT += printsupport | |
|
6 | QT += multimedia multimediawidgets | |||
6 | } |
|
7 | } | |
7 |
|
8 | |||
8 | SOCEXPLORER_SDK_BUILD="SOCEXPLORER_SDK_BUILD" |
|
9 | SOCEXPLORER_SDK_BUILD="SOCEXPLORER_SDK_BUILD" |
@@ -27,6 +27,7 | |||||
27 | QObject(parent) |
|
27 | QObject(parent) | |
28 | { |
|
28 | { | |
29 | p_rootDev = rootDev; |
|
29 | p_rootDev = rootDev; | |
|
30 | p_litleEndian = false; | |||
30 | } |
|
31 | } | |
31 |
|
32 | |||
32 | qint32 SOCModel::getEnumDeviceBaseAddress(int VID, int PID, int count) |
|
33 | qint32 SOCModel::getEnumDeviceBaseAddress(int VID, int PID, int count) | |
@@ -110,3 +111,8 | |||||
110 | p_rootDev->Read(&valueInt,1,addressInt); |
|
111 | p_rootDev->Read(&valueInt,1,addressInt); | |
111 | return (qint32)valueInt; |
|
112 | return (qint32)valueInt; | |
112 | } |
|
113 | } | |
|
114 | ||||
|
115 | bool SOCModel::isLitleEndian() | |||
|
116 | { | |||
|
117 | return p_litleEndian; | |||
|
118 | } |
@@ -94,10 +94,12 | |||||
94 | int addEnumDevice(socExplorerEnumDevice* device); |
|
94 | int addEnumDevice(socExplorerEnumDevice* device); | |
95 | void writeReg(qint32 address,qint32 value); |
|
95 | void writeReg(qint32 address,qint32 value); | |
96 | qint32 readReg(qint32 address); |
|
96 | qint32 readReg(qint32 address); | |
|
97 | bool isLitleEndian(); | |||
97 | private: |
|
98 | private: | |
98 | socexplorerplugin* p_rootDev; |
|
99 | socexplorerplugin* p_rootDev; | |
99 | QList<socExplorerEnumDevice*> p_enumeratedDevices; |
|
100 | QList<socExplorerEnumDevice*> p_enumeratedDevices; | |
100 | QList<SOCclk*> clktree; |
|
101 | QList<SOCclk*> clktree; | |
|
102 | bool p_litleEndian; | |||
101 | }; |
|
103 | }; | |
102 |
|
104 | |||
103 |
|
105 |
@@ -89,6 +89,7 | |||||
89 | plugins \ |
|
89 | plugins \ | |
90 | pluginManagerWdgt \ |
|
90 | pluginManagerWdgt \ | |
91 | ../common \ |
|
91 | ../common \ | |
|
92 | ../common/genericBinaryFiles \ | |||
92 | ../ \ |
|
93 | ../ \ | |
93 | RegisterMVS \ |
|
94 | RegisterMVS \ | |
94 | XmlEngine \ |
|
95 | XmlEngine \ |
@@ -281,5 +281,10 | |||||
281 | loglvl = level; |
|
281 | loglvl = level; | |
282 | } |
|
282 | } | |
283 |
|
283 | |||
|
284 | bool SocExplorerEngine::isSocLitleEndian(socexplorerplugin *plugin) | |||
|
285 | { | |||
|
286 | return plugin2Soc(plugin)->isLitleEndian(); | |||
|
287 | } | |||
284 |
|
288 | |||
285 |
|
289 | |||
|
290 |
@@ -107,6 +107,7 | |||||
107 | static void removeSOC(socexplorerplugin* rootPlugin); |
|
107 | static void removeSOC(socexplorerplugin* rootPlugin); | |
108 | static void message(socexplorerplugin* sender,const QString& message,int debugLevel=0); |
|
108 | static void message(socexplorerplugin* sender,const QString& message,int debugLevel=0); | |
109 | static void setLogLevel(int level); |
|
109 | static void setLogLevel(int level); | |
|
110 | static bool isSocLitleEndian(socexplorerplugin* plugin); | |||
110 | signals: |
|
111 | signals: | |
111 | void enumDeviceAdded(socExplorerEnumDevice* device); |
|
112 | void enumDeviceAdded(socExplorerEnumDevice* device); | |
112 | public slots: |
|
113 | public slots: |
@@ -11,7 +11,7 | |||||
11 | #endif |
|
11 | #endif | |
12 | #endif |
|
12 | #endif | |
13 |
|
13 | |||
14 |
|
14 | #include <socexplorerengine.h> | ||
15 |
|
15 | |||
16 |
|
16 | |||
17 | genericPySysdriver::genericPySysdriver(socexplorerplugin* plugin,QObject* parent): |
|
17 | genericPySysdriver::genericPySysdriver(socexplorerplugin* plugin,QObject* parent): | |
@@ -44,56 +44,28 | |||||
44 |
|
44 | |||
45 | bool genericPySysdriver::dumpMemory(unsigned int address,unsigned int count,QString file) |
|
45 | bool genericPySysdriver::dumpMemory(unsigned int address,unsigned int count,QString file) | |
46 | { |
|
46 | { | |
47 | unsigned int* buffer = (unsigned int*)malloc(count*sizeof(unsigned int)); |
|
47 | return this->plugin->dumpMemory(address,count,file); | |
48 | if(buffer!=NULL) |
|
|||
49 | { |
|
|||
50 | this->plugin->Read(buffer,count,address); |
|
|||
51 | QFile outfile(file); |
|
|||
52 | if (!outfile.open(QIODevice::ReadWrite | QIODevice::Text)) |
|
|||
53 | return false; |
|
|||
54 | QTextStream out(&outfile); |
|
|||
55 | for(int i=0;(unsigned int)i<count;i++) |
|
|||
56 | out << "0x"+QString::number(address+(i*4),16) + ": 0x" + QString::number(buffer[i],16) + "\n"; |
|
|||
57 | free(buffer); |
|
|||
58 | out.flush(); |
|
|||
59 | outfile.close(); |
|
|||
60 | return true; |
|
|||
61 | } |
|
|||
62 | return false; |
|
|||
63 | } |
|
48 | } | |
64 |
|
49 | |||
65 | bool genericPySysdriver::memSet(unsigned int address,int value, unsigned int count) |
|
50 | bool genericPySysdriver::memSet(unsigned int address,int value, unsigned int count) | |
66 | { |
|
51 | { | |
67 | unsigned int* buffer = (unsigned int*)malloc(count*sizeof(unsigned int)); |
|
52 | return this->plugin->memSet(address,value,count); | |
68 | if(buffer!=NULL) |
|
|||
69 | { |
|
|||
70 | memset((void*)buffer,value,count*sizeof(unsigned int)); |
|
|||
71 | this->plugin->Write(buffer,count,address); |
|
|||
72 | free(buffer ); |
|
|||
73 | return true; |
|
|||
74 | } |
|
|||
75 | return false; |
|
|||
76 | } |
|
53 | } | |
77 |
|
54 | |||
78 | bool genericPySysdriver::loadbin(unsigned int address,QString file) |
|
55 | bool genericPySysdriver::loadbin(unsigned int address,QString file) | |
79 | { |
|
56 | { | |
80 | QFile infile(file); |
|
57 | return this->plugin->loadbin(address,file); | |
81 | if (!infile.open(QIODevice::ReadOnly)) |
|
58 | ||
82 | return false; |
|
59 | } | |
83 | uint32_t* buffer = (uint32_t*)malloc(infile.size()); |
|
|||
84 | if(buffer!=NULL) |
|
|||
85 | { |
|
|||
86 | infile.read((char*)buffer,infile.size()); |
|
|||
87 | for(int i=0;i<(infile.size()/4);i++) |
|
|||
88 | { |
|
|||
89 | buffer[i] = socexplorerBswap32(buffer[i]); |
|
|||
90 | } |
|
|||
91 | this->plugin->Write(buffer,infile.size()/4,address); |
|
|||
92 | free(buffer); |
|
|||
93 | return true; |
|
|||
94 | } |
|
|||
95 | return false; |
|
|||
96 |
|
60 | |||
|
61 | bool genericPySysdriver::loadfile(abstractBinFile *file) | |||
|
62 | { | |||
|
63 | return this->plugin->loadfile(file); | |||
|
64 | } | |||
|
65 | ||||
|
66 | bool genericPySysdriver::dumpMemory(unsigned int address, unsigned int count, QString file, const QString &format) | |||
|
67 | { | |||
|
68 | return this->plugin->dumpMemory(address,count,file,format); | |||
97 | } |
|
69 | } | |
98 |
|
70 | |||
99 | QString genericPySysdriver::instance() |
|
71 | QString genericPySysdriver::instance() |
@@ -28,6 +28,7 | |||||
28 | #include <QFile> |
|
28 | #include <QFile> | |
29 | #include <stdint.h> |
|
29 | #include <stdint.h> | |
30 | #include <QTextStream> |
|
30 | #include <QTextStream> | |
|
31 | #include <abstractbinfile.h> | |||
31 | #if defined(SOCEXPLORER_SDK_BUILD) |
|
32 | #if defined(SOCEXPLORER_SDK_BUILD) | |
32 | # define SOCEXPLORER_SDK_EXPORT Q_DECL_EXPORT |
|
33 | # define SOCEXPLORER_SDK_EXPORT Q_DECL_EXPORT | |
33 | #else |
|
34 | #else | |
@@ -49,6 +50,8 | |||||
49 | bool dumpMemory(unsigned int address,unsigned int count,QString file); |
|
50 | bool dumpMemory(unsigned int address,unsigned int count,QString file); | |
50 | bool memSet(unsigned int address,int value, unsigned int count); |
|
51 | bool memSet(unsigned int address,int value, unsigned int count); | |
51 | bool loadbin(unsigned int address,QString file); |
|
52 | bool loadbin(unsigned int address,QString file); | |
|
53 | bool loadfile(abstractBinFile* file); | |||
|
54 | bool dumpMemory(unsigned int address, unsigned int count, QString file, const QString &format); | |||
52 | QString instance(); |
|
55 | QString instance(); | |
53 | private: |
|
56 | private: | |
54 | socexplorerplugin* plugin; |
|
57 | socexplorerplugin* plugin; |
@@ -21,7 +21,9 | |||||
21 | ----------------------------------------------------------------------------*/ |
|
21 | ----------------------------------------------------------------------------*/ | |
22 |
|
22 | |||
23 | #include <socexplorerplugin.h> |
|
23 | #include <socexplorerplugin.h> | |
24 |
|
24 | #include <abstractbinfile.h> | ||
|
25 | #include <srec/srecfile.h> | |||
|
26 | #include <BinFile/binaryfile.h> | |||
25 |
|
27 | |||
26 | int socexplorerplugin::isConnected(){return this->Connected;} |
|
28 | int socexplorerplugin::isConnected(){return this->Connected;} | |
27 |
|
29 | |||
@@ -33,44 +35,44 | |||||
33 |
|
35 | |||
34 | QString socexplorerplugin::instanceName() |
|
36 | QString socexplorerplugin::instanceName() | |
35 | { |
|
37 | { | |
36 |
|
|
38 | return this->_instanceName; | |
37 | } |
|
39 | } | |
38 |
|
40 | |||
39 | int socexplorerplugin::registermenu(QMenu *menu) |
|
41 | int socexplorerplugin::registermenu(QMenu *menu) | |
40 | { |
|
42 | { | |
41 |
|
|
43 | this->menu = menu->addMenu(this->_instanceName); | |
42 |
|
|
44 | this->closeAction = this->menu->addAction(tr("Close plugin")); | |
43 |
|
|
45 | QObject::connect(this->closeAction,SIGNAL(triggered()),this,SLOT(closeMe())); | |
44 |
|
|
46 | this->ChildsMenu = this->menu->addMenu(QString("Childs")); | |
45 |
|
|
47 | for(int i=0;i<this->childs.count();i++) | |
46 | { |
|
48 | { | |
47 |
|
|
49 | this->childs.at(i)->registermenu(this->ChildsMenu); | |
48 | } |
|
50 | } | |
49 |
|
|
51 | if(this->pyObject!=NULL)emit this->registerObject((QObject*)this->pyObject,this->instanceName()); | |
50 |
|
|
52 | return 0; | |
51 | } |
|
53 | } | |
52 |
|
54 | |||
53 | void socexplorerplugin::postInstantiationTrigger() |
|
55 | void socexplorerplugin::postInstantiationTrigger() | |
54 | { |
|
56 | { | |
55 |
|
|
57 | return; | |
56 | } |
|
58 | } | |
57 |
|
59 | |||
58 | unsigned int socexplorerplugin::Write(unsigned int *Value, unsigned int count, unsigned int address) |
|
60 | unsigned int socexplorerplugin::Write(unsigned int *Value, unsigned int count, unsigned int address) | |
59 | { |
|
61 | { | |
60 |
|
|
62 | if(parent!=NULL) | |
61 | { |
|
63 | { | |
62 |
|
|
64 | return parent->Write(Value,count,address); | |
63 | } |
|
65 | } | |
64 |
|
|
66 | return 0; | |
65 | } |
|
67 | } | |
66 |
|
68 | |||
67 | unsigned int socexplorerplugin::Read(unsigned int *Value, unsigned int count, unsigned int address) |
|
69 | unsigned int socexplorerplugin::Read(unsigned int *Value, unsigned int count, unsigned int address) | |
68 | { |
|
70 | { | |
69 |
|
|
71 | if(parent!=NULL) | |
70 | { |
|
72 | { | |
71 |
|
|
73 | return parent->Read(Value,count,address); | |
72 | } |
|
74 | } | |
73 |
|
|
75 | return 0; | |
74 | } |
|
76 | } | |
75 |
|
77 | |||
76 | void socexplorerplugin::closeMe(){emit this->closePlugin(this);} |
|
78 | void socexplorerplugin::closeMe(){emit this->closePlugin(this);} | |
@@ -79,13 +81,164 | |||||
79 |
|
81 | |||
80 | void socexplorerplugin::setInstanceName(const QString &newName) |
|
82 | void socexplorerplugin::setInstanceName(const QString &newName) | |
81 | { |
|
83 | { | |
82 |
|
|
84 | this->_instanceName = newName; | |
83 |
|
|
85 | if(this->menu) | |
84 |
|
|
86 | this->menu->setTitle(this->_instanceName); | |
85 |
|
|
87 | this->setWindowTitle(newName); | |
|
88 | } | |||
|
89 | ||||
|
90 | bool socexplorerplugin::dumpMemory(unsigned int address, unsigned int count, QString file) | |||
|
91 | { | |||
|
92 | unsigned int* buffer = (unsigned int*)malloc(count*sizeof(unsigned int)); | |||
|
93 | if(buffer!=NULL) | |||
|
94 | { | |||
|
95 | this->Read(buffer,count,address); | |||
|
96 | QFile outfile(file); | |||
|
97 | if (!outfile.open(QIODevice::ReadWrite | QIODevice::Text)) | |||
|
98 | return false; | |||
|
99 | QTextStream out(&outfile); | |||
|
100 | for(int i=0;(unsigned int)i<count;i++) | |||
|
101 | out << "0x"+QString::number(address+(i*4),16) + ": 0x" + QString::number(buffer[i],16) + "\n"; | |||
|
102 | free(buffer); | |||
|
103 | out.flush(); | |||
|
104 | outfile.close(); | |||
|
105 | return true; | |||
|
106 | } | |||
|
107 | return false; | |||
|
108 | } | |||
|
109 | ||||
|
110 | bool socexplorerplugin::memSet(unsigned int address, int value, unsigned int count) | |||
|
111 | { | |||
|
112 | unsigned int* buffer = (unsigned int*)malloc(count*sizeof(unsigned int)); | |||
|
113 | if(buffer!=NULL) | |||
|
114 | { | |||
|
115 | memset((void*)buffer,value,count*sizeof(unsigned int)); | |||
|
116 | this->Write(buffer,count,address); | |||
|
117 | free(buffer ); | |||
|
118 | return true; | |||
|
119 | } | |||
|
120 | return false; | |||
|
121 | } | |||
|
122 | ||||
|
123 | bool socexplorerplugin::loadbin(unsigned int address, QString file) | |||
|
124 | { | |||
|
125 | QFile infile(file); | |||
|
126 | if (!infile.open(QIODevice::ReadOnly)) | |||
|
127 | return false; | |||
|
128 | uint32_t* buffer = (uint32_t*)malloc(infile.size()); | |||
|
129 | if(buffer!=NULL) | |||
|
130 | { | |||
|
131 | infile.read((char*)buffer,infile.size()); | |||
|
132 | for(int i=0;i<(infile.size()/4);i++) | |||
|
133 | { | |||
|
134 | buffer[i] = socexplorerBswap32(buffer[i]); | |||
|
135 | } | |||
|
136 | this->Write(buffer,infile.size()/4,address); | |||
|
137 | free(buffer); | |||
|
138 | return true; | |||
|
139 | } | |||
|
140 | return false; | |||
|
141 | ||||
|
142 | } | |||
|
143 | ||||
|
144 | bool socexplorerplugin::loadfile(abstractBinFile *file) | |||
|
145 | { | |||
|
146 | if(file->isopened()) | |||
|
147 | { | |||
|
148 | QList<codeFragment*> fragments= file->getFragments(); | |||
|
149 | for(int i=0;i<fragments.count();i++) | |||
|
150 | { | |||
|
151 | int size = fragments.at(i)->size/4; | |||
|
152 | // TODO fixme, should be the oposite | |||
|
153 | #if __BYTE_ORDER == __LITTLE_ENDIAN | |||
|
154 | if(!file->litleendian) | |||
|
155 | { | |||
|
156 | uint32_t* buffer = (uint32_t*)malloc(fragments.at(i)->size); | |||
|
157 | memcpy(buffer,fragments.at(i)->data,fragments.at(i)->size); | |||
|
158 | if(buffer!=NULL) | |||
|
159 | { | |||
|
160 | for(int l=0;l<(size);l++) | |||
|
161 | { | |||
|
162 | buffer[l] = socexplorerBswap32(buffer[l]); | |||
|
163 | } | |||
|
164 | this->Write(buffer,size,fragments.at(i)->address); | |||
|
165 | free(buffer); | |||
|
166 | } | |||
|
167 | } | |||
|
168 | else | |||
|
169 | { | |||
|
170 | this->Write((uint32_t*) fragments.at(i)->data,size,fragments.at(i)->address); | |||
|
171 | } | |||
|
172 | #elif __BYTE_ORDER == __BIG_ENDIAN | |||
|
173 | if(file->litleendian) | |||
|
174 | { | |||
|
175 | uint32_t* buffer = (uint32_t*)malloc(fragments.at(i)->size); | |||
|
176 | memcpy(buffer,fragments.at(i)->data,fragments.at(i)->size); | |||
|
177 | if(buffer!=NULL) | |||
|
178 | { | |||
|
179 | for(int l=0;l<(size);l++) | |||
|
180 | { | |||
|
181 | buffer[l] = socexplorerBswap32(buffer[l]); | |||
|
182 | } | |||
|
183 | this->Write(buffer,size,fragments.at(i)->address); | |||
|
184 | free(buffer); | |||
|
185 | } | |||
|
186 | } | |||
|
187 | else | |||
|
188 | { | |||
|
189 | this->Write((uint32_t*) fragments.at(i)->data,size,fragments.at(i)->address); | |||
|
190 | } | |||
|
191 | #endif | |||
|
192 | } | |||
|
193 | } | |||
|
194 | return true; | |||
|
195 | } | |||
|
196 | ||||
|
197 | bool socexplorerplugin::dumpMemory(unsigned int address, unsigned int count, QString file, const QString &format) | |||
|
198 | { | |||
|
199 | unsigned int* buffer = (unsigned int*)malloc(count*sizeof(unsigned int)); | |||
|
200 | if(buffer!=NULL) | |||
|
201 | { | |||
|
202 | this->Read(buffer,count,address); | |||
|
203 | if(!format.compare("srec",Qt::CaseInsensitive)) | |||
|
204 | { | |||
|
205 | //need to convert from in memory endianness to file endianness | |||
|
206 | //SREC is always big endian | |||
|
207 | #if __BYTE_ORDER == __LITTLE_ENDIAN | |||
|
208 | for(int l=0;l<(count);l++) | |||
|
209 | { | |||
|
210 | buffer[l] = socexplorerBswap32(buffer[l]); | |||
|
211 | } | |||
|
212 | #elif __BYTE_ORDER == __BIG_ENDIAN | |||
|
213 | ||||
|
214 | #endif | |||
|
215 | codeFragment fragment((char*)buffer,count*4,address); | |||
|
216 | srecFile::toSrec(QList<codeFragment*>()<<&fragment,file); | |||
|
217 | } | |||
|
218 | if(!format.compare("bin",Qt::CaseInsensitive)) | |||
|
219 | { | |||
|
220 | //beware this format is not portable from a big endian host to a litle endian one | |||
|
221 | codeFragment fragment((char*)buffer,count*4,address); | |||
|
222 | binaryFile::toBinary(QList<codeFragment*>()<<&fragment,file); | |||
|
223 | } | |||
|
224 | if(!format.compare("hexa",Qt::CaseInsensitive)) | |||
|
225 | { | |||
|
226 | QFile outfile(file); | |||
|
227 | if (!outfile.open(QIODevice::ReadWrite | QIODevice::Text)) | |||
|
228 | return false; | |||
|
229 | QTextStream out(&outfile); | |||
|
230 | for(int i=0;(unsigned int)i<count;i++) | |||
|
231 | out << "0x"+QString::number(address+(i*4),16) + ": 0x" + QString::number(buffer[i],16) + "\n"; | |||
|
232 | free(buffer); | |||
|
233 | out.flush(); | |||
|
234 | outfile.close(); | |||
|
235 | } | |||
|
236 | return true; | |||
|
237 | } | |||
|
238 | return false; | |||
86 | } |
|
239 | } | |
87 |
|
240 | |||
88 | void socexplorerplugin::makeGenericPyWrapper() |
|
241 | void socexplorerplugin::makeGenericPyWrapper() | |
89 | { |
|
242 | { | |
90 |
|
|
243 | this->pyObject = new genericPySysdriver(this); | |
91 | } |
|
244 | } |
@@ -43,6 +43,7 | |||||
43 | #include <stdint.h> |
|
43 | #include <stdint.h> | |
44 | #include <QTextStream> |
|
44 | #include <QTextStream> | |
45 | #include <genericPySysdriver.h> |
|
45 | #include <genericPySysdriver.h> | |
|
46 | #include <abstractbinfile.h> | |||
46 | #ifndef driver_Name |
|
47 | #ifndef driver_Name | |
47 | #define driver_Name "Plugin" |
|
48 | #define driver_Name "Plugin" | |
48 | #endif |
|
49 | #endif | |
@@ -161,6 +162,12 | |||||
161 | virtual void closeMe(); |
|
162 | virtual void closeMe(); | |
162 | virtual void activate(bool flag); |
|
163 | virtual void activate(bool flag); | |
163 | virtual void setInstanceName(const QString& newName); |
|
164 | virtual void setInstanceName(const QString& newName); | |
|
165 | ||||
|
166 | virtual bool dumpMemory(unsigned int address,unsigned int count,QString file); | |||
|
167 | virtual bool memSet(unsigned int address,int value, unsigned int count); | |||
|
168 | virtual bool loadbin(unsigned int address,QString file); | |||
|
169 | virtual bool loadfile(abstractBinFile* file); | |||
|
170 | virtual bool dumpMemory(unsigned int address,unsigned int count,QString file,const QString& format); | |||
164 | protected: |
|
171 | protected: | |
165 | void makeGenericPyWrapper(); |
|
172 | void makeGenericPyWrapper(); | |
166 | int BaseAddress; |
|
173 | int BaseAddress; |
This diff has been collapsed as it changes many lines, (4709 lines changed) Show them Hide them | |||||
@@ -2,11 +2,11 | |||||
2 | #include <PythonQtConversion.h> |
|
2 | #include <PythonQtConversion.h> | |
3 | #include <PythonQtMethodInfo.h> |
|
3 | #include <PythonQtMethodInfo.h> | |
4 | #include <PythonQtSignalReceiver.h> |
|
4 | #include <PythonQtSignalReceiver.h> | |
5 | #include <QIconEngine> |
|
|||
6 | #include <QVariant> |
|
5 | #include <QVariant> | |
7 | #include <abstractbinfile.h> |
|
6 | #include <abstractbinfile.h> | |
8 | #include <elfparser.h> |
|
7 | #include <elfparser.h> | |
9 | #include <qaction.h> |
|
8 | #include <qaction.h> | |
|
9 | #include <qbackingstore.h> | |||
10 | #include <qbitmap.h> |
|
10 | #include <qbitmap.h> | |
11 | #include <qbytearray.h> |
|
11 | #include <qbytearray.h> | |
12 | #include <qcolor.h> |
|
12 | #include <qcolor.h> | |
@@ -17,12 +17,14 | |||||
17 | #include <qfont.h> |
|
17 | #include <qfont.h> | |
18 | #include <qgraphicseffect.h> |
|
18 | #include <qgraphicseffect.h> | |
19 | #include <qgraphicsproxywidget.h> |
|
19 | #include <qgraphicsproxywidget.h> | |
|
20 | #include <qicon.h> | |||
20 | #include <qkeysequence.h> |
|
21 | #include <qkeysequence.h> | |
21 | #include <qlayout.h> |
|
22 | #include <qlayout.h> | |
22 | #include <qlineedit.h> |
|
23 | #include <qlineedit.h> | |
23 | #include <qlist.h> |
|
24 | #include <qlist.h> | |
24 | #include <qlocale.h> |
|
25 | #include <qlocale.h> | |
25 | #include <qmargins.h> |
|
26 | #include <qmargins.h> | |
|
27 | #include <qmetaobject.h> | |||
26 | #include <qobject.h> |
|
28 | #include <qobject.h> | |
27 | #include <qpaintdevice.h> |
|
29 | #include <qpaintdevice.h> | |
28 | #include <qpaintengine.h> |
|
30 | #include <qpaintengine.h> | |
@@ -42,6 +44,7 | |||||
42 | #include <qstyle.h> |
|
44 | #include <qstyle.h> | |
43 | #include <qstyleoption.h> |
|
45 | #include <qstyleoption.h> | |
44 | #include <qwidget.h> |
|
46 | #include <qwidget.h> | |
|
47 | #include <qwindow.h> | |||
45 |
|
48 | |||
46 | PythonQtShell_ElfFile::~PythonQtShell_ElfFile() { |
|
49 | PythonQtShell_ElfFile::~PythonQtShell_ElfFile() { | |
47 | PythonQtPrivate* priv = PythonQt::priv(); |
|
50 | PythonQtPrivate* priv = PythonQt::priv(); | |
@@ -49,10 +52,10 | |||||
49 | } |
|
52 | } | |
50 | int PythonQtShell_ElfFile::closeFile() |
|
53 | int PythonQtShell_ElfFile::closeFile() | |
51 | { |
|
54 | { | |
52 | if (_wrapper) { |
|
55 | if (_wrapper && (((PyObject*)_wrapper)->ob_refcnt > 0)) { | |
53 | PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "closeFile"); |
|
56 | static PyObject* name = PyString_FromString("closeFile"); | |
54 | PyErr_Clear(); |
|
57 | PyObject* obj = PyBaseObject_Type.tp_getattro((PyObject*)_wrapper, name); | |
55 | if (obj && !PythonQtSlotFunction_Check(obj)) { |
|
58 | if (obj) { | |
56 | static const char* argumentList[] ={"int"}; |
|
59 | static const char* argumentList[] ={"int"}; | |
57 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); |
|
60 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); | |
58 | int returnValue; |
|
61 | int returnValue; | |
@@ -71,16 +74,18 | |||||
71 | if (result) { Py_DECREF(result); } |
|
74 | if (result) { Py_DECREF(result); } | |
72 | Py_DECREF(obj); |
|
75 | Py_DECREF(obj); | |
73 | return returnValue; |
|
76 | return returnValue; | |
|
77 | } else { | |||
|
78 | PyErr_Clear(); | |||
74 | } |
|
79 | } | |
75 | } |
|
80 | } | |
76 | return ElfFile::closeFile(); |
|
81 | return ElfFile::closeFile(); | |
77 | } |
|
82 | } | |
78 | QList<codeFragment* > PythonQtShell_ElfFile::getFragments() |
|
83 | QList<codeFragment* > PythonQtShell_ElfFile::getFragments() | |
79 | { |
|
84 | { | |
80 | if (_wrapper) { |
|
85 | if (_wrapper && (((PyObject*)_wrapper)->ob_refcnt > 0)) { | |
81 |
PyObject* |
|
86 | static PyObject* name = PyString_FromString("getFragments"); | |
82 | PyErr_Clear(); |
|
87 | PyObject* obj = PyBaseObject_Type.tp_getattro((PyObject*)_wrapper, name); | |
83 | if (obj && !PythonQtSlotFunction_Check(obj)) { |
|
88 | if (obj) { | |
84 | static const char* argumentList[] ={"QList<codeFragment* >"}; |
|
89 | static const char* argumentList[] ={"QList<codeFragment* >"}; | |
85 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); |
|
90 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); | |
86 | QList<codeFragment* > returnValue; |
|
91 | QList<codeFragment* > returnValue; | |
@@ -99,16 +104,18 | |||||
99 | if (result) { Py_DECREF(result); } |
|
104 | if (result) { Py_DECREF(result); } | |
100 | Py_DECREF(obj); |
|
105 | Py_DECREF(obj); | |
101 | return returnValue; |
|
106 | return returnValue; | |
|
107 | } else { | |||
|
108 | PyErr_Clear(); | |||
102 | } |
|
109 | } | |
103 | } |
|
110 | } | |
104 | return ElfFile::getFragments(); |
|
111 | return ElfFile::getFragments(); | |
105 | } |
|
112 | } | |
106 | bool PythonQtShell_ElfFile::isopened() |
|
113 | bool PythonQtShell_ElfFile::isopened() | |
107 | { |
|
114 | { | |
108 | if (_wrapper) { |
|
115 | if (_wrapper && (((PyObject*)_wrapper)->ob_refcnt > 0)) { | |
109 | PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "isopened"); |
|
116 | static PyObject* name = PyString_FromString("isopened"); | |
110 | PyErr_Clear(); |
|
117 | PyObject* obj = PyBaseObject_Type.tp_getattro((PyObject*)_wrapper, name); | |
111 | if (obj && !PythonQtSlotFunction_Check(obj)) { |
|
118 | if (obj) { | |
112 | static const char* argumentList[] ={"bool"}; |
|
119 | static const char* argumentList[] ={"bool"}; | |
113 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); |
|
120 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); | |
114 | bool returnValue; |
|
121 | bool returnValue; | |
@@ -127,20 +134,22 | |||||
127 | if (result) { Py_DECREF(result); } |
|
134 | if (result) { Py_DECREF(result); } | |
128 | Py_DECREF(obj); |
|
135 | Py_DECREF(obj); | |
129 | return returnValue; |
|
136 | return returnValue; | |
|
137 | } else { | |||
|
138 | PyErr_Clear(); | |||
130 | } |
|
139 | } | |
131 | } |
|
140 | } | |
132 | return ElfFile::isopened(); |
|
141 | return ElfFile::isopened(); | |
133 | } |
|
142 | } | |
134 | bool PythonQtShell_ElfFile::openFile(const QString& File) |
|
143 | bool PythonQtShell_ElfFile::openFile(const QString& File0) | |
135 | { |
|
144 | { | |
136 | if (_wrapper) { |
|
145 | if (_wrapper && (((PyObject*)_wrapper)->ob_refcnt > 0)) { | |
137 | PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "openFile"); |
|
146 | static PyObject* name = PyString_FromString("openFile"); | |
138 | PyErr_Clear(); |
|
147 | PyObject* obj = PyBaseObject_Type.tp_getattro((PyObject*)_wrapper, name); | |
139 | if (obj && !PythonQtSlotFunction_Check(obj)) { |
|
148 | if (obj) { | |
140 | static const char* argumentList[] ={"bool" , "const QString&"}; |
|
149 | static const char* argumentList[] ={"bool" , "const QString&"}; | |
141 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); |
|
150 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | |
142 | bool returnValue; |
|
151 | bool returnValue; | |
143 | void* args[2] = {NULL, (void*)&File}; |
|
152 | void* args[2] = {NULL, (void*)&File0}; | |
144 | PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); |
|
153 | PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | |
145 | if (result) { |
|
154 | if (result) { | |
146 | args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); |
|
155 | args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | |
@@ -155,20 +164,22 | |||||
155 | if (result) { Py_DECREF(result); } |
|
164 | if (result) { Py_DECREF(result); } | |
156 | Py_DECREF(obj); |
|
165 | Py_DECREF(obj); | |
157 | return returnValue; |
|
166 | return returnValue; | |
158 | } |
|
167 | } else { | |
159 | } |
|
168 | PyErr_Clear(); | |
160 | return ElfFile::openFile(File); |
|
169 | } | |
161 | } |
|
170 | } | |
162 | bool PythonQtShell_ElfFile::toBinary(const QString& File) |
|
171 | return ElfFile::openFile(File0); | |
163 | { |
|
172 | } | |
164 | if (_wrapper) { |
|
173 | bool PythonQtShell_ElfFile::toBinary(const QString& File0) | |
165 | PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "toBinary"); |
|
174 | { | |
166 | PyErr_Clear(); |
|
175 | if (_wrapper && (((PyObject*)_wrapper)->ob_refcnt > 0)) { | |
167 | if (obj && !PythonQtSlotFunction_Check(obj)) { |
|
176 | static PyObject* name = PyString_FromString("toBinary"); | |
|
177 | PyObject* obj = PyBaseObject_Type.tp_getattro((PyObject*)_wrapper, name); | |||
|
178 | if (obj) { | |||
168 | static const char* argumentList[] ={"bool" , "const QString&"}; |
|
179 | static const char* argumentList[] ={"bool" , "const QString&"}; | |
169 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); |
|
180 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | |
170 | bool returnValue; |
|
181 | bool returnValue; | |
171 | void* args[2] = {NULL, (void*)&File}; |
|
182 | void* args[2] = {NULL, (void*)&File0}; | |
172 | PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); |
|
183 | PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | |
173 | if (result) { |
|
184 | if (result) { | |
174 | args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); |
|
185 | args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | |
@@ -183,20 +194,22 | |||||
183 | if (result) { Py_DECREF(result); } |
|
194 | if (result) { Py_DECREF(result); } | |
184 | Py_DECREF(obj); |
|
195 | Py_DECREF(obj); | |
185 | return returnValue; |
|
196 | return returnValue; | |
186 | } |
|
197 | } else { | |
187 | } |
|
198 | PyErr_Clear(); | |
188 | return ElfFile::toBinary(File); |
|
199 | } | |
189 | } |
|
200 | } | |
190 | bool PythonQtShell_ElfFile::toSrec(const QString& File) |
|
201 | return ElfFile::toBinary(File0); | |
191 | { |
|
202 | } | |
192 | if (_wrapper) { |
|
203 | bool PythonQtShell_ElfFile::toSrec(const QString& File0) | |
193 | PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "toSrec"); |
|
204 | { | |
194 | PyErr_Clear(); |
|
205 | if (_wrapper && (((PyObject*)_wrapper)->ob_refcnt > 0)) { | |
195 | if (obj && !PythonQtSlotFunction_Check(obj)) { |
|
206 | static PyObject* name = PyString_FromString("toSrec"); | |
|
207 | PyObject* obj = PyBaseObject_Type.tp_getattro((PyObject*)_wrapper, name); | |||
|
208 | if (obj) { | |||
196 | static const char* argumentList[] ={"bool" , "const QString&"}; |
|
209 | static const char* argumentList[] ={"bool" , "const QString&"}; | |
197 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); |
|
210 | static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | |
198 | bool returnValue; |
|
211 | bool returnValue; | |
199 | void* args[2] = {NULL, (void*)&File}; |
|
212 | void* args[2] = {NULL, (void*)&File0}; | |
200 | PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); |
|
213 | PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | |
201 |