Changes between Initial Version and Version 1 of DebuggingGuidelines


Ignore:
Timestamp:
Oct 12, 2010, 8:39:21 AM (14 years ago)
Author:
FrederikHeber
Comment:

First version of the debugging guidelines

Legend:

Unmodified
Added
Removed
Modified
  • DebuggingGuidelines

    v1 v1  
     1= Debug the code =
     2
     3Since the switch to shared libraries we use [http://www.gnu.org/software/libtool/ libtool] to do the compiling and linking.
     4
     5Due to its inner workings, the true executable is not generated until
     6{{{
     7make install
     8}}}
     9is executed. If you check on e.g. ./src/molecuilder in your build directory after compilation you will notice that it is just a shell script pointing to some stuff residing in '''.libs''' in the same directory.
     10
     11Hence, debugging this shell script will not work, but make [http://www.gnu.org/software/gdb/ gdb] cry out that it does not recognize the executable's format:
     12{{{
     13$> gdb ./src/molecuilder
     14GNU gdb (GDB) 7.1-ubuntu
     15Copyright (C) 2010 Free Software Foundation, Inc.
     16License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
     17This is free software: you are free to change and redistribute it.
     18There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
     19and "show warranty" for details.
     20This GDB was configured as "x86_64-linux-gnu".
     21For bug reporting instructions, please see:
     22<http://www.gnu.org/software/gdb/bugs/>...
     23"/mnt.auto/bespin/heber/workspace_C/molecuilder/debug64/src/molecuilder": not in executable format: File format not recognized
     24(gdb) q
     25}}}
     26
     27Instead, execute:
     28{{{
     29libtool --mode=execute gdb --args ./src/molecuilder -v [some more options ...]
     30}}}
     31
     32You may also set your own alias in '''~/.bashrc''' to ease the typing, just add the following line to the file
     33{{{
     34alias debug='libtool --mode=execute gdb --args'
     35}}}