MCPcopy Index your code
hub / github.com/Marus/cortex-debug / customRequest

Method customRequest

src/gdb.ts:1041–1172  ·  view source on GitHub ↗
(command: string, response: DebugProtocol.Response, args: any)

Source from the content-addressed store, hash-verified

1039 }
1040
1041 protected async customRequest(command: string, response: DebugProtocol.Response, args: any) {
1042 const retFunc = () => {
1043 this.sendErrorResponse(response, 110, `Custom request ${command} cannot be run now, because debugger is busy}`,
1044 undefined, ErrorDestination.Telemetry);
1045 return;
1046 };
1047
1048 if (this.serverController.customRequest(command, response, args)) {
1049 return retFunc();
1050 }
1051
1052 const isBusy = !this.stopped || this.continuing || !this.isMIStatusStopped();
1053 switch (command) {
1054 case 'liveEvaluate':
1055 if (this.miLiveGdb) {
1056 const r: DebugProtocol.EvaluateResponse = {
1057 ...response,
1058 body: {
1059 result: undefined,
1060 variablesReference: undefined
1061 }
1062 };
1063 await this.miLiveGdb.evaluateRequest(r, args);
1064 } else {
1065 this.sendResponse(response);
1066 }
1067 break;
1068 case 'liveCacheRefresh':
1069 if (this.miLiveGdb) {
1070 await this.miLiveGdb.refreshLiveCache(args);
1071 }
1072 this.sendResponse(response);
1073 break;
1074 case 'liveVariables':
1075 if (this.miLiveGdb) {
1076 const r: DebugProtocol.VariablesResponse = {
1077 ...response,
1078 body: {
1079 variables: []
1080 }
1081 };
1082 return this.miLiveGdb.variablesRequest(r, args);
1083 } else {
1084 this.sendResponse(response);
1085 }
1086 break;
1087 case 'is-global-or-static': {
1088 const varRef = args.varRef;
1089 const id = this.variableHandles.get(varRef);
1090 const ret = this.isVarRefGlobalOrStatic(varRef, id);
1091 response.body = { success: ret };
1092 this.sendResponse(response);
1093 break;
1094 }
1095 case 'load-function-symbols':
1096 response.body = { functionSymbols: this.symbolTable.getFunctionSymbols() };
1097 this.sendResponse(response);
1098 break;

Callers

nothing calls this directly

Calls 15

isMIStatusStoppedMethod · 0.95
setGdbOutputRadixMethod · 0.95
readRegistersRequestMethod · 0.95
resetDeviceMethod · 0.95
serverConsoleLogMethod · 0.95
disconnectRequest2Method · 0.95
COMMAND_MAPFunction · 0.85
refreshLiveCacheMethod · 0.80

Tested by

no test coverage detected