From: Bernd Jendrissek <berndj@prism.co.za>
To: gdb@sources.redhat.com
Subject: Who's insane: gdb or I?
Date: Wed, 03 Jul 2002 06:16:00 -0000 [thread overview]
Message-ID: <20020703151547.A28413@prism.co.za> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm busy trying to hunt down a problem with INN (2.3.3), and at one point
I thought I might have found a compiler bug. But nooo... (more below)
1083 OVERtime+=(etv.tv_sec - stv.tv_sec) * 1000;
(gdb) s
1084 OVERtime+=(etv.tv_usec - stv.tv_usec) / 1000;
(gdb) s
1083 OVERtime+=(etv.tv_sec - stv.tv_sec) * 1000;
(gdb) s
1084 OVERtime+=(etv.tv_usec - stv.tv_usec) / 1000;
(gdb) s
1083 OVERtime+=(etv.tv_sec - stv.tv_sec) * 1000;
(gdb) s
1084 OVERtime+=(etv.tv_usec - stv.tv_usec) / 1000;
(gdb) list
1079 return;
1080 }
1081 if (PERMaccessconf->nnrpdoverstats) {
1082 gettimeofday(&etv, NULL);
1083 OVERtime+=(etv.tv_sec - stv.tv_sec) * 1000;
1084 OVERtime+=(etv.tv_usec - stv.tv_usec) / 1000;
1085 }
1086
1087 if (av[1] != NULL)
1088 Reply("%d %s fields follow\r\n", NNTP_OVERVIEW_FOLLOWS_VAL, av[1]);
(gdb) print OVERtime
$26 = 0
######### I can understand this if OVERtime is still in a register...
(gdb) print etv
$27 = {tv_sec = 1025700128, tv_usec = 739014}
(gdb) print etv stv
A parse error in expression, near `'.
(gdb) print etv, stv
$28 = {tv_sec = 1025700032, tv_usec = 32372}
(gdb) print etv
$29 = {tv_sec = 1025700128, tv_usec = 739014}
(gdb) print stv
$30 = {tv_sec = 1025700032, tv_usec = 32372}
objdump -S nnrpd of the relevant part:
if (PERMaccessconf->nnrpdoverstats) {
804cb25: a1 e8 9b 06 08 mov 0x8069be8,%eax
804cb2a: 83 78 74 00 cmpl $0x0,0x74(%eax)
804cb2e: 74 48 je 804cb78 <CMDxover+0x15c>
gettimeofday(&etv, NULL);
804cb30: 83 c4 f8 add $0xfffffff8,%esp
804cb33: 6a 00 push $0x0
804cb35: 8d 5d d0 lea 0xffffffd0(%ebp),%ebx
804cb38: 53 push %ebx
804cb39: e8 b6 d9 ff ff call 804a4f4 <_init+0x780>
OVERtime+=(etv.tv_sec - stv.tv_sec) * 1000;
804cb3e: 8b 45 d8 mov 0xffffffd8(%ebp),%eax
804cb41: 8b 4d d0 mov 0xffffffd0(%ebp),%ecx
804cb44: 29 c1 sub %eax,%ecx
OVERtime+=(etv.tv_usec - stv.tv_usec) / 1000;
804cb46: 8b 45 dc mov 0xffffffdc(%ebp),%eax
804cb49: 8b 73 04 mov 0x4(%ebx),%esi
804cb4c: 69 c9 e8 03 00 00 imul $0x3e8,%ecx,%ecx
804cb52: 29 c6 sub %eax,%esi
804cb54: bb d3 4d 62 10 mov $0x10624dd3,%ebx
804cb59: 89 f0 mov %esi,%eax
804cb5b: f7 eb imul %ebx,%eax
804cb5d: 03 0d b0 9b 06 08 add 0x8069bb0,%ecx
804cb63: c1 fa 06 sar $0x6,%edx
804cb66: 89 f0 mov %esi,%eax
804cb68: c1 f8 1f sar $0x1f,%eax
804cb6b: 29 c2 sub %eax,%edx
804cb6d: 01 d1 add %edx,%ecx
804cb6f: 89 0d b0 9b 06 08 mov %ecx,0x8069bb0
}
804cb75: 83 c4 10 add $0x10,%esp
Which all seems fine.
Why did gdb tell me that the "OVERtime+=..." part happened several times
over? A bad interaction with CFLAGS="... -O2 ..."? Still, there are no
jumps in the generated assembly... And why would gdb's idea of the
"current" line-number cycle between 1083 and 1084?
Bernd Jendrissek
- --
berndj@users.sourceforge.net is probably better to bookmark than any
employer-specific email address I may have appearing in the headers.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9Ivjt/FmLrNfLpjMRAhK2AJ9Lb7wjqA1Oj4V2CS9JWrF7n1DavwCfSt55
sgKfxWFsdH++XtlnjRS350A=
=u+rm
-----END PGP SIGNATURE-----
next reply other threads:[~2002-07-03 13:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-03 6:16 Bernd Jendrissek [this message]
2002-07-03 6:24 ` Eli Zaretskii
2002-07-03 6:42 ` Kris Warkentin
2002-07-03 9:29 ` Carlo Wood
2002-07-05 3:05 ` Bernd Jendrissek
2002-07-05 18:23 ` Who's insane: gdb or I? (Answer: I am) Bernd Jendrissek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020703151547.A28413@prism.co.za \
--to=berndj@prism.co.za \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox