diff options
author | Andrey Rodionov | 2025-03-16 20:47:40 +0300 |
---|---|---|
committer | Andrey Rodionov | 2025-03-16 20:58:21 +0300 |
commit | 6f9c8717d0afe657f9289811f0a9cc81e836bbc8 (patch) | |
tree | f4632bab926513f6cb19f2d70d4d0d96cb4e5c86 /breakpoint.patch | |
download | aur-6f9c8717d0afe657f9289811f0a9cc81e836bbc8.tar.gz |
Create package
Diffstat (limited to 'breakpoint.patch')
-rw-r--r-- | breakpoint.patch | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/breakpoint.patch b/breakpoint.patch new file mode 100644 index 000000000000..a008bc701045 --- /dev/null +++ b/breakpoint.patch @@ -0,0 +1,155 @@ +diff -cr a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp +*** a/src/plugins/debugger/debuggerplugin.cpp 2022-10-25 00:00:23.378435033 +0300 +--- b/src/plugins/debugger/debuggerplugin.cpp 2022-10-24 23:56:32.034431011 +0300 +*************** +*** 635,640 **** +--- 635,642 ---- + int lineNumber, QMenu *menu); + + void setOrRemoveBreakpoint(); ++ void setMessageTracepoint(); ++ void editBreakpoint(); + void enableOrDisableBreakpoint(); + void updateDebugWithoutDeployMenu(); + +*************** +*** 688,693 **** +--- 689,696 ---- + QAction m_setOrRemoveBreakpointAction{Tr::tr("Set or Remove Breakpoint")}; + QAction m_enableOrDisableBreakpointAction{Tr::tr("Enable or Disable Breakpoint")}; + QAction m_reloadDebuggingHelpersAction{Tr::tr("Reload Debugging Helpers")}; ++ QAction m_setMessageTracepointAction{tr("Set Message Tracepoint...")}; ++ QAction m_editBreakpoint{tr("Edit Breakpoint...")}; + + BreakpointManager m_breakpointManager; + QString m_lastPermanentStatusMessage; +*************** +*** 1092,1103 **** +--- 1095,1118 ---- + connect(&m_setOrRemoveBreakpointAction, &QAction::triggered, + this, &DebuggerPluginPrivate::setOrRemoveBreakpoint); + ++ cmd = ActionManager::registerAction(&m_setMessageTracepointAction, "Debugger.SetMessageTracepoint"); ++ debugMenu->addAction(cmd); ++ cmd->setDefaultKeySequence(QKeySequence(tr("F8"))); ++ connect(&m_setMessageTracepointAction, &QAction::triggered, ++ this, &DebuggerPluginPrivate::setMessageTracepoint); ++ + cmd = ActionManager::registerAction(&m_enableOrDisableBreakpointAction, + "Debugger.EnableOrDisableBreakpoint"); + cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Ctrl+F8") : Tr::tr("Ctrl+F9"))); + debugMenu->addAction(cmd); + connect(&m_enableOrDisableBreakpointAction, &QAction::triggered, + this, &DebuggerPluginPrivate::enableOrDisableBreakpoint); ++ ++ cmd = ActionManager::registerAction(&m_editBreakpoint, "EditBreakpoint"); ++ cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F9"))); ++ debugMenu->addAction(cmd); ++ connect(&m_editBreakpoint, &QAction::triggered, ++ this, &DebuggerPluginPrivate::editBreakpoint); + + debugMenu->addSeparator(); + +*************** +*** 1494,1500 **** +--- 1509,1517 ---- + + m_watchAction.setEnabled(state != DebuggerFinished && state != DebuggerNotReady); + m_setOrRemoveBreakpointAction.setEnabled(true); ++ m_setMessageTracepointAction.setEnabled(true); + m_enableOrDisableBreakpointAction.setEnabled(true); ++ m_editBreakpoint.setEnabled(true); + } + + void DebuggerPluginPrivate::onStartupProjectChanged(Project *project) +*************** +*** 1827,1833 **** +--- 1844,1852 ---- + { + BaseTextEditor *textEditor = qobject_cast<BaseTextEditor *>(editor); + m_setOrRemoveBreakpointAction.setEnabled(textEditor != nullptr); ++ m_setMessageTracepointAction.setEnabled(textEditor != nullptr); + m_enableOrDisableBreakpointAction.setEnabled(textEditor != nullptr); ++ m_editBreakpoint.setEnabled(textEditor != nullptr); + } + + void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget, +*************** +*** 1923,1928 **** +--- 1942,1963 ---- + } + } + ++ void DebuggerPluginPrivate::editBreakpoint() ++ { ++ const BaseTextEditor *textEditor = BaseTextEditor::currentTextEditor(); ++ QTC_ASSERT(textEditor, return); ++ const int lineNumber = textEditor->currentLine(); ++ ContextData location = getLocationContext(textEditor->textDocument(), lineNumber); ++ if (location.isValid()) { ++ GlobalBreakpoint gbp = BreakpointManager::findBreakpointFromContext(location); ++ if (!gbp) { ++ BreakpointManager::setOrRemoveBreakpoint(location); ++ gbp = BreakpointManager::findBreakpointFromContext(location); ++ } ++ BreakpointManager::editBreakpoint(gbp, ICore::dialogParent()); ++ } ++ } ++ + void DebuggerPluginPrivate::setOrRemoveBreakpoint() + { + const BaseTextEditor *textEditor = BaseTextEditor::currentTextEditor(); +*************** +*** 1933,1938 **** +--- 1968,2008 ---- + BreakpointManager::setOrRemoveBreakpoint(location); + } + ++ void DebuggerPluginPrivate::setMessageTracepoint() ++ { ++ const BaseTextEditor *textEditor = BaseTextEditor::currentTextEditor(); ++ QTC_ASSERT(textEditor, return); ++ const int lineNumber = textEditor->currentLine(); ++ ContextData location = getLocationContext(textEditor->textDocument(), lineNumber); ++ if (location.isValid()) { ++ GlobalBreakpoint gbp = BreakpointManager::findBreakpointFromContext(location); ++ if (gbp) ++ return; ++ ++ QString message; ++ if (location.type == LocationByAddress) { ++ //: Message tracepoint: Address hit. ++ message = tr("0x%1 hit").arg(location.address, 0, 16); ++ } else { ++ //: Message tracepoint: %1 file, %2 line %3 function hit. ++ message = tr("%1:%2 %3() hit").arg(location.fileName.fileName()). ++ arg(location.textPosition.line). ++ arg(cppFunctionAt(location.fileName, location.textPosition.line)); ++ } ++ QInputDialog dialog; // Create wide input dialog. ++ dialog.setWindowFlags(dialog.windowFlags() ++ & ~(Qt::MSWindowsFixedSizeDialogHint)); ++ dialog.resize(600, dialog.height()); ++ dialog.setWindowTitle(tr("Add Message Tracepoint")); ++ dialog.setLabelText (tr("Message:")); ++ dialog.setTextValue(message); ++ if (dialog.exec() != QDialog::Accepted || dialog.textValue().isEmpty()) ++ return; ++ message = dialog.textValue(); ++ BreakpointManager::setOrRemoveBreakpoint(location, message); ++ } ++ } ++ + void DebuggerPluginPrivate::enableOrDisableBreakpoint() + { + const BaseTextEditor *textEditor = BaseTextEditor::currentTextEditor(); +*************** +*** 1964,1969 **** +--- 2034,2040 ---- + + m_watchAction.setEnabled(false); + m_setOrRemoveBreakpointAction.setEnabled(false); ++ m_setMessageTracepointAction.setEnabled(false); + m_enableOrDisableBreakpointAction.setEnabled(false); + //m_snapshotAction.setEnabled(false); + |