<div dir="ltr">On Fri, Oct 25, 2013 at 7:16 AM, Ali Çehreli <span dir="ltr"><<a href="mailto:acehreli@yahoo.com" target="_blank">acehreli@yahoo.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>On 10/25/2013 04:12 AM, Timothee Cour wrote:<br>

<br>
> the stack would already be unwinded and there'd be no way to go back in time<br>
> to the point where the relevant exception got thrown.<br>
<br></div>
Another spot is the constructor of the exception. We print the stack contents by libunwind in a C++ project. (Never tried in D.)</blockquote><div><br></div><div>The problem with this approach is 2-fold:</div><div>* it requires modifying how each exception is constructed </div>

<div>* it doesn't know where the exception will be caught so you'd launch the debugger at every thrown exception instead of at one location which gathers all uncaught exceptions</div><div><br></div><div>I've actually worked out a solution that works great, see my post: </div>

<div>"proposal(+working code): catch block callback before stack unwinds to allow attaching debugger"</div><div><br></div><div>it doesn't affect any try/catch blocks except the ones we specify; the key is to put the logic as annotation at the catch block, not at the thrown exception. </div>
</div></div></div>