summaryrefslogtreecommitdiffstats
path: root/src/coff/base/text_coff.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/coff/base/text_coff.cpp')
-rw-r--r--src/coff/base/text_coff.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/src/coff/base/text_coff.cpp b/src/coff/base/text_coff.cpp
index 0d0862e..1a749fe 100644
--- a/src/coff/base/text_coff.cpp
+++ b/src/coff/base/text_coff.cpp
@@ -14,18 +14,18 @@ namespace Coff
{
class CodeData {
public:
- QString address, opcode, disasm1, disasm2;
+ TQString address, opcode, disasm1, disasm2;
};
class LineData {
public:
- QValueVector<CodeData> codes;
- QString lineNumber, lineText;
+ TQValueVector<CodeData> codes;
+ TQString lineNumber, lineText;
};
class FileData {
public:
PURL::Url url;
bool read;
- QValueVector<LineData> lines;
+ TQValueVector<LineData> lines;
};
}
@@ -40,7 +40,7 @@ bool Coff::TextObject::parse(Log::Base &log)
return ok;
}
-PURL::Url Coff::TextObject::urlForFilename(const QString &filename) const
+PURL::Url Coff::TextObject::urlForFilename(const TQString &filename) const
{
PURL::Url rurl = PURL::Url::fromPathOrUrl(filename);
return rurl.toAbsolute(url().directory());
@@ -48,11 +48,11 @@ PURL::Url Coff::TextObject::urlForFilename(const QString &filename) const
const Coff::Section *Coff::TextObject::section(const CodeLine &cline) const
{
- if ( cline.section().instructions().contains(cline.address()) ) return &cline.section();
+ if ( cline.section().instructions().tqcontains(cline.address()) ) return &cline.section();
// possible for coff generated by picc...
for (uint i=0; i<uint(_sections.count()); i++) {
if ( _sections[i]->type()!=SectionType::Code ) continue;
- if ( _sections[i]->instructions().contains(cline.address()) ) return _sections[i];
+ if ( _sections[i]->instructions().tqcontains(cline.address()) ) return _sections[i];
}
return 0;
}
@@ -63,12 +63,12 @@ void Coff::TextObject::init() const
_initialized = true;
// open and read files
- QMap<QString, FileData> fd;
+ TQMap<TQString, FileData> fd;
for (uint i=0; i<uint(_sections.count()); i++) {
if ( _sections[i]->type()!=SectionType::Code ) continue;
for (uint k=0; k<uint(_sections[i]->lines().count()); k++) {
- QString filename = _sections[i]->lines()[k]->filename();
- if ( filename.isEmpty() || fd.contains(filename) ) continue;
+ TQString filename = _sections[i]->lines()[k]->filename();
+ if ( filename.isEmpty() || fd.tqcontains(filename) ) continue;
_filenames.append(filename);
FileData fdata;
fdata.url = urlForFilename(filename);
@@ -76,7 +76,7 @@ void Coff::TextObject::init() const
PURL::File file(fdata.url, sview);
fdata.read = file.openForRead();
if (fdata.read) {
- QStringList lines = file.readLines();
+ TQStringList lines = file.readLines();
fdata.lines.resize(lines.count());
for (uint i=0; i<uint(lines.count()); i++)
fdata.lines[i].lineText = lines[i];
@@ -88,11 +88,11 @@ void Coff::TextObject::init() const
// create strings (for later justification)
const uint addressWidth = _device->nbCharsAddress();
uint opcodeWidth = 0, disasm1Width = 0, disasm2Width = 0, lineNumberWidth = 0, lineTextWidth = 0;
- QMap<QString, FileData>::iterator it;
+ TQMap<TQString, FileData>::iterator it;
for (it=fd.begin(); it!=fd.end(); ++it) {
for (uint i=0; i<uint(it.data().lines.count()); i++) {
LineData &ldata = it.data().lines[i];
- QValueVector<const CodeLine *> lines = findCodeLines(it.key(), i);
+ TQValueVector<const CodeLine *> lines = findCodeLines(it.key(), i);
ldata.codes.resize(lines.count());
for (uint k=0; k<uint(lines.count()); k++) {
Address address = lines[k]->address();
@@ -102,8 +102,8 @@ void Coff::TextObject::init() const
ldata.codes[k].opcode = "0x" + sec->instructions()[address].opcode.upper();
//qDebug("%s: %s", ldata.codes[k].address.latin1(), ldata.codes[k].opcode.latin1());
opcodeWidth = qMax(opcodeWidth, uint(ldata.codes[k].opcode.length()));
- QString s = sec->instructions()[address].disasm;
- int j = s.find('\t');
+ TQString s = sec->instructions()[address].disasm;
+ int j = s.tqfind('\t');
if ( j!=-1 ) {
ldata.codes[k].disasm2 = s.mid(j+1);
disasm2Width = qMax(disasm2Width, uint(ldata.codes[k].disasm2.length()));
@@ -112,7 +112,7 @@ void Coff::TextObject::init() const
disasm1Width = qMax(disasm1Width, uint(ldata.codes[k].disasm1.length()));
}
}
- ldata.lineNumber = QString::number(i+1);
+ ldata.lineNumber = TQString::number(i+1);
lineNumberWidth = qMax(lineNumberWidth, uint(ldata.lineNumber.length()));
lineTextWidth = qMax(lineTextWidth, uint(ldata.lineText.length()));
}
@@ -122,19 +122,19 @@ void Coff::TextObject::init() const
// create text
for (it = fd.begin(); it!=fd.end(); ++it) {
- QString s = QString("--- ") + it.data().url.pretty() + " ";
+ TQString s = TQString("--- ") + it.data().url.pretty() + " ";
_list += s.leftJustify(totalWidth, '-');
if ( !it.data().read ) {
- s = QString("--- ") + i18n("File could not be read") + " ";
+ s = TQString("--- ") + i18n("File could not be read") + " ";
_list += s.leftJustify(totalWidth, '-');
}
for (uint i=0; i<uint(it.data().lines.count()); i++) {
const LineData &ldata = it.data().lines[i];
- QString cline = repeat(" ", 4) + ldata.lineNumber.leftJustify(lineNumberWidth) + ": " + ldata.lineText;
+ TQString cline = repeat(" ", 4) + ldata.lineNumber.leftJustify(lineNumberWidth) + ": " + ldata.lineText;
if ( ldata.codes.count()==0 ) _list += stripEndingWhiteSpaces(repeat(" ", asmWidth) + cline);
else for (uint k=0; k<uint(ldata.codes.count()); k++) {
if ( ldata.codes[k].opcode.isEmpty() ) continue;
- QString line;
+ TQString line;
line += ldata.codes[k].address + repeat(" ", 4);
line += ldata.codes[k].opcode.leftJustify(opcodeWidth) + repeat(" ", 4);
line += ldata.codes[k].disasm1.leftJustify(disasm1Width) + repeat(" ", 2);
@@ -147,7 +147,7 @@ void Coff::TextObject::init() const
}
}
-uint Coff::TextObject::nbLines(const QString &filename) const
+uint Coff::TextObject::nbLines(const TQString &filename) const
{
init();
uint nb = 0;
@@ -161,10 +161,10 @@ uint Coff::TextObject::nbLines(const QString &filename) const
return nb;
}
-QValueVector<const Coff::CodeLine *> Coff::TextObject::findCodeLines(const QString &filename, uint line) const
+TQValueVector<const Coff::CodeLine *> Coff::TextObject::findCodeLines(const TQString &filename, uint line) const
{
init();
- QValueVector<const CodeLine *> list;
+ TQValueVector<const CodeLine *> list;
for (uint i=0; i<uint(_sections.count()); i++) {
if ( _sections[i]->type()!=SectionType::Code ) continue;
for (uint k=0; k<uint(_sections[i]->lines().count()); k++) {
@@ -178,13 +178,13 @@ QValueVector<const Coff::CodeLine *> Coff::TextObject::findCodeLines(const QStri
int Coff::TextObject::lineForAddress(const PURL::Url &url, Address address) const
{
init();
- if ( url==_url && _lines.contains(address) ) return _lines[address]-1;
+ if ( url==_url && _lines.tqcontains(address) ) return _lines[address]-1;
for (uint i=0; i<uint(_sections.count()); i++) {
if ( _sections[i]->type()!=SectionType::Code ) continue;
for (uint k=0; k<uint(_sections[i]->lines().count()); k++) {
const CodeLine *cl = _sections[i]->lines()[k];
if ( cl->address()!=address ) continue;
- QString filename = cl->filename();
+ TQString filename = cl->filename();
if ( filename.isEmpty() || urlForFilename(filename)!=url ) continue;
return cl->line()-1;
}
@@ -192,30 +192,30 @@ int Coff::TextObject::lineForAddress(const PURL::Url &url, Address address) cons
return -1;
}
-QMap<PURL::Url, uint> Coff::TextObject::sourceLinesForAddress(Address address) const
+TQMap<PURL::Url, uint> Coff::TextObject::sourceLinesForAddress(Address address) const
{
- QMap<PURL::Url, uint> slines;
+ TQMap<PURL::Url, uint> slines;
init();
for (uint i=0; i<uint(_sections.count()); i++) {
if ( _sections[i]->type()!=SectionType::Code ) continue;
for (uint k=0; k<uint(_sections[i]->lines().count()); k++) {
const CodeLine *cl = _sections[i]->lines()[k];
if ( cl->address()!=address ) continue;
- QString filename = cl->filename();
+ TQString filename = cl->filename();
if ( filename.isEmpty() ) continue;
slines[urlForFilename(filename)] = cl->line()-1;
}
}
- if ( _lines.contains(address) ) slines[_url] = _lines[address] - 1;
+ if ( _lines.tqcontains(address) ) slines[_url] = _lines[address] - 1;
return slines;
}
-QValueVector<Address> Coff::TextObject::addresses(const PURL::Url &url, uint line) const
+TQValueVector<Address> Coff::TextObject::addresses(const PURL::Url &url, uint line) const
{
init();
- QValueVector<Address> ad;
+ TQValueVector<Address> ad;
if ( url==_url ) {
- QMap<Address, uint>::const_iterator it;
+ TQMap<Address, uint>::const_iterator it;
for (it=_lines.begin(); it!=_lines.end(); ++it)
if ( line==(it.data()-1) ) ad.append(it.key());
return ad;
@@ -225,7 +225,7 @@ QValueVector<Address> Coff::TextObject::addresses(const PURL::Url &url, uint lin
for (uint k=0; k<uint(_sections[i]->lines().count()); k++) {
const CodeLine *cl = _sections[i]->lines()[k];
if ( line!=(cl->line()-1) ) continue;
- QString filename = cl->filename();
+ TQString filename = cl->filename();
if ( filename.isEmpty() || urlForFilename(filename)!=url ) continue;
ad.append(cl->address());
}
@@ -233,13 +233,13 @@ QValueVector<Address> Coff::TextObject::addresses(const PURL::Url &url, uint lin
return ad;
}
-const QStringList &Coff::TextObject::filenames() const
+const TQStringList &Coff::TextObject::filenames() const
{
init();
return _filenames;
}
-QString Coff::TextObject::disassembly() const
+TQString Coff::TextObject::disassembly() const
{
init();
if ( _list.isEmpty() ) return i18n("Parsing COFF file is not supported for this device or an error occured.");
@@ -249,14 +249,14 @@ QString Coff::TextObject::disassembly() const
Log::KeyList Coff::TextObject::information() const
{
Log::KeyList keys;
- keys.append(i18n("Format:"), i18n("%1 (magic id: %2)").arg(format().label()).arg(toHexLabel(format().data().magic, 4)));
- QString name = (format()==Format::PIC30 || device()==0 ? "?" : device()->name());
+ keys.append(i18n("Format:"), i18n("%1 (magic id: %2)").tqarg(format().label()).tqarg(toHexLabel(format().data().magic, 4)));
+ TQString name = (format()==Format::PIC30 || device()==0 ? "?" : device()->name());
keys.append(i18n("Device:"), name);
OptHeaderFormat ohf = optHeaderFormat();
- QString label = (ohf==OptHeaderFormat::Nb_Types ? i18n("Unknown") : ohf.label());
- keys.append(i18n("Option header:"), i18n("%1 (magic id: %2)").arg(label).arg(toHexLabel(optHeaderMagic(), 4)));
- keys.append(i18n("No. of sections:"), QString::number(nbSections()));
- keys.append(i18n("No. of symbols:"), QString::number(nbSymbols()));
- keys.append(i18n("No. of variables:"), QString::number(variables().count()));
+ TQString label = (ohf==OptHeaderFormat::Nb_Types ? i18n("Unknown") : ohf.label());
+ keys.append(i18n("Option header:"), i18n("%1 (magic id: %2)").tqarg(label).tqarg(toHexLabel(optHeaderMagic(), 4)));
+ keys.append(i18n("No. of sections:"), TQString::number(nbSections()));
+ keys.append(i18n("No. of symbols:"), TQString::number(nbSymbols()));
+ keys.append(i18n("No. of variables:"), TQString::number(variables().count()));
return keys;
}