Showing posts with label mingw. Show all posts
Showing posts with label mingw. Show all posts

31 July 2009

Obese debug information (sqlite and qtcreator)

SQLite.c is the 'amalgemon' version of the Database: a huge .c file containing all the dependencies to compile SQLite into our projects.

Using GCC, and standard mingw compilation option, we probably all notice the ton of compilation warning telling us that debug infos are too huge to be handled correctly (if you tried that, it's impossible to trace sqlite sources with gdb).
The problem is concerning the embedded debugging information in STABS format: GCC is handling more modern types of debugging info. We just have to tell it to use them (http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html)


in your .pro file (assuming you're using QtCreator), force these flags to be used:

#remove standard debug generation for c files
QMAKE_CFLAGS_DEBUG -= -g
#(*= 'if not present'), force uber debug infos, perfect for gdb
QMAKE_CFLAGS_DEBUG *= -ggdb


No more compilation warning=quickest compilation, and we're now able to trace sqlite.c in gdb... Another win ;-)

27 May 2009

QtCreator Debug Helper...

QtCreator (1.1 for now) is great tool to work with...

The whole Qt thing is, too.

I'm sharing some experience with the beast.

If you need some relevant debug infos concerning the Qt class guts, you need to instruct gdb on how to print them.

It's done via a 'debugging helper': some dll/plugin loaded by gdb on startup.

On my machine they didnt work without a rebuild after each Qt SDK every integration:

  • go to Tools->Options...->Qt4->Qt Versions,
  • check the active Qt SDK, and its path (QT_PATH).
  • *remove* the whole *QT_PATH/qtc-debugging-helper* directory via explorer
  • back to the Options Pane, select the active SDK, and press *Rebuild*
  • go to Options->Debugger->Debugging Helper, check 'Use debugging helper', uncheck 'Use debugging helper from custom location'
  • next time you debug your qt app, you should get some '43 custom... loaded' from gdb

05 March 2009

Clutter 0.9 (CodeBlocks/MinGW/Win32 build)

Do you know Clutter ?

"Clutter is an open source software library for creating fast, visually rich and animated graphical user interfaces. "

http://www.clutter-project.org/

Great Project. Really.

A bit too much intricated with gnome/gtk, not really win32 native ;), not so much pictures to display about, but... Nice and Smart code: really promising architecture.
Wanted to figure this on win32, as i'd like to create some click n play frontends for my htpc...
Good news: it's buildable on Windows/CodeBlocks (mingw) with a bit of luck and elbow grease :)

Here is a recipe:

Get Code::Blocks (Mingw flavor): http://www.codeblocks.org/downloads/5

Get Clutter0.9, and unzip-it somewhere on your hdd.

Get GTK dependencies from http://www.gtk.org/download-windows.html (binaries+dev packages): pango, cairo, glib, gtk+

Get some Mingw port from http://sourceforge.net/project/showfiles.php?group_id=7382 :
gettext, libiconv

I put all those libraries side by side with clutter-0.9.

Now some OpenGL trickeries: this is the main problem when compiling on win32 as internal OGL support is only up to 1.2, and clutter is more 1.4. So, as usual, we'll play with extensions and runtime function pointers retrieval.
Note that clutter/cogl is dealing with >1.4 extensions as well: mine is a hack concerning 'some functions 'between' OGL 1.2 and 1.4... So:

Get latest glext.h, to update your probably old \codeblocks\mingw\include\GL\GLext.h.

Create clutter-0.9.0\build\cb directory ('cb' stands for code::blocks, took the directory location from the old msvc_2k5 port).

Unzip this patch/project archive file in clutter-0.9.0\build\cb.

Run cb/prebuild.bat: it will copy some config files, create the actor-marshall.h/.c, and replace some files with a patched version (have a look into prebuild.bat as it probably wont fit with your directory configuration).

Now open code::blocks and cb\clutter.workspace: you should be ready to compile and link both clutter and interactive_d projects.

To execute interactive_d.exe: you need a bunch of dll in the running directory as the content of clutter-0.9\test\data. This is my complete build folder.

interactive_d.exe needs the name of the test to be ran, as a parameter, such as 'interactive_d.exe test-clutter-cairo-flowers'. Here is a two rows list of possible params:


test-actor-clone test-actors
test-animation test-behave
test-binding-pool test-clip
test-clutter-cairo-flowers test-cogl-multitexture
test-cogl-offscreen test-cogl-primitives
test-cogl-tex-convert test-cogl-tex-foreign
test-cogl-tex-getset test-cogl-tex-polygon
test-cogl-tex-tile test-depth
test-easing test-events
test-fbo test-fullscreen
test-grab test-layout
test-main test-model
test-multistage test-offscreen
test-paint-wrapper test-perspective
test-pixmap test-project
test-random-text test-rotate
test-scale test-score
test-script test-shader
test-stage-read-pixels test-text-field
test-text test-texture-quality
test-textures test-threads
test-unproject test-viewport

That's it for Clutter 0.9 :)
I'm going to dive more and more into it next days... And will publish my investigations in there. Stay tuned ?