mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
Finished with this task. Still doesn't fix RR, though.
This commit is contained in:
+42
-14
@@ -111,7 +111,8 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
|
||||
logsTabWidget->addTab(_seerOutputLog, "Seer output");
|
||||
logsTabWidget->setCurrentIndex(0);
|
||||
|
||||
// Create the console.
|
||||
// Create the console tab.
|
||||
// Each RUN method will create and connect to the console's terminal.
|
||||
createConsole();
|
||||
|
||||
// Create editor options bar.
|
||||
@@ -1059,15 +1060,19 @@ void SeerGdbWidget::handleGdbRunExecutable (const QString& breakMode, bool loadS
|
||||
// This causes a new gdb each time. The same console, though.
|
||||
setNewExecutableFlag(true);
|
||||
|
||||
// Disconnect from the console and delete the old gdb if there is a new executable.
|
||||
// Delete the old gdb if there is a new executable.
|
||||
if (newExecutableFlag() == true) {
|
||||
console()->deleteTerminal();
|
||||
killGdb();
|
||||
}
|
||||
|
||||
// If gdb isn't running, start it.
|
||||
if (isGdbRuning() == false) {
|
||||
|
||||
// Connect the terminal to the console.
|
||||
console()->resetTerminal();
|
||||
console()->connectTerminal();
|
||||
|
||||
// Start gdb.
|
||||
bool f = startGdb();
|
||||
if (f == false) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Can't start gdb."));
|
||||
@@ -1090,8 +1095,6 @@ void SeerGdbWidget::handleGdbRunExecutable (const QString& breakMode, bool loadS
|
||||
}
|
||||
|
||||
// Set the program's tty device for stdin and stdout.
|
||||
console()->createTerminal();
|
||||
console()->connectTerminal();
|
||||
handleGdbTerminalDeviceName();
|
||||
|
||||
setExecutableLaunchMode("run");
|
||||
@@ -1200,9 +1203,8 @@ void SeerGdbWidget::handleGdbAttachExecutable (bool loadSessionBreakpoints) {
|
||||
// This causes a new gdb each time. The same console, though.
|
||||
setNewExecutableFlag(true);
|
||||
|
||||
// Disconnect from the console and delete the old gdb if there is a new executable.
|
||||
// Delete the old gdb if there is a new executable.
|
||||
if (newExecutableFlag() == true) {
|
||||
console()->deleteTerminal();
|
||||
killGdb();
|
||||
}
|
||||
|
||||
@@ -1210,6 +1212,11 @@ void SeerGdbWidget::handleGdbAttachExecutable (bool loadSessionBreakpoints) {
|
||||
// No need to connect to the console in this mode.
|
||||
if (isGdbRuning() == false) {
|
||||
|
||||
// Connect the terminal to the console.
|
||||
console()->resetTerminal();
|
||||
console()->connectTerminal();
|
||||
|
||||
// Start gdb.
|
||||
bool f = startGdb();
|
||||
if (f == false) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Can't start gdb."));
|
||||
@@ -1224,6 +1231,10 @@ void SeerGdbWidget::handleGdbAttachExecutable (bool loadSessionBreakpoints) {
|
||||
handleGdbSourceScripts();
|
||||
}
|
||||
|
||||
// Set the program's tty device for stdin and stdout.
|
||||
// Not really needed for 'attach' mode, but do it anyway.
|
||||
handleGdbTerminalDeviceName();
|
||||
|
||||
// No console for 'attach' mode but make sure it's reattached.
|
||||
setExecutableLaunchMode("attach");
|
||||
saveLaunchMode();
|
||||
@@ -1295,14 +1306,17 @@ void SeerGdbWidget::handleGdbConnectExecutable (bool loadSessionBreakpoints) {
|
||||
|
||||
// Disconnect from the terminal and delete the old gdb if there is a new executable.
|
||||
if (newExecutableFlag() == true) {
|
||||
console()->deleteTerminal();
|
||||
killGdb();
|
||||
}
|
||||
|
||||
// If gdb isn't running, start it.
|
||||
// No need to connect to the console in this mode.
|
||||
if (isGdbRuning() == false) {
|
||||
|
||||
// Connect the terminal to the console.
|
||||
console()->resetTerminal();
|
||||
console()->connectTerminal();
|
||||
|
||||
// Start gdb.
|
||||
bool f = startGdb();
|
||||
if (f == false) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Can't start gdb."));
|
||||
@@ -1313,6 +1327,10 @@ void SeerGdbWidget::handleGdbConnectExecutable (bool loadSessionBreakpoints) {
|
||||
handleGdbSourceScripts();
|
||||
}
|
||||
|
||||
// Set the program's tty device for stdin and stdout.
|
||||
// Not really needed for 'connect' mode, but do it anyway.
|
||||
handleGdbTerminalDeviceName();
|
||||
|
||||
// No console for 'connect' mode but make sure it's reattached.
|
||||
setExecutableLaunchMode("connect");
|
||||
saveLaunchMode();
|
||||
@@ -1402,13 +1420,17 @@ void SeerGdbWidget::handleGdbRRExecutable (bool loadSessionBreakpoints) {
|
||||
|
||||
// Disconnect from the console and delete the old gdb, then reconnect.
|
||||
if (newExecutableFlag() == true) {
|
||||
console()->deleteTerminal();
|
||||
killGdb();
|
||||
}
|
||||
|
||||
// If gdb isn't running, start it.
|
||||
if (isGdbRuning() == false) {
|
||||
|
||||
// Connect the terminal to the console.
|
||||
console()->resetTerminal();
|
||||
console()->connectTerminal();
|
||||
|
||||
// Start gdb.
|
||||
bool f = startGdbRR();
|
||||
if (f == false) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Can't start gdb."));
|
||||
@@ -1417,8 +1439,6 @@ void SeerGdbWidget::handleGdbRRExecutable (bool loadSessionBreakpoints) {
|
||||
}
|
||||
|
||||
// Set the program's tty device for stdin and stdout.
|
||||
console()->createTerminal();
|
||||
console()->connectTerminal();
|
||||
handleGdbTerminalDeviceName();
|
||||
|
||||
// Set the launch mode.
|
||||
@@ -1512,7 +1532,6 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {
|
||||
|
||||
// Disconnect from the console and delete the old gdb. No need to reconnect.
|
||||
if (newExecutableFlag() == true) {
|
||||
console()->deleteTerminal();
|
||||
killGdb();
|
||||
}
|
||||
|
||||
@@ -1520,6 +1539,11 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {
|
||||
// No need to connect to the console in this mode.
|
||||
if (isGdbRuning() == false) {
|
||||
|
||||
// Connect the terminal to the console.
|
||||
console()->resetTerminal();
|
||||
console()->connectTerminal();
|
||||
|
||||
// Start gdb.
|
||||
bool f = startGdb();
|
||||
if (f == false) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Can't start gdb."));
|
||||
@@ -1534,6 +1558,10 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {
|
||||
handleGdbSourceScripts();
|
||||
}
|
||||
|
||||
// Set the program's tty device for stdin and stdout.
|
||||
// Not really needed for 'core' mode, but do it anyway.
|
||||
handleGdbTerminalDeviceName();
|
||||
|
||||
// No console for 'core' mode but make sure it's reattached.
|
||||
setExecutableLaunchMode("corefile");
|
||||
saveLaunchMode();
|
||||
@@ -1561,7 +1589,7 @@ void SeerGdbWidget::handleGdbCoreFileExecutable () {
|
||||
// Run any 'post' commands after program is loaded.
|
||||
handleGdbExecutablePostCommands();
|
||||
|
||||
// This is needed for code mode to refresh the stack frame, for some reason.
|
||||
// This is needed for 'core' mode to refresh the stack frame, for some reason.
|
||||
handleGdbStackListFrames();
|
||||
|
||||
// Set window titles with name of program.
|
||||
|
||||
@@ -9,6 +9,7 @@ Record a RR session.
|
||||
Or...
|
||||
|
||||
$ rr record -n --output-trace-dir=/path/to/rr/trace-directory hellorr arg1 arg2
|
||||
$ rr record -n --output-trace-dir=`pwd`/rr hellorr one two three
|
||||
|
||||
|
||||
Replay the RR session in Seer.
|
||||
|
||||
Reference in New Issue
Block a user