MCPcopy Create free account
hub / github.com/Marus/cortex-debug / addToLiveWatch

Method addToLiveWatch

src/frontend/extension.ts:886–909  ·  view source on GitHub ↗
(arg: any)

Source from the content-addressed store, hash-verified

884 }
885
886 private addToLiveWatch(arg: any) {
887 if (!arg || !arg.sessionId) {
888 return;
889 }
890 const mySession = CDebugSession.FindSessionById(arg.sessionId);
891 if (!mySession) {
892 vscode.window.showErrorMessage(`addToLiveWatch: Unknown debug session id ${arg.sessionId}`);
893 return;
894 }
895 const parent = arg.container;
896 const expr = arg.variable?.evaluateName;
897 if (parent && expr) {
898 const varRef = parent.variablesReference;
899 mySession.session.customRequest('is-global-or-static', {varRef: varRef}).then((result) => {
900 if (!result.success) {
901 vscode.window.showErrorMessage(`Cannot add ${expr} to Live Watch. Must be a global or static variable`);
902 } else {
903 this.liveWatchProvider.addWatchExpr(expr, vscode.debug.activeDebugSession);
904 }
905 }, (e) => {
906 console.log(e);
907 });
908 }
909 }
910
911 private removeLiveWatchExpr(node: any) {
912 this.liveWatchProvider.removeWatchExpr(node);

Callers

nothing calls this directly

Calls 4

FindSessionByIdMethod · 0.80
addWatchExprMethod · 0.80
logMethod · 0.80
customRequestMethod · 0.65

Tested by

no test coverage detected