Hi Mario,<div><br></div><div>    first you want to compile with debug symbols and perhaps with no optimization.  Second it looks like you need to link with the pthreads library, not juts compile. So you can try e.g.</div><div>
<br></div><div>platforms/unix/configure CFLAGS=&quot;-g3 -pthread&quot; LIBS=-lpthread</div><div><br></div><div>FWIW I routinely use gdb on Mac OS X, linux and windows to debug the Teleplace Cog vm.</div><div><br></div><div>
HTH</div><div>Eliot<br><br><div class="gmail_quote">On Sat, Mar 27, 2010 at 12:54 PM, Mariano Martinez Peck <span dir="ltr">&lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
 <br>(cross posting)<br><br>Hi folks. I have a SqueakVM with an image that uses SqueakDBX to talk to a database. SqueakDBX talks to a external library (written in C) called OpenDBX. At the same time, OpenDBX then talks to another library which is the database client library. When....I am having a problem with Firebird and it seems to be related with threads management. <br>

<br>So, what I want to do is to start the SqueakVM with GDB, run my tests and try to get as much information as possible when it crash. <br><br>So far I am in Ubuntu 9.10 and I have tried the following:<br><br>ubuntu@ubuntu-desktop:~/opendbx/trunk/test$ gdb /home/ubuntu/squeak/pharo-vm-0.15.2f-linux/squeak <br>

GNU gdb (GDB) 7.0-ubuntu<br>Copyright (C) 2009 Free Software Foundation, Inc.<br>License GPLv3+: GNU GPL version 3 or later &lt;<a href="http://gnu.org/licenses/gpl.html" target="_blank">http://gnu.org/licenses/gpl.html</a>&gt;<br>
This is free software: you are free to change and redistribute it.<br>
There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;<br>and &quot;show warranty&quot; for details.<br>This GDB was configured as &quot;i486-linux-gnu&quot;.<br>For bug reporting instructions, please see:<br>

&lt;<a href="http://www.gnu.org/software/gdb/bugs/" target="_blank">http://www.gnu.org/software/gdb/bugs/</a>&gt;...<br>Reading symbols from /home/ubuntu/squeak/pharo-vm-0.15.2f-linux/squeak...done.<br>(gdb) set args /home/ubuntu/squeak/pharo1.0-10500-rc1dev09.12.1/pharo1.0-10500-rc1dev09.12.dbx.1.image<br>

(gdb) run<br>Starting program: /home/ubuntu/squeak/pharo-vm-0.15.2f-linux/squeak /home/ubuntu/squeak/pharo1.0-10500-rc1dev09.12.1/pharo1.0-10500-rc1dev09.12.dbx.1.image<br><span style="background-color:rgb(255, 255, 51)">[Thread debugging using libthread_db enabled]</span><br style="background-color:rgb(255, 255, 51)">

<span style="background-color:rgb(255, 255, 51)">Cannot find new threads: generic error</span><br>(gdb) <br><br><br><br>As you can see there the error <br><br>&quot;<span style="background-color:rgb(255, 255, 51)">[Thread debugging 
using libthread_db enabled]</span><br style="background-color:rgb(255, 255, 51)">
<span style="background-color:rgb(255, 255, 51)">Cannot find new 
threads: generic error</span>&quot;<br><br>I am not an expert in C or VM so I don&#39;t know if I am doing the things correctly.  I tried to google a bit, and I found different solutions. I copy exactly what I found:<br>

<br>&quot;I&#39;ve find a workaround, i&#39;ve link the debugging app with libpthread and now gdb <br>feels happy, and i can run it with gdb !&quot;<br><br>&quot;But however, if I compile the program with -pthread option, am able to debug the program:<br>

$ cc -W -Wall -Wextra -g 20.c `pkg-config --cflags --libs gtk+-2.0` -pthread&quot;<br><br><br>&quot;The problem appears to be that something goes wrong with dynamically   <br>loading libpthread in case the program has not been linked to it at   <br>

compile time. That would explain why it works when you use msethread,   <br>because that one explicitly links to libpthread at compile time (via   <br>the imports in mselibc, I guess). <br><br>Why dynamically loading libpthread causes problems is another   <br>

question. Maybe somehow the cthreads unit loads a different (&quot;wrong&quot;)   <br>copy of libpthread than the one the static linker uses when linking   <br>the program. Or, alternatively, maybe the static linker selects a   <br>

different version of libc to link against if libpthread is also used   <br>(libc and libpthread are quite interwoven on GNU systems, even though   <br>they are separate libraries).&quot;<br><br><br>So...I don&#39;t understand exactly how can I fix it. <br>

<br>Thanks for any help.<br><br>Mariano<br><br>
<br></blockquote></div><br></div>