diff --git a/assets/translations/en_US.ts b/assets/translations/en_US.ts index 417bbe597..de143e82b 100644 --- a/assets/translations/en_US.ts +++ b/assets/translations/en_US.ts @@ -1708,185 +1708,195 @@ storage: %2 DAPDebugger - - - + + + The debugee has Terminated. - + The debugee has Exited. - + Input Condition Expression - + Condition - + When the breakpoint is reached, it will be hit only when the expression is true - - - + + + Cancel - + can`t attaching to debugee when debuging other application - + The gdb is required, please install it in console with "sudo apt install gdb", and then restart the tool, reselect the CMake Debugger in Options Dialog... - + Request cxx dap port failed, please retry. - - + + Ok - + <Unknown> name - + <Unknown> meaning - + <p>The inferior stopped because it received a signal from the operating system.<p><table><tr><td>Signal name : </td><td>%1</td></tr><tr><td>Signal meaning : </td><td>%2</td></tr></table> - + Signal Received - + New Evaluator Expression - + Enter an expression to evaluate - + Threads: - + Stack List - + Add New Expression Evaluator - + Remove This Evaluator - + Name - + Value - + Type - + Breakpoint List - + Please build first. Build : Ctrl + B - + Is preparing dependence, please waiting for a moment - + Is getting the dap port, please waiting for a moment - + Requesting debug port... - + The dap port is not ready, please retry. - + Debugging starts - + Launch dap session with port %1 ... - + + Debugging service initialization failed + + + + + Debugger startup failed + + + + Start debugging coredump file: - + The coredump target file is error: - + The coredump file is error: @@ -4472,6 +4482,7 @@ not exists support files: %0 + Debug diff --git a/assets/translations/zh_CN.ts b/assets/translations/zh_CN.ts index 2f960481d..c5ffb9030 100644 --- a/assets/translations/zh_CN.ts +++ b/assets/translations/zh_CN.ts @@ -1735,9 +1735,9 @@ storage: %2 DAPDebugger - - - + + + The debugee has Terminated. @@ -1746,151 +1746,151 @@ The debugee has Terminated. - + The debugee has Exited. 调试已退出。 - + Input Condition Expression 输入条件表达式 - + Condition 条件 - + When the breakpoint is reached, it will be hit only when the expression is true 当断点到达,仅在表达式为真时触发 - - - + + + Cancel 取消 - + can`t attaching to debugee when debuging other application 调试其他应用程序时不能附加到进程 - + The gdb is required, please install it in console with "sudo apt install gdb", and then restart the tool, reselect the CMake Debugger in Options Dialog... gdb尚未安装,请在控制台中使用“sudo apt install gdb”将其安装,然后重新启动工具,在选项对话框中重新选择CMake调试器... - + Request cxx dap port failed, please retry. 请求cxx dap端口失败,请重新尝试。 - - + + Ok 确认 - + <Unknown> name - + <Unknown> meaning - + <p>The inferior stopped because it received a signal from the operating system.<p><table><tr><td>Signal name : </td><td>%1</td></tr><tr><td>Signal meaning : </td><td>%2</td></tr></table> <p>下位机停止,因为它收到了来自操作系统的信号。<p><table><tr><td>信号名: </td><td>%1</td></tr><tr><td>信号含义: </td><td>%2</td></tr></table> - + Signal Received 信号已接收 - + New Evaluator Expression 新评估表达式 - + Enter an expression to evaluate 输入求值表达式 - + Threads: 线程: - + Stack List 堆栈列表 - + Add New Expression Evaluator 添加新评估表达式 - + Remove This Evaluator 删除评估 - + Name 名称 - + Value - + Type 类型 - + Breakpoint List 断点列表 - + Please build first. Build : Ctrl + B 请先编译工程。 编译:Ctrl + B - + Is preparing dependence, please waiting for a moment 正在加载依赖项,请等待 - + Is getting the dap port, please waiting for a moment 正在获取dap端口,请等待 - + Requesting debug port... 请求调试端口... - + The dap port is not ready, please retry. @@ -1899,27 +1899,37 @@ dap端口未就绪,请重试。 - + Debugging starts 调试开始 - + Launch dap session with port %1 ... 通过端口%1启动dap会话... - + + Debugging service initialization failed + 调试服务初始化失败 + + + + Debugger startup failed + 调试器启动失败 + + + Start debugging coredump file: 开始调试coredump文件: - + The coredump target file is error: coredump目标文件错误: - + The coredump file is error: coredump文件错误: @@ -4511,6 +4521,7 @@ not exists support files: %0 编辑 + Debug 调试 diff --git a/src/plugins/debugger/dap/dapdebugger.cpp b/src/plugins/debugger/dap/dapdebugger.cpp index 172f23fe4..1ddaf04de 100644 --- a/src/plugins/debugger/dap/dapdebugger.cpp +++ b/src/plugins/debugger/dap/dapdebugger.cpp @@ -22,6 +22,7 @@ #include "services/builder/builderservice.h" #include "services/option/optionmanager.h" #include "services/language/languageservice.h" +#include "services/window/windowservice.h" #include "unistd.h" #include "base/baseitemdelegate.h" @@ -57,6 +58,12 @@ using namespace DEBUG_NAMESPACE; using namespace dpfservice; using DTK_WIDGET_NAMESPACE::DSpinner; +void notify(uint type, const QString &message) // type 0-infomation, 1-warning, 2-error +{ + auto wdService = dpfGetService(WindowService); + wdService->notify(type, QObject::tr("Debug"), message, {}); +} + class DebuggerPrivate { friend class DAPDebugger; @@ -1494,6 +1501,8 @@ void DAPDebugger::launchSession(int port, const QMap ¶m, iniRequet); if (!bSuccess) { + updateRunState(DAPDebugger::RunState::kNoRun); + notify(2, tr("Debugging service initialization failed")); qCritical() << "startDebug failed!"; return; } @@ -1550,6 +1559,8 @@ void DAPDebugger::launchSession(int port, const QMap ¶m, } if (!bSuccess) { + updateRunState(DAPDebugger::RunState::kNoRun); + notify(2, tr("Debugger startup failed")); qCritical() << "startDebug failed!"; } else { debugService->getModel()->clear(); diff --git a/src/tools/debugadapter/debugger/python/pythondebugger.cpp b/src/tools/debugadapter/debugger/python/pythondebugger.cpp index 3d291e65f..d3ee35efb 100644 --- a/src/tools/debugadapter/debugger/python/pythondebugger.cpp +++ b/src/tools/debugadapter/debugger/python/pythondebugger.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "unistd.h" @@ -143,6 +144,7 @@ void PythonDebugger::initialize(const QString &pythonExecute, d->process.setProcessEnvironment(env); d->process.start("/bin/bash", options); d->process.waitForStarted(); + QThread::msleep(500); // The port may not start listening immediately when Python starts, resulting in the IDE being unable to connect. Wait for 500ms. } void PythonDebugger::slotReceiveClientInfo(const QString &ppid,