This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
RDI over UDP: patch to fix the fetch_ports() function
- To: Grant Edwards <grante at visi dot com>, gdb-patches at sourceware dot cygnus dot com
- Subject: RDI over UDP: patch to fix the fetch_ports() function
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Tue, 04 Jan 2000 18:33:29 -0500
- Organization: Cygnus Solutions - Toronto Office
- References: <19991026115814.A24641@visi.com> <38727BC3.B7F3BD94@cygnus.com>
I had to apply the attached patch for gdb to be able to get the UDP port
numbers with some RDI over UDP targets.
The message is sent to the control port (a fixed UPD port) and it gets
back 4 words with port numbers. With these targets, if the query
message does not contain 4 cleared words it returns garbage.
I only decided to make this change because: 1) I won't be able to get
these RDI targets fixed; 2) The ARM SDK debugger does send the 4 cleared
words (who knows why); 3) It does not seem to hurt any other target.
If someone finds that 3 is false, please let me know and I will make it
a switch.
--
Fernando Nasser
Cygnus Solutions - Toronto Office E-Mail: fnasser@cygnus.com
2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311
Toronto, Ontario M4P 2C9 Fax: 416-482-6299
Index: etherdrv.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/rdi-share/etherdrv.c,v
retrieving revision 1.8
diff -c -r1.8 etherdrv.c
*** etherdrv.c 1999/11/01 15:32:58 1.8
--- etherdrv.c 2000/01/04 23:16:49
***************
*** 266,274 ****
static void fetch_ports(void)
{
int i;
! const char ctrlpacket[] = CTRL_MAGIC;
! CtrlResponse response;
/*
* we will try 3 times to elicit a response from the target
*/
--- 266,277 ----
static void fetch_ports(void)
{
int i;
! char ctrlpacket[10];
! CtrlResponse response;
+ memset (ctrlpacket, 0, 10);
+ strcpy (ctrlpacket, CTRL_MAGIC);
+ memset (response, 0, sizeof(CtrlResponse));
/*
* we will try 3 times to elicit a response from the target
*/