Date: Fri, 2 May 2003 13:42:27 +0200 To: Richard Jones Cc: lablgtk at kaba.or.jp Subject: Re: Debugging lablgtk? Message-ID: <20030502114227.GA1517 at iliana> References: <20030502112923.GB12258 at redhat.com> <20030502113213.GA1378 at iliana> <20030502113733.GC12258 at redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030502113733.GC12258 at redhat.com> From: Sven Luther On Fri, May 02, 2003 at 12:37:33PM +0100, Richard Jones wrote: > 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: Mmm, i am not particularly familiar with ocamldebug. I guess rebuilding lablgtk with the debugging symbols on would be a good thing, more to it below. That said, you could also try using the lablgtk toplevel to try to isolate the problem. > 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. The correct way for handling this is to have in addition to the normal package a -dbg package with the debugging symbols. The same also applies to the ocaml object files, and to the ones in the ocaml std&otherlibs. Let me think about it, i will see how we can manage to build these too. It would need a second build pass i think, altough Pierre Weiss told me once that maybe it would be better to enable the debugging symbols by default. Friendly, Sven Luther