Page 1 of 1

Is there a way to debug my kernel at source level?

Posted: Sun Feb 27, 2011 2:57 pm
by Peterbjornx
I am working on a OS kernel and i got a nasty bug i cant seem to fix with bochs internal debugger, and of course i cannot use MSVC's built-in debugger, so what can i use for this purpose??

Re: Is there a way to debug my kernel at source level?

Posted: Sun Feb 27, 2011 3:23 pm
by TylerH
You would have to build the debugging into your kernel, AFAIK.

Re: Is there a way to debug my kernel at source level?

Posted: Sun Feb 27, 2011 4:05 pm
by MDM
Generally under such a situation, I decompile the code, and write out on a piece of paper what is happening according to the op code. Depending on the level of the bug you may have to rely on this technique.

Re: Is there a way to debug my kernel at source level?

Posted: Sun Feb 27, 2011 7:20 pm
by gravaera
You'll never know how amazing and awesome "printf()" and infinite loops are until you try them :)

Re: Is there a way to debug my kernel at source level?

Posted: Sun Feb 27, 2011 7:29 pm
by gerryg400
MDM wrote:Generally under such a situation, I decompile the code, and write out on a piece of paper what is happening according to the op code.
gravaera wrote:You'll never know how amazing and awesome "printf()" and infinite loops are until you try them :)
Concur. The only debugging methods you'll ever need.

Re: Is there a way to debug my kernel at source level?

Posted: Mon Feb 28, 2011 2:58 am
by Peterbjornx
I fixed the bug now, and indeed i just had to make my dprintf's a little more detailed :)