Problem debugging SOs

Iztok Kobal iztok.kobal@sysen.si
Mon Aug 26 02:43:00 GMT 2002


Thanks Kevin.

I am responding a little bit late since I was out of the office for the 
week-end.

I have taken a look to the references you wrote and, yes, that is 
exactly the thing that is happening. I have been also peep-ing into the 
gdb's source code and the code-in-the-matter is already included into 
the latest gdb-5.2.1 version which I am trying to use also.

I have been trying with the 5.1.x and lately 5.2.1 (downloaded from 
ftp.gnu, configured without any options and compiled on my machine with 
the gcc 2.95.x) with the something better and something worse success:

1. SO's symbol resolving is behaving slightly better. But !!! I have to 
step into the function from the SO with the <Step Into Instruction> and 
go through the whole SO resolving stuff to come into the function body - 
instead of using simply Step Into command. And I have also changed my SO 
dlopen-ing from RTLD_LAZY to the RTLD_NOW | RTLD_GLOBAL so I could have 
presumed that the resolving stuff would not be executed anymore... with 
no obvious difference.

2. <Step Into> generally does not work for me anymore - it usually 
behaves as it was Step Over command really - I again have to execute 
<Step Into Instruction> and after that <Step Into> to come into the 
called function body. Pretty annoying, isnt't it ? Or setting the bunch 
of the breakpoints all over the code so the whole debugging process 
takes me a lot more than too much time.

I was starting to think that the problem was related to the gcc stub 
info generation and I am going to try a gcc-3.0.4 instead of a 2.95.x 
which came with my SuSE distro. Please spare me the time and tell me if 
it would not work either !

Iztok


Kevin Buettner wrote:

> On Aug 23, 11:43am, Iztok wrote:
>
>  
>
>> Version 5.0
>> Platform i386 Linux SuSE 7.0
>>
>> I've got situation when shared object is loaded at runtime via the 
>> dlopen function. GDB afterwards shows that the symbols from this 
>> shared object are loaded but when trying to step into the function 
>> from this SO nothing shows.
>>
>> Full debugging info is included in SO.
>>
>> How should I prepare the system to debug such SW ?
>>   
>
>
> I think you may be seeing a linker bug.  Newer versions of gdb have
> a fix to work around the bug, but gdb-5.0 did not.
>
> For more information, see the threads associated with:
>
>    http://sources.redhat.com/ml/gdb/2001-08/msg00221.html
>    http://sources.redhat.com/ml/gdb-patches/2001-09/msg00003.html
>
> The simple fix is to update to a newer version of gdb.  Either 5.2
> or the current development sources should be fine.
>
> Kevin
>
>
>  
>





More information about the Gdb mailing list