-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Variables" column tightly coupled to the VARIABLES view #154
Comments
@AdrianOltean Thank you for your feedback! I see how this is confusing. As you can imagine, this capability depends on the debug adapter that is being used with the Memory Inspector. One key feature of the Memory Inspector is its adaptability to different debug adapters, and it is intended to enable vendors to enhance the Memory Inspector for their hardware, debuggers, etc. Therefore, the Memory Inspector reads the data, such as variables, their addresses, etc. (via the MemoryProvider) from the registered AdapterCapabilities. To register adapter capabilities, vendors can use the Memory Inspector API. const memoryInspectorApi = vscode.extensions.getExtension('eclipse-cdt.memory-inspector');
if (!memoryInspectorApi) {
console.error('Memory Inspector API not found');
return;
}
const api: AdapterRegistry | undefined = await memoryInspectorApi.activate();
if (!api) {
console.error('Memory Inspector API is not available');
return;
}
context.subscriptions.push(
api.registerAdapter(new MyTestTracker(), '<debug-type>')
); In the adapter capability implementation they can provide the respective memory information for a specific debug session and also configure the display settings: export class MyTestTracker implements AdapterCapabilities {
async getVariables(session: vscode.DebugSession): Promise<VariableRange[]> {
return [{
startAddress: '0x00000000',
endAddress: '0x00000001',
name: 'variableName',
type: 'variableType',
value: 'variableValue'
}];
}
async getMemoryDisplaySettings(session: vscode.DebugSession): Promise<Partial<MemoryDisplaySettingsContribution>> {
return {
message: 'Vendor-XY Defaults.',
settings: {
bytesPerMau: 2,
mausPerGroup: 2,
endianness: 'Big Endian',
addressPadding: 64,
groupsPerRow: 'Autofit',
visibleColumns: ['variables']
}
};
}
} So as a user, if you don't install any specific extension that adapts the Memory Inspector, the CTracker (subclassing AdapterVariableTracker) will be used for the debug types configured by default, which is "gdb", "embedded-debug", and "arm-debugger" at the moment, but users can change that. As you can see in the AdapterVariableTracker it captures the variables when the debug client requests them, which I believe is the reason for the behavior you are observing. Other registered |
@planger Thanks for the detailed explanation. Given that we (NXP) use our own debug adapter ("mcuxpresso-debug"), we already added it by default in the list of supported/tracked debug types from Memory Inspector, along other preferences/settings pre-configured by default. But the |
Yes, that's right. Your mcuxpresso-debug--specific |
Yes, providing a custom |
Description
Memory Inspector editors allow enabling a Variables column. A nice and useful feature but its enablement is completely unintuitive and undocumented. In other words, the column is eventually populated only if the VARIABLES view is visible and its nodes are expanded. Current implementation seems to intercept debug adapter message/responses that are related to variables retrieval and only populate the Variables column when such messages are intercepted.
From my experiments, I have never been able to see anything in the Variables column when using CPPDBG debug adapter. Whereas when using Cortex Debug, the behavior is as described above.
Requests:
Additional information
Memory Inspector editor with VARIABLES collapsed:
Memory Inspector editor with VARIABLES nodes expanded:
The text was updated successfully, but these errors were encountered: