Wednesday 6 February 2008

kernel debugging

I need to do some kernel debugging occasionally in my programming life, generally I took the reference on

http://silverstr.ufies.org/lotr0/windbg-vmware.html

to setup the configuration. I had no problem to connect the debugger on host machine
and debugee on vmware virtual machine until one day, windbg stoped at "waiting to reconnect". it reported more information
"Unable to read head of debugger data list ..." after 10 minutes later.

I googled the problem on Internet, somebody suggested that I could do Ctrl+Alt+d in windbg to see extra serial protocol info.

Actually the detailed messages were read as following, but repeated many times.

READ: Packet Read ahead.
READ: Wait for type 2 packet
READ: Grab packet from buffer.
READ: Unexpected Packet type 7 (Acked). Expecting Packet type 2
PacketType=5, ByteCount=0, PacketId=5f747,
READ: Received RESEND packet
READ: Ask for resend.
PacketType=7, ByteCount=10f, PacketId=80800001,
READ: Received Type 7 data packet with id = 80800001 successfully.

READ: Unexpected Packet type 7 (Acked). Expecting Packet type 2
PacketType=6, ByteCount=0, PacketId=5f77b,
READ: Recieved KD_RESET packet, send KD_RESET ACK packet
WRITE: Write type 2 packet
READ: Wait for ACK packet
PacketType=7, ByteCount=10f, PacketId=80800000,
READ: Received VALID data packet while waiting for ACK.
READ: Received Type 7 data packet with id = 80800000 successfully.


It meant that the serial link was not working reliably, someone said. However, what is the solution?

I tried the workaround suggested on OSR forum

http://www.osronline.com/showThread.cfm?link=98509

Unfortunately, timeout=-1 didn't work for me!

So why did the kernel debugging stop working? It almost drove me crazy. Luckily, one day I noticed that warning sign on the status bar of vmware, "Your version of VMware
Tools is out of date", I had updated VMware, but forgot to update the tools! It could be the culprit I realized, so I updated the tools, guess what? Problem solved!
I could use VMware + Windbg to do kernel debugging again, bravo!