Author Topic: Tracing into wxWidgets 2.9 functions  (Read 3665 times)

Offline JMP

  • Multiple posting newcomer
  • *
  • Posts: 11
Tracing into wxWidgets 2.9 functions
« on: March 31, 2010, 09:49:22 am »
Hello all,

Actually I am trying to move to wxWidgets 2.9 in my applications, I prefer to create debug versions of my apps using also the debug version of wxW in order to trace inside wxW functions and better understand the problems I am finding.

wxW has changed deeply the debug/release configurations from the old way used in 2.8 to the one used in 2.9. There is no different libraries for debug or release, but are both mixed up. There is a macro defined wxDEBUG_LEVEL, that can be set, at wxW compilation time to a value 0, 1 or 2. The value chosen will determine the debugging capability of the library, 0 means no debugging caps, 2 means max debugging caps. Later on, when you compile your app, you set the value of this macro to any value from 0 to 2, this value does not need to match the one you used when you compiled the library. This will enable wxASSERT and family to work even in release versions of your app.

So far so good, but in Linux releases of wxWidgets (I am using Linux), the names of the libraries for debug have lost the "d" that indicates the debug version of the lib, so the name of the lib is the same, whatever the value used for wxDEBUG_LEVEL you set in the lib. You can have just one version of the library per directory in your system. In Windows, there is still the "d" in the debug versions of the lib.

My problem is that, even when I compile the library with maximum debugging support, I cannot trace inside wxW functions from within CodeBlocks. The execution line just skips the function as if it were not containing any debug information.

Has anybody reached to trace into wxWidgets 2.9 library functions? and if yes How?
Thank you

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Tracing into wxWidgets 2.9 functions
« Reply #1 on: March 31, 2010, 10:12:54 am »
You need to have the cpp files of wxWidgets in the place gdb is expecting them.
The paths are recorded in the elf/so files.

What you can do to find the correct path is:
1. Step into a wx function (codeblocks won't open the file)
2. Open the callstack/backtrace window and see where gdb/c::b is trying to find the wx's file
3. Place the file in the correct place and that is all.

Good luck...

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline JMP

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Tracing into wxWidgets 2.9 functions
« Reply #2 on: March 31, 2010, 10:29:59 am »
Thanks,

Your hint helped me a lot.

I had left an old setting for the linker search paths of the debug version pointing to a release version of the libraries. This was overwritting the standard installed libraries folder.

Now it works :D