forked from qt-creator/qt-creator
Debugger: Use Utils::Text::Position instead of int line number
The column is currently unused. Change-Id: Iabc57c8d21e807187783071efe9a82e9c1877181 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -84,9 +84,9 @@ public:
|
|||||||
{
|
{
|
||||||
TextMark::updateLineNumber(lineNumber);
|
TextMark::updateLineNumber(lineNumber);
|
||||||
QTC_ASSERT(m_bp, return);
|
QTC_ASSERT(m_bp, return);
|
||||||
m_bp->setLineNumber(lineNumber);
|
m_bp->setTextPosition({lineNumber, -1});
|
||||||
if (GlobalBreakpoint gbp = m_bp->globalBreakpoint())
|
if (GlobalBreakpoint gbp = m_bp->globalBreakpoint())
|
||||||
gbp->m_params.lineNumber = lineNumber;
|
gbp->m_params.textPosition.line = lineNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateFilePath(const FilePath &fileName) final
|
void updateFilePath(const FilePath &fileName) final
|
||||||
@@ -107,7 +107,7 @@ public:
|
|||||||
if (!gbp)
|
if (!gbp)
|
||||||
return;
|
return;
|
||||||
BreakpointParameters params = gbp->m_params;
|
BreakpointParameters params = gbp->m_params;
|
||||||
params.lineNumber = line;
|
params.textPosition.line = line;
|
||||||
gbp->deleteBreakpoint();
|
gbp->deleteBreakpoint();
|
||||||
BreakpointManager::createBreakpoint(params);
|
BreakpointManager::createBreakpoint(params);
|
||||||
}
|
}
|
||||||
@@ -643,7 +643,7 @@ void BreakpointDialog::getParts(unsigned partsMask, BreakpointParameters *data)
|
|||||||
data->enabled = m_checkBoxEnabled->isChecked();
|
data->enabled = m_checkBoxEnabled->isChecked();
|
||||||
|
|
||||||
if (partsMask & FileAndLinePart) {
|
if (partsMask & FileAndLinePart) {
|
||||||
data->lineNumber = m_lineEditLineNumber->text().toInt();
|
data->textPosition.line = m_lineEditLineNumber->text().toInt();
|
||||||
data->pathUsage = static_cast<BreakpointPathUsage>(m_comboBoxPathUsage->currentIndex());
|
data->pathUsage = static_cast<BreakpointPathUsage>(m_comboBoxPathUsage->currentIndex());
|
||||||
data->fileName = m_pathChooserFileName->filePath();
|
data->fileName = m_pathChooserFileName->filePath();
|
||||||
}
|
}
|
||||||
@@ -683,7 +683,7 @@ void BreakpointDialog::setParts(unsigned mask, const BreakpointParameters &data)
|
|||||||
|
|
||||||
if (mask & FileAndLinePart) {
|
if (mask & FileAndLinePart) {
|
||||||
m_pathChooserFileName->setFilePath(data.fileName);
|
m_pathChooserFileName->setFilePath(data.fileName);
|
||||||
m_lineEditLineNumber->setText(QString::number(data.lineNumber));
|
m_lineEditLineNumber->setText(QString::number(data.textPosition.line));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mask & FunctionPart)
|
if (mask & FunctionPart)
|
||||||
@@ -889,7 +889,7 @@ BreakHandler::BreakHandler(DebuggerEngine *engine)
|
|||||||
|
|
||||||
bool BreakpointParameters::isLocatedAt(const FilePath &file, int line, const FilePath &markerFile) const
|
bool BreakpointParameters::isLocatedAt(const FilePath &file, int line, const FilePath &markerFile) const
|
||||||
{
|
{
|
||||||
return lineNumber == line && (fileName == file || fileName == markerFile);
|
return textPosition.line == line && (fileName == file || fileName == markerFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isSimilarTo(const BreakpointParameters ¶ms, const BreakpointParameters &needle)
|
static bool isSimilarTo(const BreakpointParameters ¶ms, const BreakpointParameters &needle)
|
||||||
@@ -911,7 +911,7 @@ static bool isSimilarTo(const BreakpointParameters ¶ms, const BreakpointPara
|
|||||||
// FIXME: breaks multiple breakpoints at the same location
|
// FIXME: breaks multiple breakpoints at the same location
|
||||||
if (!params.fileName.isEmpty()
|
if (!params.fileName.isEmpty()
|
||||||
&& params.fileName == needle.fileName
|
&& params.fileName == needle.fileName
|
||||||
&& params.lineNumber == needle.lineNumber)
|
&& params.textPosition == needle.textPosition)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -1064,7 +1064,7 @@ QVariant BreakpointItem::data(int column, int role) const
|
|||||||
return empty;
|
return empty;
|
||||||
}
|
}
|
||||||
if (role == Qt::UserRole + 1)
|
if (role == Qt::UserRole + 1)
|
||||||
return m_parameters.lineNumber;
|
return m_parameters.textPosition.line;
|
||||||
break;
|
break;
|
||||||
case BreakpointAddressColumn:
|
case BreakpointAddressColumn:
|
||||||
if (role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
@@ -1121,7 +1121,7 @@ void BreakpointItem::addToCommand(DebuggerCommand *cmd) const
|
|||||||
cmd->arg("oneshot", requested.oneShot);
|
cmd->arg("oneshot", requested.oneShot);
|
||||||
cmd->arg("enabled", requested.enabled);
|
cmd->arg("enabled", requested.enabled);
|
||||||
cmd->arg("file", requested.fileName.path());
|
cmd->arg("file", requested.fileName.path());
|
||||||
cmd->arg("line", requested.lineNumber);
|
cmd->arg("line", requested.textPosition.line);
|
||||||
cmd->arg("address", requested.address);
|
cmd->arg("address", requested.address);
|
||||||
cmd->arg("expression", requested.expression);
|
cmd->arg("expression", requested.expression);
|
||||||
}
|
}
|
||||||
@@ -1186,12 +1186,13 @@ void BreakHandler::requestSubBreakpointEnabling(const SubBreakpoint &sbp, bool e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreakpointItem::setMarkerFileAndLine(const FilePath &fileName, int lineNumber)
|
void BreakpointItem::setMarkerFileAndPosition(const FilePath &fileName,
|
||||||
|
const Text::Position &textPosition)
|
||||||
{
|
{
|
||||||
if (m_parameters.fileName == fileName && m_parameters.lineNumber == lineNumber)
|
if (m_parameters.fileName == fileName && m_parameters.textPosition == textPosition)
|
||||||
return;
|
return;
|
||||||
m_parameters.fileName = fileName;
|
m_parameters.fileName = fileName;
|
||||||
m_parameters.lineNumber = lineNumber;
|
m_parameters.textPosition = textPosition;
|
||||||
destroyMarker();
|
destroyMarker();
|
||||||
updateMarker();
|
updateMarker();
|
||||||
update();
|
update();
|
||||||
@@ -1258,7 +1259,8 @@ void BreakHandler::removeDisassemblerMarker(const Breakpoint &bp)
|
|||||||
|
|
||||||
static bool matches(const Location &loc, const BreakpointParameters &bp)
|
static bool matches(const Location &loc, const BreakpointParameters &bp)
|
||||||
{
|
{
|
||||||
if (loc.fileName() == bp.fileName && loc.lineNumber() == bp.lineNumber && bp.lineNumber > 0)
|
if (loc.fileName() == bp.fileName && loc.textPosition() == bp.textPosition
|
||||||
|
&& bp.textPosition.line > 0)
|
||||||
return true;
|
return true;
|
||||||
if (loc.address() == bp.address && bp.address > 0)
|
if (loc.address() == bp.address && bp.address > 0)
|
||||||
return true;
|
return true;
|
||||||
@@ -1836,9 +1838,9 @@ FilePath BreakpointItem::markerFileName() const
|
|||||||
|
|
||||||
int BreakpointItem::markerLineNumber() const
|
int BreakpointItem::markerLineNumber() const
|
||||||
{
|
{
|
||||||
if (m_parameters.lineNumber > 0)
|
if (m_parameters.textPosition.line > 0)
|
||||||
return m_parameters.lineNumber;
|
return m_parameters.textPosition.line;
|
||||||
return requestedParameters().lineNumber;
|
return requestedParameters().textPosition.line;
|
||||||
}
|
}
|
||||||
|
|
||||||
const BreakpointParameters &BreakpointItem::requestedParameters() const
|
const BreakpointParameters &BreakpointItem::requestedParameters() const
|
||||||
@@ -1869,7 +1871,7 @@ bool BreakpointItem::needsChange() const
|
|||||||
return true;
|
return true;
|
||||||
if (oparams.command != m_parameters.command)
|
if (oparams.command != m_parameters.command)
|
||||||
return true;
|
return true;
|
||||||
if (oparams.type == BreakpointByFileAndLine && oparams.lineNumber != m_parameters.lineNumber)
|
if (oparams.type == BreakpointByFileAndLine && oparams.textPosition != m_parameters.textPosition)
|
||||||
return true;
|
return true;
|
||||||
// FIXME: Too strict, functions may have parameter lists, or not.
|
// FIXME: Too strict, functions may have parameter lists, or not.
|
||||||
// if (m_params.type == BreakpointByFunction && m_params.functionName != m_response.functionName)
|
// if (m_params.type == BreakpointByFunction && m_params.functionName != m_response.functionName)
|
||||||
@@ -1950,8 +1952,8 @@ QString BreakpointItem::toolTip() const
|
|||||||
<< "</td><td>" << m_parameters.fileName.toUserOutput()
|
<< "</td><td>" << m_parameters.fileName.toUserOutput()
|
||||||
<< "</td></tr>"
|
<< "</td></tr>"
|
||||||
<< "<tr><td>" << Tr::tr("Line Number:")
|
<< "<tr><td>" << Tr::tr("Line Number:")
|
||||||
<< "</td><td>" << requested.lineNumber
|
<< "</td><td>" << requested.textPosition.line
|
||||||
<< "</td><td>" << m_parameters.lineNumber << "</td></tr>";
|
<< "</td><td>" << m_parameters.textPosition.line << "</td></tr>";
|
||||||
}
|
}
|
||||||
if (requested.type == BreakpointByFunction || m_parameters.type == BreakpointByFileAndLine) {
|
if (requested.type == BreakpointByFunction || m_parameters.type == BreakpointByFileAndLine) {
|
||||||
str << "<tr><td>" << Tr::tr("Module:")
|
str << "<tr><td>" << Tr::tr("Module:")
|
||||||
@@ -2163,12 +2165,12 @@ QVariant GlobalBreakpointItem::data(int column, int role) const
|
|||||||
break;
|
break;
|
||||||
case BreakpointLineColumn:
|
case BreakpointLineColumn:
|
||||||
if (role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
if (m_params.lineNumber > 0)
|
if (m_params.textPosition.line > 0)
|
||||||
return m_params.lineNumber;
|
return m_params.textPosition.line;
|
||||||
return empty;
|
return empty;
|
||||||
}
|
}
|
||||||
if (role == Qt::UserRole + 1)
|
if (role == Qt::UserRole + 1)
|
||||||
return m_params.lineNumber;
|
return m_params.textPosition.line;
|
||||||
break;
|
break;
|
||||||
case BreakpointAddressColumn:
|
case BreakpointAddressColumn:
|
||||||
if (role == Qt::DisplayRole) {
|
if (role == Qt::DisplayRole) {
|
||||||
@@ -2270,9 +2272,9 @@ void GlobalBreakpointItem::removeBreakpointFromModel()
|
|||||||
|
|
||||||
void GlobalBreakpointItem::updateLineNumber(int lineNumber)
|
void GlobalBreakpointItem::updateLineNumber(int lineNumber)
|
||||||
{
|
{
|
||||||
if (m_params.lineNumber == lineNumber)
|
if (m_params.textPosition.line == lineNumber)
|
||||||
return;
|
return;
|
||||||
m_params.lineNumber = lineNumber;
|
m_params.textPosition.line = lineNumber;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2294,7 +2296,7 @@ FilePath GlobalBreakpointItem::markerFileName() const
|
|||||||
|
|
||||||
int GlobalBreakpointItem::markerLineNumber() const
|
int GlobalBreakpointItem::markerLineNumber() const
|
||||||
{
|
{
|
||||||
return m_params.lineNumber;
|
return m_params.textPosition.line;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GlobalBreakpointItem::updateMarker()
|
void GlobalBreakpointItem::updateMarker()
|
||||||
@@ -2306,7 +2308,7 @@ void GlobalBreakpointItem::updateMarker()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int line = m_params.lineNumber;
|
const int line = m_params.textPosition.line;
|
||||||
if (m_marker) {
|
if (m_marker) {
|
||||||
if (m_params.fileName != m_marker->filePath())
|
if (m_params.fileName != m_marker->filePath())
|
||||||
m_marker->updateFilePath(m_params.fileName);
|
m_marker->updateFilePath(m_params.fileName);
|
||||||
@@ -2373,7 +2375,7 @@ QString GlobalBreakpointItem::toolTip() const
|
|||||||
<< "</td><td>" << m_params.fileName.toUserOutput()
|
<< "</td><td>" << m_params.fileName.toUserOutput()
|
||||||
<< "</td></tr>"
|
<< "</td></tr>"
|
||||||
<< "<tr><td>" << Tr::tr("Line Number:")
|
<< "<tr><td>" << Tr::tr("Line Number:")
|
||||||
<< "</td><td>" << m_params.lineNumber;
|
<< "</td><td>" << m_params.textPosition.line;
|
||||||
}
|
}
|
||||||
if (m_params.type == BreakpointByFunction || m_params.type == BreakpointByFileAndLine) {
|
if (m_params.type == BreakpointByFunction || m_params.type == BreakpointByFileAndLine) {
|
||||||
str << "<tr><td>" << Tr::tr("Module:")
|
str << "<tr><td>" << Tr::tr("Module:")
|
||||||
@@ -2487,7 +2489,7 @@ void BreakpointManager::setOrRemoveBreakpoint(const ContextData &location, const
|
|||||||
data.tracepoint = !tracePointMessage.isEmpty();
|
data.tracepoint = !tracePointMessage.isEmpty();
|
||||||
data.message = tracePointMessage;
|
data.message = tracePointMessage;
|
||||||
data.fileName = location.fileName;
|
data.fileName = location.fileName;
|
||||||
data.lineNumber = location.lineNumber;
|
data.textPosition = location.textPosition;
|
||||||
} else if (location.type == LocationByAddress) {
|
} else if (location.type == LocationByAddress) {
|
||||||
data.type = BreakpointByAddress;
|
data.type = BreakpointByAddress;
|
||||||
data.tracepoint = !tracePointMessage.isEmpty();
|
data.tracepoint = !tracePointMessage.isEmpty();
|
||||||
@@ -2513,7 +2515,7 @@ GlobalBreakpoint BreakpointManager::findBreakpointFromContext(const ContextData
|
|||||||
GlobalBreakpoint bestMatch;
|
GlobalBreakpoint bestMatch;
|
||||||
theBreakpointManager->forItemsAtLevel<1>([&](const GlobalBreakpoint &gbp) {
|
theBreakpointManager->forItemsAtLevel<1>([&](const GlobalBreakpoint &gbp) {
|
||||||
if (location.type == LocationByFile) {
|
if (location.type == LocationByFile) {
|
||||||
if (gbp->m_params.isLocatedAt(location.fileName, location.lineNumber, FilePath())) {
|
if (gbp->m_params.isLocatedAt(location.fileName, location.textPosition.line, FilePath())) {
|
||||||
matchLevel = 2;
|
matchLevel = 2;
|
||||||
bestMatch = gbp;
|
bestMatch = gbp;
|
||||||
} else if (matchLevel < 2) {
|
} else if (matchLevel < 2) {
|
||||||
@@ -2522,7 +2524,7 @@ GlobalBreakpoint BreakpointManager::findBreakpointFromContext(const ContextData
|
|||||||
for (Breakpoint bp : handler->breakpoints()) {
|
for (Breakpoint bp : handler->breakpoints()) {
|
||||||
if (bp->globalBreakpoint() == gbp) {
|
if (bp->globalBreakpoint() == gbp) {
|
||||||
if (bp->fileName() == location.fileName
|
if (bp->fileName() == location.fileName
|
||||||
&& bp->lineNumber() == location.lineNumber) {
|
&& bp->textPosition() == location.textPosition) {
|
||||||
matchLevel = 1;
|
matchLevel = 1;
|
||||||
bestMatch = gbp;
|
bestMatch = gbp;
|
||||||
}
|
}
|
||||||
@@ -2768,8 +2770,8 @@ void BreakpointManager::saveSessionData()
|
|||||||
map.insert("type", params.type);
|
map.insert("type", params.type);
|
||||||
if (!params.fileName.isEmpty())
|
if (!params.fileName.isEmpty())
|
||||||
map.insert("filename", params.fileName.toSettings());
|
map.insert("filename", params.fileName.toSettings());
|
||||||
if (params.lineNumber)
|
if (params.textPosition.line)
|
||||||
map.insert("linenumber", params.lineNumber);
|
map.insert("linenumber", params.textPosition.line);
|
||||||
if (!params.functionName.isEmpty())
|
if (!params.functionName.isEmpty())
|
||||||
map.insert("funcname", params.functionName);
|
map.insert("funcname", params.functionName);
|
||||||
if (params.address)
|
if (params.address)
|
||||||
@@ -2815,7 +2817,7 @@ void BreakpointManager::loadSessionData()
|
|||||||
params.fileName = FilePath::fromSettings(v);
|
params.fileName = FilePath::fromSettings(v);
|
||||||
v = map.value("linenumber");
|
v = map.value("linenumber");
|
||||||
if (v.isValid())
|
if (v.isValid())
|
||||||
params.lineNumber = v.toString().toInt();
|
params.textPosition.line = v.toString().toInt();
|
||||||
v = map.value("condition");
|
v = map.value("condition");
|
||||||
if (v.isValid())
|
if (v.isValid())
|
||||||
params.condition = v.toString();
|
params.condition = v.toString();
|
||||||
|
@@ -98,7 +98,8 @@ public:
|
|||||||
|
|
||||||
QIcon icon(bool withLocationMarker = false) const;
|
QIcon icon(bool withLocationMarker = false) const;
|
||||||
|
|
||||||
void setMarkerFileAndLine(const Utils::FilePath &fileName, int lineNumber);
|
void setMarkerFileAndPosition(const Utils::FilePath &fileName,
|
||||||
|
const Utils::Text::Position &textPosition);
|
||||||
bool needsChange() const;
|
bool needsChange() const;
|
||||||
|
|
||||||
SubBreakpoint findOrCreateSubBreakpoint(const QString &responseId);
|
SubBreakpoint findOrCreateSubBreakpoint(const QString &responseId);
|
||||||
@@ -128,14 +129,14 @@ public:
|
|||||||
QString message() const { return m_parameters.message; }
|
QString message() const { return m_parameters.message; }
|
||||||
QString command() const { return m_parameters.command; }
|
QString command() const { return m_parameters.command; }
|
||||||
quint64 address() const { return m_parameters.address; }
|
quint64 address() const { return m_parameters.address; }
|
||||||
int lineNumber() const { return m_parameters.lineNumber; }
|
Utils::Text::Position textPosition() const { return m_parameters.textPosition; }
|
||||||
bool isEnabled() const { return m_parameters.enabled; }
|
bool isEnabled() const { return m_parameters.enabled; }
|
||||||
bool isWatchpoint() const { return m_parameters.isWatchpoint(); }
|
bool isWatchpoint() const { return m_parameters.isWatchpoint(); }
|
||||||
bool isTracepoint() const { return m_parameters.isTracepoint(); }
|
bool isTracepoint() const { return m_parameters.isTracepoint(); }
|
||||||
bool isOneShot() const { return m_parameters.oneShot; }
|
bool isOneShot() const { return m_parameters.oneShot; }
|
||||||
bool isPending() const { return m_parameters.pending; }
|
bool isPending() const { return m_parameters.pending; }
|
||||||
|
|
||||||
void setLineNumber(int lineNumber) { m_parameters.lineNumber = lineNumber; }
|
void setTextPosition(const Utils::Text::Position pos) { m_parameters.textPosition = pos; }
|
||||||
void setFileName(const Utils::FilePath &fileName) { m_parameters.fileName = fileName; }
|
void setFileName(const Utils::FilePath &fileName) { m_parameters.fileName = fileName; }
|
||||||
void setFunctionName(const QString &functionName) { m_parameters.functionName = functionName; }
|
void setFunctionName(const QString &functionName) { m_parameters.functionName = functionName; }
|
||||||
void setPending(bool pending);
|
void setPending(bool pending);
|
||||||
|
@@ -27,7 +27,7 @@ namespace Internal {
|
|||||||
|
|
||||||
BreakpointParameters::BreakpointParameters(BreakpointType t)
|
BreakpointParameters::BreakpointParameters(BreakpointType t)
|
||||||
: type(t), enabled(true), pathUsage(BreakpointPathUsageEngineDefault),
|
: type(t), enabled(true), pathUsage(BreakpointPathUsageEngineDefault),
|
||||||
ignoreCount(0), lineNumber(0), address(0), size(0),
|
ignoreCount(0), address(0), size(0),
|
||||||
bitpos(0), bitsize(0), threadSpec(-1),
|
bitpos(0), bitsize(0), threadSpec(-1),
|
||||||
tracepoint(false), oneShot(false)
|
tracepoint(false), oneShot(false)
|
||||||
{}
|
{}
|
||||||
@@ -48,7 +48,7 @@ BreakpointParts BreakpointParameters::differencesTo
|
|||||||
parts |= ConditionPart;
|
parts |= ConditionPart;
|
||||||
if (ignoreCount != rhs.ignoreCount)
|
if (ignoreCount != rhs.ignoreCount)
|
||||||
parts |= IgnoreCountPart;
|
parts |= IgnoreCountPart;
|
||||||
if (lineNumber != rhs.lineNumber)
|
if (textPosition != rhs.textPosition)
|
||||||
parts |= FileAndLinePart;
|
parts |= FileAndLinePart;
|
||||||
if (address != rhs.address)
|
if (address != rhs.address)
|
||||||
parts |= AddressPart;
|
parts |= AddressPart;
|
||||||
@@ -73,7 +73,7 @@ bool BreakpointParameters::isValid() const
|
|||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case BreakpointByFileAndLine:
|
case BreakpointByFileAndLine:
|
||||||
return !fileName.isEmpty() && lineNumber > 0;
|
return !fileName.isEmpty() && textPosition.line > 0;
|
||||||
case BreakpointByFunction:
|
case BreakpointByFunction:
|
||||||
return !functionName.isEmpty();
|
return !functionName.isEmpty();
|
||||||
case WatchpointAtAddress:
|
case WatchpointAtAddress:
|
||||||
@@ -116,7 +116,7 @@ void BreakpointParameters::updateLocation(const QString &location)
|
|||||||
{
|
{
|
||||||
if (!location.isEmpty()) {
|
if (!location.isEmpty()) {
|
||||||
int pos = location.indexOf(':');
|
int pos = location.indexOf(':');
|
||||||
lineNumber = location.mid(pos + 1).toInt();
|
textPosition.line = location.mid(pos + 1).toInt(); // FIXME: Handle column
|
||||||
QString file = location.left(pos);
|
QString file = location.left(pos);
|
||||||
if (file.startsWith('"') && file.endsWith('"'))
|
if (file.startsWith('"') && file.endsWith('"'))
|
||||||
file = file.mid(1, file.size() - 2);
|
file = file.mid(1, file.size() - 2);
|
||||||
@@ -164,8 +164,8 @@ QString BreakpointParameters::toString() const
|
|||||||
ts << "Type: " << type;
|
ts << "Type: " << type;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case BreakpointByFileAndLine:
|
case BreakpointByFileAndLine:
|
||||||
ts << " FileName: " << fileName << ':' << lineNumber
|
ts << " FileName: " << fileName << ':' << textPosition.line;
|
||||||
<< " PathUsage: " << pathUsage;
|
ts << " PathUsage: " << pathUsage;
|
||||||
break;
|
break;
|
||||||
case BreakpointByFunction:
|
case BreakpointByFunction:
|
||||||
case BreakpointOnQmlSignalEmit:
|
case BreakpointOnQmlSignalEmit:
|
||||||
@@ -295,7 +295,7 @@ void BreakpointParameters::updateFromGdbOutput(const GdbMi &bkpt, const Utils::F
|
|||||||
} else if (child.hasName("fullname")) {
|
} else if (child.hasName("fullname")) {
|
||||||
fullName = child.data();
|
fullName = child.data();
|
||||||
} else if (child.hasName("line")) {
|
} else if (child.hasName("line")) {
|
||||||
lineNumber = child.toInt();
|
textPosition.line = child.toInt();
|
||||||
} else if (child.hasName("cond")) {
|
} else if (child.hasName("cond")) {
|
||||||
// gdb 6.3 likes to "rewrite" conditions. Just accept that fact.
|
// gdb 6.3 likes to "rewrite" conditions. Just accept that fact.
|
||||||
condition = child.data();
|
condition = child.data();
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
|
#include <utils/textutils.h>
|
||||||
|
|
||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -139,7 +140,7 @@ public:
|
|||||||
Utils::FilePath fileName;//!< Short name of source file.
|
Utils::FilePath fileName;//!< Short name of source file.
|
||||||
QString condition; //!< Condition associated with breakpoint.
|
QString condition; //!< Condition associated with breakpoint.
|
||||||
int ignoreCount; //!< Ignore count associated with breakpoint.
|
int ignoreCount; //!< Ignore count associated with breakpoint.
|
||||||
int lineNumber; //!< Line in source file.
|
Utils::Text::Position textPosition; //!< Line and column in source file.
|
||||||
quint64 address; //!< Address for address based data breakpoints.
|
quint64 address; //!< Address for address based data breakpoints.
|
||||||
QString expression; //!< Expression for expression based data breakpoints.
|
QString expression; //!< Expression for expression based data breakpoints.
|
||||||
uint size; //!< Size of watched area for data breakpoints.
|
uint size; //!< Size of watched area for data breakpoints.
|
||||||
|
@@ -818,7 +818,7 @@ void CdbEngine::executeRunToLine(const ContextData &data)
|
|||||||
} else {
|
} else {
|
||||||
bp.type =BreakpointByFileAndLine;
|
bp.type =BreakpointByFileAndLine;
|
||||||
bp.fileName = data.fileName;
|
bp.fileName = data.fileName;
|
||||||
bp.lineNumber = data.lineNumber;
|
bp.textPosition = data.textPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
runCommand({cdbAddBreakpointCommand(bp, m_sourcePathMappings), BuiltinCommand,
|
runCommand({cdbAddBreakpointCommand(bp, m_sourcePathMappings), BuiltinCommand,
|
||||||
@@ -854,7 +854,7 @@ void CdbEngine::executeJumpToLine(const ContextData &data)
|
|||||||
// Jump to source line: Resolve source line address and go to that location
|
// Jump to source line: Resolve source line address and go to that location
|
||||||
QString cmd;
|
QString cmd;
|
||||||
StringInputStream str(cmd);
|
StringInputStream str(cmd);
|
||||||
str << "? `" << data.fileName.toUserOutput() << ':' << data.lineNumber << '`';
|
str << "? `" << data.fileName.toUserOutput() << ':' << data.textPosition.line << '`';
|
||||||
runCommand({cmd, BuiltinCommand, [this, data](const DebuggerResponse &r) {
|
runCommand({cmd, BuiltinCommand, [this, data](const DebuggerResponse &r) {
|
||||||
handleJumpToLineAddressResolution(r, data); }});
|
handleJumpToLineAddressResolution(r, data); }});
|
||||||
}
|
}
|
||||||
@@ -891,7 +891,7 @@ void CdbEngine::handleJumpToLineAddressResolution(const DebuggerResponse &respon
|
|||||||
const quint64 address = answer.toULongLong(&ok, 16);
|
const quint64 address = answer.toULongLong(&ok, 16);
|
||||||
if (ok && address) {
|
if (ok && address) {
|
||||||
jumpToAddress(address);
|
jumpToAddress(address);
|
||||||
gotoLocation(Location(context.fileName, context.lineNumber));
|
gotoLocation(Location(context.fileName, context.textPosition));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2505,8 +2505,9 @@ void CdbEngine::insertBreakpoint(const Breakpoint &bp)
|
|||||||
if (!m_autoBreakPointCorrection
|
if (!m_autoBreakPointCorrection
|
||||||
&& parameters.type == BreakpointByFileAndLine
|
&& parameters.type == BreakpointByFileAndLine
|
||||||
&& debuggerSettings()->cdbBreakPointCorrection.value()) {
|
&& debuggerSettings()->cdbBreakPointCorrection.value()) {
|
||||||
response.lineNumber = int(lineCorrection->fixLineNumber(parameters.fileName,
|
response.textPosition.line =
|
||||||
unsigned(parameters.lineNumber)));
|
int(lineCorrection->fixLineNumber(parameters.fileName,
|
||||||
|
unsigned(parameters.textPosition.line)));
|
||||||
QString cmd = cdbAddBreakpointCommand(response, m_sourcePathMappings, responseId);
|
QString cmd = cdbAddBreakpointCommand(response, m_sourcePathMappings, responseId);
|
||||||
runCommand({cmd, BuiltinCommand, handleBreakInsertCB});
|
runCommand({cmd, BuiltinCommand, handleBreakInsertCB});
|
||||||
} else {
|
} else {
|
||||||
@@ -2979,7 +2980,7 @@ BreakpointParameters CdbEngine::parseBreakPoint(const GdbMi &gdbmi)
|
|||||||
result.fileName = Utils::FilePath::fromUserInput(mappedFile.fileName);
|
result.fileName = Utils::FilePath::fromUserInput(mappedFile.fileName);
|
||||||
const GdbMi lineNumber = gdbmi["srcline"];
|
const GdbMi lineNumber = gdbmi["srcline"];
|
||||||
if (lineNumber.isValid())
|
if (lineNumber.isValid())
|
||||||
result.lineNumber = lineNumber.data().toULongLong(nullptr, 0);
|
result.textPosition.line = lineNumber.data().toULongLong(nullptr, 0);
|
||||||
}
|
}
|
||||||
const GdbMi addressG = gdbmi["address"];
|
const GdbMi addressG = gdbmi["address"];
|
||||||
if (addressG.isValid())
|
if (addressG.isValid())
|
||||||
@@ -3036,7 +3037,7 @@ void CdbEngine::handleBreakPoints(const DebuggerResponse &response)
|
|||||||
currentResponse.pending = reportedResponse.pending;
|
currentResponse.pending = reportedResponse.pending;
|
||||||
currentResponse.enabled = reportedResponse.enabled;
|
currentResponse.enabled = reportedResponse.enabled;
|
||||||
currentResponse.fileName = reportedResponse.fileName;
|
currentResponse.fileName = reportedResponse.fileName;
|
||||||
currentResponse.lineNumber = reportedResponse.lineNumber;
|
currentResponse.textPosition = reportedResponse.textPosition;
|
||||||
formatCdbBreakPointResponse(bp->modelId(), responseId, currentResponse, str);
|
formatCdbBreakPointResponse(bp->modelId(), responseId, currentResponse, str);
|
||||||
if (debugBreakpoints)
|
if (debugBreakpoints)
|
||||||
qDebug(" Setting for %s: %s\n", qPrintable(responseId),
|
qDebug(" Setting for %s: %s\n", qPrintable(responseId),
|
||||||
@@ -3053,7 +3054,7 @@ void CdbEngine::handleBreakPoints(const DebuggerResponse &response)
|
|||||||
currentResponse.pending = reportedResponse.pending;
|
currentResponse.pending = reportedResponse.pending;
|
||||||
currentResponse.enabled = reportedResponse.enabled;
|
currentResponse.enabled = reportedResponse.enabled;
|
||||||
currentResponse.fileName = reportedResponse.fileName;
|
currentResponse.fileName = reportedResponse.fileName;
|
||||||
currentResponse.lineNumber = reportedResponse.lineNumber;
|
currentResponse.textPosition = reportedResponse.textPosition;
|
||||||
Breakpoint bp = sub->breakpoint();
|
Breakpoint bp = sub->breakpoint();
|
||||||
QTC_ASSERT(bp, continue);
|
QTC_ASSERT(bp, continue);
|
||||||
formatCdbBreakPointResponse(bp->modelId(), responseId, currentResponse, str);
|
formatCdbBreakPointResponse(bp->modelId(), responseId, currentResponse, str);
|
||||||
|
@@ -161,7 +161,8 @@ QString cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
|
|||||||
str << '`';
|
str << '`';
|
||||||
if (!params.module.isEmpty())
|
if (!params.module.isEmpty())
|
||||||
str << params.module << '!';
|
str << params.module << '!';
|
||||||
str << cdbBreakPointFileName(params, sourcePathMapping) << ':' << params.lineNumber << '`';
|
str << cdbBreakPointFileName(params, sourcePathMapping)
|
||||||
|
<< ':' << params.textPosition.line << '`';
|
||||||
break;
|
break;
|
||||||
case WatchpointAtAddress: { // Read/write, no space here
|
case WatchpointAtAddress: { // Read/write, no space here
|
||||||
const unsigned size = params.size ? params.size : 1;
|
const unsigned size = params.size ? params.size : 1;
|
||||||
|
@@ -281,7 +281,7 @@ static QJsonObject createBreakpoint(const Breakpoint &breakpoint)
|
|||||||
return QJsonObject();
|
return QJsonObject();
|
||||||
|
|
||||||
QJsonObject bp;
|
QJsonObject bp;
|
||||||
bp["line"] = params.lineNumber;
|
bp["line"] = params.textPosition.line;
|
||||||
bp["source"] = QJsonObject{{"name", params.fileName.fileName()},
|
bp["source"] = QJsonObject{{"name", params.fileName.fileName()},
|
||||||
{"path", params.fileName.path()}};
|
{"path", params.fileName.path()}};
|
||||||
return bp;
|
return bp;
|
||||||
@@ -622,7 +622,7 @@ void DapEngine::handleOutput(const QJsonDocument &data)
|
|||||||
QString id = QString::number(body.value("hitBreakpointIds").toArray().first().toInteger());
|
QString id = QString::number(body.value("hitBreakpointIds").toArray().first().toInteger());
|
||||||
const BreakpointParameters ¶ms
|
const BreakpointParameters ¶ms
|
||||||
= breakHandler()->findBreakpointByResponseId(id)->requestedParameters();
|
= breakHandler()->findBreakpointByResponseId(id)->requestedParameters();
|
||||||
gotoLocation(Location(params.fileName, params.lineNumber));
|
gotoLocation(Location(params.fileName, params.textPosition));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state() == InferiorStopRequested)
|
if (state() == InferiorStopRequested)
|
||||||
|
@@ -142,7 +142,7 @@ static bool debuggerActionsEnabledHelper(DebuggerState state)
|
|||||||
Location::Location(const StackFrame &frame, bool marker)
|
Location::Location(const StackFrame &frame, bool marker)
|
||||||
{
|
{
|
||||||
m_fileName = frame.file;
|
m_fileName = frame.file;
|
||||||
m_lineNumber = frame.line;
|
m_textPosition = {frame.line, -1};
|
||||||
m_needsMarker = marker;
|
m_needsMarker = marker;
|
||||||
m_functionName = frame.function;
|
m_functionName = frame.function;
|
||||||
m_hasDebugInfo = frame.isUsable();
|
m_hasDebugInfo = frame.isUsable();
|
||||||
@@ -1075,7 +1075,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const FilePath file = loc.fileName();
|
const FilePath file = loc.fileName();
|
||||||
const int line = loc.lineNumber();
|
const int line = loc.textPosition().line;
|
||||||
bool newEditor = false;
|
bool newEditor = false;
|
||||||
IEditor *editor = EditorManager::openEditor(file,
|
IEditor *editor = EditorManager::openEditor(file,
|
||||||
Id(),
|
Id(),
|
||||||
|
@@ -219,12 +219,14 @@ public:
|
|||||||
Location(quint64 address) { m_address = address; }
|
Location(quint64 address) { m_address = address; }
|
||||||
Location(const Utils::FilePath &file) { m_fileName = file; }
|
Location(const Utils::FilePath &file) { m_fileName = file; }
|
||||||
Location(const Utils::FilePath &file, int line, bool marker = true)
|
Location(const Utils::FilePath &file, int line, bool marker = true)
|
||||||
{ m_lineNumber = line; m_fileName = file; m_needsMarker = marker; }
|
{ m_textPosition = {line, -1}; m_fileName = file; m_needsMarker = marker; }
|
||||||
|
Location(const Utils::FilePath &file, const Utils::Text::Position &pos, bool marker = true)
|
||||||
|
{ m_textPosition = pos; m_fileName = file; m_needsMarker = marker; }
|
||||||
Location(const StackFrame &frame, bool marker = true);
|
Location(const StackFrame &frame, bool marker = true);
|
||||||
Utils::FilePath fileName() const { return m_fileName; }
|
Utils::FilePath fileName() const { return m_fileName; }
|
||||||
QString functionName() const { return m_functionName; }
|
QString functionName() const { return m_functionName; }
|
||||||
QString from() const { return m_from; }
|
QString from() const { return m_from; }
|
||||||
int lineNumber() const { return m_lineNumber; }
|
Utils::Text::Position textPosition() const { return m_textPosition; }
|
||||||
void setNeedsRaise(bool on) { m_needsRaise = on; }
|
void setNeedsRaise(bool on) { m_needsRaise = on; }
|
||||||
void setNeedsMarker(bool on) { m_needsMarker = on; }
|
void setNeedsMarker(bool on) { m_needsMarker = on; }
|
||||||
void setFileName(const Utils::FilePath &fileName) { m_fileName = fileName; }
|
void setFileName(const Utils::FilePath &fileName) { m_fileName = fileName; }
|
||||||
@@ -240,7 +242,7 @@ private:
|
|||||||
bool m_needsMarker = false;
|
bool m_needsMarker = false;
|
||||||
bool m_needsRaise = true;
|
bool m_needsRaise = true;
|
||||||
bool m_hasDebugInfo = true;
|
bool m_hasDebugInfo = true;
|
||||||
int m_lineNumber = -1;
|
Utils::Text::Position m_textPosition;
|
||||||
Utils::FilePath m_fileName;
|
Utils::FilePath m_fileName;
|
||||||
QString m_functionName;
|
QString m_functionName;
|
||||||
QString m_from;
|
QString m_from;
|
||||||
|
@@ -603,8 +603,8 @@ public:
|
|||||||
} else {
|
} else {
|
||||||
//: Message tracepoint: %1 file, %2 line %3 function hit.
|
//: Message tracepoint: %1 file, %2 line %3 function hit.
|
||||||
message = Tr::tr("%1:%2 %3() hit").arg(data.fileName.fileName()).
|
message = Tr::tr("%1:%2 %3() hit").arg(data.fileName.fileName()).
|
||||||
arg(data.lineNumber).
|
arg(data.textPosition.line).
|
||||||
arg(cppFunctionAt(data.fileName, data.lineNumber));
|
arg(cppFunctionAt(data.fileName, data.textPosition.line));
|
||||||
}
|
}
|
||||||
QInputDialog dialog; // Create wide input dialog.
|
QInputDialog dialog; // Create wide input dialog.
|
||||||
dialog.setWindowFlags(dialog.windowFlags() & ~(Qt::MSWindowsFixedSizeDialogHint));
|
dialog.setWindowFlags(dialog.windowFlags() & ~(Qt::MSWindowsFixedSizeDialogHint));
|
||||||
@@ -1881,7 +1881,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget,
|
|||||||
if (engine->hasCapability(RunToLineCapability)) {
|
if (engine->hasCapability(RunToLineCapability)) {
|
||||||
auto act = menu->addAction(args.address
|
auto act = menu->addAction(args.address
|
||||||
? Tr::tr("Run to Address 0x%1").arg(args.address, 0, 16)
|
? Tr::tr("Run to Address 0x%1").arg(args.address, 0, 16)
|
||||||
: Tr::tr("Run to Line %1").arg(args.lineNumber));
|
: Tr::tr("Run to Line %1").arg(args.textPosition.line));
|
||||||
connect(act, &QAction::triggered, this, [args, engine] {
|
connect(act, &QAction::triggered, this, [args, engine] {
|
||||||
QTC_ASSERT(engine, return);
|
QTC_ASSERT(engine, return);
|
||||||
engine->executeRunToLine(args);
|
engine->executeRunToLine(args);
|
||||||
@@ -1890,7 +1890,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget,
|
|||||||
if (engine->hasCapability(JumpToLineCapability)) {
|
if (engine->hasCapability(JumpToLineCapability)) {
|
||||||
auto act = menu->addAction(args.address
|
auto act = menu->addAction(args.address
|
||||||
? Tr::tr("Jump to Address 0x%1").arg(args.address, 0, 16)
|
? Tr::tr("Jump to Address 0x%1").arg(args.address, 0, 16)
|
||||||
: Tr::tr("Jump to Line %1").arg(args.lineNumber));
|
: Tr::tr("Jump to Line %1").arg(args.textPosition.line));
|
||||||
connect(act, &QAction::triggered, this, [args, engine] {
|
connect(act, &QAction::triggered, this, [args, engine] {
|
||||||
QTC_ASSERT(engine, return);
|
QTC_ASSERT(engine, return);
|
||||||
engine->executeJumpToLine(args);
|
engine->executeJumpToLine(args);
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
|
#include <utils/textutils.h>
|
||||||
|
|
||||||
namespace Utils { class ProcessHandle; }
|
namespace Utils { class ProcessHandle; }
|
||||||
|
|
||||||
@@ -326,7 +327,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
LocationType type = UnknownLocation;
|
LocationType type = UnknownLocation;
|
||||||
Utils::FilePath fileName;
|
Utils::FilePath fileName;
|
||||||
int lineNumber = 0;
|
Utils::Text::Position textPosition;
|
||||||
quint64 address = 0;
|
quint64 address = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1211,9 +1211,9 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
|
|||||||
if (Breakpoint bp = breakHandler()->findBreakpointByResponseId(nr)) {
|
if (Breakpoint bp = breakHandler()->findBreakpointByResponseId(nr)) {
|
||||||
const FilePath &bpFileName = bp->fileName();
|
const FilePath &bpFileName = bp->fileName();
|
||||||
if (!bpFileName.isEmpty())
|
if (!bpFileName.isEmpty())
|
||||||
bp->setMarkerFileAndLine(bpFileName, lineNumber);
|
bp->setMarkerFileAndPosition(bpFileName, {lineNumber, -1});
|
||||||
else if (!fileName.isEmpty())
|
else if (!fileName.isEmpty())
|
||||||
bp->setMarkerFileAndLine(fileName, lineNumber);
|
bp->setMarkerFileAndPosition(fileName, {lineNumber, -1});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1946,13 +1946,13 @@ void GdbEngine::executeRunToLine(const ContextData &data)
|
|||||||
CHECK_STATE(InferiorStopOk);
|
CHECK_STATE(InferiorStopOk);
|
||||||
setTokenBarrier();
|
setTokenBarrier();
|
||||||
notifyInferiorRunRequested();
|
notifyInferiorRunRequested();
|
||||||
showStatusMessage(Tr::tr("Run to line %1 requested...").arg(data.lineNumber), 5000);
|
showStatusMessage(Tr::tr("Run to line %1 requested...").arg(data.textPosition.line), 5000);
|
||||||
#if 1
|
#if 1
|
||||||
QString loc;
|
QString loc;
|
||||||
if (data.address)
|
if (data.address)
|
||||||
loc = addressSpec(data.address);
|
loc = addressSpec(data.address);
|
||||||
else
|
else
|
||||||
loc = '"' + breakLocation(data.fileName) + '"' + ':' + QString::number(data.lineNumber);
|
loc = '"' + breakLocation(data.fileName) + '"' + ':' + QString::number(data.textPosition.line);
|
||||||
runCommand({"tbreak " + loc});
|
runCommand({"tbreak " + loc});
|
||||||
|
|
||||||
runCommand({"continue", NativeCommand|RunRequest, CB(handleExecuteRunToLine)});
|
runCommand({"continue", NativeCommand|RunRequest, CB(handleExecuteRunToLine)});
|
||||||
@@ -1980,7 +1980,7 @@ void GdbEngine::executeJumpToLine(const ContextData &data)
|
|||||||
if (data.address)
|
if (data.address)
|
||||||
loc = addressSpec(data.address);
|
loc = addressSpec(data.address);
|
||||||
else
|
else
|
||||||
loc = '"' + breakLocation(data.fileName) + '"' + ':' + QString::number(data.lineNumber);
|
loc = '"' + breakLocation(data.fileName) + '"' + ':' + QString::number(data.textPosition.line);
|
||||||
runCommand({"tbreak " + loc});
|
runCommand({"tbreak " + loc});
|
||||||
notifyInferiorRunRequested();
|
notifyInferiorRunRequested();
|
||||||
|
|
||||||
@@ -2086,7 +2086,7 @@ QString GdbEngine::breakpointLocation(const BreakpointParameters &data)
|
|||||||
// The argument is simply a C-quoted version of the argument to the
|
// The argument is simply a C-quoted version of the argument to the
|
||||||
// non-MI "break" command, including the "original" quoting it wants.
|
// non-MI "break" command, including the "original" quoting it wants.
|
||||||
return "\"\\\"" + GdbMi::escapeCString(fileName) + "\\\":"
|
return "\"\\\"" + GdbMi::escapeCString(fileName) + "\\\":"
|
||||||
+ QString::number(data.lineNumber) + '"';
|
+ QString::number(data.textPosition.line) + '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GdbEngine::breakpointLocation2(const BreakpointParameters &data)
|
QString GdbEngine::breakpointLocation2(const BreakpointParameters &data)
|
||||||
@@ -2097,7 +2097,7 @@ QString GdbEngine::breakpointLocation2(const BreakpointParameters &data)
|
|||||||
|
|
||||||
const QString fileName = usage == BreakpointUseFullPath
|
const QString fileName = usage == BreakpointUseFullPath
|
||||||
? data.fileName.path() : breakLocation(data.fileName);
|
? data.fileName.path() : breakLocation(data.fileName);
|
||||||
return GdbMi::escapeCString(fileName) + ':' + QString::number(data.lineNumber);
|
return GdbMi::escapeCString(fileName) + ':' + QString::number(data.textPosition.line);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbEngine::handleInsertInterpreterBreakpoint(const DebuggerResponse &response,
|
void GdbEngine::handleInsertInterpreterBreakpoint(const DebuggerResponse &response,
|
||||||
@@ -2236,7 +2236,7 @@ void GdbEngine::handleBreakInsert1(const DebuggerResponse &response, const Break
|
|||||||
// Older version of gdb don't know the -a option to set tracepoints
|
// Older version of gdb don't know the -a option to set tracepoints
|
||||||
// ^error,msg="mi_cmd_break_insert: Unknown option ``a''"
|
// ^error,msg="mi_cmd_break_insert: Unknown option ``a''"
|
||||||
const QString fileName = bp->fileName().toString();
|
const QString fileName = bp->fileName().toString();
|
||||||
const int lineNumber = bp->lineNumber();
|
const int lineNumber = bp->textPosition().line;
|
||||||
DebuggerCommand cmd("trace \"" + GdbMi::escapeCString(fileName) + "\":"
|
DebuggerCommand cmd("trace \"" + GdbMi::escapeCString(fileName) + "\":"
|
||||||
+ QString::number(lineNumber),
|
+ QString::number(lineNumber),
|
||||||
NeedsTemporaryStop);
|
NeedsTemporaryStop);
|
||||||
|
@@ -416,7 +416,7 @@ void LldbEngine::executeRunToLine(const ContextData &data)
|
|||||||
notifyInferiorRunRequested();
|
notifyInferiorRunRequested();
|
||||||
DebuggerCommand cmd("executeRunToLocation");
|
DebuggerCommand cmd("executeRunToLocation");
|
||||||
cmd.arg("file", data.fileName.path());
|
cmd.arg("file", data.fileName.path());
|
||||||
cmd.arg("line", data.lineNumber);
|
cmd.arg("line", data.textPosition.line);
|
||||||
cmd.arg("address", data.address);
|
cmd.arg("address", data.address);
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
}
|
}
|
||||||
@@ -433,7 +433,7 @@ void LldbEngine::executeJumpToLine(const ContextData &data)
|
|||||||
{
|
{
|
||||||
DebuggerCommand cmd("executeJumpToLocation");
|
DebuggerCommand cmd("executeJumpToLocation");
|
||||||
cmd.arg("file", data.fileName.path());
|
cmd.arg("file", data.fileName.path());
|
||||||
cmd.arg("line", data.lineNumber);
|
cmd.arg("line", data.textPosition.line);
|
||||||
cmd.arg("address", data.address);
|
cmd.arg("address", data.address);
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
}
|
}
|
||||||
@@ -561,7 +561,7 @@ void LldbEngine::updateBreakpointData(const Breakpoint &bp, const GdbMi &bkpt, b
|
|||||||
bp->setCondition(fromHex(bkpt["condition"].data()));
|
bp->setCondition(fromHex(bkpt["condition"].data()));
|
||||||
bp->setHitCount(bkpt["hitcount"].toInt());
|
bp->setHitCount(bkpt["hitcount"].toInt());
|
||||||
bp->setFileName(FilePath::fromUserInput(bkpt["file"].data()));
|
bp->setFileName(FilePath::fromUserInput(bkpt["file"].data()));
|
||||||
bp->setLineNumber(bkpt["line"].toInt());
|
bp->setTextPosition({bkpt["line"].toInt(), -1});
|
||||||
|
|
||||||
GdbMi locations = bkpt["locations"];
|
GdbMi locations = bkpt["locations"];
|
||||||
const int numChild = locations.childCount();
|
const int numChild = locations.childCount();
|
||||||
@@ -574,7 +574,7 @@ void LldbEngine::updateBreakpointData(const Breakpoint &bp, const GdbMi &bkpt, b
|
|||||||
loc->params.address = location["addr"].toAddress();
|
loc->params.address = location["addr"].toAddress();
|
||||||
loc->params.functionName = location["function"].data();
|
loc->params.functionName = location["function"].data();
|
||||||
loc->params.fileName = FilePath::fromUserInput(location["file"].data());
|
loc->params.fileName = FilePath::fromUserInput(location["file"].data());
|
||||||
loc->params.lineNumber = location["line"].toInt();
|
loc->params.textPosition.line = location["line"].toInt();
|
||||||
loc->displayName = QString("%1.%2").arg(bp->responseId()).arg(locid);
|
loc->displayName = QString("%1.%2").arg(bp->responseId()).arg(locid);
|
||||||
}
|
}
|
||||||
bp->setPending(false);
|
bp->setPending(false);
|
||||||
|
@@ -220,7 +220,7 @@ void PdbEngine::insertBreakpoint(const Breakpoint &bp)
|
|||||||
if (params.type == BreakpointByFunction)
|
if (params.type == BreakpointByFunction)
|
||||||
loc = params.functionName;
|
loc = params.functionName;
|
||||||
else
|
else
|
||||||
loc = params.fileName.toString() + ':' + QString::number(params.lineNumber);
|
loc = params.fileName.toString() + ':' + QString::number(params.textPosition.line);
|
||||||
|
|
||||||
postDirectCommand("break " + loc);
|
postDirectCommand("break " + loc);
|
||||||
}
|
}
|
||||||
@@ -476,7 +476,7 @@ void PdbEngine::handleOutput2(const QString &data)
|
|||||||
QTC_ASSERT(bp, continue);
|
QTC_ASSERT(bp, continue);
|
||||||
bp->setResponseId(bpnr);
|
bp->setResponseId(bpnr);
|
||||||
bp->setFileName(fileName);
|
bp->setFileName(fileName);
|
||||||
bp->setLineNumber(lineNumber);
|
bp->setTextPosition({lineNumber, -1});
|
||||||
bp->adjustMarker();
|
bp->adjustMarker();
|
||||||
bp->setPending(false);
|
bp->setPending(false);
|
||||||
notifyBreakpointInsertOk(bp);
|
notifyBreakpointInsertOk(bp);
|
||||||
|
@@ -603,10 +603,10 @@ void QmlEngine::executeRunToLine(const ContextData &data)
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
|
QTC_ASSERT(state() == InferiorStopOk, qDebug() << state());
|
||||||
showStatusMessage(Tr::tr("Run to line %1 (%2) requested...")
|
showStatusMessage(Tr::tr("Run to line %1 (%2) requested...")
|
||||||
.arg(data.lineNumber)
|
.arg(data.textPosition.line)
|
||||||
.arg(data.fileName.toString()),
|
.arg(data.fileName.toString()),
|
||||||
5000);
|
5000);
|
||||||
d->setBreakpoint(SCRIPTREGEXP, data.fileName.toString(), true, data.lineNumber);
|
d->setBreakpoint(SCRIPTREGEXP, data.fileName.toString(), true, data.textPosition.line);
|
||||||
clearExceptionSelection();
|
clearExceptionSelection();
|
||||||
d->continueDebugging(Continue);
|
d->continueDebugging(Continue);
|
||||||
|
|
||||||
@@ -658,7 +658,7 @@ void QmlEngine::insertBreakpoint(const Breakpoint &bp)
|
|||||||
|
|
||||||
} else if (requested.type == BreakpointByFileAndLine) {
|
} else if (requested.type == BreakpointByFileAndLine) {
|
||||||
d->setBreakpoint(SCRIPTREGEXP, requested.fileName.toString(),
|
d->setBreakpoint(SCRIPTREGEXP, requested.fileName.toString(),
|
||||||
requested.enabled, requested.lineNumber, 0,
|
requested.enabled, requested.textPosition.line, 0,
|
||||||
requested.condition, requested.ignoreCount);
|
requested.condition, requested.ignoreCount);
|
||||||
|
|
||||||
} else if (requested.type == BreakpointOnQmlSignalEmit) {
|
} else if (requested.type == BreakpointOnQmlSignalEmit) {
|
||||||
@@ -716,7 +716,7 @@ void QmlEngine::updateBreakpoint(const Breakpoint &bp)
|
|||||||
} else {
|
} else {
|
||||||
d->clearBreakpoint(bp);
|
d->clearBreakpoint(bp);
|
||||||
d->setBreakpoint(SCRIPTREGEXP, requested.fileName.toString(),
|
d->setBreakpoint(SCRIPTREGEXP, requested.fileName.toString(),
|
||||||
requested.enabled, requested.lineNumber, 0,
|
requested.enabled, requested.textPosition.line, 0,
|
||||||
requested.condition, requested.ignoreCount);
|
requested.condition, requested.ignoreCount);
|
||||||
d->breakpointsSync.insert(d->sequence, bp);
|
d->breakpointsSync.insert(d->sequence, bp);
|
||||||
}
|
}
|
||||||
@@ -1727,7 +1727,7 @@ void QmlEnginePrivate::messageReceived(const QByteArray &data)
|
|||||||
//The breakpoint requested line should be same as
|
//The breakpoint requested line should be same as
|
||||||
//actual line
|
//actual line
|
||||||
if (bp && bp->state() != BreakpointInserted) {
|
if (bp && bp->state() != BreakpointInserted) {
|
||||||
bp->setLineNumber(line);
|
bp->setTextPosition({line, -1});
|
||||||
bp->setPending(false);
|
bp->setPending(false);
|
||||||
engine->notifyBreakpointInsertOk(bp);
|
engine->notifyBreakpointInsertOk(bp);
|
||||||
}
|
}
|
||||||
@@ -1865,7 +1865,7 @@ void QmlEnginePrivate::messageReceived(const QByteArray &data)
|
|||||||
setBreakpoint(SCRIPTREGEXP,
|
setBreakpoint(SCRIPTREGEXP,
|
||||||
params.fileName.toString(),
|
params.fileName.toString(),
|
||||||
params.enabled,
|
params.enabled,
|
||||||
params.lineNumber,
|
params.textPosition.line,
|
||||||
newColumn,
|
newColumn,
|
||||||
params.condition,
|
params.condition,
|
||||||
params.ignoreCount);
|
params.ignoreCount);
|
||||||
@@ -1889,7 +1889,7 @@ void QmlEnginePrivate::messageReceived(const QByteArray &data)
|
|||||||
bp->setFunctionName(invocationText);
|
bp->setFunctionName(invocationText);
|
||||||
}
|
}
|
||||||
if (bp->state() != BreakpointInserted) {
|
if (bp->state() != BreakpointInserted) {
|
||||||
bp->setLineNumber(breakData.value("sourceLine").toInt() + 1);
|
bp->setTextPosition({breakData.value("sourceLine").toInt() + 1, -1});
|
||||||
bp->setPending(false);
|
bp->setPending(false);
|
||||||
engine->notifyBreakpointInsertOk(bp);
|
engine->notifyBreakpointInsertOk(bp);
|
||||||
}
|
}
|
||||||
|
@@ -315,14 +315,14 @@ ContextData getLocationContext(TextDocument *document, int lineNumber)
|
|||||||
if (ln > 0) {
|
if (ln > 0) {
|
||||||
data.type = LocationByFile;
|
data.type = LocationByFile;
|
||||||
data.fileName = Utils::FilePath::fromString(fileName);
|
data.fileName = Utils::FilePath::fromString(fileName);
|
||||||
data.lineNumber = ln;
|
data.textPosition.line = ln;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
data.type = LocationByFile;
|
data.type = LocationByFile;
|
||||||
data.fileName = document->filePath();
|
data.fileName = document->filePath();
|
||||||
data.lineNumber = lineNumber;
|
data.textPosition.line = lineNumber;
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -381,13 +381,13 @@ static void setValueAnnotationsHelper(BaseTextEditor *textEditor,
|
|||||||
if (!cppDocument) // For non-C++ documents.
|
if (!cppDocument) // For non-C++ documents.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int firstLine = firstRelevantLine(cppDocument, loc.lineNumber(), 1);
|
const int firstLine = firstRelevantLine(cppDocument, loc.textPosition().line, 1);
|
||||||
if (firstLine < 1)
|
if (firstLine < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CPlusPlus::ExpressionUnderCursor expressionUnderCursor(cppDocument->languageFeatures());
|
CPlusPlus::ExpressionUnderCursor expressionUnderCursor(cppDocument->languageFeatures());
|
||||||
QTextCursor tc = widget->textCursor();
|
QTextCursor tc = widget->textCursor();
|
||||||
for (int lineNumber = loc.lineNumber(); lineNumber >= firstLine; --lineNumber) {
|
for (int lineNumber = loc.textPosition().line; lineNumber >= firstLine; --lineNumber) {
|
||||||
const QTextBlock block = textDocument->document()->findBlockByNumber(lineNumber - 1);
|
const QTextBlock block = textDocument->document()->findBlockByNumber(lineNumber - 1);
|
||||||
tc.setPosition(block.position());
|
tc.setPosition(block.position());
|
||||||
for (; !tc.atBlockEnd(); tc.movePosition(QTextCursor::NextCharacter)) {
|
for (; !tc.atBlockEnd(); tc.movePosition(QTextCursor::NextCharacter)) {
|
||||||
|
@@ -359,7 +359,7 @@ void UvscEngine::insertBreakpoint(const Breakpoint &bp)
|
|||||||
// Add file name.
|
// Add file name.
|
||||||
expression += "\\" + requested.fileName.toString();
|
expression += "\\" + requested.fileName.toString();
|
||||||
// Add line number.
|
// Add line number.
|
||||||
expression += "\\" + QString::number(requested.lineNumber);
|
expression += "\\" + QString::number(requested.textPosition.line);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleInsertBreakpoint(expression, bp);
|
handleInsertBreakpoint(expression, bp);
|
||||||
@@ -777,7 +777,7 @@ void UvscEngine::handleInsertBreakpoint(const QString &exp, const Breakpoint &bp
|
|||||||
bp->setPending(false);
|
bp->setPending(false);
|
||||||
bp->setResponseId(QString::number(tickMark));
|
bp->setResponseId(QString::number(tickMark));
|
||||||
bp->setAddress(address);
|
bp->setAddress(address);
|
||||||
bp->setLineNumber(line);
|
bp->setTextPosition(Text::Position{int(line), -1});
|
||||||
bp->setFileName(FilePath::fromString(fileName));
|
bp->setFileName(FilePath::fromString(fileName));
|
||||||
bp->setFunctionName(function);
|
bp->setFunctionName(function);
|
||||||
notifyBreakpointInsertOk(bp);
|
notifyBreakpointInsertOk(bp);
|
||||||
|
Reference in New Issue
Block a user