bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug using rawclock() function in module ser-go32.c


From: Francisco Pastor
Subject: Bug using rawclock() function in module ser-go32.c
Date: Thu, 25 Jul 2002 12:35:01 +0200

Testing remote debugging in the next gdb version:
 
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-pc-msdosdjgpp".
 
I found that the time-out for waiting response form the target do not work.
 
This is because in the module ser-go32.c, the funcion rawclock() defined in <time.h> return an unsigned long, and when computing the expresion:
 
   if ((rawclock () - then) >= 0)
this is always true (although 'then' be defined as long) . I suppose that happen in new versions of gcc only.
 
The solution is change the expresion above by:
 
   if (rawclock () >= then)
or (less elegant but easier) put a '#define rawclock (long) rawclock' after the #include <time.h> to force signed the type of the return of rawclock().
 
Thats all.
 
Francisco Pastor
email: address@hidden
Tf: 96 313 4082. Fax 96 350 3234
ETRA I+D
Avda. Tres Forques, 147
46014 Valencia

reply via email to

[Prev in Thread] Current Thread [Next in Thread]