Hi Eran et al,
I have made quite a bit of progress with the changes required for embedded debugging and to make any changes suitable for integration.
To be able to do that I timed out to refresh my knowledge of wxWidgets and familiarize myself with wxCrafter.
I wanted these changes to have CodeLite behavour as it is or be selectable to do Embedded Debugging as distinct from Remote Debugging.
First attempt at this is to have two checkboxes to switch between the debugging modes as follows :-
1 Move the existing m_checkBoxDbgRemote into a new horizontal FlexgridSizer.
2 Add a new m_checkBoxDbgEmbedded into the FlexgridSizer and label it "Debugging embedded target".
3 Rename the m_checkBoxDbgEmbedded Event Handler to be "OnCmdEvtEmbeddedToggle".
4 Rename the m_checkBoxDbgRemote Event Handler to be "OnCmdEvtRemoteToggle".
5 Generate the wxCrafter code.
6 Edit PSDebuggerPage::OnCmdEvtEmbeddedToggle in Codelite/LiteEditor/ps_debugger_page.cpp to be
Code: Select all
m_dlg->SetIsDirty(true);
if (event.IsChecked())
{
m_checkBoxDbgRemote->SetValue(false);
}
7 Edit PSDebuggerPage::OnCmdEvtRemoteToggle in Codelite/LiteEditor/ps_debugger_page.cpp to be
Code: Select all
m_dlg->SetIsDirty(true);
if (event.IsChecked())
{
m_checkBoxDbgEmbedded->SetValue(false);
}
8 Add code changes to mimic the code for the m_checkBoxDbgRemote by doing a search->find-in-files for all instances of "Remote".
9 add changes to Codelite/Debugger/debuggergdb.cpp as follows :-
at line approx 298
Code: Select all
// Embedded Debugging Changes
if(GetIsEmbeddedDebugging()) {
cmd << wxT(" -q --interpreter=mi ") << si.exeName << wxT(".elf");
} else {
cmd << wxT(" --interpreter=mi ") << si.exeName;
}
at line 1156
Code: Select all
// Embedded Debugging CHanges
if(!GetIsEmbeddedDebugging()) {
if(FileUtils::WriteFileContent(clGdbInitFile, fileContent)) {
m_observer->UpdateAddLine(wxString() << "Using gdbinit file: " << clGdbInitFile.GetFullPath());
dbgExeName << " --command=\"" << clGdbInitFile.GetFullPath() << "\"";
}
}
10 Build CodeLite.
I am creating bash, Powershell and batch scripts to completely automate all configuration and setup for Arduino development and GDB debugging using CodeLite.
I have not finished testing yet but I am enclosing the patches for Linux. WSL (Windows Subststem for Linux) and Windows Msys2 and a PKGBUILD eexample script for msys2.
Some screenshots are also attached.
Cheers Noel