On Sat, 14 Sep 2013 10:30:09 -0700 "H. S. Teoh" <hst...@quickfur.ath.cx> wrote:
> On Sat, Sep 14, 2013 at 02:25:43PM +0200, Paolo Invernizzi wrote: > > > > Give me a way to writeln the callstack frames at a certain point, > > and I'll take that: until this, I still need a debugger for > > following the program flow. > > I'm pretty sure this is possible with a little effort. > [...] > Still, if there was a way to print a stacktrace *without* terminating > the program, that would be an invaluable addition to our toolset. Although I haven't actually hit a need to try, can't you just do this?: writeln(new Exception("TRACE")); Or at the very least this: // Or make this a string mixin if you *really* don't // want printStackTrace itself shown in the trace. void printStackTrace() { try throw new Exception("TRACE"); catch(Exception e) writeln(e); } > > > > And no, adding a writeln everywhere you call that function is not a > > solution. > [...] > > True, this is one of the weak points of writeln debugging. Though I > usually start from the top-level, so generally by the time I get to a > specific function I already know how it got there. > Same here. I writeln-debug the way you'd play that "hi-lo" number guessing game: 1-100: 50 lower 1-100: 25 higher 1-100: 40 higher 1-100: 45 lower 1-100: 43 lower 1-100: 42 It took you that long to guess 42? Really? What kind of nerd are you? Only I make a lot more than one guess at a time.