<br><br><div class="gmail_quote">On Fri, Jun 7, 2013 at 12:39 AM, nazriel <span dir="ltr"><<a href="mailto:spam@dzfl.pl" target="_blank">spam@dzfl.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thursday, 6 June 2013 at 21:50:58 UTC, Timothee Cour wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Great!<br>
two issues (on OSX at least):<br>
<br>
A)<br>
it seems the top-most element of the call stack gets chopped off; eg in<br>
your code, the main_module.main symbol will not appear in the stack trace.<br>
Any idea why or how to fix that?<br>
Is that some inlining issue ? I tried with dmd -g, or -gs or -gc.<br>
This can be annoying when the top-most function is a large function and<br>
it's not at all clear where the code stopped.<br>
<br>
</blockquote></div>
I haven't got Mac OSX to test it out but I fixed it a little bit so it is less hacky:<br>
<br>
<a href="http://dpaste.dzfl.pl/241c6fb5" target="_blank">http://dpaste.dzfl.pl/241c6fb5</a><br>
</blockquote><div><br></div><div>Thanks, ya, the demangling part is the easy part :) (although demangle is still incomplete in many cases...)</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Compiler switches you may want to consider are:<br>
-gc -L--export-dynamic -O0</blockquote><div><br></div><div>export-dynamic or rdynamic are not available on OSX.</div><div>-gc doesn't change anything on dmd (and -O0 isn't available on dmd)</div><div>-gc -O0 doesn't change anything on ldc</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
B)<br>
there are no line numbers. I did a complex workaround by launching a<br>
process and calling atos to get those, but isn't there a better way?<br>
<br>
</blockquote></div>
Yeah, it is a complex issue. There are 2 ways to fix it from what I know.<br>
1) pipe addresses to addr2line - easier<br></blockquote><div><br></div><div>OSX doesn't have addr2line, hence my solution based on piping to atos on OSX. It works except in a few cases where for some reason only the basename of the file is shown instead of full file path, but its a bit complex so i was hoping for simpler.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2) use libdwarf - more complex but also more out-of-box solution</blockquote><div><br></div><div>Thanks for the link, that sounds promising! Will look at it.</div><div>under doc:</div><div><a href="http://sourceforge.net/apps/trac/elftoolchain/wiki/libdwarf">http://sourceforge.net/apps/trac/elftoolchain/wiki/libdwarf</a></div>
<div>relevant sections:</div></div>"Line Number Operations"<div><br></div><div><br></div>