Debugger: Use the pathUsage parameter

Previously the "Path:" option for breakpoints was ignored
by the lldb engine.

Change-Id: I3878ff7b50da994b26b9c42483e4640adc5c60cc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marcus Tillmanns
2023-06-07 09:28:19 +02:00
parent f3b25b1d62
commit d7a26911e4
2 changed files with 14 additions and 3 deletions

View File

@@ -1107,7 +1107,7 @@ QVariant BreakpointItem::data(int column, int role) const
return QVariant();
}
void BreakpointItem::addToCommand(DebuggerCommand *cmd) const
void BreakpointItem::addToCommand(DebuggerCommand *cmd, BreakpointPathUsage defaultPathUsage) const
{
QTC_ASSERT(m_globalBreakpoint, return);
const BreakpointParameters &requested = requestedParameters();
@@ -1120,10 +1120,19 @@ void BreakpointItem::addToCommand(DebuggerCommand *cmd) const
cmd->arg("function", requested.functionName);
cmd->arg("oneshot", requested.oneShot);
cmd->arg("enabled", requested.enabled);
cmd->arg("file", requested.fileName.path());
cmd->arg("line", requested.textPosition.line);
cmd->arg("address", requested.address);
cmd->arg("expression", requested.expression);
BreakpointPathUsage pathUsage = (requested.pathUsage
== BreakpointPathUsage::BreakpointPathUsageEngineDefault)
? defaultPathUsage
: requested.pathUsage;
cmd->arg("file",
pathUsage == BreakpointPathUsage::BreakpointUseFullPath
? requested.fileName.path()
: requested.fileName.fileName());
}
void BreakpointItem::updateFromGdbOutput(const GdbMi &bkpt, const FilePath &fileRoot)

View File

@@ -107,7 +107,9 @@ public:
int markerLineNumber() const;
const BreakpointParameters &requestedParameters() const;
void addToCommand(DebuggerCommand *cmd) const;
void addToCommand(DebuggerCommand *cmd,
BreakpointPathUsage defaultPathUsage
= BreakpointPathUsage::BreakpointUseFullPath) const;
void updateFromGdbOutput(const GdbMi &bkpt, const Utils::FilePath &fileRoot);
int modelId() const;