Page 1 of 2
arm-none-eabi-gdb remote debug error
Posted: Sat Feb 26, 2022 2:30 pm
by ndivner
Hi Eran.
Have not been in touch for a while, which is a whole other sad story.
But I am back!!
I am on a mission to make CodeLite the best Embedded IDE there is, but I need some assistence.
I am using the xpack-arm-none-eabi-gcc tools to compile a Arduino Sketch (F103CBT6-HelloW) using CMake and then debug using Codelite IDE to debug.
See the attachments showing my setup and the debug output log.
I am getting the following error and I am unable to see how to specify the elf file F103CBT6.elf
DEBUG>>&"No symbol table is loaded. Use the \"file\" command.\n"
I would appreciate your advice on how to fix this.
Thank you and Best regards
Noel Diviney
Re: arm-none-eabi-gdb remote debug error
Posted: Mon Feb 28, 2022 8:11 am
by ndivner
Hi All,
I have made some progress with arm-none-eabi-gdb remote debugging.
I have been able to get the Debugger Path set up as "/home/eicon/DinRDuino/tools/xpack-arm-none-eabi-gcc/bin/arm-none-eabi-gdb"
And Debugger Startup Commands set to load the elf file "load F103CBT6-HelloW.elf"
This produces the result shown in screenshot DebuggerOutput1
Problem to be resolved is to stop ".codelite-gdbinit" from also starting the Degugger but this time using F103CBT6-HelloW as the elf file
Note the absence .of the .elf extension
See screenshot DebuggerOutput2
So almost there.
Cheers Noel Diviney
Re: arm-none-eabi-gdb remote debug error
Posted: Sun Mar 06, 2022 2:06 am
by ndivner
Hi All,
Continuing to make progress as the attached screenshot shows
Notice that I have been able to successfully set a breakpoint at line 22 of the Arduino Sketch "F103CBT6-BlinkHello,cpp"
and CodeLite has started up correctly and stopped at line 22.
So all set to do the Debugging magic.
I have had to Hack the file codelite/Debugger/debuggergdb.cpp to get it to work
1 create a .gdbinit file in /home/USER/ with the following contents :-
"set auto-load safe-path /home/USER/DinRDuino/Projects/F103CBT6-BlinkHello/build/.gdbinit"
2 create a gdbint file in the Project "build" folder with the following contents :-
"set history save on
set pagination off
set print pretty on
set confirm off
target extended-remote:3333
b /home/eicon/DinRDuino/Projects/F103CBT6-BlinkHello/App/F103CBT6-BlinkHello.cpp:22"
3 Edit line 298 of codelite/Debugger/debugger.cpp as follows :-
"// cmd << wxT(" --interpreter=mi ") << si.exeName;
cmd << wxT(" -q --interpreter=mi ") << wxT(" F103CBT6-BlinkHello.elf ");
4 Disable the creation of .codelite-gdbinit by commenting lines 1151 to 1154 inclusive as follows
"// if(FileUtils::WriteFileContent(clGdbInitFile, fileContent)) {
// m_observer->UpdateAddLine(wxString() << "Using gdbinit file: " << clGdbInitFile.GetFullPath());
// dbgExeName << " --command=\"" << clGdbInitFile.GetFullPath() << "\"";
// }"
TODO
Make these changes transparent by
1 Adding a "Enable Embedded Debugging" "Tick Box" to the "Project-->settings" Dialog
From the Menu select the Debugger Dialog and tickj the to be added "Enable Embedded Debugging" "Tick Box"
The software changes are the implemented using a "ifdef" structure to either keep existing or go for Embedded.
Stay Tuned
Noel Diviney.
Re: arm-none-eabi-gdb remote debug error
Posted: Fri Mar 11, 2022 12:52 pm
by eranif
is it possible to make this configurable and as PR to the code?
Re: arm-none-eabi-gdb remote debug error
Posted: Sat Mar 12, 2022 9:10 am
by ndivner
Hi Eran,
Delighted to hear from you and thank you.
It is indeed my desire to develop configurable changes and the issue a "Pull Request" to add Embedded Support to CodeLite.
So far I have been busy creating Powershell Scripts to automate the installation and setup of an Embedded development Environment.
This has been successfull and I am now ready to commence doing the software changes properly.
I must admit that I am a Hardware Engineer but with sufficient experience in software to be able to do the job.
I would like some assistance in setting up wxCrafter to add an additional "Tick Box" Control to the Debuuger Setting Dialog alongside the existing "Debugging a remote target"
and then access this from the "debuggergdb.cpp" source file where the changes can be applied in a selectable way.
In the meantime I will continue to educate myself in wxCrafter. I had been using "DialogBlocks" in the past.
I would also like to join the CodeLite Team and could be talked into supporting the "embedded" side of things.
Looking forward to hearing from you.
Cheers Noel Diviney.
Re: arm-none-eabi-gdb remote debug error
Posted: Sun Mar 13, 2022 11:18 am
by ndivner
Hi,
I have added a "Check Box" labeled "DebuggingEmbedded target" to the "LiteEditor/project_settings.wxcp" and this builds and displays correctly.
See the attached Screenshot.
I am having difficulty in being able to test the state of the "Check Box" because the #include "project_settings_base_dlg.h" is not working.
I have tried including the path to the header file to no avail.
See attached BuildLog
I would appreciate some help with this.
Best regards Noel Diviney.
Re: arm-none-eabi-gdb remote debug error
Posted: Mon Mar 14, 2022 7:18 am
by ndivner
Hi All,
Monday 14 Mar 2022 at 14:04 Aust Time.
I have overcome my difficulty with including Header Files by updating codelite/Debugger/CMakListes.txt Line 18 as follows :-
include_directories("${CL_SRC_ROOT}/Plugin" "${CL_SRC_ROOT}/sdk/wxsqlite3/include" "${CL_SRC_ROOT}/CodeLite" "${CL_SRC_ROOT}/PCH" "${CL_SRC_ROOT}/Interfaces" "${CL_SRC_ROOT}/LiteEditor")
This did not fix my problem though as shown in Attachment 1 and Attachment 2 namely :-
Code: Select all
[ 44%] Building CXX object wxformbuilder/CMakeFiles/wxFormBuilder.dir/wxformbuilder.cpp.o
/home/eicon/DevSW/codelite/Debugger/debuggergdb.cpp: In member function ‘virtual bool DbgGdb::Start(const DebugSessionInfo&, clEnvList_t*)’:
/home/eicon/DevSW/codelite/Debugger/debuggergdb.cpp:300:12: error: ‘GetCheckBoxDbgEmbedded’ was not declared in this scope
300 | if(GetCheckBoxDbgEmbedded()) {
| ^~~~~~~~~~~~~~~~~~~~~~
[ 44%] Building CXX object Gizmos/CMakeFiles/Wizards.dir/gizmos_gizmos_bitmaps.cpp.o
I now have to learn how to manage the Scope in CodeLite builds.
I am hoping somebody may be able to help me here!!
Almost there.
Thanks and regards Noel Diviney.
Re: arm-none-eabi-gdb remote debug error
Posted: Sat Mar 19, 2022 1:10 pm
by eranif
Some comments:
- The folder
LiteEditor
must not be included by any other plugin or interface. This is the core of CodeLite and is not accessible by any of the plugins. The communication is done by events. So your fix to include ${CL_SRC_ROOT}/LiteEditor
is wrong
- The project UI (where you added the checkbox, is part of the LiteEditor) to pass this to the
DebuggerGDB
you should probably make it a member of IDebugger
. I suggest that you follow the Debugging a remote target
logic in the code
To summarize:
- Each field in the project UI is mapped into a field in the
BuildConfig
object - you should add add a new member to this class and set/unset it to match the UI when user clicks OK
or Apply
in that dialog
- Once this is a member of this object, you need to pass it to the debugger before the debug session starts. See for example how the remote flag is passed: https://github.com/eranif/codelite/blob ... .cpp#L2074
In general, follow the logic of the field https://github.com/eranif/codelite/blob ... fig.h#L128 in the code to get the idea of what needs to be done
Re: arm-none-eabi-gdb remote debug error
Posted: Sat Mar 19, 2022 3:25 pm
by ndivner
Thank you Eran.
I will have a bash at this tomorrow as it is now past bedtime for me.
I will post results of progress
Regards Noel.
Re: arm-none-eabi-gdb remote debug error
Posted: Sun Mar 20, 2022 1:18 pm
by ndivner
Hi Eran et al,
Following your excellent guidelines I have been able to mimic the "GdbRemoteTarget" code with my "GdbEmbeddedTarget" code and get a successful build and install.
See attached Screenshot of a successful launch of CodeLite.
With the "Debug Embedded Target" "Check Box" unchecked CodeLite performs as normal and switches to Embedded Debugging using "arm-none-eabi-gdb" when checked.
I will now do some extensive testing to prove everything is ready for Prime Time.
A big Thank you and Best regards
Noel Diviney