[Lazarus] Debugging shared libraries

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Fri Sep 21 16:16:26 CEST 2012


Mark Morgan Lloyd wrote:
> Martin wrote:
>> On 19/09/2012 15:04, Mark Morgan Lloyd wrote:
>>> Martin wrote:
>>>> please do.
>>>>
>>>> Though it may be a while till I process it. I am away this week.
>>>
>>> No significant urgency from my POV, but it's something that I'm 
>>> looking at on an ongoing basis. Do you have a Linux development 
>>> machine with a MIDI interface?
>>>
>> Midi as in the music interface? No |(No either way). I have FC13 in a 
>> VirtualBox.
>>
>> First step for me is to make a basic sampe lib+app (both fpc). That I 
>> can add to the automatic tests.
>>
>> Then more complex cases can be addressed
> 
> I'll see what I can find.

Using Lazarus 1.0, FPC 2.6.0 and GDB 7.0.1 on x86 Linux I've definitely 
got some capability of stepping into a shared library (i.e. via a 
pointer of appropriate type etc.). However it doesn't work in all cases, 
I suspect that there might be something trivial like a requirement that 
the units defining the library are in the same directory as those of the 
main program... adding the directory to the debugger paths list doesn't 
appear to help. There might also be something the debugger really 
doesn't like particularly if the call is in a thread: I'm getting 
intermittent X lockups even working on the local console (i.e. rather 
than X tunneled over SSH).

I've got a convenient test program that doesn't have any particular 
requirements. Probably the easiest thing would be to tarball it and put 
it on Pastebin.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list