Subject: Problem with gdb and DLLs and their symbols when setting breakpoints
From: Roland Schwingel <[email-masked]>
To: [email-masked]
Date: Thu, 16 May 2002 20:28:38 +0200

Hi....

===============================================================
Maybe it is a little bit offtopic, but maybe somewhere knows also what 
to do.
I posted the same mail to the gdb mailinglist as well.
===============================================================

I am working on a rather big project consisting of about 170 modules 
each is a shared library.

On Windows everything is compiled under cygwin for mingwin into dlls. 
For debugging I am
using gdb from cygwin. But there is a problem. I have also tried a 
couple of other versions
of gdb/Insight from 5.0 to 5.2 beside the one that comes with cygwin.

When the dlls are loaded they sometimes get relocated because of 
collisions with other
dlls (even they are all linked with  --enable-auto-image-base). Thats ok 
so far, the app
is of course running. BUT it appears that only the code is relocated but not
the symbols....

For being more easy: Imagine an application with 2 dlls called a.dll and 
b.dll with
overlapping  base addresses so the collide when loading.
So
a.dll gets loaded.
b.dll will be loaded and relocated.

And now try to set a breakpoint somewhere in b.dll.
When saying something like that
(gdb) b aFileFromBDll.m:2344
everything is ok at first, but when looking
where the breakpoint is set it is not set in b.dll, but it is set 
somewhere in a.dll.
When continuing the breakpoint in a.dll is reached but of course not
the desired one in b.dll

Thats truely bad. Is there someone who knows what to do?
(Except giving each dll a unique non overlapping addressspace and so 
preventing collisions).

Can the symbol tables be relocated also?

Many thanks in advance,

Roland Schwingel

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/