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