- enhancement: Refine suggestion info when try debug and the compiler settings are not correct.
- enhancement: Open the options dialog/project options dialog when user want to correct compiler settings for debug.
This commit is contained in:
parent
08124282da
commit
799ce52460
2
NEWS.md
2
NEWS.md
|
@ -5,6 +5,8 @@ Red Panda C++ Version 2.20
|
||||||
- fix: File/Project visit histories are not correctly saved when clearing.
|
- fix: File/Project visit histories are not correctly saved when clearing.
|
||||||
- change: Default max function frame size is 2MB under windows / 8MB others.
|
- change: Default max function frame size is 2MB under windows / 8MB others.
|
||||||
- fix: Octal numeric escape sequences is not correctly syntax highlighted.
|
- fix: Octal numeric escape sequences is not correctly syntax highlighted.
|
||||||
|
- enhancement: Refine suggestion info when try debug and the compiler settings are not correct.
|
||||||
|
- enhancement: Open the options dialog/project options dialog when user want to correct compiler settings for debug.
|
||||||
|
|
||||||
Red Panda C++ Version 2.19
|
Red Panda C++ Version 2.19
|
||||||
|
|
||||||
|
|
|
@ -1625,6 +1625,20 @@ void MainWindow::changeOptions(const QString &widgetName, const QString &groupNa
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::changeProjectOptions(const QString &widgetName, const QString &groupName)
|
||||||
|
{
|
||||||
|
if (!mProject)
|
||||||
|
return;
|
||||||
|
// int oldCompilerSet = mProject->options().compilerSet;
|
||||||
|
QString oldName = mProject->name();
|
||||||
|
PSettingsDialog dialog = SettingsDialog::projectOptionDialog();
|
||||||
|
if (!groupName.isEmpty()) {
|
||||||
|
dialog->setCurrentWidget(widgetName, groupName);
|
||||||
|
}
|
||||||
|
dialog->exec();
|
||||||
|
updateCompilerSet();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::updateCompilerSet()
|
void MainWindow::updateCompilerSet()
|
||||||
{
|
{
|
||||||
updateCompilerSet(mEditorList->getEditor());
|
updateCompilerSet(mEditorList->getEditor());
|
||||||
|
@ -2169,30 +2183,26 @@ void MainWindow::debug()
|
||||||
// Check if we enabled proper options
|
// Check if we enabled proper options
|
||||||
debugEnabled = mProject->getCompileOption(CC_CMD_OPT_DEBUG_INFO) == COMPILER_OPTION_ON;
|
debugEnabled = mProject->getCompileOption(CC_CMD_OPT_DEBUG_INFO) == COMPILER_OPTION_ON;
|
||||||
stripEnabled = mProject->getCompileOption(LINK_CMD_OPT_STRIP_EXE) == COMPILER_OPTION_ON;
|
stripEnabled = mProject->getCompileOption(LINK_CMD_OPT_STRIP_EXE) == COMPILER_OPTION_ON;
|
||||||
if (stripEnabled) {
|
if (stripEnabled && !debugEnabled) {
|
||||||
QMessageBox::critical(this,
|
|
||||||
tr("Can't Debug"),
|
|
||||||
tr("Your compiler set's \"Strip executable (-s)\" options is turnned on")
|
|
||||||
+"<BR /><BR />"
|
|
||||||
+tr("The generated executable doesn't have symbol table, and can't be debugged.")
|
|
||||||
+"<BR /><BR />"
|
|
||||||
+tr("Please correct it, recompile and retry debug.")
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Ask the user if he wants to enable debugging...
|
|
||||||
if (compilerSet->name().endsWith("Debug") && !debugEnabled) {
|
|
||||||
if (QMessageBox::question(this,
|
if (QMessageBox::question(this,
|
||||||
tr("Correct compiler setting"),
|
tr("Correct compile settings for debug"),
|
||||||
tr("You are using a Debug compiler set with wrong compile/link settings: ")
|
tr("The generated executable won't have debug symbol infos, and can't be debugged.")
|
||||||
+"<BR /><BR />"
|
+"<BR /><BR />"
|
||||||
+tr(" - \"Generate debug info (-g3)\" should be turned on")
|
+tr("If you are using the Release compiler set, please use choose the Debug version from toolbar.")
|
||||||
+"<BR /><BR />"
|
+"<BR /><BR />"
|
||||||
+tr("Do you want to correct it now?")
|
+tr("Or you can manually change the following settings in the options dialog's compiler set page:")
|
||||||
|
+"<BR />"
|
||||||
|
+tr(" - Turned on the \"Generate debug info (-g3)\" option.")
|
||||||
|
+"<BR />"
|
||||||
|
+tr(" - Turned off the \"Strip executable (-s)\" option.")
|
||||||
|
+"<BR />"
|
||||||
|
+tr(" - Turned off the \"Optimization level (-O)\" option or set it to \"Debug (-Og)\".")
|
||||||
|
+"<BR /><BR />"
|
||||||
|
+tr("Do you want to mannually change the compiler set settings now?")
|
||||||
)== QMessageBox::Yes) {
|
)== QMessageBox::Yes) {
|
||||||
changeOptions(
|
changeProjectOptions(
|
||||||
SettingsDialog::tr("Compiler Set"),
|
SettingsDialog::tr("Compiler Set"),
|
||||||
SettingsDialog::tr("Compiler")
|
SettingsDialog::tr("Project")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -2286,28 +2296,22 @@ void MainWindow::debug()
|
||||||
// Check if we enabled proper options
|
// Check if we enabled proper options
|
||||||
debugEnabled = compilerSet->getCompileOptionValue(CC_CMD_OPT_DEBUG_INFO) == COMPILER_OPTION_ON;
|
debugEnabled = compilerSet->getCompileOptionValue(CC_CMD_OPT_DEBUG_INFO) == COMPILER_OPTION_ON;
|
||||||
stripEnabled = compilerSet->getCompileOptionValue(LINK_CMD_OPT_STRIP_EXE) == COMPILER_OPTION_ON;
|
stripEnabled = compilerSet->getCompileOptionValue(LINK_CMD_OPT_STRIP_EXE) == COMPILER_OPTION_ON;
|
||||||
if (stripEnabled) {
|
if (stripEnabled && !debugEnabled) {
|
||||||
QMessageBox::critical(this,
|
|
||||||
tr("Can't Debug"),
|
|
||||||
tr("Your compiler set's \"Strip executable (-s)\" options is turnned on")
|
|
||||||
+"<BR /><BR />"
|
|
||||||
+tr("The generated executable doesn't have symbol table, and can't be debugged.")
|
|
||||||
+"<BR /><BR />"
|
|
||||||
+tr("Please correct it, recompile and retry debug.")
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Ask the user if he wants to enable debugging...
|
|
||||||
if (compilerSet->name().endsWith("Debug") && !debugEnabled) {
|
|
||||||
if (QMessageBox::question(this,
|
if (QMessageBox::question(this,
|
||||||
tr("Enable debugging"),
|
tr("Correct compile settings for debug"),
|
||||||
tr("You are using a Debug compiler set with wrong compile/link settings: ")
|
tr("The generated executable won't have debug symbol infos, and can't be debugged.")
|
||||||
+"<BR /><BR />"
|
+"<BR /><BR />"
|
||||||
+tr(" - \"Generate debug info (-g3)\" should be turned on")
|
+tr("If you are using the Release compiler set, please use choose the Debug version from toolbar.")
|
||||||
+"<BR /><BR />"
|
+"<BR /><BR />"
|
||||||
+tr(" - \"Strip executable (-s)\" should be turned off")
|
+tr("Or you can manually change the following settings in the options dialog's compiler set page:")
|
||||||
|
+"<BR />"
|
||||||
|
+tr(" - Turned on the \"Generate debug info (-g3)\" option.")
|
||||||
|
+"<BR />"
|
||||||
|
+tr(" - Turned off the \"Strip executable (-s)\" option.")
|
||||||
|
+"<BR />"
|
||||||
|
+tr(" - Turned off the \"Optimization level (-O)\" option or set it to \"Debug (-Og)\".")
|
||||||
+"<BR /><BR />"
|
+"<BR /><BR />"
|
||||||
+tr("Do you want to correct it now?")
|
+tr("Do you want to mannually change the compiler set settings now?")
|
||||||
)== QMessageBox::Yes) {
|
)== QMessageBox::Yes) {
|
||||||
changeOptions(
|
changeOptions(
|
||||||
SettingsDialog::tr("Compiler Set"),
|
SettingsDialog::tr("Compiler Set"),
|
||||||
|
@ -5031,12 +5035,35 @@ void MainWindow::enableDebugActions()
|
||||||
void MainWindow::stopDebugForNoSymbolTable()
|
void MainWindow::stopDebugForNoSymbolTable()
|
||||||
{
|
{
|
||||||
mDebugger->stop();
|
mDebugger->stop();
|
||||||
QMessageBox::critical(this,
|
if (QMessageBox::question(this,
|
||||||
tr("Debug Failed"),
|
tr("Correct compile settings for debug"),
|
||||||
tr("The executable doesn't have symbol table, and can't be debugged.")
|
tr("The executable doesn't have symbol table, and can't be debugged.")
|
||||||
+"<BR /><BR />"
|
+"<BR /><BR />"
|
||||||
+tr("Please turn off your compiler set's \"Strip executable (-s)\" option, recompile and retry debug.")
|
+tr("If you are using the Release compiler set, please use choose the Debug version from toolbar.")
|
||||||
|
+"<BR /><BR />"
|
||||||
|
+tr("Or you can manually change the following settings in the options dialog's compiler set page:")
|
||||||
|
+"<BR />"
|
||||||
|
+tr(" - Turned on the \"Generate debug info (-g3)\" option.")
|
||||||
|
+"<BR />"
|
||||||
|
+tr(" - Turned off the \"Strip executable (-s)\" option.")
|
||||||
|
+"<BR />"
|
||||||
|
+tr(" - Turned off the \"Optimization level (-O)\" option or set it to \"Debug (-Og)\".")
|
||||||
|
+"<BR /><BR />"
|
||||||
|
+tr("Do you want to mannually change the compiler set settings now?")
|
||||||
|
)== QMessageBox::Yes) {
|
||||||
|
Editor * editor = mEditorList->getEditor();
|
||||||
|
if (editor && editor->inProject()) {
|
||||||
|
changeProjectOptions(
|
||||||
|
SettingsDialog::tr("Compiler Set"),
|
||||||
|
SettingsDialog::tr("Project")
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
changeOptions(
|
||||||
|
SettingsDialog::tr("Compiler Set"),
|
||||||
|
SettingsDialog::tr("Compiler")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onTodoParsingFile(const QString& filename)
|
void MainWindow::onTodoParsingFile(const QString& filename)
|
||||||
|
|
|
@ -224,6 +224,7 @@ public:
|
||||||
Editor* openFile(const QString& filename, bool activate=true, QTabWidget* page=nullptr);
|
Editor* openFile(const QString& filename, bool activate=true, QTabWidget* page=nullptr);
|
||||||
void openProject(const QString& filename, bool openFiles = true);
|
void openProject(const QString& filename, bool openFiles = true);
|
||||||
void changeOptions(const QString& widgetName=QString(), const QString& groupName=QString());
|
void changeOptions(const QString& widgetName=QString(), const QString& groupName=QString());
|
||||||
|
void changeProjectOptions(const QString& widgetName=QString(), const QString& groupName=QString());
|
||||||
|
|
||||||
bool openningFiles() const;
|
bool openningFiles() const;
|
||||||
|
|
||||||
|
|
|
@ -4241,7 +4241,7 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>Enable debugging</source>
|
<source>Enable debugging</source>
|
||||||
<translation>Habilitar depuração</translation>
|
<translation type="vanished">Habilitar depuração</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>You have not enabled debugging info (-g3) and/or stripped it from the executable (-s) in Compiler Options.<BR /><BR />Do you want to correct this now?</source>
|
<source>You have not enabled debugging info (-g3) and/or stripped it from the executable (-s) in Compiler Options.<BR /><BR />Do you want to correct this now?</source>
|
||||||
|
@ -5079,54 +5079,10 @@
|
||||||
<source>GNU Assembler Manual</source>
|
<source>GNU Assembler Manual</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Correct compiler setting</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>You are using a Debug compiler set with wrong compile/link settings: </source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source> - "Generate debug info (-g3)" should be turned on</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source> - "Strip executable (-s)" should be turned off</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Do you want to correct it now?</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Can't Debug</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Your compiler set's "Strip executable (-s)" options is turnned on</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Please correct it, recompile and retry debug.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The generated executable doesn't have symbol table, and can't be debugged.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Debug Failed</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>The executable doesn't have symbol table, and can't be debugged.</source>
|
<source>The executable doesn't have symbol table, and can't be debugged.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Please turn off your compiler set's "Strip executable (-s)" option, recompile and retry debug.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>x86 Assembly Language Reference Manual</source>
|
<source>x86 Assembly Language Reference Manual</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -5203,6 +5159,38 @@
|
||||||
<source>Ctrl+K, Ctrl+S</source>
|
<source>Ctrl+K, Ctrl+S</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Correct compile settings for debug</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>The generated executable won't have debug symbol infos, and can't be debugged.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Or you can manually change the following settings in the options dialog's compiler set page:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source> - Turned on the "Generate debug info (-g3)" option.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source> - Turned off the "Strip executable (-s)" option.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source> - Turned off the "Optimization level (-O)" option or set it to "Debug (-Og)".</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>If you are using the Release compiler set, please use choose the Debug version from toolbar.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Do you want to mannually change the compiler set settings now?</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MemoryModel</name>
|
<name>MemoryModel</name>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -4004,10 +4004,6 @@
|
||||||
<source>Can't start debugging.</source>
|
<source>Can't start debugging.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Enable debugging</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Host applcation missing</source>
|
<source>Host applcation missing</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -4808,54 +4804,10 @@
|
||||||
<source>GNU Assembler Manual</source>
|
<source>GNU Assembler Manual</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Correct compiler setting</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>You are using a Debug compiler set with wrong compile/link settings: </source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source> - "Generate debug info (-g3)" should be turned on</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source> - "Strip executable (-s)" should be turned off</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Do you want to correct it now?</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Can't Debug</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Your compiler set's "Strip executable (-s)" options is turnned on</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Please correct it, recompile and retry debug.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>The generated executable doesn't have symbol table, and can't be debugged.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>Debug Failed</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>The executable doesn't have symbol table, and can't be debugged.</source>
|
<source>The executable doesn't have symbol table, and can't be debugged.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Please turn off your compiler set's "Strip executable (-s)" option, recompile and retry debug.</source>
|
|
||||||
<translation type="unfinished"></translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>x86 Assembly Language Reference Manual</source>
|
<source>x86 Assembly Language Reference Manual</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
|
@ -4936,6 +4888,38 @@
|
||||||
<source>Ctrl+K, Ctrl+S</source>
|
<source>Ctrl+K, Ctrl+S</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Correct compile settings for debug</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>The generated executable won't have debug symbol infos, and can't be debugged.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Or you can manually change the following settings in the options dialog's compiler set page:</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source> - Turned on the "Generate debug info (-g3)" option.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source> - Turned off the "Strip executable (-s)" option.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source> - Turned off the "Optimization level (-O)" option or set it to "Debug (-Og)".</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>If you are using the Release compiler set, please use choose the Debug version from toolbar.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Do you want to mannually change the compiler set settings now?</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MemoryModel</name>
|
<name>MemoryModel</name>
|
||||||
|
|
Loading…
Reference in New Issue