Finished with this task. Still doesn't fix RR, though. · epasveer/seer@39f8f9e (original) (raw)

`@@ -111,7 +111,8 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {

`

111

111

` logsTabWidget->addTab(_seerOutputLog, "Seer output");

`

112

112

` logsTabWidget->setCurrentIndex(0);

`

113

113

``

114

``

`-

// Create the console.

`

``

114

`+

// Create the console tab.

`

``

115

`+

// Each RUN method will create and connect to the console's terminal.

`

115

116

`createConsole();

`

116

117

``

117

118

`// Create editor options bar.

`

`@@ -1059,15 +1060,19 @@ void SeerGdbWidget::handleGdbRunExecutable (const QString& breakMode, bool loadS

`

1059

1060

`// This causes a new gdb each time. The same console, though.

`

1060

1061

`setNewExecutableFlag(true);

`

1061

1062

``

1062

``

`-

// Disconnect from the console and delete the old gdb if there is a new executable.

`

``

1063

`+

// Delete the old gdb if there is a new executable.

`

1063

1064

`if (newExecutableFlag() == true) {

`

1064

``

`-

console()->deleteTerminal();

`

1065

1065

`killGdb();

`

1066

1066

` }

`

1067

1067

``

1068

1068

`// If gdb isn't running, start it.

`

1069

1069

`if (isGdbRuning() == false) {

`

1070

1070

``

``

1071

`+

// Connect the terminal to the console.

`

``

1072

`+

console()->resetTerminal();

`

``

1073

`+

console()->connectTerminal();

`

``

1074

+

``

1075

`+

// Start gdb.

`

1071

1076

`bool f = startGdb();

`

1072

1077

`if (f == false) {

`

1073

1078

`QMessageBox::critical(this, tr("Error"), tr("Can't start gdb."));

`

`@@ -1090,8 +1095,6 @@ void SeerGdbWidget::handleGdbRunExecutable (const QString& breakMode, bool loadS

`

1090

1095

` }

`

1091

1096

``

1092

1097

`// Set the program's tty device for stdin and stdout.

`

1093

``

`-

console()->createTerminal();

`

1094

``

`-

console()->connectTerminal();

`

1095

1098

`handleGdbTerminalDeviceName();

`

1096

1099

``

1097

1100

`setExecutableLaunchMode("run");

`

`@@ -1200,16 +1203,20 @@ void SeerGdbWidget::handleGdbAttachExecutable (bool loadSessionBreakpoints) {

`

1200

1203

`// This causes a new gdb each time. The same console, though.

`

1201

1204

`setNewExecutableFlag(true);

`

1202

1205

``

1203

``

`-

// Disconnect from the console and delete the old gdb if there is a new executable.

`

``

1206

`+

// Delete the old gdb if there is a new executable.

`

1204

1207

`if (newExecutableFlag() == true) {

`

1205

``

`-

console()->deleteTerminal();

`

1206

1208

`killGdb();

`

1207

1209

` }

`

1208

1210

``

1209

1211

`// If gdb isn't running, start it.

`

1210

1212

`// No need to connect to the console in this mode.

`

1211

1213

`if (isGdbRuning() == false) {

`

1212

1214

``

``

1215

`+

// Connect the terminal to the console.

`

``

1216

`+

console()->resetTerminal();

`

``

1217

`+

console()->connectTerminal();

`

``

1218

+

``

1219

`+

// Start gdb.

`

1213

1220

`bool f = startGdb();

`

1214

1221

`if (f == false) {

`

1215

1222

`QMessageBox::critical(this, tr("Error"), tr("Can't start gdb."));

`

`@@ -1224,6 +1231,10 @@ void SeerGdbWidget::handleGdbAttachExecutable (bool loadSessionBreakpoints) {

`

1224

1231

`handleGdbSourceScripts();

`

1225

1232

` }

`

1226

1233

``

``

1234

`+

// Set the program's tty device for stdin and stdout.

`

``

1235

`+

// Not really needed for 'attach' mode, but do it anyway.

`

``

1236

`+

handleGdbTerminalDeviceName();

`

``

1237

+

1227

1238

`// No console for 'attach' mode but make sure it's reattached.

`

1228

1239

`setExecutableLaunchMode("attach");

`

1229

1240

`saveLaunchMode();

`

`@@ -1295,14 +1306,17 @@ void SeerGdbWidget::handleGdbConnectExecutable (bool loadSessionBreakpoints) {

`

1295

1306

``

1296

1307

`// Disconnect from the terminal and delete the old gdb if there is a new executable.

`

1297

1308

`if (newExecutableFlag() == true) {

`

1298

``

`-

console()->deleteTerminal();

`

1299

1309

`killGdb();

`

1300

1310

` }

`

1301

1311

``

1302

1312

`// If gdb isn't running, start it.

`

1303

``

`-

// No need to connect to the console in this mode.

`

1304

1313

`if (isGdbRuning() == false) {

`

1305

1314

``

``

1315

`+

// Connect the terminal to the console.

`

``

1316

`+

console()->resetTerminal();

`

``

1317

`+

console()->connectTerminal();

`

``

1318

+

``

1319

`+

// Start gdb.

`

1306

1320

`bool f = startGdb();

`

1307

1321

`if (f == false) {

`

1308

1322

`QMessageBox::critical(this, tr("Error"), tr("Can't start gdb."));

`

`@@ -1313,6 +1327,10 @@ void SeerGdbWidget::handleGdbConnectExecutable (bool loadSessionBreakpoints) {

`

