Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* "Transfer rate" patch
@ 2006-09-05  7:25 Ilko Iliev
  2006-09-05 18:03 ` Michael Snyder
  2006-09-06  7:11 ` Vladimir Prus
  0 siblings, 2 replies; 10+ messages in thread
From: Ilko Iliev @ 2006-09-05  7:25 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

Hi,

I found a small bug by the calculating of the transfer rate at the 
"load" command - if the download image size or the download speed is 
higher then occurs overflow and the printed information is wrong.

I attached a patch for this problem.


regards,
Ilko Iliev
www.ronetix.at



[-- Attachment #2: gdb_download_speed.patch --]
[-- Type: text/plain, Size: 826 bytes --]

--- symfile.c.orig	2006-08-31 15:29:12.000000000 +0200
+++ symfile.c	2006-08-31 15:47:28.000000000 +0200
@@ -1769,14 +1769,14 @@
   ui_out_text (uiout, "Transfer rate: ");
   if (time_count > 0)
     {
-      ui_out_field_fmt (uiout, "transfer-rate", "%lu",
-			1000 * (data_count * 8) / time_count);
-      ui_out_text (uiout, " bits/sec");
+      ui_out_field_fmt (uiout, "transfer-rate", "%lu", 
+	(unsigned long)((((unsigned long long)data_count)*1000)/time_count)/1024);
+      ui_out_text (uiout, " Kbytes/sec");
     }
   else
     {
-      ui_out_field_fmt (uiout, "transferred-bits", "%lu", (data_count * 8));
-      ui_out_text (uiout, " bits in <1 sec");
+      ui_out_field_fmt (uiout, "transferred-bits", "%lu", data_count);
+      ui_out_text (uiout, " bytes in <1 sec");
     }
   if (write_count > 0)
     {



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-10-17 16:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-05  7:25 "Transfer rate" patch Ilko Iliev
2006-09-05 18:03 ` Michael Snyder
2006-09-06  7:11 ` Vladimir Prus
2006-09-07 14:20   ` Ilko Iliev
2006-09-07 14:58     ` Vladimir Prus
2006-09-07 19:54     ` Mark Kettenis
2006-09-10 18:50       ` Ilko Iliev
2006-10-17 16:04         ` Andrew STUBBS
2006-10-17 16:08           ` Daniel Jacobowitz
2006-09-07 14:44   ` Andrew STUBBS

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox