summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-05-11 16:33:39 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2022-05-11 16:33:39 +0900
commit2fa77340550901f84c7b763000d80bb20018e773 (patch)
tree96024a8452d1eeaaeebbda86487cc94c013f4c3a
parentb97891ede25fcaa6dc0dd918daf916e728a4522f (diff)
downloadkdbg-2fa77340550901f84c7b763000d80bb20018e773.tar.gz
kdbg-2fa77340550901f84c7b763000d80bb20018e773.zip
Convert some TRACE() messages to avoid FTBFS with clang. This resolves issue #13.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r--kdbg/dbgdriver.cpp3
-rw-r--r--kdbg/debugger.cpp3
-rw-r--r--kdbg/gdbdriver.cpp14
-rw-r--r--kdbg/sourcewnd.cpp8
-rw-r--r--kdbg/typetable.cpp2
5 files changed, 14 insertions, 16 deletions
diff --git a/kdbg/dbgdriver.cpp b/kdbg/dbgdriver.cpp
index ab8301d..04c7270 100644
--- a/kdbg/dbgdriver.cpp
+++ b/kdbg/dbgdriver.cpp
@@ -130,8 +130,7 @@ CmdQueueItem* DebuggerDriver::executeCmdString(DbgCommand cmd,
m_state = DSinterrupted;
kill(SIGINT);
ASSERT(m_activeCmd != 0);
- TRACE(TQString().sprintf("interrupted the command %d",
- (m_activeCmd ? m_activeCmd->m_cmd : -1)));
+ TRACE(TQString("interrupted the command %1").arg((m_activeCmd ? m_activeCmd->m_cmd : -1)));
delete m_activeCmd;
m_activeCmd = 0;
}
diff --git a/kdbg/debugger.cpp b/kdbg/debugger.cpp
index 4d86803..6a749f0 100644
--- a/kdbg/debugger.cpp
+++ b/kdbg/debugger.cpp
@@ -2175,8 +2175,7 @@ void KDebugger::slotValueEdited(VarTree* expr, const TQString& text)
return; /* no text entered: ignore request */
ExprWnd* wnd = static_cast<ExprWnd*>(expr->listView());
- TRACE(TQString().sprintf("Changing %s to ",
- wnd->name()) + text);
+ TRACE(TQString("Changing %1 to ").arg(wnd->name()) + text);
// determine the lvalue to edit
TQString lvalue = expr->computeExpr();
diff --git a/kdbg/gdbdriver.cpp b/kdbg/gdbdriver.cpp
index 4135576..4ac2776 100644
--- a/kdbg/gdbdriver.cpp
+++ b/kdbg/gdbdriver.cpp
@@ -902,7 +902,7 @@ static ExprValue* parseVar(const char*& s)
while (isspace(*p))
p++;
if (*p != '=') {
- TRACE(TQString().sprintf("parse error: = not found after %s", name));
+ TRACE(TQString("parse error: = not found after %1").arg(name));
return 0;
}
// skip the '=' and more whitespace
@@ -941,7 +941,7 @@ static void skipNested(const char*& s, char opening, char closing)
p++;
}
if (nest != 0) {
- TRACE(TQString().sprintf("parse error: mismatching %c%c at %-20.20s", opening, closing, s));
+ TRACE(TQString("parse error: mismatching %1%2 at %3").arg(opening).arg(closing).arg(s));
}
s = p;
}
@@ -984,7 +984,7 @@ static void skipNestedAngles(const char*& s)
p++;
}
if (nest != 0) {
- TRACE(TQString().sprintf("parse error: mismatching <> at %-20.20s", s));
+ TRACE(TQString("parse error: mismatching <> at %1").arg(s));
}
s = p;
}
@@ -1100,7 +1100,7 @@ static void skipNestedWithString(const char*& s, char opening, char closing)
p++;
}
if (nest > 0) {
- TRACE(TQString().sprintf("parse error: mismatching %c%c at %-20.20s", opening, closing, s));
+ TRACE(TQString("parse error: mismatching %1%2 at %3").arg(opening).arg(closing).arg(s));
}
s = p;
}
@@ -1132,7 +1132,7 @@ static bool parseName(const char*& s, TQString& name, VarTree::NameKind& kind)
// name, which might be "static"; allow dot for "_vtbl."
skipName(p);
if (p == s) {
- TRACE(TQString().sprintf("parse error: not a name %-20.20s", s));
+ TRACE(TQString("parse error: not a name %1").arg(s));
return false;
}
int len = p - s;
@@ -1145,7 +1145,7 @@ static bool parseName(const char*& s, TQString& name, VarTree::NameKind& kind)
s = p;
skipName(p);
if (p == s) {
- TRACE(TQString().sprintf("parse error: not a name after static %-20.20s", s));
+ TRACE(TQString("parse error: not a name after static %1").arg(s));
return false;
}
len = p - s;
@@ -1477,7 +1477,7 @@ static bool parseValueSeq(const char*& s, ExprValue* variable)
delete var;
return false;
}
- TRACE(TQString().sprintf("found <repeats %d times> in array", l));
+ TRACE(TQString("found <repeats %1 times> in array").arg(l));
// replace name and advance index
name.sprintf("[%d .. %d]", index, index+l-1);
var->m_name = name;
diff --git a/kdbg/sourcewnd.cpp b/kdbg/sourcewnd.cpp
index 8d0699c..bf8558a 100644
--- a/kdbg/sourcewnd.cpp
+++ b/kdbg/sourcewnd.cpp
@@ -251,7 +251,7 @@ void SourceWindow::updateLineItems(const KDebugger* dbg)
if (m_lineItems[i] & liBPany) {
// check if this breakpoint still exists
int line = rowToLine(i);
- TRACE(TQString().sprintf("checking for bp at %d", line));
+ TRACE(TQString("checking for bp at %1").arg(line));
KDebugger::BrkptROIterator bp = dbg->breakpointsBegin();
for (; bp != dbg->breakpointsEnd(); ++bp)
{
@@ -275,7 +275,7 @@ void SourceWindow::updateLineItems(const KDebugger* dbg)
for (KDebugger::BrkptROIterator bp = dbg->breakpointsBegin(); bp != dbg->breakpointsEnd(); ++bp)
{
if (fileNameMatches(bp->fileName)) {
- TRACE(TQString().sprintf("updating %s:%d", bp->fileName, bp->lineNo));
+ TRACE(TQString("updating %1:%2").arg(bp->fileName).arg(bp->lineNo));
int i = bp->lineNo;
if (i < 0 || i >= int(m_sourceCode.size()))
continue;
@@ -370,12 +370,12 @@ void SourceWindow::mousePressEvent(TQMouseEvent* ev)
switch (ev->button()) {
case LeftButton:
- TRACE(TQString().sprintf("left-clicked line %d", line));
+ TRACE(TQString("left-clicked line %1").arg(line));
emit clickedLeft(m_fileName, line, address,
(ev->state() & ShiftButton) != 0);
break;
case MidButton:
- TRACE(TQString().sprintf("mid-clicked row %d", line));
+ TRACE(TQString("mid-clicked row %1").arg(line));
emit clickedMid(m_fileName, line, address);
break;
default:;
diff --git a/kdbg/typetable.cpp b/kdbg/typetable.cpp
index 7c0c54e..2dc4276 100644
--- a/kdbg/typetable.cpp
+++ b/kdbg/typetable.cpp
@@ -182,7 +182,7 @@ void TypeTable::readType(TDEConfigBase& cf, const TQString& type)
m_typeDict.insert(type, info);
else
m_templates[type] = info;
- TRACE(type + TQString().sprintf(": %d exprs", info->m_numExprs));
+ TRACE(type + TQString(": %1 exprs").arg(info->m_numExprs));
}
void TypeTable::copyTypes(TQDict<TypeInfo>& dict)