eclipse-cdt-cloud / vscode-memory-inspector

vscode memory inspector
https://open-vsx.org/extension/eclipse-cdt/memory-inspector
Eclipse Public License 2.0
8 stars 12 forks source link

Memory Inspector

A Visual Studio Code extension that provides a powerful and configurable memory viewer that works with debug adapters.

Screenshot of the Memory Inspector

Features

Getting Started

Prerequisites

  1. Install: Add the extension to VS Code.
  2. Verify Debugger Capability: Ensure the debug adapter supports ReadMemory requests.
  3. Enable Debug Type: Enable the Memory Inspector for the debug configuration type (VS Code setting Debug Types: memory-inspector.debugTypes).

Use Memory Inspector

  1. Debug Session: Start a debug session.
  2. Open Memory Inspector: Either run the Memory: Show Memory Inspector command or right-click a variable in the Variables view and select Show in Memory Inspector.
  3. Adjust View: Modify the memory range you're interested in, as needed.

Configuration

Use the gear symbol in each memory view to customize the individual settings like columns, grouping, and formats. Default settings can be adjusted in the VS Code settings of this extension.

Memory Format Settings

The Memory Format settings allow to configure how data that is read from the target system is interpreted and displayed. Use the following to adjust the view to your needs and the inspected memory architecture:

Screenshot of the Memory Inspector

  1. Bytes per MAU: The number of Bytes that form the Minimum Addressable Unit. It commonly is a fixed number for a specific target hardware. Use for example a value of 1 for byte-addressable architectures.
  2. MAUs per Group: The number of MAUs that form a Group considering the selected Endianess. Use for example a value of 2 to form a 4-byte value consisting of 2 2-byte MAUs.
  3. Groups per Row: Number of Groups to display in a row. This can be a fixed number of Groups. Or the value Autofit to let the Memory Inspector calculate the best utilization of space in the Data column.
  4. Group Endianess: The order of MAUs within a Group. The value can be Little Endian or Big Endian.

Screenshot of the Memory Inspector

The following terminology is used:

Contributing

We welcome contributions on GitHub. Check our contribution guidelines for more info. This open-source project is part of Eclipse CDT Cloud.

Behind the Scenes

The Memory Provider

The primary entry point for the backend functionality of the plugin is the the MemoryProvider class. That class has two primary functions: it handles requests that are specified by the Debug Adapter Protocol, and it instantiates custom handlers that can provide additional functionality depending on the capabilities of a given debug adapter. In order to register custom capabilities, the AdapterRegistry matches debug types to objects implementing the AdapterCapabilities interface.

Memory Widget

The MemoryWidget is a wrapper around two functional widgets, a MemoryOptionsWidget and aMemoryTableWidget. The OptionsWidget is responsible for configuring the display and fetching memory, and the MemoryTable renders the memory according to the options specified by the user in the options.