1/1

|
unable set flags jtag problem and patch
by Unknown on Oct 19, 2004 |
Not available! | ||
|
Hi,
During working with the or32 toolchain I've found some little problems in some of the tools. I've created several patches and I'll send them to the list. Can anybody with CVS write access (Matjaz?) have a look at them and apply the patches? The first patch is for the jtag tool: 1. wrong usage of the fcntl syscall which caused failing it sometimes: If fcntl was used with F_GETFL the third parameter mustn't be the variable in which the output should be written to. According to the manual the third parameter is not used when F_GETFL is used. The output of the syscall is returned as it's function return value. Fixed in the patch. This problem was reported several times on the mailing list, last was yesterday (subject "Subject: [openrisc] jp1 server") 2. If the gdb connection was closed from gdb, the (now invalid) filedescriptor of the connection remained in the poll set and caused a busy loop, because the poll returned always with an error. Fixed in the patch, too. The patch is against the current CVS. Best regards, Christian Krause =================================================================== RCS file: /home/oc/cvs/or1k/jtag/gdb.c,v retrieving revision 1.1 diff -u -r1.1 gdb.c --- gdb.c 5 Feb 2004 09:55:20 -0000 1.1 +++ gdb.c 19 Oct 2004 12:55:37 -0000 @@ -122,7 +122,7 @@ } /* The server should also be non blocking. Get the current flags. */ - if(fcntl(sockfd, F_GETFL, &flags) + if((flags = fcntl(sockfd, F_GETFL, 0)) sprintf(sTemp, "Unable to get flags for socket %d", sockfd); perror(sTemp); close(sockfd); @@ -261,7 +261,7 @@ return; } - if(fcntl(fd, F_GETFL, &flags) + if((flags = fcntl(fd, F_GETFL,0)) sprintf(sTemp, "Unable to get flags for gdb socket %d", fd); perror(sTemp); close(fd); Index: gdb2.c =================================================================== RCS file: /home/oc/cvs/or1k/jtag/gdb2.c,v retrieving revision 1.2 diff -u -r1.2 gdb2.c --- gdb2.c 14 Apr 2004 13:03:24 -0000 1.2 +++ gdb2.c 19 Oct 2004 12:55:42 -0000 @@ -131,7 +131,7 @@ } /* The server should also be non blocking. Get the current flags. */ - if(fcntl(sockfd, F_GETFL, &flags) + if((flags = fcntl(sockfd, F_GETFL, 0)) sprintf(sTemp, "Unable to get flags for socket %d", sockfd); perror(sTemp); close(sockfd); @@ -270,7 +270,7 @@ return; } - if(fcntl(fd, F_GETFL, &flags) + if((flags = fcntl(fd, F_GETFL, 0)) sprintf(sTemp, "Unable to get flags for gdb socket %d", fd); perror(sTemp); close(fd); Index: jp1.c =================================================================== RCS file: /home/oc/cvs/or1k/jtag/jp1.c,v retrieving revision 1.5 diff -u -r1.5 jp1.c --- jp1.c 25 Jan 2002 07:58:27 -0000 1.5 +++ jp1.c 19 Oct 2004 12:55:46 -0000 @@ -1191,7 +1191,7 @@ } /* The server should also be non blocking. Get the current flags. */ - if(fcntl(sockfd,F_GETFL,&flags) + if((flags = fcntl(sockfd,F_GETFL,0)) { sprintf(sTemp,"Unable to get flags for socket %d",sockfd); perror(sTemp); @@ -1317,6 +1317,12 @@ return; } } + if (fds[1].revents && !gdb_fd) { + /* gdb_fd was cleared because connection was closed, + * but fd still in poll set */ + fds[1].fd = -1; + n = 1; + } break; } /* End of switch statement */ } /* End of while statement */ @@ -1354,7 +1360,7 @@ return; } - if(fcntl(fd,F_GETFL,&flags) + if((flags = fcntl(fd,F_GETFL,0)) { sprintf(sTemp,"Unable to get flags for gdb socket %d",fd); perror(sTemp); |
|||
|
unable set flags jtag problem and patch
by Unknown on Oct 19, 2004 |
Not available! | ||
|
* Christian Krause (chkr@plauener.de) wrote:
Hi,
During working with the or32 toolchain I've found some little problems in some of the tools. I've created several patches and I'll send them to the list. Can anybody with CVS write access (Matjaz?) have a look at them and apply the patches? great, thank you. applied! best regards, p. |
|||
1/1

