Stepping into wxWidgets code using Codelite

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Widgets
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 534
Joined: Thu Jun 01, 2006 4:36 pm
Location: Right here!

Stepping into wxWidgets code using Codelite

Post by Widgets »

Not sure whether this is a good place to ask, but ...
As I am trying to wean myself off Windows, I would like to use Codelite under Mint (latest Mint 20.3 & wxWidgets 3.1.7)
At this point I have installed Codelite and built the wxWidgets libraries.
To resolve a (perceived) issue with the helpview sample project, I would like to step into the wxWidgets code to try and determine where a specific icon is selected for the tool bar when running under Linux.

As it is, I am rather new to Codelte and wxWidgets in the Linux environment and, though I have been able to set up and compile the helpview project so that it runs and I can/could debug the helpview code, I have been unable to sort out which wxWidgets configuration I need to compile and how to set up Codelite to allow me to step into the wxWidgets code for further analysis.
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Stepping into wxWidgets code using Codelite

Post by DavidHart »

Hi,
Not sure whether this is a good place to ask
The CodeLite forum would have been an alternative.
I have been unable to sort out which wxWidgets configuration I need to compile and how to set up Codelite to allow me to step into the wxWidgets code for further analysis.
Well, any wx configuration would work, but configuring --enable-debug is a good idea.

You've already built and (presumably) 'make install'ed wxWidgets, but you may wish to do so again, with a 'in situ' install. These have the enormous advantage that they don't conflict with other wx builds. So, for e.g. a GKT+3 debug build, open a terminal in the wx source dir and do something like:

Code: Select all

(mkdir -p udb3 && cd udb3 && ../configure --with-gtk=3 --prefix=$(pwd) --enable-debug --enable-cxx11  && make -j`nproc`)
The magic comes from the '--prefix='. It means that you get a working build in the udb3 subdir; no need to make install.
To use it, point to its wx-config script in your terminal's PATH, or call it direct or, for you use it in your CodeLite compilation and Linker settings.
So for me, the C++ Compiler options field contains:

Code: Select all

-g;-O0;-Wall;$(shell /home/david/devel/git/wx/udb3/wx-config --cxxflags) 
and the Linker:

Code: Select all

$(shell /home/david/devel/git/wx/udb3/wx-config --libs)
(or, depending on your program's need, maybe wx-config --libs all).

Build your code. Put breakpoints in sensible places,then click the 'Debug' icon to run it the debugger.

Regards,

David
Widgets
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 534
Joined: Thu Jun 01, 2006 4:36 pm
Location: Right here!

Re: Stepping into wxWidgets code using Codelite

Post by Widgets »

Thank you, David
After a bit of reflection and a rebuild, I was able to step into the wxWidgets source code, thanks to the compiler & linker flags you gave.

If I had tried to get to the Codelite forum from the Codelite GUI, I would have ended up in the proper place, but Google sent me off to some old forum where the last post was years ago. #-o
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
Post Reply