[dmd-internals] Asserts

Walter Bright walter at digitalmars.com
Fri Nov 9 23:44:12 PST 2012


On 11/9/2012 10:41 PM, David Held wrote:
>
> Also, the compiler is only deterministic because it isn't yet multi-threaded.  
> That doesn't mean Walter hasn't attempted to make it such on more than one 
> occasion.  If the compiler had more immutable data structures, this would 
> probably be an easier effort. ;)

There is some async code in there. If I suspect a problem with it, I've left in 
the single thread logic, and switch to that in order to make it deterministic.

It is somewhat annoying that modern Windows will start programs at a different 
address each time, which makes pointer values from one run to the next not the same.

>
> Finally, what the debugger cannot do is provide you with a history of what 
> happened, except insofar as you are willing to manually capture the state 
> change of various memory locations as you step through the program.  Although 
> I tend to use debuggers as the tool of last resort, I will still insist that 
> logs are even more powerful when used with the debugger, because they can 
> often give you a good idea where you should set breakpoints, avoiding having 
> to step through large portions of the code which aren't relevant to the 
> problem at hand (after all, not all bugs are as obvious as a segfault/AV).

Actually, very very few bugs manifest themselves as seg faults. I mentioned 
before that I regard the emphasis on NULL pointers to be wildly excessive.


More information about the dmd-internals mailing list