summaryrefslogtreecommitdiffstats
path: root/src/progs/icd2/base/icd2_debug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/progs/icd2/base/icd2_debug.cpp')
-rw-r--r--src/progs/icd2/base/icd2_debug.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/progs/icd2/base/icd2_debug.cpp b/src/progs/icd2/base/icd2_debug.cpp
index 62f6404..ba10a4d 100644
--- a/src/progs/icd2/base/icd2_debug.cpp
+++ b/src/progs/icd2/base/icd2_debug.cpp
@@ -26,8 +26,8 @@ bool Icd2::Debugger::waitForTargetMode(Pic::TargetMode mode)
if ( rmode==mode ) return true;
Port::msleep(200);
}
- log(Log::LineType::Error, QString("Timeout waiting for mode: %1 (target is in mode: %2).")
- .arg(i18n(Pic::TARGET_MODE_LABELS[mode])).arg(i18n(Pic::TARGET_MODE_LABELS[rmode])));
+ log(Log::LineType::Error, TQString("Timeout waiting for mode: %1 (target is in mode: %2).")
+ .tqarg(i18n(Pic::TARGET_MODE_LABELS[mode])).tqarg(i18n(Pic::TARGET_MODE_LABELS[rmode])));
return false;
}
@@ -55,11 +55,11 @@ bool Icd2::Debugger::updateState()
return true;
}
-bool Icd2::Debugger::setBreakpoints(const QValueList<Address> &addresses)
+bool Icd2::Debugger::setBreakpoints(const TQValueList<Address> &addresses)
{
if ( addresses.count()==0 ) return specific()->setBreakpoint(Address());
for (uint i=0; i<uint(addresses.count()); i++) {
- log(Log::DebugLevel::Normal, QString("Set breakpoint at %1").arg(toHexLabel(addresses[i], device()->nbCharsAddress())));
+ log(Log::DebugLevel::Normal, TQString("Set breakpoint at %1").tqarg(toHexLabel(addresses[i], device()->nbCharsAddress())));
if ( !specific()->setBreakpoint(addresses[i]) ) return false;
}
return true;
@@ -97,14 +97,14 @@ bool Icd2::Debugger::readRegister(const Register::TypeData &data, BitValue &valu
{
if ( data.type()==Register::Special ) {
if ( data.name()=="WREG" ) return hardware()->readRegister(specific()->addressWREG(), value, 1);
- if ( data.name()=="PC" ) { value = hardware()->getProgramCounter().maskWith(specific()->maskPC()); return !hasError(); }
+ if ( data.name()=="PC" ) { value = hardware()->getProgramCounter().tqmaskWith(specific()->tqmaskPC()); return !hasError(); }
Q_ASSERT(false);
return true;
}
- QString name = device()->registersData().sfrNames[data.address()];
+ TQString name = device()->registersData().sfrNames[data.address()];
if ( name=="WREG" ) return hardware()->readRegister(specific()->addressWREG(), value, 1);
- if ( name=="PCL" ) { value = hardware()->getProgramCounter().maskWith(specific()->maskPC()).byte(0); return !hasError(); }
- if ( name=="PCLATH" ) { value = hardware()->getProgramCounter().maskWith(specific()->maskPC()).byte(1); return !hasError(); }
+ if ( name=="PCL" ) { value = hardware()->getProgramCounter().tqmaskWith(specific()->tqmaskPC()).byte(0); return !hasError(); }
+ if ( name=="PCLATH" ) { value = hardware()->getProgramCounter().tqmaskWith(specific()->tqmaskPC()).byte(1); return !hasError(); }
return hardware()->readRegister(specific()->addressRegister(data.address()), value, 1);
}
@@ -115,7 +115,7 @@ bool Icd2::Debugger::writeRegister(const Register::TypeData &data, BitValue valu
Q_ASSERT(false);
return true;
}
- QString name = device()->registersData().sfrNames[data.address()];
+ TQString name = device()->registersData().sfrNames[data.address()];
if ( name=="WREG" ) return hardware()->writeRegister(specific()->addressWREG(), value, 1);
return hardware()->writeRegister(specific()->addressRegister(data.address()), value, 1);
}
@@ -143,29 +143,29 @@ bool Icd2::DebugProgrammer::internalSetupHardware()
return false;
}
uint reservedBank = 0;
- QString filename;
+ TQString filename;
if ( device()->is18Family() ) {
Debugger *debug = static_cast<Debugger *>(debugger());
reservedBank = static_cast<const P18FDebuggerSpecific *>(debug->specific())->reservedBank();
- filename = QString("de18F_BANK%1.hex").arg(QString(toString(NumberBase::Dec, reservedBank, 2)));
- } else filename = QString("de%1.hex").arg(fdata.debugExec);
+ filename = TQString("de18F_BANK%1.hex").tqarg(TQString(toString(NumberBase::Dec, reservedBank, 2)));
+ } else filename = TQString("de%1.hex").tqarg(fdata.debugExec);
PURL::Url url = dir.findMatchingFilename(filename);
- log(Log::DebugLevel::Normal, QString(" Debug executive file: %1").arg(url.pretty()));
+ log(Log::DebugLevel::Normal, TQString(" Debug executive file: %1").tqarg(url.pretty()));
if ( !url.exists() ) {
- log(Log::LineType::Error, i18n("Could not find debug executive file \"%1\".").arg(url.pretty()));
+ log(Log::LineType::Error, i18n("Could not find debug executive file \"%1\".").tqarg(url.pretty()));
return false;
}
// upload hex file
Log::StringView sview;
PURL::File file(url, sview);
if ( !file.openForRead() ) {
- log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").arg(url.pretty()));
+ log(Log::LineType::Error, i18n("Could not open firmware file \"%1\".").tqarg(url.pretty()));
return false;
}
- QStringList errors;
+ TQStringList errors;
HexBuffer hbuffer;
if ( !hbuffer.load(file.stream(), errors) ) {
- log(Log::LineType::Error, i18n("Could not read debug executive file \"%1\": %2.").arg(url.pretty()).arg(errors[0]));
+ log(Log::LineType::Error, i18n("Could not read debug executive file \"%1\": %2.").tqarg(url.pretty()).tqarg(errors[0]));
return false;
}
uint nbWords = device()->nbWords(Pic::MemoryRangeType::Code);
@@ -173,8 +173,8 @@ bool Icd2::DebugProgrammer::internalSetupHardware()
if ( fdata.debugExecOffset!=0 && fdata.debugExecOffset!=offset )
for (uint i=0; i<0x100; i++) hbuffer.insert(offset+i, hbuffer[fdata.debugExecOffset+i]);
Pic::Memory::WarningTypes warningTypes;
- QStringList warnings;
- QMap<uint, bool> inRange;
+ TQStringList warnings;
+ TQMap<uint, bool> inRange;
Pic::Memory memory(*device());
memory.fromHexBuffer(Pic::MemoryRangeType::Code, hbuffer, warningTypes, warnings, inRange);
_deArray = memory.arrayForWriting(Pic::MemoryRangeType::Code);
@@ -199,7 +199,7 @@ bool Icd2::DebugProgrammer::internalSetupHardware()
_deStart = specific()->findNonMaskStart(Pic::MemoryRangeType::Code, _deArray);
_deEnd = specific()->findNonMaskEnd(Pic::MemoryRangeType::Code, _deArray);
}
- log(Log::DebugLevel::Extra, QString("debug executive: \"%1\" %2:%3").arg(url.pretty()).arg(toHexLabel(_deStart, 4)).arg(toHexLabel(_deEnd, 4)));
+ log(Log::DebugLevel::Extra, TQString("debug executive: \"%1\" %2:%3").tqarg(url.pretty()).tqarg(toHexLabel(_deStart, 4)).tqarg(toHexLabel(_deEnd, 4)));
return Icd2::ProgrammerBase::internalSetupHardware();
}
@@ -251,9 +251,9 @@ bool Icd2::DebugProgrammer::writeDebugExecutive()
uint inc = device()->addressIncrement(Pic::MemoryRangeType::Code);
Address address = device()->range(Pic::MemoryRangeType::Code).start + inc * (_deStart + i);
log(Log::LineType::Error, i18n("Device memory doesn't match debug executive (at address %1: reading %2 and expecting %3).")
- .arg(toHexLabel(address, device()->nbCharsAddress()))
- .arg(toHexLabel(data[i], device()->nbCharsWord(Pic::MemoryRangeType::Code)))
- .arg(toHexLabel(_deArray[_deStart+i], device()->nbCharsWord(Pic::MemoryRangeType::Code))));
+ .tqarg(toHexLabel(address, device()->nbCharsAddress()))
+ .tqarg(toHexLabel(data[i], device()->nbCharsWord(Pic::MemoryRangeType::Code)))
+ .tqarg(toHexLabel(_deArray[_deStart+i], device()->nbCharsWord(Pic::MemoryRangeType::Code))));
return false;
}
return true;
@@ -265,7 +265,7 @@ bool Icd2::DebugProgrammer::doProgram(const Device::Memory &memory, const Device
if ( !doConnectDevice() ) return false;
_progressMonitor.startNextTask();
// probably needed for all devices that don't have a "erase and write" mode
- if ( range.all() && FAMILY_DATA[family(device()->name())].debugExec==QString("16F7X7") ) {
+ if ( range.all() && FAMILY_DATA[family(device()->name())].debugExec==TQString("16F7X7") ) {
Pic::Memory dmemory(*device());
dmemory.setWord(Pic::MemoryRangeType::Code, 0, 0x0028);
dmemory.setWord(Pic::MemoryRangeType::Code, 1, 0x0030);
@@ -290,7 +290,7 @@ bool Icd2::DebugProgrammer::programAll(const Pic::Memory &mem)
if ( !programAndVerifyRange(Pic::MemoryRangeType::UserId, memory) ) return false;
if ( device()->is18Family() ) {
if ( !hardware()->command("0C00", 0) ) return false; // #### ??
- QString com = "42" + toHex(0xFB5, 8) + toHex(1, 8); // write RSBUG (?)
+ TQString com = "42" + toHex(0xFB5, 8) + toHex(1, 8); // write RSBUG (?)
if ( !hardware()->command(com, 0) ) return false;
if ( !hardware()->command("0C01", 0) ) return false; // #### ??
}
@@ -311,12 +311,12 @@ bool Icd2::DebugProgrammer::internalRead(Device::Memory *mem, const Device::Memo
bool Icd2::DebugProgrammer::readDebugExecutiveVersion()
{
if ( !hardware()->getDebugExecVersion(_debugExecutiveVersion) ) return false;
- log(Log::LineType::Information, i18n(" Debug executive version: %1").arg(_debugExecutiveVersion.pretty()));
+ log(Log::LineType::Information, i18n(" Debug executive version: %1").tqarg(_debugExecutiveVersion.pretty()));
return true;
}
//----------------------------------------------------------------------------
-void Icd2::DebuggerGroup::addDevice(const QString &name, const Device::Data *ddata, ::Group::Support)
+void Icd2::DebuggerGroup::addDevice(const TQString &name, const Device::Data *ddata, ::Group::Support)
{
if ( FAMILY_DATA[family(name)].debugExec==0 ) return;
Group::addDevice(name, ddata, data(name).debugSupport);
@@ -326,7 +326,7 @@ void Icd2::DebuggerGroup::addDevice(const QString &name, const Device::Data *dda
{
const Pic::Data *data = static_cast< ::Debugger::PicBase &>(base).device();
if ( data==0 ) return 0;
- QString debugExec = FAMILY_DATA[family(data->name())].debugExec;
+ TQString debugExec = FAMILY_DATA[family(data->name())].debugExec;
switch (data->architecture().type()) {
case Pic::Architecture::P16X:
if ( debugExec=="16F872" ) return new P16F872DebuggerSpecific(base);