Date: Fri, 2 May 2003 12:37:33 +0100 Cc: lablgtk at kaba.or.jp Subject: Re: Debugging lablgtk? Message-ID: <20030502113733.GC12258 at redhat.com> References: <20030502112923.GB12258 at redhat.com> <20030502113213.GA1378 at iliana> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030502113213.GA1378 at iliana> From: Richard Jones On Fri, May 02, 2003 at 01:32:13PM +0200, Sven Luther wrote: > On Fri, May 02, 2003 at 12:29:23PM +0100, Richard Jones wrote: > > > > How do people debug lablgtk? I can't set breakpoints in gdb because, of > > course, the libraries are loaded dynamically. > > Did you try building a bytecode executable and using ocamldebug ? > > Never tried it with C bindings though. ocamldebug seems a bit limited. In this case it seems to lose the thread when I try to debug the program: Lost connection with process 16292 (active process) between time 550000 and time 560000 Trying to recover... Time : 550000 - pc : 50964 - module CamlinternalOO 180 <|b|>try (ocd) bt #0 Pc : 50964 CamlinternalOO char 4578 #1 Pc : 55628 CamlinternalOO char 5015 #2 Pc : 52512 CamlinternalOO char 10479 (Encountered a function with no debugging information) (... whatever that means.) Anyhow, the actual segfault in this case happens deep inside the native C code (stack trace attached below if you're interested). Because I can't set breakpoints, it's hard for me to catch the error before it happens & examine the data structures. On a separate point, it would be _so nice_ if Debian didn't mandate that all libraries were stripped before installation. Rich. 0x404620b5 in gtk_layout_get_type () from /usr/lib/libgtk-1.2.so.0 (gdb) bt #0 0x404620b5 in gtk_layout_get_type () from /usr/lib/libgtk-1.2.so.0 #1 0x4097c296 in gtk_html_update_styles () from /usr/lib/libgtkhtml-1.1.so.3 #2 0x4046c043 in gtk_marshal_NONE__POINTER () from /usr/lib/libgtk-1.2.so.0 #3 0x4049ae6f in gtk_signal_set_funcs () from /usr/lib/libgtk-1.2.so.0 #4 0x404990b3 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 #5 0x404cebd8 in gtk_widget_size_allocate () from /usr/lib/libgtk-1.2.so.0 #6 0x40456054 in gtk_hbox_new () from /usr/lib/libgtk-1.2.so.0 #7 0x4046c043 in gtk_marshal_NONE__POINTER () from /usr/lib/libgtk-1.2.so.0 #8 0x4049ae6f in gtk_signal_set_funcs () from /usr/lib/libgtk-1.2.so.0 #9 0x404990b3 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 #10 0x404cebd8 in gtk_widget_size_allocate () from /usr/lib/libgtk-1.2.so.0 #11 0x404c470e in gtk_vbox_new () from /usr/lib/libgtk-1.2.so.0 #12 0x4046c043 in gtk_marshal_NONE__POINTER () from /usr/lib/libgtk-1.2.so.0 #13 0x4049ae6f in gtk_signal_set_funcs () from /usr/lib/libgtk-1.2.so.0 #14 0x404990b3 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 #15 0x404cebd8 in gtk_widget_size_allocate () from /usr/lib/libgtk-1.2.so.0 #16 0x404d7710 in gtk_window_set_default_size () from /usr/lib/libgtk-1.2.so.0 #17 0x4046c043 in gtk_marshal_NONE__POINTER () from /usr/lib/libgtk-1.2.so.0 #18 0x4049ae6f in gtk_signal_set_funcs () from /usr/lib/libgtk-1.2.so.0 #19 0x404990b3 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 #20 0x404cebd8 in gtk_widget_size_allocate () from /usr/lib/libgtk-1.2.so.0 #21 0x404d6d75 in gtk_window_set_default_size () from /usr/lib/libgtk-1.2.so.0 #22 0x4046c1b9 in gtk_marshal_NONE__NONE () from /usr/lib/libgtk-1.2.so.0 #23 0x4049ae6f in gtk_signal_set_funcs () from /usr/lib/libgtk-1.2.so.0 #24 0x404990b3 in gtk_signal_emit () from /usr/lib/libgtk-1.2.so.0 #25 0x404cc42b in gtk_widget_show () from /usr/lib/libgtk-1.2.so.0 #26 0x403d3253 in ml_gtk_widget_show () from /usr/lib/ocaml/3.06/stublibs/dlllablgtk.so #27 0x0805bae1 in interprete () #28 0x0805cf74 in caml_main () #29 0x0804e75d in main () #30 0x400eba51 in __libc_start_main () from /lib/libc.so.6 -- Richard Jones, Red Hat Inc. (London) and Merjis Ltd. http://www.merjis.com/ http://www.annexia.org/ Freshmeat projects: http://freshmeat.net/users/rwmj PTHRLIB is a library for writing small, efficient and fast servers in C. HTTP, CGI, DBI, lightweight threads: http://www.annexia.org/freeware/pthrlib/