summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/cdb
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-07-05 15:37:08 +0200
committerhjk <hjk@qt.io>2022-07-08 12:32:38 +0000
commit9894c6eaf079fd1e768271c3b6a0af8cc11de735 (patch)
treea9c7404ffaabad97cf303a54ff0ca5d256f9fe18 /src/plugins/debugger/cdb
parentbb3549a7210ce599ea353af52807144e455dc206 (diff)
downloadqt-creator-9894c6eaf079fd1e768271c3b6a0af8cc11de735.tar.gz
Debugger: Convert to Tr::tr
Change-Id: I5d2475c790851c68f9997ac6af72b5eaca58482d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/debugger/cdb')
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp27
-rw-r--r--src/plugins/debugger/cdb/cdbengine.h6
-rw-r--r--src/plugins/debugger/cdb/cdboptionspage.cpp45
3 files changed, 32 insertions, 46 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index 5ce9bd2ab9..a5025c1af4 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -39,6 +39,7 @@
#include <debugger/debuggerprotocol.h>
#include <debugger/debuggerruncontrol.h>
#include <debugger/debuggertooltipmanager.h>
+#include <debugger/debuggertr.h>
#include <debugger/disassembleragent.h>
#include <debugger/disassemblerlines.h>
#include <debugger/enginemanager.h>
@@ -303,7 +304,7 @@ void CdbEngine::createFullBacktrace()
void CdbEngine::handleSetupFailure(const QString &errorMessage)
{
showMessage(errorMessage, LogError);
- Core::AsynchronousMessageBox::critical(tr("Failed to Start the Debugger"), errorMessage);
+ Core::AsynchronousMessageBox::critical(Tr::tr("Failed to Start the Debugger"), errorMessage);
notifyEngineSetupFailed();
}
@@ -337,7 +338,7 @@ void CdbEngine::setupEngine()
// The extension is passed as relative name with the path variable set
//(does not work with absolute path names)
if (sp.debugger.command.isEmpty()) {
- handleSetupFailure(tr("There is no CDB executable specified."));
+ handleSetupFailure(Tr::tr("There is no CDB executable specified."));
return;
}
@@ -353,7 +354,7 @@ void CdbEngine::setupEngine()
m_wow64State = noWow64Stack;
const QFileInfo extensionFi(CdbEngine::extensionLibraryName(cdbIs64Bit, cdbIsArm));
if (!extensionFi.isFile()) {
- handleSetupFailure(tr("Internal error: The extension %1 cannot be found.\n"
+ handleSetupFailure(Tr::tr("Internal error: The extension %1 cannot be found.\n"
"If you have updated %2 via Maintenance Tool, you may "
"need to rerun the Tool and select \"Add or remove components\" "
"and then select the "
@@ -1638,14 +1639,14 @@ enum StopActionFlags
static inline QString msgTracePointTriggered(const Breakpoint &, const QString &displayName,
const QString &threadId)
{
- return CdbEngine::tr("Trace point %1 in thread %2 triggered.")
+ return Tr::tr("Trace point %1 in thread %2 triggered.")
.arg(displayName).arg(threadId);
}
static inline QString msgCheckingConditionalBreakPoint(const Breakpoint &bp, const QString &displayName,
const QString &threadId)
{
- return CdbEngine::tr("Conditional breakpoint %1 in thread %2 triggered, examining expression \"%3\".")
+ return Tr::tr("Conditional breakpoint %1 in thread %2 triggered, examining expression \"%3\".")
.arg(displayName).arg(threadId, bp->condition());
}
@@ -1662,7 +1663,7 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason,
qDebug("%s", qPrintable(stopReason.toString(true, 4)));
const QString reason = stopReason["reason"].data();
if (reason.isEmpty()) {
- *message = tr("Malformed stop response received.");
+ *message = Tr::tr("Malformed stop response received.");
rc |= StopReportParseError|StopNotifyStop;
return rc;
}
@@ -1806,7 +1807,7 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT
m_sourceStepInto = false;
// Start sequence to get all relevant data.
if (stopFlags & StopInArtificialThread) {
- showMessage(tr("Switching to main thread..."), LogMisc);
+ showMessage(Tr::tr("Switching to main thread..."), LogMisc);
runCommand({"~0 s", NoFlags});
forcedThread = true;
// Re-fetch stack again.
@@ -2169,7 +2170,7 @@ void CdbEngine::handleExtensionMessage(char t, int token, const QString &what, c
const Task::TaskType type =
isFatalWinException(exception.exceptionCode) ? Task::Error : Task::Warning;
const FilePath fileName = FilePath::fromUserInput(exception.file);
- const QString taskEntry = tr("Debugger encountered an exception: %1").arg(
+ const QString taskEntry = Tr::tr("Debugger encountered an exception: %1").arg(
exception.toString(false).trimmed());
TaskHub::addTask(Task(type, taskEntry,
fileName, exception.lineNumber,
@@ -2251,7 +2252,7 @@ void CdbEngine::checkQtSdkPdbFiles(const QString &module)
return;
const QString message
- = tr("The installed %1 is missing debug information files.\n"
+ = Tr::tr("The installed %1 is missing debug information files.\n"
"Locals and Expression might not be able to display all Qt Types in a "
"human readable format.\n\n"
"Please install the \"Qt Debug Information Files\" Package from the "
@@ -2261,7 +2262,7 @@ void CdbEngine::checkQtSdkPdbFiles(const QString &module)
CheckableMessageBox::doNotShowAgainInformation(
Core::ICore::dialogParent(),
- tr("Missing Qt Debug Information"),
+ Tr::tr("Missing Qt Debug Information"),
message,
Core::ICore::settings(),
"CdbQtSdkPdbHint");
@@ -2384,7 +2385,7 @@ void CdbEngine::parseOutputLine(QString line)
const QRegularExpressionMatch match = moduleRegExp.match(line);
if (match.hasMatch()) {
const QString module = match.captured(3).trimmed();
- showStatusMessage(tr("Module loaded: %1").arg(module), 3000);
+ showStatusMessage(Tr::tr("Module loaded: %1").arg(module), 3000);
checkQtSdkPdbFiles(module);
}
} else {
@@ -2818,9 +2819,9 @@ void CdbEngine::handleExpression(const DebuggerResponse &response, const Breakpo
showMessage(response.data["msg"].data(), LogError);
// Is this a conditional breakpoint?
const QString message = value ?
- tr("Value %1 obtained from evaluating the condition of breakpoint %2, stopping.").
+ Tr::tr("Value %1 obtained from evaluating the condition of breakpoint %2, stopping.").
arg(value).arg(bp->displayName()) :
- tr("Value 0 obtained from evaluating the condition of breakpoint %1, continuing.").
+ Tr::tr("Value 0 obtained from evaluating the condition of breakpoint %1, continuing.").
arg(bp->displayName());
showMessage(message, LogMisc);
// Stop if evaluation is true, else continue
diff --git a/src/plugins/debugger/cdb/cdbengine.h b/src/plugins/debugger/cdb/cdbengine.h
index c26cd901b8..c46627d848 100644
--- a/src/plugins/debugger/cdb/cdbengine.h
+++ b/src/plugins/debugger/cdb/cdbengine.h
@@ -36,8 +36,7 @@
#include <QElapsedTimer>
-namespace Debugger {
-namespace Internal {
+namespace Debugger::Internal {
class CdbEngine : public CppDebuggerEngine
{
@@ -231,5 +230,4 @@ private:
mutable CPlusPlus::Snapshot m_codeModelSnapshot;
};
-} // namespace Internal
-} // namespace Debugger
+} // Debugger::Internal
diff --git a/src/plugins/debugger/cdb/cdboptionspage.cpp b/src/plugins/debugger/cdb/cdboptionspage.cpp
index f62454fc79..333a5d74d1 100644
--- a/src/plugins/debugger/cdb/cdboptionspage.cpp
+++ b/src/plugins/debugger/cdb/cdboptionspage.cpp
@@ -25,12 +25,11 @@
#include "cdboptionspage.h"
-#include "cdbengine.h"
-
#include <debugger/commonoptionspage.h>
#include <debugger/debuggeractions.h>
#include <debugger/debuggercore.h>
#include <debugger/debuggerinternalconstants.h>
+#include <debugger/debuggertr.h>
#include <debugger/shared/cdbsymbolpathlisteditor.h>
#include <coreplugin/icore.h>
@@ -56,18 +55,12 @@ struct EventsDescription {
// Parameters of the "sxe" command
const EventsDescription eventDescriptions[] =
{
- {"eh", false, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "C++ exception")},
- {"ct", false, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "Thread creation")},
- {"et", false, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "Thread exit")},
- {"ld", true, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "Load module:")},
- {"ud", true, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "Unload module:")},
- {"out", true, QT_TRANSLATE_NOOP("Debugger::Internal::CdbBreakEventWidget",
- "Output:")}
+ {"eh", false, QT_TRANSLATE_NOOP("Debugger", "C++ exception")},
+ {"ct", false, QT_TRANSLATE_NOOP("Debugger", "Thread creation")},
+ {"et", false, QT_TRANSLATE_NOOP("Debugger", "Thread exit")},
+ {"ld", true, QT_TRANSLATE_NOOP("Debugger", "Load module:")},
+ {"ud", true, QT_TRANSLATE_NOOP("Debugger", "Unload module:")},
+ {"out", true, QT_TRANSLATE_NOOP("Debugger", "Output:")}
};
static inline int indexOfEvent(const QString &abbrev)
@@ -86,8 +79,6 @@ static inline int indexOfEvent(const QString &abbrev)
// events with parameters (like 'out:Needle').
class CdbBreakEventWidget : public QWidget
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CdbBreakEventWidget)
-
public:
explicit CdbBreakEventWidget(QWidget *parent = nullptr);
@@ -113,7 +104,7 @@ CdbBreakEventWidget::CdbBreakEventWidget(QWidget *parent) : QWidget(parent)
mainLayout->addLayout(leftLayout);
const size_t eventCount = sizeof(eventDescriptions) / sizeof(EventsDescription);
for (size_t e = 0; e < eventCount; e++) {
- auto cb = new QCheckBox(tr(eventDescriptions[e].description));
+ auto cb = new QCheckBox(Tr::tr(eventDescriptions[e].description));
QLineEdit *le = nullptr;
if (eventDescriptions[e].hasParameter) {
if (!parameterLayout) {
@@ -185,8 +176,6 @@ QStringList CdbBreakEventWidget::breakEvents() const
class CdbOptionsPageWidget : public Core::IOptionsPageWidget
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CdbOptionsPageWidget)
-
public:
CdbOptionsPageWidget();
@@ -209,14 +198,14 @@ CdbOptionsPageWidget::CdbOptionsPageWidget()
Column {
Row {
Group {
- Title(tr("Startup")),
+ Title(Tr::tr("Startup")),
s.cdbAdditionalArguments,
s.useCdbConsole,
Stretch()
},
Group {
- Title(tr("Various")),
+ Title(Tr::tr("Various")),
s.ignoreFirstChanceAccessViolation,
s.cdbBreakOnCrtDbgReport,
s.cdbBreakPointCorrection,
@@ -225,12 +214,12 @@ CdbOptionsPageWidget::CdbOptionsPageWidget()
},
Group {
- Title(tr("Break On")),
+ Title(Tr::tr("Break On")),
m_breakEventWidget
},
Group {
- Title(tr("Add Exceptions to Issues View")),
+ Title(Tr::tr("Add Exceptions to Issues View")),
s.firstChanceExceptionTaskEntry,
s.secondChanceExceptionTaskEntry
},
@@ -255,7 +244,7 @@ void CdbOptionsPageWidget::finish()
CdbOptionsPage::CdbOptionsPage()
{
setId("F.Debugger.Cda");
- setDisplayName(CdbOptionsPageWidget::tr("CDB"));
+ setDisplayName(Tr::tr("CDB"));
setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
setWidgetCreator([] { return new CdbOptionsPageWidget; });
}
@@ -265,8 +254,6 @@ CdbOptionsPage::CdbOptionsPage()
class CdbPathsPageWidget : public Core::IOptionsPageWidget
{
- Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::CdbPathsPageWidget)
-
public:
CdbPathsPageWidget();
@@ -288,8 +275,8 @@ CdbPathsPageWidget::CdbPathsPageWidget()
finish();
Column {
- Group { Title(tr("Symbol Paths")), m_symbolPaths },
- Group { Title(tr("Source Paths")), m_sourcePaths },
+ Group { Title(Tr::tr("Symbol Paths")), m_symbolPaths },
+ Group { Title(Tr::tr("Source Paths")), m_sourcePaths },
Stretch()
}.attachTo(this);
}
@@ -310,7 +297,7 @@ void CdbPathsPageWidget::finish()
CdbPathsPage::CdbPathsPage()
{
setId("F.Debugger.Cdb");
- setDisplayName(CdbPathsPageWidget::tr("CDB Paths"));
+ setDisplayName(Tr::tr("CDB Paths"));
setCategory(Debugger::Constants::DEBUGGER_SETTINGS_CATEGORY);
setWidgetCreator([] { return new CdbPathsPageWidget; });
}