1313

1327

`handleGdbSourceScripts();

`

1314

1328

` }

`

1315

1329

``

``

1330

`+

// Set the program's tty device for stdin and stdout.

`

``

1331

`+

// Not really needed for 'connect' mode, but do it anyway.

`

``

1332

`+

handleGdbTerminalDeviceName();

`

``

1333

+

1316

1334

`// No console for 'connect' mode but make sure it's reattached.

`

1317

1335

`setExecutableLaunchMode("connect");

`

1318

1336

`saveLaunchMode();

`

`@@ -1327,7 +1345,7 @@ void SeerGdbWidget::handleGdbConnectExecutable (bool loadSessionBreakpoints) {

`

1327

1345

` }else{

`

1328

1346

`handleGdbCommand("-gdb-set debug remote 0");

`

1329

1347

` }

`

1330

``

`-

handleGdbExecutablePreCommands(); // Run any 'pre' commands before program is loaded.

`

``

1348

`+

handleGdbExecutablePreCommands(); // Run any 'pre' commands before program is loaded.

`

1331

1349

` }

`

1332

1350

``

1333

1351

`// Connect to the remote gdbserver using the proper remote type.

`

`@@ -1402,13 +1420,17 @@ void SeerGdbWidget::handleGdbRRExecutable (bool loadSessionBreakpoints) {

`

1402

1420

``

1403

1421

`// Disconnect from the console and delete the old gdb, then reconnect.

`

1404

1422

`if (newExecutableFlag() == true) {

`

1405

``

`-

console()->deleteTerminal();

`

1406

1423

`killGdb();

`

1407

1424

` }

`

1408

1425

``

1409

1426

`// If gdb isn't running, start it.

`

1410

1427

`if (isGdbRuning() == false) {

`

1411

1428

``

``

1429

`+

// Connect the terminal to the console.

`

``

1430

`+

console()->resetTerminal();

`

``

1431

`+

console()->connectTerminal();

`

``

1432

+

``

1433

`+

// Start gdb.

`

1412

1434

`bool f = startGdbRR();

`

1413

1435

`if (f == false) {

`

1414

1436

`QMessageBox::critical(this, tr("Error"), tr("Can't start gdb."));

`

`@@ -1417,8 +1439,6 @@ void SeerGdbWidget::handleGdbRRExecutable (bool loadSessionBreakpoints) {

`

1417

1439

` }

`

1418

1440

``

1419

1441

`// Set the program's tty device for stdin and stdout.

`

1420

``

`-

console()->createTerminal();

`

1421

``

`-

console()->connectTerminal();

`

1422

1442

`handleGdbTerminalDeviceName();

`

1423

1443

``

1424

1444

`// Set the launch mode.

`

`@@ -1512,14 +1532,18 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {

`

1512

1532

``

1513

1533

`// Disconnect from the console and delete the old gdb. No need to reconnect.

`

1514

1534

`if (newExecutableFlag() == true) {

`

1515

``

`-

console()->deleteTerminal();

`

1516

1535

`killGdb();

`

1517

1536

` }

`

1518

1537

``

1519

1538

`// If gdb isn't running, start it.

`

1520

1539

`// No need to connect to the console in this mode.

`

1521

1540

`if (isGdbRuning() == false) {

`

1522

1541

``

``

1542

`+

// Connect the terminal to the console.

`

``

1543

`+

console()->resetTerminal();

`

``

1544

`+

console()->connectTerminal();

`

``

1545

+

``

1546

`+

// Start gdb.

`

1523

1547

`bool f = startGdb();

`

1524

1548

`if (f == false) {

`

1525

1549

`QMessageBox::critical(this, tr("Error"), tr("Can't start gdb."));

`

`@@ -1534,6 +1558,10 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {

`

1534

1558

`handleGdbSourceScripts();

`

1535

1559

` }

`

1536

1560

``

``

1561

`+

// Set the program's tty device for stdin and stdout.

`

``

1562

`+

// Not really needed for 'core' mode, but do it anyway.

`

``

1563

`+

handleGdbTerminalDeviceName();

`

``

1564

+

1537

1565

`// No console for 'core' mode but make sure it's reattached.

`

1538

1566

`setExecutableLaunchMode("corefile");

`

1539

1567

`saveLaunchMode();

`

`@@ -1561,7 +1589,7 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {

`

1561

1589

`// Run any 'post' commands after program is loaded.

`

1562

1590

`handleGdbExecutablePostCommands();

`

1563

1591

``

1564

``

`-

// This is needed for code mode to refresh the stack frame, for some reason.

`

``

1592

`+

// This is needed for 'core' mode to refresh the stack frame, for some reason.

`

1565

1593

`handleGdbStackListFrames();

`

1566

1594

``

1567

1595

`// Set window titles with name of program.

`

`@@ -2100,7 +2128,7 @@ void SeerGdbWidget::handleGdbTerminalDeviceName () {

`

2100

2128

``

2101

2129

`if (_consoleWidget->terminalDeviceName() != "") {

`

2102

2130

``

2103

``

`-

handleGdbCommand(QString("-inferior-tty-set ") + _consoleWidget->terminalDeviceName());

`

``

2131

`+

handleGdbCommand(QString("-inferior-tty-set ") + _consoleWidget->terminalDeviceName());

`

2104

2132

``

2105

2133

` }else{

`

2106

2134

`qWarning() << "Can't set TTY name because the name is blank.";

`