[fpc-devel] Status of debug line info

Sergio Flores relfos at gmail.com
Mon Jun 22 12:52:13 CEST 2015


Some time ago I already talked a bit about it, but let's discuss this again.

I have developed a very complex game with FPC, that includes a crash log
reporting (by mail).
Recently a update did introduce some weird bug, and I keep receiving
reports by mail.
Sadly, except the ones that come from Windows users, the others have a
stack dump that just has addresses.

Please correct if I'm wrong, but it seems that line info is not working in
those 3 major platforms:

- Android
- iOS
- OSX

>From what I gathered last time, both iOS and OSX need fpc support for DWARF
debug info, and thats why they not work (again, I not 100% sure if I'm
correct).

Now, about Android, which actually is more important for me now, I did some
investigation and experiments.

I asked FPC to generate a map file for Android (via -Xm) and noticed that
all addresses there are way different than the addresses in the stack
dumps. This makes sense, because when the .SO file that contains pascal
code is loaded in Android, it gets reallocated, so the addresses in the
.map file are just relative addresses.

Question 1:
Is it possible that this is a simple problem caused by FPC not calculating
the base address correctly and thus not finding the routine/line info?
If yes, anyone can point to the right place so I can try to look at it.

Question 2:
Related to question 1, but more broad. Can anyone give me a fast resume how
line info actually works in FPC. What files in FPC source should I look at
in case I want to add support for example for line info in Android/OSX/iOS?

Question 3:
I also found this C library that converts crashes that happen in native
code to proper Java exceptions with a neat stack dump of the native code. I
though I might try using this for now,  but it requires some compile flags
that I dont know if I can pass to FPC.

  LOCAL_CFLAGS := -funwind-tables -Wl,--no-merge-exidx-entries

Is it possible to pass the flags?
If yes, maybe I could even try to study the source of this and try to add
Android line info support for FPC.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20150622/5b5dfa65/attachment.html>


More information about the fpc-devel mailing list