Commit 727c16a6 authored by hjk's avatar hjk
Browse files

debugger: make adjustments of breakpoint markers on lines without code optional

parent 55fe83c2
......@@ -332,6 +332,20 @@ DebuggerSettings *DebuggerSettings::instance()
item->setSettingsKey(debugModeGroup, QLatin1String("UsePreciseBreakpoints"));
instance->insertItem(UsePreciseBreakpoints, item);
item = new SavedAction(instance);
item->setText(tr("Adjust Breakpoint Locations"));
item->setToolTip(tr("Not all source code lines generate "
"executable code. Putting a breakpoint on such a line acts as "
"if the breakpoint was set on the next line that generated code. "
"Selecting 'Adjust Breakpoint Locations' shifts the red "
"breakpoint markers in such cases to the location of the true "
"breakpoint."));
item->setCheckable(true);
item->setDefaultValue(true);
item->setValue(true);
item->setSettingsKey(debugModeGroup, QLatin1String("AdjustBreakpointLocations"));
instance->insertItem(AdjustBreakpointLocations, item);
item = new SavedAction(instance);
item->setText(tr("Break on \"throw\""));
item->setCheckable(true);
......
......@@ -137,6 +137,7 @@ enum DebuggerActionCode
SynchronizeBreakpoints,
AllPluginBreakpoints,
SelectedPluginBreakpoints,
AdjustBreakpointLocations,
NoPluginBreakpoints,
SelectedPluginBreakpointsPattern,
UsePreciseBreakpoints,
......
......@@ -2579,9 +2579,12 @@ void GdbEngine::attemptBreakpointSynchronization()
if (data->bpAddress && data->bpCorrectedLineNumber == 0) {
// Prevent endless loop.
data->bpCorrectedLineNumber = -1;
postCommand("info line *0x" + QByteArray::number(data->bpAddress, 16),
NeedsStop | RebuildBreakpointModel,
CB(handleInfoLine), data->bpNumber.toInt());
if (theDebuggerBoolSetting(AdjustBreakpointLocations)) {
postCommand(
"info line *0x" + QByteArray::number(data->bpAddress, 16),
NeedsStop | RebuildBreakpointModel,
CB(handleInfoLine), data->bpNumber.toInt());
}
}
}
}
......
......@@ -81,6 +81,8 @@ QWidget *GdbOptionsPage::createPage(QWidget *parent)
m_ui.scriptFileChooser);
m_group.insert(theDebuggerAction(GdbEnvironment),
m_ui.environmentEdit);
m_group.insert(theDebuggerAction(AdjustBreakpointLocations),
m_ui.checkBoxAdjustBreakpointLocations);
m_group.insert(theDebuggerAction(UsePreciseBreakpoints),
m_ui.checkBoxUsePreciseBreakpoints);
m_group.insert(theDebuggerAction(GdbWatchdogTimeout),
......
......@@ -129,6 +129,13 @@ name in different directories.</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxAdjustBreakpointLocations">
<property name="text">
<string>Adjust Breakpoint Locationss</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment