diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2013-07-03 02:22:47 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-07-03 02:22:47 +0200 |
commit | 9dab0e253ecf583a2cc6ca22e068d4f4022ca4d3 (patch) | |
tree | 63c2afb5cbab9420e0d43683e09ddb0092663d49 /kdbg/gdbdriver.cpp | |
parent | 1ace27a9852850ad348dd28679c2fe2b7d2ddc73 (diff) | |
download | kdbg-9dab0e253ecf583a2cc6ca22e068d4f4022ca4d3.tar.gz kdbg-9dab0e253ecf583a2cc6ca22e068d4f4022ca4d3.zip |
Initial TQt conversion
Diffstat (limited to 'kdbg/gdbdriver.cpp')
-rw-r--r-- | kdbg/gdbdriver.cpp | 288 |
1 files changed, 144 insertions, 144 deletions
diff --git a/kdbg/gdbdriver.cpp b/kdbg/gdbdriver.cpp index c0fcc94..4aab46d 100644 --- a/kdbg/gdbdriver.cpp +++ b/kdbg/gdbdriver.cpp @@ -6,8 +6,8 @@ #include "gdbdriver.h" #include "exprwnd.h" -#include <qregexp.h> -#include <qstringlist.h> +#include <ntqregexp.h> +#include <ntqstringlist.h> #include <klocale.h> /* i18n */ #include <ctype.h> #include <stdlib.h> /* strtol, atoi */ @@ -22,7 +22,7 @@ static void skipString(const char*& p); static void skipNested(const char*& s, char opening, char closing); static ExprValue* parseVar(const char*& s); -static bool parseName(const char*& s, QString& name, VarTree::NameKind& kind); +static bool parseName(const char*& s, TQString& name, VarTree::NameKind& kind); static bool parseValue(const char*& s, ExprValue* variable); static bool parseNested(const char*& s, ExprValue* variable); static bool parseVarSeq(const char*& s, ExprValue* variable); @@ -47,10 +47,10 @@ struct GdbCmdInfo { }; #if 0 -// This is how the QString data print statement generally looks like. -// It is set by KDebugger via setPrintQStringDataCmd(). +// This is how the TQString data print statement generally looks like. +// It is set by KDebugger via setPrintTQStringDataCmd(). -static const char printQStringStructFmt[] = +static const char printTQStringStructFmt[] = // if the string data is junk, fail early "print ($qstrunicode=($qstrdata=(%s))->unicode)?" // print an array of shorts @@ -60,7 +60,7 @@ static const char printQStringStructFmt[] = // if unicode data is 0, report a special value ":1==0\n"; #endif -static const char printQStringStructFmt[] = "print (0?\"%s\":$kdbgundef)\n"; +static const char printTQStringStructFmt[] = "print (0?\"%s\":$kdbgundef)\n"; /* * The following array of commands must be sorted by the DC* values, @@ -106,7 +106,7 @@ static GdbCmdInfo cmds[] = { { DCprint, "print %s\n", GdbCmdInfo::argString }, { DCprintDeref, "print *(%s)\n", GdbCmdInfo::argString }, { DCprintStruct, "print %s\n", GdbCmdInfo::argString }, - { DCprintQStringStruct, printQStringStructFmt, GdbCmdInfo::argString}, + { DCprintTQStringStruct, printTQStringStructFmt, GdbCmdInfo::argString}, { DCframe, "frame %d\n", GdbCmdInfo::argNum }, { DCfindType, "whatis %s\n", GdbCmdInfo::argString }, { DCinfosharedlib, "info sharedlibrary\n", GdbCmdInfo::argNone }, @@ -185,7 +185,7 @@ GdbDriver::GdbDriver() : break; } } - assert(strlen(printQStringStructFmt) <= MAX_FMTLEN); + assert(strlen(printTQStringStructFmt) <= MAX_FMTLEN); #endif } @@ -194,12 +194,12 @@ GdbDriver::~GdbDriver() } -QString GdbDriver::driverName() const +TQString GdbDriver::driverName() const { return "GDB"; } -QString GdbDriver::defaultGdb() +TQString GdbDriver::defaultGdb() { return "gdb" @@ -207,7 +207,7 @@ QString GdbDriver::defaultGdb() " --nx"; /* do not execute initialization files */ } -QString GdbDriver::defaultInvocation() const +TQString GdbDriver::defaultInvocation() const { if (m_defaultCmd.isEmpty()) { return defaultGdb(); @@ -216,13 +216,13 @@ QString GdbDriver::defaultInvocation() const } } -QStringList GdbDriver::boolOptionList() const +TQStringList GdbDriver::boolOptionList() const { // no options - return QStringList(); + return TQStringList(); } -bool GdbDriver::startup(QString cmdStr) +bool GdbDriver::startup(TQString cmdStr) { if (!DebuggerDriver::startup(cmdStr)) return false; @@ -263,8 +263,8 @@ bool GdbDriver::startup(QString cmdStr) executeCmdString(DCinitialize, gdbInitialize, false); - // assume that QString::null is ok - cmds[DCprintQStringStruct].fmt = printQStringStructFmt; + // assume that TQString::null is ok + cmds[DCprintTQStringStruct].fmt = printTQStringStructFmt; return true; } @@ -284,7 +284,7 @@ void GdbDriver::commandFinished(CmdQueueItem* cmd) // get version number from preamble { int len; - QRegExp GDBVersion("\\nGDB [0-9]+\\.[0-9]+"); + TQRegExp GDBVersion("\\nGDB [0-9]+\\.[0-9]+"); int offset = GDBVersion.match(m_output, 0, &len); if (offset >= 0) { char* start = m_output + offset + 5; // skip "\nGDB " @@ -320,7 +320,7 @@ void GdbDriver::commandFinished(CmdQueueItem* cmd) * because at least OpenSUSE writes its own version number * in the first line (but before GDB's version number). */ - QRegExp re( + TQRegExp re( " " // must be preceded by space "[(]?" // SLES 10 embeds in parentheses "(\\d+)\\.(\\d+)" // major, minor @@ -376,7 +376,7 @@ void GdbDriver::parseMarker() // extract the marker startMarker += 2; - TRACE(QString("found marker: ") + startMarker); + TRACE(TQString("found marker: ") + startMarker); char* endMarker = strchr(startMarker, '\n'); if (endMarker == 0) return; @@ -384,7 +384,7 @@ void GdbDriver::parseMarker() *endMarker = '\0'; // extract filename and line number - static QRegExp MarkerRE(":[0-9]+:[0-9]+:[begmidl]+:0x"); + static TQRegExp MarkerRE(":[0-9]+:[0-9]+:[begmidl]+:0x"); int len; int lineNoStart = MarkerRE.match(startMarker, 0, &len); @@ -393,7 +393,7 @@ void GdbDriver::parseMarker() // get address const char* addrStart = startMarker + lineNoStart + len - 2; - DbgAddr address = QString(addrStart).stripWhiteSpace(); + DbgAddr address = TQString(addrStart).stripWhiteSpace(); // now show the window startMarker[lineNoStart] = '\0'; /* split off file name */ @@ -406,7 +406,7 @@ void GdbDriver::parseMarker() * Escapes characters that might lead to problems when they appear on gdb's * command line. */ -static void normalizeStringArg(QString& arg) +static void normalizeStringArg(TQString& arg) { /* * Remove trailing backslashes. This approach is a little simplistic, @@ -419,7 +419,7 @@ static void normalizeStringArg(QString& arg) } -QString GdbDriver::makeCmdString(DbgCommand cmd, QString strArg) +TQString GdbDriver::makeCmdString(DbgCommand cmd, TQString strArg) { assert(cmd >= 0 && cmd < NUM_CMDS); assert(cmds[cmd].argsNeeded == GdbCmdInfo::argString); @@ -437,22 +437,22 @@ QString GdbDriver::makeCmdString(DbgCommand cmd, QString strArg) strArg = m_redirect + " " + strArg; } - QString cmdString; + TQString cmdString; cmdString.sprintf(cmds[cmd].fmt, strArg.latin1()); return cmdString; } -QString GdbDriver::makeCmdString(DbgCommand cmd, int intArg) +TQString GdbDriver::makeCmdString(DbgCommand cmd, int intArg) { assert(cmd >= 0 && cmd < NUM_CMDS); assert(cmds[cmd].argsNeeded == GdbCmdInfo::argNum); - QString cmdString; + TQString cmdString; cmdString.sprintf(cmds[cmd].fmt, intArg); return cmdString; } -QString GdbDriver::makeCmdString(DbgCommand cmd, QString strArg, int intArg) +TQString GdbDriver::makeCmdString(DbgCommand cmd, TQString strArg, int intArg) { assert(cmd >= 0 && cmd < NUM_CMDS); assert(cmds[cmd].argsNeeded == GdbCmdInfo::argStringNum || @@ -462,7 +462,7 @@ QString GdbDriver::makeCmdString(DbgCommand cmd, QString strArg, int intArg) normalizeStringArg(strArg); - QString cmdString; + TQString cmdString; if (cmd == DCtty) { @@ -525,7 +525,7 @@ QString GdbDriver::makeCmdString(DbgCommand cmd, QString strArg, int intArg) } break; } - QString spec; + TQString spec; spec.sprintf("/%d%c%c", count, sizeSpec, formatSpec); return makeCmdString(DCexamine, spec, strArg); @@ -555,7 +555,7 @@ QString GdbDriver::makeCmdString(DbgCommand cmd, QString strArg, int intArg) return cmdString; } -QString GdbDriver::makeCmdString(DbgCommand cmd, QString strArg1, QString strArg2) +TQString GdbDriver::makeCmdString(DbgCommand cmd, TQString strArg1, TQString strArg2) { assert(cmd >= 0 && cmd < NUM_CMDS); assert(cmds[cmd].argsNeeded == GdbCmdInfo::argString2); @@ -563,17 +563,17 @@ QString GdbDriver::makeCmdString(DbgCommand cmd, QString strArg1, QString strArg normalizeStringArg(strArg1); normalizeStringArg(strArg2); - QString cmdString; + TQString cmdString; cmdString.sprintf(cmds[cmd].fmt, strArg1.latin1(), strArg2.latin1()); return cmdString; } -QString GdbDriver::makeCmdString(DbgCommand cmd, int intArg1, int intArg2) +TQString GdbDriver::makeCmdString(DbgCommand cmd, int intArg1, int intArg2) { assert(cmd >= 0 && cmd < NUM_CMDS); assert(cmds[cmd].argsNeeded == GdbCmdInfo::argNum2); - QString cmdString; + TQString cmdString; cmdString.sprintf(cmds[cmd].fmt, intArg1, intArg2); return cmdString; } @@ -590,7 +590,7 @@ CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, bool clearLow) return executeCmdString(cmd, cmds[cmd].fmt, clearLow); } -CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, QString strArg, +CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, TQString strArg, bool clearLow) { return executeCmdString(cmd, makeCmdString(cmd, strArg), clearLow); @@ -603,13 +603,13 @@ CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, int intArg, return executeCmdString(cmd, makeCmdString(cmd, intArg), clearLow); } -CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, QString strArg, int intArg, +CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, TQString strArg, int intArg, bool clearLow) { return executeCmdString(cmd, makeCmdString(cmd, strArg, intArg), clearLow); } -CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, QString strArg1, QString strArg2, +CmdQueueItem* GdbDriver::executeCmd(DbgCommand cmd, TQString strArg1, TQString strArg2, bool clearLow) { return executeCmdString(cmd, makeCmdString(cmd, strArg1, strArg2), clearLow); @@ -626,7 +626,7 @@ CmdQueueItem* GdbDriver::queueCmd(DbgCommand cmd, QueueMode mode) return queueCmdString(cmd, cmds[cmd].fmt, mode); } -CmdQueueItem* GdbDriver::queueCmd(DbgCommand cmd, QString strArg, +CmdQueueItem* GdbDriver::queueCmd(DbgCommand cmd, TQString strArg, QueueMode mode) { return queueCmdString(cmd, makeCmdString(cmd, strArg), mode); @@ -638,13 +638,13 @@ CmdQueueItem* GdbDriver::queueCmd(DbgCommand cmd, int intArg, return queueCmdString(cmd, makeCmdString(cmd, intArg), mode); } -CmdQueueItem* GdbDriver::queueCmd(DbgCommand cmd, QString strArg, int intArg, +CmdQueueItem* GdbDriver::queueCmd(DbgCommand cmd, TQString strArg, int intArg, QueueMode mode) { return queueCmdString(cmd, makeCmdString(cmd, strArg, intArg), mode); } -CmdQueueItem* GdbDriver::queueCmd(DbgCommand cmd, QString strArg1, QString strArg2, +CmdQueueItem* GdbDriver::queueCmd(DbgCommand cmd, TQString strArg1, TQString strArg2, QueueMode mode) { return queueCmdString(cmd, makeCmdString(cmd, strArg1, strArg2), mode); @@ -706,11 +706,11 @@ static bool parseErrorMessage(const char*& output, { if (wantErrorValue) { // put the error message as value in the variable - variable = new ExprValue(QString(), VarTree::NKplain); + variable = new ExprValue(TQString(), VarTree::NKplain); const char* endMsg = strchr(output, '\n'); if (endMsg == 0) endMsg = output + strlen(output); - variable->m_value = QString::fromLatin1(output, endMsg-output); + variable->m_value = TQString::fromLatin1(output, endMsg-output); } else { variable = 0; } @@ -719,8 +719,8 @@ static bool parseErrorMessage(const char*& output, return false; } -#if QT_VERSION >= 300 -union Qt2QChar { +#if TQT_VERSION >= 300 +union TQt2TQChar { short s; struct { uchar row; @@ -729,16 +729,16 @@ union Qt2QChar { }; #endif -void GdbDriver::setPrintQStringDataCmd(const char* cmd) +void GdbDriver::setPrintTQStringDataCmd(const char* cmd) { // don't accept the command if it is empty if (cmd == 0 || *cmd == '\0') return; assert(strlen(cmd) <= MAX_FMTLEN); - cmds[DCprintQStringStruct].fmt = cmd; + cmds[DCprintTQStringStruct].fmt = cmd; } -ExprValue* GdbDriver::parseQCharArray(const char* output, bool wantErrorValue, bool qt3like) +ExprValue* GdbDriver::parseTQCharArray(const char* output, bool wantErrorValue, bool qt3like) { ExprValue* variable = 0; @@ -752,7 +752,7 @@ ExprValue* GdbDriver::parseQCharArray(const char* output, bool wantErrorValue, b // special case: empty string (0 repetitions) if (strncmp(output, "Invalid number 0 of repetitions", 31) == 0) { - variable = new ExprValue(QString(), VarTree::NKplain); + variable = new ExprValue(TQString(), VarTree::NKplain); variable->m_value = "\"\""; return variable; } @@ -780,8 +780,8 @@ ExprValue* GdbDriver::parseQCharArray(const char* output, bool wantErrorValue, b p++; /* skip '{' */ // parse the array - QString result; - QString repeatCount; + TQString result; + TQString repeatCount; enum { wasNothing, wasChar, wasRepeat } lastThing = wasNothing; /* * A matrix for separators between the individual "things" @@ -810,22 +810,22 @@ ExprValue* GdbDriver::parseQCharArray(const char* output, bool wantErrorValue, b if (p == 0) goto error; p++; /* skip '>' */ - repeatCount = QString::fromLatin1(start, p-start); + repeatCount = TQString::fromLatin1(start, p-start); while (isspace(*p) || *p == ',') p++; } // p is now at the next char (or the end) - // interpret the value as a QChar + // interpret the value as a TQChar // TODO: make cross-architecture compatible - QChar ch; + TQChar ch; if (qt3like) { - ch = QChar(value); + ch = TQChar(value); } else { -#if QT_VERSION < 300 +#if TQT_VERSION < 300 (unsigned short&)ch = value; #else - Qt2QChar c; + TQt2TQChar c; c.s = value; ch.setRow(c.qch.row); ch.setCell(c.qch.cell); @@ -870,17 +870,17 @@ ExprValue* GdbDriver::parseQCharArray(const char* output, bool wantErrorValue, b result += "\""; // assign the value - variable = new ExprValue(QString(), VarTree::NKplain); + variable = new ExprValue(TQString(), VarTree::NKplain); variable->m_value = result; } else if (strncmp(p, "true", 4) == 0) { - variable = new ExprValue(QString(), VarTree::NKplain); - variable->m_value = "QString::null"; + variable = new ExprValue(TQString(), VarTree::NKplain); + variable->m_value = "TQString::null"; } else if (strncmp(p, "false", 5) == 0) { - variable = new ExprValue(QString(), VarTree::NKplain); + variable = new ExprValue(TQString(), VarTree::NKplain); variable->m_value = "(null)"; } else @@ -889,7 +889,7 @@ ExprValue* GdbDriver::parseQCharArray(const char* output, bool wantErrorValue, b error: if (wantErrorValue) { - variable = new ExprValue(QString(), VarTree::NKplain); + variable = new ExprValue(TQString(), VarTree::NKplain); variable->m_value = "internal parse error"; } return variable; @@ -903,7 +903,7 @@ static ExprValue* parseVar(const char*& s) while (isspace(*p)) p++; - QString name; + TQString name; VarTree::NameKind kind; /* * Detect anonymouse struct values: The 'name =' part is missing: @@ -930,7 +930,7 @@ static ExprValue* parseVar(const char*& s) while (isspace(*p)) p++; if (*p != '=') { - TRACE(QString().sprintf("parse error: = not found after %s", (const char*)name)); + TRACE(TQString().sprintf("parse error: = not found after %s", (const char*)name)); return 0; } // skip the '=' and more whitespace @@ -969,7 +969,7 @@ static void skipNested(const char*& s, char opening, char closing) p++; } if (nest != 0) { - TRACE(QString().sprintf("parse error: mismatching %c%c at %-20.20s", opening, closing, s)); + TRACE(TQString().sprintf("parse error: mismatching %c%c at %-20.20s", opening, closing, s)); } s = p; } @@ -1012,7 +1012,7 @@ static void skipNestedAngles(const char*& s) p++; } if (nest != 0) { - TRACE(QString().sprintf("parse error: mismatching <> at %-20.20s", s)); + TRACE(TQString().sprintf("parse error: mismatching <> at %-20.20s", s)); } s = p; } @@ -1116,7 +1116,7 @@ static void skipNestedWithString(const char*& s, char opening, char closing) p++; } if (nest > 0) { - TRACE(QString().sprintf("parse error: mismatching %c%c at %-20.20s", opening, closing, s)); + TRACE(TQString().sprintf("parse error: mismatching %c%c at %-20.20s", opening, closing, s)); } s = p; } @@ -1128,7 +1128,7 @@ inline void skipName(const char*& p) p++; } -static bool parseName(const char*& s, QString& name, VarTree::NameKind& kind) +static bool parseName(const char*& s, TQString& name, VarTree::NameKind& kind) { kind = VarTree::NKplain; @@ -1140,7 +1140,7 @@ static bool parseName(const char*& s, QString& name, VarTree::NameKind& kind) if (*p == '<') { skipNestedAngles(p); - name = QString::fromLatin1(s, p - s); + name = TQString::fromLatin1(s, p - s); kind = VarTree::NKtype; } else @@ -1148,7 +1148,7 @@ static bool parseName(const char*& s, QString& name, VarTree::NameKind& kind) // name, which might be "static"; allow dot for "_vtbl." skipName(p); if (p == s) { - TRACE(QString().sprintf("parse error: not a name %-20.20s", s)); + TRACE(TQString().sprintf("parse error: not a name %-20.20s", s)); return false; } int len = p - s; @@ -1161,12 +1161,12 @@ static bool parseName(const char*& s, QString& name, VarTree::NameKind& kind) s = p; skipName(p); if (p == s) { - TRACE(QString().sprintf("parse error: not a name after static %-20.20s", s)); + TRACE(TQString().sprintf("parse error: not a name after static %-20.20s", s)); return false; } len = p - s; } - name = QString::fromLatin1(s, len); + name = TQString::fromLatin1(s, len); } // return the new position s = p; @@ -1189,7 +1189,7 @@ repeat: { const char* start = s; skipNested(s, '{', '}'); - variable->m_value = QString::fromLatin1(start, s-start); + variable->m_value = TQString::fromLatin1(start, s-start); variable->m_value += ' '; // add only a single space while (isspace(*s)) s++; @@ -1234,13 +1234,13 @@ repeat: const char*p = s; // check for type - QString type; + TQString type; if (*p == '(') { skipNested(p, '(', ')'); while (isspace(*p)) p++; - variable->m_value = QString::fromLatin1(s, p - s); + variable->m_value = TQString::fromLatin1(s, p - s); } bool reference = false; @@ -1348,7 +1348,7 @@ repeat: if (*p == '(') skipNested(p, '(', ')'); } - variable->m_value += QString::fromLatin1(start, p - start); + variable->m_value += TQString::fromLatin1(start, p - start); // remove line breaks from the value; this is ok since // string values never contain a literal line break @@ -1372,7 +1372,7 @@ repeat: if (p != start) { // there is always a blank before the string, // which we will include in the final string value - variable->m_value += QString::fromLatin1(start-1, (p - start)+1); + variable->m_value += TQString::fromLatin1(start-1, (p - start)+1); // if this was a pointer, reset that flag since we // now got the value variable->m_varKind = VarTree::VKsimple; @@ -1475,7 +1475,7 @@ static bool parseValueSeq(const char*& s, ExprValue* variable) int index = 0; bool good; for (;;) { - QString name; + TQString name; name.sprintf("[%d]", index); ExprValue* var = new ExprValue(name, VarTree::NKplain); good = parseValue(s, var); @@ -1493,7 +1493,7 @@ static bool parseValueSeq(const char*& s, ExprValue* variable) delete var; return false; } - TRACE(QString().sprintf("found <repeats %d times> in array", l)); + TRACE(TQString().sprintf("found <repeats %d times> in array", l)); // replace name and advance index name.sprintf("[%d .. %d]", index, index+l-1); var->m_name = name; @@ -1532,8 +1532,8 @@ static bool parseValueSeq(const char*& s, ExprValue* variable) /** * Parses a stack frame. */ -static void parseFrameInfo(const char*& s, QString& func, - QString& file, int& lineNo, DbgAddr& address) +static void parseFrameInfo(const char*& s, TQString& func, + TQString& file, int& lineNo, DbgAddr& address) { const char* p = s; @@ -1545,7 +1545,7 @@ static void parseFrameInfo(const char*& s, QString& func, p++; while (isxdigit(*p)) p++; - address = QString::fromLatin1(start, p-start); + address = TQString::fromLatin1(start, p-start); if (strncmp(p, " in ", 4) == 0) p += 4; } else { @@ -1554,8 +1554,8 @@ static void parseFrameInfo(const char*& s, QString& func, const char* start = p; // check for special signal handler frame if (strncmp(p, "<signal handler called>", 23) == 0) { - func = QString::fromLatin1(start, 23); - file = QString(); + func = TQString::fromLatin1(start, 23); + file = TQString(); lineNo = -1; s = p+23; if (*s == '\n') @@ -1600,7 +1600,7 @@ static void parseFrameInfo(const char*& s, QString& func, if (*p == '\0') { func = start; - file = QString(); + file = TQString(); lineNo = -1; s = p; return; @@ -1637,7 +1637,7 @@ static void parseFrameInfo(const char*& s, QString& func, do { --colon; } while (*colon != ':'); - file = QString::fromLatin1(fileStart, colon-fileStart); + file = TQString::fromLatin1(fileStart, colon-fileStart); lineNo = atoi(colon+1)-1; // skip new-line if (*p != '\0') @@ -1660,13 +1660,13 @@ static void parseFrameInfo(const char*& s, QString& func, if (*p == '\0') { func = start; } else { - func = QString::fromLatin1(start, p-start-1); /* don't include \n */ + func = TQString::fromLatin1(start, p-start-1); /* don't include \n */ } s = p; /* * Replace \n (and whitespace around it) in func by a blank. We cannot - * use QString::simplifyWhiteSpace() for this because this would also + * use TQString::simplifyWhiteSpace() for this because this would also * simplify space that belongs to a string arguments that gdb sometimes * prints in the argument lists of the function. */ @@ -1694,8 +1694,8 @@ static void parseFrameInfo(const char*& s, QString& func, /** * Parses a stack frame including its frame number */ -static bool parseFrame(const char*& s, int& frameNo, QString& func, - QString& file, int& lineNo, DbgAddr& address) +static bool parseFrame(const char*& s, int& frameNo, TQString& func, + TQString& file, int& lineNo, DbgAddr& address) { // Example: // #1 0x8048881 in Dl::Dl (this=0xbffff418, r=3214) at testfile.cpp:72 @@ -1727,7 +1727,7 @@ static bool parseFrame(const char*& s, int& frameNo, QString& func, void GdbDriver::parseBackTrace(const char* output, std::list<StackFrame>& stack) { - QString func, file; + TQString func, file; int lineNo, frameNo; DbgAddr address; @@ -1743,9 +1743,9 @@ void GdbDriver::parseBackTrace(const char* output, std::list<StackFrame>& stack) } bool GdbDriver::parseFrameChange(const char* output, int& frameNo, - QString& file, int& lineNo, DbgAddr& address) + TQString& file, int& lineNo, DbgAddr& address) { - QString func; + TQString func; return ::parseFrame(output, frameNo, func, file, lineNo, address); } @@ -1807,7 +1807,7 @@ bool GdbDriver::parseBreakList(const char* output, std::list<Breakpoint>& brks) const char* start = p; while (*p != '\0' && !isspace(*p)) p++; - bp.address = QString::fromLatin1(start, p-start); + bp.address = TQString::fromLatin1(start, p-start); while (isspace(*p) && *p != '\n') p++; if (*p == '\0') @@ -1819,7 +1819,7 @@ bool GdbDriver::parseBreakList(const char* output, std::list<Breakpoint>& brks) bp.location = p; p += bp.location.length(); } else { - bp.location = QString::fromLatin1(p, end-p).stripWhiteSpace(); + bp.location = TQString::fromLatin1(p, end-p).stripWhiteSpace(); p = end+1; /* skip over \n */ } @@ -1838,20 +1838,20 @@ bool GdbDriver::parseBreakList(const char* output, std::list<Breakpoint>& brks) // extract the hit count p += 22; bp.hitCount = strtol(p, &dummy, 10); - TRACE(QString("hit count %1").arg(bp.hitCount)); + TRACE(TQString("hit count %1").arg(bp.hitCount)); } else if (strncmp(p, "stop only if ", 13) == 0) { // extract condition p += 13; - bp.condition = QString::fromLatin1(p, end-p).stripWhiteSpace(); + bp.condition = TQString::fromLatin1(p, end-p).stripWhiteSpace(); TRACE("condition: "+bp.condition); } else if (strncmp(p, "ignore next ", 12) == 0) { // extract ignore count p += 12; bp.ignoreCount = strtol(p, &dummy, 10); - TRACE(QString("ignore count %1").arg(bp.ignoreCount)); + TRACE(TQString("ignore count %1").arg(bp.ignoreCount)); } else { // indeed a continuation - bp.location += " " + QString::fromLatin1(p, end-p).stripWhiteSpace(); + bp.location += " " + TQString::fromLatin1(p, end-p).stripWhiteSpace(); } p = end; if (*p != '\0') @@ -1904,7 +1904,7 @@ std::list<ThreadInfo> GdbDriver::parseThreadList(const char* output) // syntax error; bail out return threads; } - thr.threadName = QString::fromLatin1(p, end-p); + thr.threadName = TQString::fromLatin1(p, end-p); p = end+2; /* @@ -1925,12 +1925,12 @@ std::list<ThreadInfo> GdbDriver::parseThreadList(const char* output) } static bool parseNewBreakpoint(const char* o, int& id, - QString& file, int& lineNo, QString& address); + TQString& file, int& lineNo, TQString& address); static bool parseNewWatchpoint(const char* o, int& id, - QString& expr); + TQString& expr); bool GdbDriver::parseBreakpoint(const char* output, int& id, - QString& file, int& lineNo, QString& address) + TQString& file, int& lineNo, TQString& address) { const char* o = output; // skip lines of that begin with "(Cannot find" @@ -1955,7 +1955,7 @@ bool GdbDriver::parseBreakpoint(const char* output, int& id, } static bool parseNewBreakpoint(const char* o, int& id, - QString& file, int& lineNo, QString& address) + TQString& file, int& lineNo, TQString& address) { // breakpoint id char* p; @@ -1969,7 +1969,7 @@ static bool parseNewBreakpoint(const char* o, int& id, p += 6; while (isxdigit(*p)) ++p; - address = QString::fromLatin1(start, p-start); + address = TQString::fromLatin1(start, p-start); } // file name @@ -1980,7 +1980,7 @@ static bool parseNewBreakpoint(const char* o, int& id, // line number char* numStart = strstr(fileStart, ", line "); - QString fileName = QString::fromLatin1(fileStart, numStart-fileStart); + TQString fileName = TQString::fromLatin1(fileStart, numStart-fileStart); numStart += 7; int line = strtoul(numStart, &p, 10); if (numStart == p) @@ -1992,7 +1992,7 @@ static bool parseNewBreakpoint(const char* o, int& id, } static bool parseNewWatchpoint(const char* o, int& id, - QString& expr) + TQString& expr) { // watchpoint id char* p; @@ -2005,7 +2005,7 @@ static bool parseNewWatchpoint(const char* o, int& id, p += 2; // all the rest on the line is the expression - expr = QString::fromLatin1(p, strlen(p)).stripWhiteSpace(); + expr = TQString::fromLatin1(p, strlen(p)).stripWhiteSpace(); return true; } @@ -2061,10 +2061,10 @@ ExprValue* GdbDriver::parsePrintExpr(const char* output, bool wantErrorValue) return var; } -bool GdbDriver::parseChangeWD(const char* output, QString& message) +bool GdbDriver::parseChangeWD(const char* output, TQString& message) { bool isGood = false; - message = QString(output).simplifyWhiteSpace(); + message = TQString(output).simplifyWhiteSpace(); if (message.isEmpty()) { message = i18n("New working directory: ") + m_programWD; isGood = true; @@ -2072,7 +2072,7 @@ bool GdbDriver::parseChangeWD(const char* output, QString& message) return isGood; } -bool GdbDriver::parseChangeExecutable(const char* output, QString& message) +bool GdbDriver::parseChangeExecutable(const char* output, TQString& message) { message = output; @@ -2107,7 +2107,7 @@ bool GdbDriver::parseCoreFile(const char* output) return m_haveCoreFile; } -uint GdbDriver::parseProgramStopped(const char* output, QString& message) +uint GdbDriver::parseProgramStopped(const char* output, TQString& message) { // optionally: "program changed, rereading symbols", // followed by: @@ -2119,7 +2119,7 @@ uint GdbDriver::parseProgramStopped(const char* output, QString& message) // go through the output, line by line, checking what we have const char* start = output - 1; uint flags = SFprogramActive; - message = QString(); + message = TQString(); do { start++; /* skip '\n' */ @@ -2143,7 +2143,7 @@ uint GdbDriver::parseProgramStopped(const char* output, QString& message) const char* endOfMessage = strchr(start, '\n'); if (endOfMessage == 0) endOfMessage = start + strlen(start); - message = QString::fromLatin1(start, endOfMessage-start); + message = TQString::fromLatin1(start, endOfMessage-start); } else if (strncmp(start, "Breakpoint ", 11) == 0) { /* * We stopped at a (permanent) breakpoint (gdb doesn't tell us @@ -2168,9 +2168,9 @@ uint GdbDriver::parseProgramStopped(const char* output, QString& message) return flags; } -QStringList GdbDriver::parseSharedLibs(const char* output) +TQStringList GdbDriver::parseSharedLibs(const char* output) { - QStringList shlibs; + TQStringList shlibs; if (strncmp(output, "No shared libraries loaded", 26) == 0) return shlibs; @@ -2181,7 +2181,7 @@ QStringList GdbDriver::parseSharedLibs(const char* output) if (output == 0) return shlibs; output++; /* skip '\n' */ - QString shlibName; + TQString shlibName; while (*output != '\0') { // format of a line is // 0x404c5000 0x40580d90 Yes /lib/libc.so.5 @@ -2200,7 +2200,7 @@ QStringList GdbDriver::parseSharedLibs(const char* output) output = strchr(output, '\n'); if (output == 0) output = start + strlen(start); - shlibName = QString::fromLatin1(start, output-start); + shlibName = TQString::fromLatin1(start, output-start); if (*output != '\0') output++; shlibs.append(shlibName); @@ -2209,7 +2209,7 @@ QStringList GdbDriver::parseSharedLibs(const char* output) return shlibs; } -bool GdbDriver::parseFindType(const char* output, QString& type) +bool GdbDriver::parseFindType(const char* output, TQString& type) { if (strncmp(output, "type = ", 7) != 0) return false; @@ -2223,7 +2223,7 @@ bool GdbDriver::parseFindType(const char* output, QString& type) if (strncmp(output, "const ", 6) == 0) output += 6; type = output; - type.replace(QRegExp("\\s+"), ""); + type.replace(TQRegExp("\\s+"), ""); if (type.endsWith("&")) type.truncate(type.length() - 1); return true; @@ -2236,7 +2236,7 @@ std::list<RegisterInfo> GdbDriver::parseRegisters(const char* output) return regs; } - QString value; + TQString value; // parse register values while (*output != '\0') @@ -2252,7 +2252,7 @@ std::list<RegisterInfo> GdbDriver::parseRegisters(const char* output) output++; if (*output == '\0') break; - reg.regName = QString::fromLatin1(start, output-start); + reg.regName = TQString::fromLatin1(start, output-start); // skip space while (isspace(*output)) @@ -2266,7 +2266,7 @@ std::list<RegisterInfo> GdbDriver::parseRegisters(const char* output) { start = output; skipNested(output, '{', '}'); - value = QString::fromLatin1(start, output-start).simplifyWhiteSpace(); + value = TQString::fromLatin1(start, output-start).simplifyWhiteSpace(); // skip space, but not the end of line while (isspace(*output) && *output != '\n') output++; @@ -2283,7 +2283,7 @@ std::list<RegisterInfo> GdbDriver::parseRegisters(const char* output) start = output; skipNested(output, '{', '}'); - value = QString::fromLatin1(start, output-start).simplifyWhiteSpace(); + value = TQString::fromLatin1(start, output-start).simplifyWhiteSpace(); } else { // for gdb 5.3 // find first type that does not have an array, this is the RAW value @@ -2300,7 +2300,7 @@ std::list<RegisterInfo> GdbDriver::parseRegisters(const char* output) end=cur; while (*end && (*end!='}') && (*end!=',') && (*end!='\n')) end++; - QString rawValue = QString::fromLatin1(cur, end-cur).simplifyWhiteSpace(); + TQString rawValue = TQString::fromLatin1(cur, end-cur).simplifyWhiteSpace(); reg.rawValue = rawValue; if (rawValue.left(2)=="0x") { @@ -2312,7 +2312,7 @@ std::list<RegisterInfo> GdbDriver::parseRegisters(const char* output) while (*cur!='{' && *cur!=' ') cur--; cur++; - reg.type = QString::fromLatin1(cur, end-cur); + reg.type = TQString::fromLatin1(cur, end-cur); } // end while loop @@ -2337,7 +2337,7 @@ std::list<RegisterInfo> GdbDriver::parseRegisters(const char* output) output = strchr(output,'\n'); if (output == 0) output = start + strlen(start); - value = QString::fromLatin1(start, output-start).simplifyWhiteSpace(); + value = TQString::fromLatin1(start, output-start).simplifyWhiteSpace(); /* * We split the raw from the cooked values. @@ -2363,7 +2363,7 @@ std::list<RegisterInfo> GdbDriver::parseRegisters(const char* output) int pos = value.find(' '); if (pos < 0) { reg.rawValue = value; - reg.cookedValue = QString(); + reg.cookedValue = TQString(); } else { reg.rawValue = value.left(pos); reg.cookedValue = value.mid(pos+1); @@ -2378,7 +2378,7 @@ std::list<RegisterInfo> GdbDriver::parseRegisters(const char* output) return regs; } -bool GdbDriver::parseInfoLine(const char* output, QString& addrFrom, QString& addrTo) +bool GdbDriver::parseInfoLine(const char* output, TQString& addrFrom, TQString& addrTo) { // "is at address" or "starts at address" const char* start = strstr(output, "s at address "); @@ -2389,7 +2389,7 @@ bool GdbDriver::parseInfoLine(const char* output, QString& addrFrom, QString& ad const char* p = start; while (*p != '\0' && !isspace(*p)) p++; - addrFrom = QString::fromLatin1(start, p-start); + addrFrom = TQString::fromLatin1(start, p-start); start = strstr(p, "and ends at "); if (start == 0) { @@ -2401,7 +2401,7 @@ bool GdbDriver::parseInfoLine(const char* output, QString& addrFrom, QString& ad p = start; while (*p != '\0' && !isspace(*p)) p++; - addrTo = QString::fromLatin1(start, p-start); + addrTo = TQString::fromLatin1(start, p-start); return true; } @@ -2438,7 +2438,7 @@ std::list<DisassembledCode> GdbDriver::parseDisassemble(const char* output) // address while (p != end && !isspace(*p)) p++; - c.address = QString::fromLatin1(start, p-start); + c.address = TQString::fromLatin1(start, p-start); // function name (enclosed in '<>', followed by ':') while (p != end && *p != '<') @@ -2459,17 +2459,17 @@ std::list<DisassembledCode> GdbDriver::parseDisassemble(const char* output) if (p != end) /* include '\n' */ p++; - c.code = QString::fromLatin1(start, p-start); + c.code = TQString::fromLatin1(start, p-start); code.push_back(c); } return code; } -QString GdbDriver::parseMemoryDump(const char* output, std::list<MemoryDump>& memdump) +TQString GdbDriver::parseMemoryDump(const char* output, std::list<MemoryDump>& memdump) { if (isErrorExpr(output)) { // error; strip space - QString msg = output; + TQString msg = output; return msg.stripWhiteSpace(); } @@ -2482,7 +2482,7 @@ QString GdbDriver::parseMemoryDump(const char* output, std::list<MemoryDump>& me const char* start = p; while (*p != '\0' && *p != ':' && !isspace(*p)) p++; - md.address = QString::fromLatin1(start, p-start); + md.address = TQString::fromLatin1(start, p-start); if (*p != ':') { // parse function offset while (isspace(*p)) @@ -2490,7 +2490,7 @@ QString GdbDriver::parseMemoryDump(const char* output, std::list<MemoryDump>& me start = p; while (*p != '\0' && !(*p == ':' && isspace(p[1]))) p++; - md.address.fnoffs = QString::fromLatin1(start, p-start); + md.address.fnoffs = TQString::fromLatin1(start, p-start); } if (*p == ':') p++; @@ -2500,19 +2500,19 @@ QString GdbDriver::parseMemoryDump(const char* output, std::list<MemoryDump>& me // everything to the end of the line is the memory dump const char* end = strchr(p, '\n'); if (end != 0) { - md.dump = QString::fromLatin1(p, end-p); + md.dump = TQString::fromLatin1(p, end-p); p = end+1; } else { - md.dump = QString::fromLatin1(p, strlen(p)); + md.dump = TQString::fromLatin1(p, strlen(p)); p += strlen(p); } memdump.push_back(md); } - return QString(); + return TQString(); } -QString GdbDriver::editableValue(VarTree* value) +TQString GdbDriver::editableValue(VarTree* value) { const char* s = value->value().latin1(); @@ -2550,10 +2550,10 @@ repeat: ++s; if (*s == '"') { // a string - return QString::fromLatin1(start, end-start); + return TQString::fromLatin1(start, end-start); } else { // other pointer - return QString::fromLatin1(start, strlen(start)); + return TQString::fromLatin1(start, strlen(start)); } } @@ -2561,10 +2561,10 @@ repeat: return s; } -QString GdbDriver::parseSetVariable(const char* output) +TQString GdbDriver::parseSetVariable(const char* output) { // if there is any output, it is an error message - QString msg = output; + TQString msg = output; return msg.stripWhiteSpace(); } |