www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.debugger - [ddbg] 'us' after stack overflow takes a Looooong time

reply Bill Baxter <dnewsgroup billbaxter.com> writes:
It seems like maybe it's building the full string describing the stack 
in memory and then printing it out.

--bb
Dec 03 2007
parent Jascha Wetzel <firstname mainia.de> writes:
Bill Baxter wrote:
 It seems like maybe it's building the full string describing the stack 
 in memory and then printing it out.
 
 --bb
hm, in naive tests the printing starts instantly and the speed is limited by the console output. what changed in 0.11 is that ddbg goes through the stack twice in order to find the "last known source location" for stack frames that don't have source line info. unfortunately, i don't see a way to do it in one pass, since the stack frames can only be unwound in one direction. there still is potential for optimization, though, since for every stack frame i do a tree search for the source location of the return address. assuming that in a stack overflow situation there are only few locations repeated many times, hashing the lookup results could speed it up. if you can send me a testcase, i'll do some profiling.
Dec 04 2007