🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1506

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

#1506
From: Francisco Pastor
Date: Thu, 25 Jul 2002 10:35
119 lines
5529 bytes
This is a multi-part message in MIME format.

------=_NextPart_000_002E_01C233D7.B1CA0FF0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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) >=3D 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 () >=3D 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: fpastor.etra-id@grupoetra.com
Tf: 96 313 4082. Fax 96 350 3234
ETRA I+D
Avda. Tres Forques, 147
46014 Valencia


------=_NextPart_000_002E_01C233D7.B1CA0FF0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Testing remote debugging in the next =
gdb=20
version:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>GNU gdb 5.1.1<BR>Copyright 2002 Free =
Software=20
Foundation, Inc.<BR>GDB is free software, covered by the GNU General =
Public=20
License, and you are<BR>welcome to change it and/or distribute copies of =
it=20
under certain conditions.<BR>Type "show copying" to see the =
conditions.<BR>There=20
is absolutely no warranty for GDB.&nbsp; Type "show warranty" for=20
details.<BR>This GDB was configured as =
"i386-pc-msdosdjgpp".</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I found that the time-out for waiting =
response form=20
the target do not work.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This is because in the module =
ser-go32.c, the=20
funcion rawclock() defined in &lt;time.h&gt; return an unsigned long, =
and when=20
computing the expresion:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; if ((rawclock () - then) =
&gt;=3D=20
0)<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>this is always true (although =
'then'&nbsp;be=20
defined as long)&nbsp;. I suppose that happen in new versions of gcc=20
only.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The solution is change the expresion =
above=20
by:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; if (rawclock =
()&nbsp;&gt;=3D=20
then)<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>or (less elegant but easier) put a =
'#define=20
rawclock (long) rawclock' after the #include &lt;time.h&gt; to force =
signed the=20
type of the return of rawclock().</DIV></FONT>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thats all.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Francisco Pastor<BR>email: <A=20
href=3D"mailto:fpastor.etra-id@grupoetra.com">fpastor.etra-id@grupoetra.c=
om</A><BR>Tf:=20
96 313 4082. Fax 96 350 3234<BR>ETRA I+D<BR>Avda. Tres Forques, =
147<BR>46014=20
Valencia<BR></DIV></FONT></BODY></HTML>

------=_NextPart_000_002E_01C233D7.B1CA0FF0--
Technical Details
Message-ID: <003101c233c6$f64603c0$0500a8c0@magre>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed1.earthlink.net!newsfeed.earthlink.net!uunet!lax.uu.net!dfw.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,7585f1c276dfefa9,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 2002-07-26 01:44:56 PST
x-uunet-gateway: sjc3sosrv11.alter.net from bug-gdb to gnu.gdb.bug; Fri, 26 Jul 2002 08:44:55 GMT
Message-ID: <003101c233c6$f64603c0$0500a8c0@magre>
From: "Francisco Pastor" <fpastor.etra-id@grupoetra.com>
Subject: Bug using rawclock() function in module ser-go32.c
Date: Thu, 25 Jul 2002 12:35:01 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="----=_NextPart_000_002E_01C233D7.B1CA0FF0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-OriginalArrivalTime: 25 Jul 2002 10:34:04.0937 (UTC) FILETIME=[CC9FEF90:01C233C6]
Approved: bug-gdb-request@mail.gnu.org
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed2.earthlink.net!newsfeed1.earthlink.net!newsfeed.earthlink.net!uunet!lax.uu.net!dfw.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb
Sender: bug-gdb-request@mail.gnu.org
Lines: 120