From 0d59153be7be6015e5ec97976adeb30a42257bb1 Mon Sep 17 00:00:00 2001 From: Thays Grazia Date: Mon, 7 Jan 2019 17:13:10 -0200 Subject: [Debugger] Record time it took between steps. I implemented a new message to avoid breaking the protocol. I used the MonoStopwatch to count the time between the steps, it was already used in the debugger-agent. Fixes #8460 --- Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs | 7 +++++-- Mono.Debugger.Soft/Mono.Debugger.Soft/ThreadMirror.cs | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'Mono.Debugger.Soft') diff --git a/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs b/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs index c9da1c7..57f10e4 100644 --- a/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs +++ b/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs @@ -507,7 +507,8 @@ namespace Mono.Debugger.Soft GET_ID = 5, /* Ditto */ GET_TID = 6, - SET_IP = 7 + SET_IP = 7, + GET_ELAPSED_TIME = 8 } enum CmdEventRequest { @@ -2041,7 +2042,9 @@ namespace Mono.Debugger.Soft internal string Thread_GetName (long id) { return SendReceive (CommandSet.THREAD, (int)CmdThread.GET_NAME, new PacketWriter ().WriteId (id)).ReadString (); } - + internal long Thread_GetElapsedTime (long id) { + return SendReceive (CommandSet.THREAD, (int)CmdThread.GET_ELAPSED_TIME, new PacketWriter ().WriteId (id)).ReadLong (); + } internal void Thread_GetFrameInfo (long id, int start_frame, int length, Action resultCallaback) { Send (CommandSet.THREAD, (int)CmdThread.GET_FRAME_INFO, new PacketWriter ().WriteId (id).WriteInt (start_frame).WriteInt (length), (res) => { int count = res.ReadInt (); diff --git a/Mono.Debugger.Soft/Mono.Debugger.Soft/ThreadMirror.cs b/Mono.Debugger.Soft/Mono.Debugger.Soft/ThreadMirror.cs index 938a4ca..9f20534 100644 --- a/Mono.Debugger.Soft/Mono.Debugger.Soft/ThreadMirror.cs +++ b/Mono.Debugger.Soft/Mono.Debugger.Soft/ThreadMirror.cs @@ -30,11 +30,18 @@ namespace Mono.Debugger.Soft return frames; } + public long ElapsedTime () { + long elapsedTime = GetElapsedTime (); + return elapsedTime; + } + internal void InvalidateFrames () { cacheInvalid = true; threadStateInvalid = true; } - + internal long GetElapsedTime () { + return vm.conn.Thread_GetElapsedTime (id); + } internal void FetchFrames (bool mustFetch = false) { lock (fetchingLocker) { if (fetching || !cacheInvalid) -- cgit v1.2.3