Skip to content

Commit 8b4c5fd

Browse files
committed
Changes for UNDO's udb debugger.
1 parent 7411288 commit 8b4c5fd

File tree

4 files changed

+72
-23
lines changed

4 files changed

+72
-23
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ if(${QTVERSION} STREQUAL "QT6")
3232
find_package(Qt6 COMPONENTS REQUIRED PrintSupport)
3333
find_package(Qt6 COMPONENTS REQUIRED Charts)
3434
find_package(Qt6 COMPONENTS REQUIRED Svg)
35+
find_package(Qt6 COMPONENTS REQUIRED OpenGL)
3536

3637
set(CMAKE_CXX_STANDARD 17)
3738
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -279,7 +280,7 @@ add_executable(${PROJECT_NAME} ${SYSTEM_TYPE} ${SOURCE_FILES})
279280
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
280281

281282
if(${QTVERSION} STREQUAL "QT6")
282-
target_link_libraries(${PROJECT_NAME} Qt6::Widgets Qt6::Gui Qt6::Core Qt6::PrintSupport Qt6::Charts Qt6::Svg)
283+
target_link_libraries(${PROJECT_NAME} Qt6::Widgets Qt6::Gui Qt6::Core Qt6::PrintSupport Qt6::Charts Qt6::Svg Qt6::OpenGL)
283284
elseif(${QTVERSION} STREQUAL "QT5")
284285
target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::Gui Qt5::Core Qt5::PrintSupport Qt5::Charts)
285286
endif()

src/SeerGdbWidget.cpp

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -739,10 +739,18 @@ QString SeerGdbWidget::gdbRemoteTargetType () const {
739739

740740
void SeerGdbWidget::setGdbRecordMode(const QString& mode) {
741741

742-
_gdbRecordMode = mode;
742+
if (mode == "auto") {
743+
if (gdbProgram().contains("udb")) {
744+
_gdbRecordMode = "udb";
745+
}else{
746+
_gdbRecordMode = "";
747+
}
748+
}else{
749+
_gdbRecordMode = mode;
750+
}
743751

744-
if (mode != "rr" && mode != "") {
745-
handleGdbCommand("record " + gdbRecordMode());
752+
if (_gdbRecordMode != "rr" && _gdbRecordMode != "udb" && _gdbRecordMode != "") {
753+
handleGdbCommand("record " + _gdbRecordMode);
746754
}
747755

748756
emit recordSettingsChanged();
@@ -1076,7 +1084,7 @@ void SeerGdbWidget::handleGdbRunExecutable (const QString& breakMode, bool loadS
10761084

10771085
setExecutableLaunchMode("run");
10781086
saveLaunchMode();
1079-
setGdbRecordMode("");
1087+
setGdbRecordMode("auto");
10801088
setExecutablePid(0);
10811089

10821090
// Load the executable, if needed.
@@ -1138,9 +1146,9 @@ void SeerGdbWidget::handleGdbRunExecutable (const QString& breakMode, bool loadS
11381146

11391147
// Run the executable.
11401148
if (_executableBreakMode == "inmain") {
1141-
handleGdbCommand("-exec-run --all --start"); // Stop in main
1149+
handleGdbCommand("-exec-run --start"); // Stop in main
11421150
}else{
1143-
handleGdbCommand("-exec-run --all"); // Do not stop in main. But honor other breakpoints that may have been previously set.
1151+
handleGdbCommand("-exec-run"); // Do not stop in main. But honor other breakpoints that may have been previously set.
11441152
}
11451153

11461154
// Set window titles with name of program.
@@ -1207,7 +1215,7 @@ void SeerGdbWidget::handleGdbAttachExecutable (bool loadSessionBreakpoints) {
12071215
// No console for 'attach' mode but make sure it's reattached.
12081216
setExecutableLaunchMode("attach");
12091217
saveLaunchMode();
1210-
setGdbRecordMode("");
1218+
setGdbRecordMode("auto");
12111219
reattachConsole();
12121220

12131221
// Load the executable, if needed.
@@ -1296,7 +1304,7 @@ void SeerGdbWidget::handleGdbConnectExecutable (bool loadSessionBreakpoints) {
12961304
// No console for 'connect' mode but make sure it's reattached.
12971305
setExecutableLaunchMode("connect");
12981306
saveLaunchMode();
1299-
setGdbRecordMode("");
1307+
setGdbRecordMode("auto");
13001308
setExecutablePid(0);
13011309
reattachConsole();
13021310

@@ -1447,9 +1455,9 @@ void SeerGdbWidget::handleGdbRRExecutable (bool loadSessionBreakpoints) {
14471455
// Restart the executable if it was already running.
14481456
if (newExecutableFlag() == false) {
14491457
if (_executableBreakMode == "inmain") {
1450-
handleGdbCommand("-exec-run --all --start"); // Stop in main
1458+
handleGdbCommand("-exec-run --start"); // Stop in main
14511459
}else{
1452-
handleGdbCommand("-exec-run --all"); // Do not stop in main. But honor other breakpoints that may have been previously set.
1460+
handleGdbCommand("-exec-run"); // Do not stop in main. But honor other breakpoints that may have been previously set.
14531461
}
14541462
}
14551463

@@ -1517,7 +1525,7 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {
15171525
// No console for 'core' mode but make sure it's reattached.
15181526
setExecutableLaunchMode("corefile");
15191527
saveLaunchMode();
1520-
setGdbRecordMode("");
1528+
setGdbRecordMode("auto");
15211529
setExecutablePid(0);
15221530
reattachConsole();
15231531

@@ -1703,8 +1711,8 @@ void SeerGdbWidget::handleGdbRecordStart () {
17031711
return;
17041712
}
17051713

1706-
if (executableLaunchMode() == "rr") {
1707-
QMessageBox::warning(this, "Seer", QString("Record 'Start' not available in RR mode."), QMessageBox::Ok);
1714+
if (executableLaunchMode() == "rr" || executableLaunchMode() == "udb") {
1715+
QMessageBox::warning(this, "Seer", QString("Record 'Start' not available in RR or UDB mode."), QMessageBox::Ok);
17081716
return;
17091717
}
17101718

@@ -1718,8 +1726,8 @@ void SeerGdbWidget::handleGdbRecordStop () {
17181726
return;
17191727
}
17201728

1721-
if (executableLaunchMode() == "rr") {
1722-
QMessageBox::warning(this, "Seer", QString("Record 'Stop' not available in RR mode."), QMessageBox::Ok);
1729+
if (executableLaunchMode() == "rr" || executableLaunchMode() == "udb") {
1730+
QMessageBox::warning(this, "Seer", QString("Record 'Stop' not available in RR or UDB mode."), QMessageBox::Ok);
17231731
return;
17241732
}
17251733

@@ -1753,6 +1761,10 @@ void SeerGdbWidget::handleGdbRecordStartStopToggle () {
17531761

17541762
// Don't do anthing.
17551763

1764+
}else if (gdbRecordMode() == "udb") {
1765+
1766+
// Don't do anthing.
1767+
17561768
}else{
17571769

17581770
setGdbRecordMode("stop");

src/SeerMainWindow.cpp

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ void SeerMainWindow::handleRecordSettingsChanged () {
13301330

13311331
// Toolbar
13321332
actionRecordProcess->setText("Record");
1333+
actionRecordProcess->setToolTip("Toggle Record mode.");
13331334
actionRecordProcess->setEnabled(true);
13341335
actionRecordDirection->setEnabled(false);
13351336
actionRecordDirection->setIcon(QIcon(":/seer/resources/RelaxLightIcons/go-next.svg"));
@@ -1363,6 +1364,7 @@ void SeerMainWindow::handleRecordSettingsChanged () {
13631364

13641365
// Toolbar
13651366
actionRecordProcess->setText("Recording");
1367+
actionRecordProcess->setToolTip("Toggle Record mode.");
13661368
actionRecordProcess->setEnabled(true);
13671369
actionRecordDirection->setEnabled(true);
13681370

@@ -1395,11 +1397,45 @@ void SeerMainWindow::handleRecordSettingsChanged () {
13951397

13961398
// Toolbar
13971399
actionRecordProcess->setText("RR");
1400+
actionRecordProcess->setToolTip("Using RR debugger.");
1401+
actionRecordProcess->setEnabled(true);
1402+
actionRecordDirection->setEnabled(true);
1403+
1404+
}else if (gdbWidget->gdbRecordMode() == "udb") {
1405+
1406+
// Menu Control
1407+
actionControlRecordStart->setEnabled(false);
1408+
actionControlRecordStop->setEnabled(false);
1409+
actionControlRecordForward->setEnabled(true);
1410+
actionControlRecordReverse->setEnabled(true);
1411+
1412+
if (gdbWidget->gdbRecordDirection() == "") {
1413+
1414+
actionControlRecordForward->setChecked(true);
1415+
actionRecordDirection->setIcon(QIcon(":/seer/resources/RelaxLightIcons/go-next.svg"));
1416+
1417+
}else if (gdbWidget->gdbRecordDirection() == "--reverse") {
1418+
1419+
actionControlRecordReverse->setChecked(true);
1420+
actionRecordDirection->setIcon(QIcon(":/seer/resources/RelaxLightIcons/go-previous.svg"));
1421+
1422+
}else{
1423+
1424+
actionControlRecordForward->setChecked(false);
1425+
actionControlRecordReverse->setChecked(false);
1426+
actionRecordDirection->setIcon(QIcon(":/seer/resources/RelaxLightIcons/go-next.svg"));
1427+
1428+
qDebug() << "Bad record direction of '" << gdbWidget->gdbRecordDirection() << "'";
1429+
}
1430+
1431+
// Toolbar
1432+
actionRecordProcess->setText("UDB");
1433+
actionRecordProcess->setToolTip("Using UDB debugger.");
13981434
actionRecordProcess->setEnabled(true);
13991435
actionRecordDirection->setEnabled(true);
14001436

14011437
}else{
1402-
qDebug() << "Bad record mode of '" << gdbWidget->gdbRecordMode() << "'";
1438+
qDebug() << "Bad record mode of:" << gdbWidget->gdbRecordMode();
14031439
}
14041440
}
14051441

src/SeerMainWindow.ui

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
</property>
9999
<widget class="QMenu" name="menuRecord">
100100
<property name="toolTip">
101-
<string>Set Gdb Record mode.</string>
101+
<string>Set Record mode.</string>
102102
</property>
103103
<property name="title">
104104
<string>Record</string>
@@ -112,7 +112,7 @@
112112
</widget>
113113
<widget class="QMenu" name="menuDirection">
114114
<property name="toolTip">
115-
<string>Set Gdb Playback direction.</string>
115+
<string>Set Playback direction.</string>
116116
</property>
117117
<property name="title">
118118
<string>Direction</string>
@@ -529,7 +529,7 @@
529529
<string>Stop</string>
530530
</property>
531531
<property name="toolTip">
532-
<string>Stop Gdb Record mode.</string>
532+
<string>Stop Record mode.</string>
533533
</property>
534534
</action>
535535
<action name="actionControlRecordReverse">
@@ -556,7 +556,7 @@
556556
<string>Record</string>
557557
</property>
558558
<property name="toolTip">
559-
<string>Toggle Gdb Record mode.</string>
559+
<string>Toggle Record mode.</string>
560560
</property>
561561
</action>
562562
<action name="actionControlRecordStart">
@@ -568,7 +568,7 @@
568568
<string>Start</string>
569569
</property>
570570
<property name="toolTip">
571-
<string>Start Gdb Record mode.</string>
571+
<string>Start Record mode.</string>
572572
</property>
573573
</action>
574574
<action name="actionControlRecordForward">
@@ -595,7 +595,7 @@
595595
<string>Direction</string>
596596
</property>
597597
<property name="toolTip">
598-
<string>Toggle Gdb Playback direction.</string>
598+
<string>Toggle Playback direction.</string>
599599
</property>
600600
</action>
601601
<action name="actionViewImageVisualizer">

0 commit comments

Comments
 (0)