Page 1 of 1

GDB Remote debugging in Windows

Posted: Mon Nov 13, 2006 12:29 am
by samueldotj
Hi,

I tried GDB remote debugging a real machine using direct serial connection, but it is not working. Anybody tried it under windows environment (cygwin/mingw)?

Details:
I tested my serial direct cable connection with Windows Hyperterminal and my OS. It is working perfectly. I copied the i386-stub.c from the GDB source. Latest version of GDB(6.x.x) is crashing on remote debugging so I am using GDB 5.1.1(cygwin).


GDB connects to my kernel on hardcoded breakpoint (int3). However it is not able to read or write memory locations correctly. From the gdb debug messages I found that GDB sends only last two hexadecimal values for memory read/write.

(gdb) printf "%X\n", &wel
C0053F88
(gdb) printf "%X", wel
Sending packet: $m88,4#3d...Ack
Packet received: 17e800f0

Has any one faced this problem before?

Thanks
Sam

Posted: Mon Nov 13, 2006 10:08 am
by Dex
I have no experience with GDB etc, but i have code my own ver and had the same problem, this was fix by a delay in the send code.

Posted: Mon Nov 13, 2006 10:17 pm
by samueldotj
Dex wrote:I have no experience with GDB etc, but i have code my own ver and had the same problem, this was fix by a delay in the send code.
Can you share your code?

Thanks
Sam

Posted: Tue Nov 14, 2006 8:30 am
by Dex
Sure, but two problems 1. is the debugger runs on Dex4u OS (my OS), 2. the other half is for a ARM processor.
You can get code for debugger here: http://jas2o.forthworks.com/dexforum/in ... opic=174.0
You need the GP2Com.zip
If you want the ARM code let me know.

More info here: http://jas2o.forthworks.com/dexforum/in ... opic=142.0

Re: GDB Remote debugging in Windows

Posted: Thu Nov 16, 2006 12:31 am
by samueldotj
I thought the problem is related to cygwin/mingw, but after trying GDB in Fedora Core 6, I find that serial remote debugging has some problem.

Anyone using Linux(host)+gdb to debug your OS?

Posted: Mon Nov 20, 2006 12:44 am
by samueldotj
It was my mistake, I used wrong option.

Wrong setting
set remoteaddresssize 8

Correct setting
set remoteaddresssize 32


Now I am able to debug my kenrel using GDB.