##// END OF EJS Templates
added endianness to abstractBinaryFile.
jeandet -
r14:c218d6ee38e9 default
parent child
Show More
@@ -24,16 +24,19
24 24
25 25 binaryFile::binaryFile()
26 26 {
27 litleendian = false;
27 28 }
28 29
29 30 binaryFile::binaryFile(const QString &File)
30 31 {
31 32 openFile(File);
33 litleendian = false;
32 34 }
33 35
34 36 binaryFile::binaryFile(const QStringList &Files)
35 37 {
36 38 openFiles(Files);
39 litleendian = false;
37 40 }
38 41
39 42 binaryFile::~binaryFile()
@@ -54,6 +54,8 public:
54 54 virtual QList<codeFragment*> getFragments()=0;
55 55 virtual bool toSrec(const QString& File)=0;
56 56 virtual bool toBinary(const QString& File)=0;
57
58 bool litleendian;
57 59 protected:
58 60 QString p_fileName;
59 61 };
@@ -90,6 +90,7 bool ElfFile::openFile(const QString &Fi
90 90 this->updateSections();
91 91 this->updateSymbols();
92 92 this->opened = true;
93 litleendian = isLitleEndian();
93 94 return 1;
94 95 }
95 96
@@ -487,6 +488,26 QString ElfFile::getEndianness()
487 488 return "none";
488 489 }
489 490
491 bool ElfFile::isLitleEndian()
492 {
493 if(this->e!=NULL)
494 {
495 if(this->ehdr.e_ident[EI_DATA]==ELFDATA2LSB)return true;
496 if(this->ehdr.e_ident[EI_DATA]==ELFDATA2MSB)return false;
497 }
498 return false;
499 }
500
501 bool ElfFile::isBigEndian()
502 {
503 if(this->e!=NULL)
504 {
505 if(this->ehdr.e_ident[EI_DATA]==ELFDATA2LSB)return false;
506 if(this->ehdr.e_ident[EI_DATA]==ELFDATA2MSB)return true;
507 }
508 return false;
509 }
510
490 511 QString ElfFile::getABI()
491 512 {
492 513 if(this->e!=NULL)
@@ -75,6 +75,8 public:
75 75 QString getArchitecture();
76 76 QString getType();
77 77 QString getEndianness();
78 bool isLitleEndian();
79 bool isBigEndian();
78 80 QString getABI();
79 81 qint64 getVersion();
80 82 qint64 getEntryPointAddress();
@@ -26,18 +26,21
26 26 srecFile::srecFile()
27 27 {
28 28 p_mergingRecords = true;
29 litleendian = false;
29 30 }
30 31
31 32 srecFile::srecFile(const QString &File)
32 33 {
33 34 p_mergingRecords = true;
34 35 openFile(File);
36 litleendian = false;
35 37 }
36 38
37 39 srecFile::srecFile(const QStringList &Files)
38 40 {
39 41 p_mergingRecords = true;
40 42 openFiles(Files);
43 litleendian = false;
41 44 }
42 45
43 46 srecFile::~srecFile()
General Comments 0
You need to be logged in to leave comments. Login now