Re: Debugging multi-threaded programmes - I suggest compiling -O0 and Keep-It-Simple

Pete/Piet Delaney <[email protected]>
Newsgroups gmane.comp.debugging.ddd.general
Organization Bluelane
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fabian Scheler wrote:
| Hello Aref,
|
|> Is there an extensive use of ddd over gdb for debugging multi-threaded
|> applications, or in other words how reliable or easy is it to do this,
|> especially for hard real time applications in Linux user space?
|
| I would suppose this to be as stable as debugging threads with gdb and
| I suppose that to work. Debugging real-time applications, however, is
| another issue, as you have to be aware of the probe effect caused by
| debuggers like gdb ...
|
|> I have had a lot of difficulties doing this and I sincerely hope
someone can
|> help. I am having a range of problems with ddd version 3.3.11 on top
of gdb
|> version 6.3.0.0-1.122rh. The most annoying problem is local variables not
|> known to the gdb - I get "No symbol "fred" in current context"
although that
|> may be a gdb problem. I have compiled my programme with:

I you compile -O0 your locals will be visible and almost everything
will be nice and easy. I don't recall a problem with threads when
I worked on a user space application that used threads. Threads problems
were more confined to compile options to enable the use of locks with
the threads in openssl. I think ddd worked fine. I usually set the
openssl debug enable with then compiled -O0 as I recall.

|
| Did you try 'Data'->'Display Local Variables' in the Menu. Normally
| the compiler does not generate symbols for local variables (these
| variables just exist on the stack) and so you cannot add a display for
| them.
|
| Besides that: I would not switch to -O0, gcc does not perform register
| allocation with -O0 and so the code finally generated has nothing to
| do with the real code that will actually be run. I would use compiler
| switches as close as possible to the real ones.

I prefer to debug the kernel with -O0 and convert 'static inlines' to
static. I increase the maximum stack size to compensate for the
increased number of frames on the stack.

I suppose it's like religion, lots of points of view. I like to keep the
debugging env as transparent as possible. Others like to minimally
change timing. Your choice.

- -piet

|
| Ciao, Fabian
|
|
| _______________________________________________
| Ddd mailing list
| [email protected]
| http://lists.gnu.org/mailman/listinfo/ddd

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIYIrHJICwm/rv3hoRAiODAJwPa3Q6otZzNHzAjtF6h1vDrN6hrQCeJUST
u5H8jlj81mv96C0bk6yIEcU=
=gkIF
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.