Skip to content

Integration with the Visual Studio 'Modules' Window

Andrew Crawley edited this page Feb 1, 2018 · 1 revision

Integration with the Visual Studio "Modules" window

Debug adapters that support the concept of "modules" (e.g. loaded binaries or scripts) can have their modules displayed in the Visual Studio "Modules" window.

Required implementation

To take advantage of this integration, debug adapters must:

  • Implement a handler for the modules request.
  • Send module events when a module is loaded or unloaded.
  • Return true for the supportsModulesRequest field in the Capabilities object returned in response to the initialize request.
  • Populate the additionalModuleColumns field in the Capabilities object returned in response to the initialize request, if any Visual Studio-specific fields are to be used.

Module fields

In addition to the standard fields provided on the Module object, the following Visual Studio-specific fields are supported:

Field Name Type Description Required ColumnDescriptor
vsLoadAddress string The module's load address, expressed as a string containing a 64-bit unsigned decimal number. { "attributeName": "vsLoadAddress", "type": "string" }
vsPreferredLoadAddress string The module's preferred load address, expressed as a string containing a 64-bit unsigned decimal number. { "attributeName": "vsPreferredLoadAddress", "type": "string"}
vsModuleSize integer The size of the module in the process's address space, in bytes. { "attributeName": "vsModuleSize", "type": "number"}
vsLoadOrder integer The order in which the module was loaded. { "attributeName": "vsLoadOrder", "type": "number"}
vsTimestampUTC string The module's build timestamp as a UNIX-style timestamp (i.e. the number of seconds elapsed since 00:00:00 UTC, January 1, 1970), expressed as a string containing a 64-bit signed decimal number. { "attributeName": "vsTimestampUTC", "type": "unixTimestampUTC"}
vsIs64Bit boolean Indicates whether or not the loaded module is 64-bit. { "attributeName": "vsIs64Bit", "type": "boolean"}
vsAppDomain string The name of the AppDomain in which the module is loaded, for .NET modules. { "attributeName": "vsAppDomain", "type": "string"}
vsAppDomainId integer The ID of the AppDomain in which the module is loaded, for .NET modules. { "attributeName": "vsAppDomainId", "type": "number"}

Sample

The following example is the body of a module event that uses these fields.

{
    "reason": "new",
    "module": {
        "id": "{1a1a2a59-8ef2-4904-9fb0-9482d7b1fa6f}",
        "name": "System.Runtime.dll",
        "path": "/usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0-preview1-002111-00/System.Runtime.dll",
        "isOptimized": true,
        "isUserCode": false,
        "symbolStatus": "Skipped loading symbols.",
        "vsLoadAddress": "140037931147264",
        "vsPreferredLoadAddress": "140037931147264",
        "vsModuleSize": 53248,
        "vsLoadOrder": 2,
        "vsTimestampUTC": "1493942921",
        "vsIs64Bit": true,
        "vsAppDomain": "clrhost",
        "vsAppDomainId": 1
    }
}
Clone this wiki locally