[Vm-dev] Can I use GDB with SqueakVM ?
Mariano Martinez Peck
marianopeck at gmail.com
Sun Mar 28 20:10:52 UTC 2010
On Sat, Mar 27, 2010 at 5:57 PM, Eliot Miranda <eliot.miranda at gmail.com>wrote:
> Hi Mario,
> 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.
> platforms/unix/configure CFLAGS="-g3 -pthread" LIBS=-lpthread
> FWIW I routinely use gdb on Mac OS X, linux and windows to debug the
> Teleplace Cog vm.
Thanks Eliot. I tried what you said, but I got another problem now. I
configure the VM, with this:
../unix/cmake/configure --CFLAGS="-g3 -pthread" --LIBS=-lpthread
Then I make and make install. No problems. SqueakVM works ok and I can open
The problem is with gdb. I tried this:
ubuntu at ubuntu-desktop:~/Pharo/vm/Squeak-184.108.40.2065-pharo-src/build$ gdb
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
"/home/ubuntu/Pharo/vm/Squeak-220.127.116.115-pharo-src/build/squeak": not in
executable format: File format not recognized
And the same happens with gdb ./squeak or gdb /usr/local/bin/squeak etc...
But squeak IS executable:
ubuntu at ubuntu-desktop:~/Pharo/vm/Squeak-18.104.22.1685-pharo-src/build$ ls -la
-rwxr-xr-x 1 root root 1791 2010-03-28 21:57 /usr/local/bin/squeak
So...any ideas what can be the problem ?
Thanks a lot in advance,
> On Sat, Mar 27, 2010 at 12:54 PM, Mariano Martinez Peck <
> marianopeck at gmail.com> wrote:
>> (cross posting)
>> 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.
>> 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.
>> So far I am in Ubuntu 9.10 and I have tried the following:
>> ubuntu at ubuntu-desktop:~/opendbx/trunk/test$ gdb
>> GNU gdb (GDB) 7.0-ubuntu
>> Copyright (C) 2009 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later <
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
>> and "show warranty" for details.
>> This GDB was configured as "i486-linux-gnu".
>> For bug reporting instructions, please see:
>> Reading symbols from
>> (gdb) set args
>> (gdb) run
>> Starting program: /home/ubuntu/squeak/pharo-vm-0.15.2f-linux/squeak
>> [Thread debugging using libthread_db enabled]
>> Cannot find new threads: generic error
>> As you can see there the error
>> "[Thread debugging using libthread_db enabled]
>> Cannot find new threads: generic error"
>> I am not an expert in C or VM so I don'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:
>> "I've find a workaround, i've link the debugging app with libpthread and
>> now gdb
>> feels happy, and i can run it with gdb !"
>> "But however, if I compile the program with -pthread option, am able to
>> debug the program:
>> $ cc -W -Wall -Wextra -g 20.c `pkg-config --cflags --libs gtk+-2.0`
>> "The problem appears to be that something goes wrong with dynamically
>> loading libpthread in case the program has not been linked to it at
>> compile time. That would explain why it works when you use msethread,
>> because that one explicitly links to libpthread at compile time (via
>> the imports in mselibc, I guess).
>> Why dynamically loading libpthread causes problems is another
>> question. Maybe somehow the cthreads unit loads a different ("wrong")
>> copy of libpthread than the one the static linker uses when linking
>> the program. Or, alternatively, maybe the static linker selects a
>> different version of libc to link against if libpthread is also used
>> (libc and libpthread are quite interwoven on GNU systems, even though
>> they are separate libraries)."
>> So...I don't understand exactly how can I fix it.
>> Thanks for any help.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev