Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Dmitry Kozlov <dmitry_kozlov@mentor.com>
To: Tom Tromey <tromey@redhat.com>
Cc: <gdb-patches@sourceware.org>,
	"'Stan_Shebs@mentor.com'"	<Stan_Shebs@mentor.com>,
	Vladimir Prus <vladimir@codesourcery.com>
Subject: Re: PATCH fix start-time and stop-time in trace-status
Date: Mon, 01 Oct 2012 13:41:00 -0000	[thread overview]
Message-ID: <50699D74.2090401@mentor.com> (raw)
In-Reply-To: <87d317wlaa.fsf@fleche.redhat.com>

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

Tom,
I have updated the patch.

Thank you,
Dmitry

On 09/27/2012 07:14 PM, Tom Tromey wrote:
>>>>>> "Dmitry" == Dmitry Kozlov <dmitry_kozlov@mentor.com> writes:
> Dmitry> +char *unpack_ulongest (char *buff, ULONGEST *result);
>
> I think you could use the existing strtoulst rather than introducing a
> new function.
>
> Tom


[-- Attachment #2: gdb_dates_v2.diff --]
[-- Type: text/x-patch, Size: 2843 bytes --]

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 20631b5..eeaf805 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-01  Dmitry Kozlov  <ddk@mentor.com>
+
+	* tracepoint.c (trace_status_command): Fix type of printf arg.
+	(trace_status_mi): Likewise.
+
 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
 
 	* target.c (simple_search_memory): Include access length in
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index cce8d00..0f94150 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -2041,20 +2041,20 @@ trace_status_command (char *args, int from_tty)
 
 	  /* Reporting a run time is more readable than two long numbers.  */
 	  printf_filtered (_("Trace started at %ld.%06ld secs, stopped %ld.%06ld secs later.\n"),
-			   (long int) ts->start_time / 1000000,
-			   (long int) ts->start_time % 1000000,
-			   (long int) run_time / 1000000,
-			   (long int) run_time % 1000000);
+			   (long int) (ts->start_time / 1000000),
+			   (long int) (ts->start_time % 1000000),
+			   (long int) (run_time / 1000000),
+			   (long int) (run_time % 1000000));
 	}
       else
 	printf_filtered (_("Trace started at %ld.%06ld secs.\n"),
-			 (long int) ts->start_time / 1000000,
-			 (long int) ts->start_time % 1000000);
+			 (long int) (ts->start_time / 1000000),
+			 (long int) (ts->start_time % 1000000));
     }
   else if (ts->stop_time)
     printf_filtered (_("Trace stopped at %ld.%06ld secs.\n"),
-		     (long int) ts->stop_time / 1000000,
-		     (long int) ts->stop_time % 1000000);
+		     (long int) (ts->stop_time / 1000000),
+		     (long int) (ts->stop_time % 1000000));
 
   /* Now report any per-tracepoint status available.  */
   tp_vec = all_tracepoints ();
@@ -2169,12 +2169,12 @@ trace_status_mi (int on_stop)
     char buf[100];
 
     xsnprintf (buf, sizeof buf, "%ld.%06ld",
-	       (long int) ts->start_time / 1000000,
-	       (long int) ts->start_time % 1000000);
+	       (long int) (ts->start_time / 1000000),
+	       (long int) (ts->start_time % 1000000));
     ui_out_field_string (uiout, "start-time", buf);
     xsnprintf (buf, sizeof buf, "%ld.%06ld",
-	       (long int) ts->stop_time / 1000000,
-	       (long int) ts->stop_time % 1000000);
+	       (long int) (ts->stop_time / 1000000),
+	       (long int) (ts->stop_time % 1000000));
     ui_out_field_string (uiout, "stop-time", buf);
   }
 }
@@ -3940,12 +3940,12 @@ Status line: '%s'\n"), p, line);
 	}
       else if (strncmp (p, "starttime", p1 - p) == 0)
 	{
-	  p = unpack_varlen_hex (++p1, &val);
+	  val = strtoulst(++p1, (const char **) &p, 10);
 	  ts->start_time = val;
 	}
       else if (strncmp (p, "stoptime", p1 - p) == 0)
 	{
-	  p = unpack_varlen_hex (++p1, &val);
+	  val = strtoulst(++p1, (const char **) &p, 10);
 	  ts->stop_time = val;
 	}
       else if (strncmp (p, "username", p1 - p) == 0)

  reply	other threads:[~2012-10-01 13:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-27 12:22 Dmitry Kozlov
2012-09-27 15:14 ` Tom Tromey
2012-10-01 13:41   ` Dmitry Kozlov [this message]
2012-10-15 19:11     ` Tom Tromey
2012-10-16 14:59       ` Dmitry Kozlov
2012-10-16 15:15         ` Pedro Alves
2012-10-16 17:07           ` Stan Shebs
2012-10-16 16:51         ` Tom Tromey
2012-10-08 13:54   ` Dmitry Kozlov

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=50699D74.2090401@mentor.com \
    --to=dmitry_kozlov@mentor.com \
    --cc=Stan_Shebs@mentor.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    --cc=vladimir@codesourcery.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