<div dir="ltr"> I was trying to get lineinfo to work in the crash reporter since I've seen<br>
some comercial games doing the same (reporting a stack dump with<br>
lines/filename.cpp).<br>
The problem with gathering just addresses is that they change with every<br>
build (and I ship daily builds).<br>
Anyway I could try that, but I still need the base address, and I have no<br>
clue how to obtain that in FPC.<br>
Is there any easy way to find it?<br>
Probably reading it from /proc/pid/maps in unix platforms could work...<br>
Another question, I thought about a idea for platform independent way to<br>
support line info.<br>
Could the compiler generate a internal table/array that mapped all<br>
functions addresses to strings?<br>
Let's say a additional-Gsomething flag is added for this, then a special<br>
internal function would be generated, and called at run-time, before units<br>
initialization. The function would just build a huge table of adress<br>
associations, like this.<br>
<br>
- Ignored:<br>
procedure init_debuginfo();<br>
begin<br>
register_debug_address(@unitX_funcA, 'unitX', 'funcA');<br>
register_debug_address(@unitX_funcB, 'unitX', 'funcB');<br>
register_debug_address(@unitY_funcA, 'unitY', 'funcA');<br>
// all other functions/methods/procedures in the whole program ...<br>
end;<br>
<br>
<br>
Probably not as simple of that, it might need more info (range of the<br>
functions address, not just starting point).<br>
Then calling BackTraceStrFunc() would look up the address using the table<br>
built before.<br>
<br>
Even though this would just be useful to print routine names and not lines,<br>
would this work?</div>