[fpc-devel] fp IDE with libgdb

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Sun Mar 7 22:49:01 CET 2010

Mark Morgan Lloyd wrote:
> Jonas Maebe wrote:
>> On 01 Mar 2010, at 15:10, Mark Morgan Lloyd wrote:
>>> I'm still getting a bus or alignment error in the fp IDE when driving 
>>> gdb but I'm reasonably optimistic that I'll be able to find that now. 
>>> PowerPC is fine so it's probably not something like an endianness issue.
>> A bus error generally means an alignment issue. Most PowerPC 
>> processors don't require data to be aligned, but SPARC cpu's do.
> Thanks for that Jonas, noted. The other possibility is some peculiarity 
> when parsing gdb output back into the IDE. I'll be back :-)

I found myself wondering whether the problem was related to the change 
from NPTL to pthreads, and couldn't decide from my notes exactly when I 
last had the IDE debugger working successfully on SPARC. At that point I 
decided that trying a version of libgdb later than 6.7 would be a good 
idea, since this could be a libgdb rather than an fp problem.

Since I see related discussion on Mantis as 15272 I hope this will be 
useful to somebody.

I've got 2.5.1 installed as the standard fpc on the system I'm working 
on, so there's no significant difference between the installed compiler 
and the one I'm trying to build.

I was not able to get libgdb 6.8 working due to duplicate symbols so I 
moved straight to 7.0.1.

libgdb configure/make runs without problems. I note here that 
--without-python is inoperative and --with-python=no little better: 
libpython is still required even if Python scripting is not built into 
the debugger. The result of this is that there must be (a symlink to) 
libpython.so or possibly libpython.a on the target system, on Debian 
"Lenny" I added libpython.so -> libpython2.5.so.

These are the libgdb files that are needed for the fp IDE:


Note the last two which are new. On a SPARC target they need to be in 
../libgdb/linux/sparc, otherwise as above; a (Linux) PowerPC system 
also needs libsim.a.

With the files available as above a complete build (i.e. make all) will 
still fail. Referring to instructions given in bug #15272, cd 
fpcsrc/ide, run  make 'FPCOPT=-s'  and then edit link.res to add a 
couple more libraries:


Finally, run ./ppas.sh which should result in a usable 2.5.1 fp IDE with 
libgdb 7.0.1.

Unfortunately I still get problems on SPARC even with 7.0.1, I can't 
shed any light on those yet but wanted to get the above written up while 
it was still fresh in my mind.

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 fpc-devel mailing list