Page 1 of 1

I love debugging..

Posted: Fri Apr 27, 2007 2:31 pm
by mystran
I just love debugging, and especially the art of fitting as much debugging info in easily readable format on screen, as possible...

This time my OS console looked like below, when I finally found 'da bug in my new blockcache code: I forgot to update cache->lru.last when removing block from a lru-list. If somebody cares, the lru-list is currently singly-linked list, but with pointers to first and last element to make it easier to add entries at the end.. should make it double linked list I guess.

Anyway, the beauty of debugging:

edit: to be absolutely clear, that's a shot from the first successful test run after testing the code, but you get the point

Posted: Fri Apr 27, 2007 3:20 pm
by mystran
Actually, I'll torture you with another.... this is what happens when your malloc doesn't keep a separate free list, instead just scanning over all the blocks. Brown stuff is malloc output, with '-' for each scanned used block, '+' for each free block that's too small, and '#' for the final selected allocation block.

Output is after running 'ls' and waiting for a few clockticks to pass. Not quite what one would hope. ;)