Re: debugging gtk+ apps



$ gdb glunarclock 
GNU gdb 19991004 
Copyright 1998 Free Software Foundation, Inc. 
GDB is free software, covered by the GNU General Public License, and you
are 
welcome to change it and/or distribute copies of it under certain
conditions. 
Type "show copying" to see the conditions. 
There is absolutely no warranty for GDB.  Type "show warranty" for
details. 
This GDB was configured as "i386-redhat-linux"... 
(gdb) run --sync 
Starting program: /home/leandro/install/glunarclock-0.11/src/glunarclock
--sync 
Gdk-ERROR **: BadMatch (invalid parameter attributes) 
  serial 1961 error_code 8 request_code 62 minor_code 0 

Program exited with code 01. 
(gdb) bt 
No stack. 
(gdb) 


Put a breakpoint on main
then run the program until it stops (almost instantly :)
then put a breakpoint on gdk_x_error
then continue like so
b main<enter>
run --sync<enter>
b gdk_x_error<enter>
cont<enter>
then play with your program until you get to the error and gdb will stop
and if you do a backtrace it should give you the place of the error.

iain





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]