GDB Remote debugging in Windows

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
samueldotj
Member
Member
Posts: 32
Joined: Mon Nov 13, 2006 12:24 am

GDB Remote debugging in Windows

Post 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
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post 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.
User avatar
samueldotj
Member
Member
Posts: 32
Joined: Mon Nov 13, 2006 12:24 am

Post 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
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post 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
User avatar
samueldotj
Member
Member
Posts: 32
Joined: Mon Nov 13, 2006 12:24 am

Re: GDB Remote debugging in Windows

Post 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?
User avatar
samueldotj
Member
Member
Posts: 32
Joined: Mon Nov 13, 2006 12:24 am

Post 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.
Post Reply