diff --git a/src/vogleditor/vogleditor.cpp b/src/vogleditor/vogleditor.cpp index e67f4b93..44acd78f 100644 --- a/src/vogleditor/vogleditor.cpp +++ b/src/vogleditor/vogleditor.cpp @@ -471,8 +471,9 @@ VoglEditor::Prompt_Result VoglEditor::prompt_generate_trace() #endif QString cmdLine = m_pLaunchTracerDialog->get_command_line(); + QString workingDir = m_pLaunchTracerDialog->get_application_working_dir(); QProcessEnvironment env = m_pLaunchTracerDialog->get_process_environment(); - bool bSuccess = launch_application_to_generate_trace(cmdLine, env); + bool bSuccess = launch_application_to_generate_trace(cmdLine, workingDir, env); QFileInfo fileInfo(m_pLaunchTracerDialog->get_trace_file_path()); if (bSuccess && fileInfo.exists()) { @@ -494,7 +495,7 @@ VoglEditor::Prompt_Result VoglEditor::prompt_generate_trace() return vogleditor_prompt_success; } -bool VoglEditor::launch_application_to_generate_trace(const QString &cmdLine, const QProcessEnvironment &environment) +bool VoglEditor::launch_application_to_generate_trace(const QString &cmdLine, const QString &workingDir, const QProcessEnvironment &environment) { vogleditor_output_message("Tracing application:"); vogleditor_output_message(cmdLine.toStdString().c_str()); @@ -505,6 +506,10 @@ bool VoglEditor::launch_application_to_generate_trace(const QString &cmdLine, co m_pVoglReplayProcess->setProcessEnvironment(environment); bool bCompleted = false; + if (!workingDir.isEmpty()) + { + m_pVoglReplayProcess->setWorkingDirectory(workingDir); + } m_pVoglReplayProcess->start(cmdLine); if (m_pVoglReplayProcess->waitForStarted() == false) { diff --git a/src/vogleditor/vogleditor.h b/src/vogleditor/vogleditor.h index 1c7adc4b..628bca45 100644 --- a/src/vogleditor/vogleditor.h +++ b/src/vogleditor/vogleditor.h @@ -151,7 +151,7 @@ private bool displayBuffer(GLuint64 bufferHandle, bool bBringTabToFront); bool resetApiCallTreeModel(); - bool launch_application_to_generate_trace(const QString &cmdLine, const QProcessEnvironment &environment); + bool launch_application_to_generate_trace(const QString &cmdLine, const QString &workingDir, const QProcessEnvironment &environment); Prompt_Result prompt_load_new_trace(const char *tracefile); diff --git a/src/vogleditor/vogleditor_qlaunchtracerdialog.cpp b/src/vogleditor/vogleditor_qlaunchtracerdialog.cpp index b6381b1f..a9fbfc78 100644 --- a/src/vogleditor/vogleditor_qlaunchtracerdialog.cpp +++ b/src/vogleditor/vogleditor_qlaunchtracerdialog.cpp @@ -152,6 +152,11 @@ QString vogleditor_QLaunchTracerDialog::get_application_to_launch() return ui->applicationLineEdit->text(); } +QString vogleditor_QLaunchTracerDialog::get_application_working_dir() +{ + return ui->workingDirLineEdit->text(); +} + void vogleditor_QLaunchTracerDialog::on_applicationLineEdit_textChanged(const QString &text) { check_inputs(); @@ -162,6 +167,11 @@ void vogleditor_QLaunchTracerDialog::on_traceFileLineEdit_textChanged(const QStr check_inputs(); } +void vogleditor_QLaunchTracerDialog::on_workingDirLineEdit_textChanged(const QString &text) +{ + check_inputs(); +} + void vogleditor_QLaunchTracerDialog::check_inputs() { bool applicationFileEntered = ui->applicationLineEdit->text().size() != 0; @@ -182,6 +192,18 @@ void vogleditor_QLaunchTracerDialog::on_findApplicationButton_clicked() } } +void vogleditor_QLaunchTracerDialog::on_findWorkingDirButton_clicked() +{ + // open file dialog + QString suggestedName = ui->workingDirLineEdit->text(); + QString selectedName = QFileDialog::getExistingDirectory(this, tr("Find Application working directory"), suggestedName); + + if (!selectedName.isEmpty()) + { + ui->workingDirLineEdit->setText(selectedName); + } +} + void vogleditor_QLaunchTracerDialog::on_findTraceFileButton_clicked() { // open file dialog diff --git a/src/vogleditor/vogleditor_qlaunchtracerdialog.h b/src/vogleditor/vogleditor_qlaunchtracerdialog.h index e147e992..de4fd673 100644 --- a/src/vogleditor/vogleditor_qlaunchtracerdialog.h +++ b/src/vogleditor/vogleditor_qlaunchtracerdialog.h @@ -18,6 +18,7 @@ class vogleditor_QLaunchTracerDialog : public QDialog ~vogleditor_QLaunchTracerDialog(); QString get_application_to_launch(); + QString get_application_working_dir(); QString get_command_line(); QProcessEnvironment get_process_environment(); QString get_trace_file_path(); @@ -28,8 +29,12 @@ private void on_traceFileLineEdit_textChanged(const QString &text); + void on_workingDirLineEdit_textChanged(const QString &text); + void on_findApplicationButton_clicked(); + void on_findWorkingDirButton_clicked(); + void on_findTraceFileButton_clicked(); void on_vogltraceCheckBox_clicked(bool checked); diff --git a/src/vogleditor/vogleditor_qlaunchtracerdialog.ui b/src/vogleditor/vogleditor_qlaunchtracerdialog.ui index 753c1277..28708a84 100644 --- a/src/vogleditor/vogleditor_qlaunchtracerdialog.ui +++ b/src/vogleditor/vogleditor_qlaunchtracerdialog.ui @@ -20,36 +20,24 @@ 0 - - + + - + Vogl options: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + - + 0 0 - - - 0 - 0 - - - - - 20 - 16777215 - - - - ... - @@ -71,21 +59,7 @@ - - - - Force debug context - - - - - - - Disable glProgramBinary - - - - + @@ -104,86 +78,72 @@ - - + + - + 0 0 - - Application arguments: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0 + 0 + - - - - - - - 1 - 0 - + + + 20 + 16777215 + - + ... - - + + - <span style="color: red;">*</span>Output trace file: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + - - + + + + + - Vogl options: + Use vogl tool - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + false - - + + - Gather call stacks + Force debug context - - + + - 0 + 1 0 - - - - - - - - Use vogl tool - - - false + - + QFrame::NoFrame @@ -250,6 +210,85 @@ + + + + <span style="color: red;">*</span>Output trace file: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Gather call stacks + + + + + + + + 0 + 0 + + + + Application arguments: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Disable glProgramBinary + + + + + + + Application working dir: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 1 + 0 + + + + + + + + + 0 + 0 + + + + + 20 + 16777215 + + + + ... + + +