Here is what happened so far in my spare time trying to debug xpdf:
_ First, I compiled xpdf for pdaXrom using the official rc5 cross-compiler. The resulting xpdf was doing illegal memory access too while loading specific pdf file (mean killed with segmentation fault). To try to correct this, I used patches from Debian Unstable but xpdf was still segfault. Used patches from Mandrakelinux. Same thing. Used both patches . No change.
_ So I really needed to find a way to debug the application. As I didn't know gdb at all I played with it a bit on x86 PC. Loading, running, breaking, stepping, listing... used gdb graphical front-end like kdbg or ddd too. All this worked well (even if the gdbui provided with my Linux distribution gdb x86 package segfault too on x86 .
_ Back on xpdf debuging for pdaXrom. There is no gdb for arm in pdaxromsdk-1.1.0-softfloat.tar.bz2. This is a missing application for the x86 sdk. To correct this, I recompiled gdb with "./configure --target armv5tel-cacko-linux". But there is a problem with the resulting armv5tel-cacko-linux-gdb: only “target sim†(mean arm simulator) will work to debug arm program directly on x86 machine. To use this arm simulator, gdb need to load a complete pdaXrom image. This mean to recompile a kernel without specific patches at least. To use remote X11, would need to build a small filesystem with default libraries (without specific Zaurus patches), a network simulated card to be able debug remote X11 connection of xpdf or to find a way to have a simulated framebuffer... To big to do so I tryied other solutions.
_ Tried to run gdb arm coming from the rc5 feed. This is a Zaurus package (installed with “ipkg install gdbâ€). Problem: I can load and run xpdf in this Zaurus gdb version but but I didn't succeed in adding a break point. I can list the source with the list command but “break 132†“run†will just run the program straight to the end. Breakpoints are just ignored. So now I needed to debug gdb to find how to fix this issue before been able to debug xpdf. A jocke . Well, let see if I can find other solution.
_ Ok. Next, installed gdb-server from rc5 feed to do remote debuggin. The problem: gdb-server is nothing else than a shrank gdb with remote protocol capacity. Used the x86 gdb version compiled for pdaXrom and on the Zaurus the gdb-server. The gdb version doesn't match but the connection is made. This time I can't display the application source code (mean the list command doesn't work). Searched for a solution but nothing found. The debug information are not used. The Zaurus gdb handles correctly the list command but not the gdb-server with my current x86 remote gdb. Without code listing it's a bit difficult to add breakpoints and to step into C source. :/
_ Next step for this afternoon: recompile gdb and gdb-server for pdaXrom using my current gdb source code version. This way, the remote gdb-server and local gdb won't have any excuse for incompatibility. If I still have issue than... well... I will have to ask to you people if you know a gdb version that work. The jocke could have been to try to debug the Zaurus gdb-server or gdb remotely.
If someone want to play too on this, well..., there is space for everyone. I you can espect, I'm not a guru and I'm doing all this for fun (and for yours).
(the last step could be to play with asertion and printf all over the source code... but this takes more time and need)