[ros-kernel] Debugging for beginners
Waldo Alvarez Cañizares
wac at lab.matcom.uh.cu
Tue Jan 27 15:03:02 CET 2004
I have found that the BOCH debugger is the best tool you can ever use because it does not modifies anything (ie it does not patch bytes with int 3 or something) it does not need to be loaded from the disk and you can trace at the first instruction the CPU executes in ROM. I'm working on the nonpaged pool and I found that those dbgprints do not work very early on the executive initialization (as when I initialize the nonpaged pool) So I had to trace it with BOSCH debugger (it is enabled during configuration, you need MSYS to configure it) Also you can break at anytime in the code writing to a port (That's it you write to that port in the source, start reactos and the BOCHS debugger fires up there, watching at bochs sources there is also an special instruction (a hole in the instruction matrix) disabled by default that can fire the BOCHs debugger when executed) to enable the breaks with the io port you need to configure BOCHS with --enable-iodebug if I remember well. You don't need speed when you debug, reactos loads in seconds anyway, wich is faster than having to reboot a machine and pass for the whole initialization. Injecting a kernel to the image is quick too. I'm not sure but I read somewhere that David Welch has patches to use GDB with BOCHS (by the way, I think those patches should be distributed with Reactos, maybe in the tools folder). The GDB stub that comes with BOCHS is only implemented for *nix systems. Another thing, with time you usually do not need to trace in every problem you find. Usually a DbgPrint or simply watching the code you can find the problem, even more if you do very small changes and test those changes all the time (finding problems in lot's of places is really hard, that's it do not modify things too much before each test run you do and bugs will be easier to fix)
Althoug sometimes you can't do such very small changes.
Best Regards
Waldo Alvarez
________________________________
From: ros-kernel-bounces at reactos.com on behalf of Björn Fischer
Sent: Thu 1/22/2004 5:50 AM
To: 'ReactOS Kernel List'
Subject: [ros-kernel] Debugging for beginners
Hi,
as I'm quite new to ROS I am digging myself through the list archive
right now. I now have a running version of ROS (on real hardware because
bochs is too slow and VMWare too expensive). I now would like to do
debugging. As reading through the list archive I got many information
about debugging, but somehow that was a bit too confusing for me and I
still have questions:
1) Do I have to use GDB for debugging or is it replaceable by pice (and
which one is easyer to use)?
2) Must I do remote debugging via a COM-Port or can I use the same
machine for running and debugging ROS (pice documentation said CTRL-D
changes to debug mode...)?
3) What do most people use to debug ROS (since I don't want to be the
only one using a special method or technique...)
Greetings
Björn
_______________________________________________
Ros-kernel mailing list
Ros-kernel at reactos.com
http://reactos.com/mailman/listinfo/ros-kernel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 5497 bytes
Desc: not available
Url : http://reactos.com:8080/pipermail/ros-kernel/attachments/20040127/64de27ce/attachment.bin
More information about the Ros-kernel
mailing list