RevDebug

Displaying search results for .

Search: TMQL

Search through all states with your own queries

What is TMQL?

TMQL (Time Machine Query Language) is a query language that allows user to search through available application states within given recording. The first iteration of this language uses C# 6.0 syntax.
TMQL query is compiled using build-in .NET 4.0 compiler (CodeDom). Expressions used within this query can reference any types and methods, that are defined within .NET 4.0 System.dll and System.Core.dll libraries.

Opening TMQL query dialog window

TMQL query dialog can be opened either through RevDeBug menu:

tmql_menu.png

RevDeBug marker view toolbar:

tmql_markerview.png

Or by executing Find usages / Find executions commands:

tmql_contextmenu.png

Additionally, if you use Find usages/Find executions command, query dialog will already have query generated based on selected command.

Available identifiers

$BaseState
BaseState provides access to basic information about a single application state.
Available fields:

  • • id - state identifier,
  • • Timestamp - timestamp associated with current application state,
  • • ApplicationId - unique assembly identifier
  • • ThreadId - thread identifier
  • • statementId - linked statement

$VariableState
VariableState is a specific application state that is linked to an expression, that can be evaluated (variable, member access, function invocation, etc.).
Available fields (besides those, that are inherited from BaseState):

  • • Value - stored result of linked expression evaluation,
  • • TypeName - string containing the name of the value’s type,
  • • DeclarationId - if current variable state stores a variable or object’s member value, this field will contain statement id declaring this variable or member.

$Statement
Each application state is linked with a single statement, providing additional information about this state’s context. Statements can describe any syntax structure available: from variable assignments and binary expressions, to class declarations.
Available fields:

  • • id - unique statement identifier
  • • Identifier – fields functionality depends on statement’s type. In many cases this field contains original source code.

Current state and statement
User can reference current application state within TMQL query using “Current” prefix.

Examples

  • • Return all application states created after “2017-02-07 10:21:36.5”:
    new DateTime($BaseState.Timestamp) > DateTime.Parse(“2017-02-07 10:21:36.5”)

  • • Return application states with a DeclarationId same as current:
    $CurrentVariableState.DeclarationId == $VariableState.DeclarationId

  • • Return application states with Value equal to “3”:
    $VariableState.Value == “3”

Known Issues

  • •State id shown within marker view may deviate from values shown in control panel. That is, when jumping to application state from a result in marker view, application state id shown in control panel may be different from application state shown in marker view.

Didn't find answer to your problem? Contact us at
support@revdebug.com