Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@
{
"command": "rdbg.inspector.disableTraceClanguageCall",
"title": "✓ Trace c_call / c_return"
},
{
"command": "rdbg.setVariableValue",
"title": "Set Value"
}
],
"menus": {
Expand Down Expand Up @@ -370,6 +374,12 @@
"command": "rdbg.inspector.copyLog",
"when": "view == rdbg.inspector"
}
],
"debug/variables/context": [
{
"command": "rdbg.setVariableValue",
"when": "debugType == 'rdbg'"
}
]
}
},
Expand Down
22 changes: 22 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,28 @@ export function activate(context: vscode.ExtensionContext) {
}
}

context.subscriptions.push(
vscode.commands.registerCommand("rdbg.setVariableValue", async(variable) => {
const session = vscode.debug.activeDebugSession;
const value = await vscode.window.showInputBox({
title: "Enter a value of the variable",
});
if (value === undefined || session === undefined) {
return;
}
const name = variable.variable.name;
const args: DebugProtocol.EvaluateArguments = {
expression: `,eval ${name}=${value}`,
context: "repl"
};
try {
await session.customRequest("evaluate", args);
} catch (err) {
vscode.window.showErrorMessage(`Failed to set a value: ${err}`);
}
})
);

const disp = registerInspectorView(DAPTrackQueue, adapterDescriptorFactory);
context.subscriptions.concat(disp);
}
Expand Down