<div dir="ltr"><div><div>Some time ago I already talked a bit about it, but let's discuss this again.<br><br><div>I have developed a very complex game with FPC, that includes a crash log reporting (by mail).<br></div><div>Recently a update did introduce some weird bug, and I keep receiving reports by mail.<br></div><div>Sadly, except the ones that come from Windows users, the others have a stack dump that just has addresses.<br></div><br>Please correct if I'm wrong, but it seems that line info is not working in those 3 major platforms:<br><br></div><div>- Android<br></div><div>- iOS<br></div>- OSX<br></div><br><div>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).<br><br></div><div>Now, about Android, which actually is more important for me now, I did some investigation and experiments.<br><br></div><div>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.<br><br></div><div>Question 1: <br></div><div>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?<br></div><div>If yes, anyone can point to the right place so I can try to look at it.<br><br></div><div>Question 2:<br></div><div>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?<br><br></div><div>Question 3:<br></div><div>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.<br><pre><code> LOCAL_CFLAGS := -funwind-tables -Wl,--no-merge-exidx-entries
</code></pre>Is it possible to pass the flags?<br></div>If yes, maybe I could even try to study the source of this and try to add Android line info support for FPC.<br></div>