diff --git a/dist/adapter.js b/dist/adapter.js index 0ff9a2b..eac0ede 100644 --- a/dist/adapter.js +++ b/dist/adapter.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vscode-debugadapter")):"function"==typeof define&&define.amd?define(["vscode-debugadapter"],t):"object"==typeof exports?exports["platformio-vscode-debug"]=t(require("vscode-debugadapter")):e["platformio-vscode-debug"]=t(e["vscode-debugadapter"])}(global,function(e){return(()=>{"use strict";var t={370:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,i)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return i(t,e),t},o=this&&this.__awaiter||function(e,t,s,r){return new(s||(s=Promise))(function(i,n){function o(e){try{d(r.next(e))}catch(e){n(e)}}function a(e){try{d(r.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s(function(e){e(t)})).then(o,a)}d((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.GDBDebugSession=void 0;const a=n(s(113)),d=n(s(147)),l=s(512),u=s(797),h=s(200),c=s(593),p=s(253),b=s(175),m=s(922),f=s(74),g=s(434);class v{constructor(e,t){this.name=e,this.options=t}}const y=65536,R=131071;class x extends u.Event{constructor(e,t){super("custom-stop",{reason:e,threadID:t})}}class E extends u.Event{constructor(e,t=!0){super("custom-continued",{threadID:e,allThreads:t})}}class O extends u.DebugSession{constructor(e,t){super(e,t),this.variableHandles=new u.Handles(131072),this.variableHandlesReverse={},this.forceDisassembly=!1,this.activeEditorPath=null,this.currentThreadId=0,this.stopped=!1,this.stoppedReason="",this.breakpointMap=new Map,this.fileExistsCache=new Map}initDebugger(){this.miDebugger.on("launcherror",this.launchError.bind(this)),this.miDebugger.on("quit",this.quitEvent.bind(this)),this.miDebugger.on("exited-normally",this.quitEvent.bind(this)),this.miDebugger.on("stopped",this.stopEvent.bind(this)),this.miDebugger.on("msg",this.handleMsg.bind(this)),this.miDebugger.on("breakpoint",this.handleBreakpoint.bind(this)),this.miDebugger.on("step-end",this.handleBreak.bind(this)),this.miDebugger.on("step-out-end",this.handleBreak.bind(this)),this.miDebugger.on("signal-stop",this.handlePause.bind(this)),this.miDebugger.on("running",this.handleRunning.bind(this)),this.miDebugger.on("thread-created",this.handleThreadCreated.bind(this)),this.miDebugger.on("thread-exited",this.handleThreadExited.bind(this)),this.miDebugger.on("thread-selected",this.handleThreadSelected.bind(this)),this.sendEvent(new u.InitializedEvent)}initializeRequest(e,t){e.body.supportsConditionalBreakpoints=!0,e.body.supportsConfigurationDoneRequest=!0,e.body.supportsEvaluateForHovers=!0,e.body.supportsFunctionBreakpoints=!0,e.body.supportsHitConditionalBreakpoints=!0,e.body.supportsRestartRequest=!0,e.body.supportsSetVariable=!0,e.body.supportsTerminateRequest=!0,e.body.supportsValueFormattingOptions=!0,this.sendResponse(e)}launchRequest(e,t){this.args=t,this.processLaunchAttachRequest(e,!1)}attachRequest(e,t){this.args=t,this.processLaunchAttachRequest(e,!0)}processLaunchAttachRequest(e,t){this.quit=!1,this.attached=!1,this.started=!1,this.crashed=!1,this.debugReady=!1,this.stopped=!1,this.breakpointMap=new Map,this.fileExistsCache=new Map;const s=["debug"];this.args.projectEnvName&&s.push("-e",this.args.projectEnvName),this.args.loadMode&&s.push("--load-mode",this.args.loadMode),s.push("--interface","gdb","--interpreter=mi2","-q"),this.miDebugger=new m.MI2("platformio",s),this.initDebugger(),this.miDebugger.printCalls=!!this.args.showDevDebugOutput,this.miDebugger.debugOutput=!!this.args.showDevDebugOutput,this.miDebugger.once("debug-ready",()=>{this.debugReady=!0,this.stopped=!0,this.stoppedReason="start",this.sendEvent(new h.StoppedEvent("start",this.currentThreadId,!0)),this.sendEvent(new x("start",this.currentThreadId))}),this.miDebugger.connect(this.args.cwd,['interpreter-exec console "source .pioinit"',"enable-pretty-printing"]).then(()=>{this.symbolTable=new g.SymbolTable(this.args.toolchainBinDir,this.args.executable);try{this.symbolTable.loadSymbols(),this.started=!0,this.sendResponse(e)}catch(t){this.args.toolchainBinDir&&this.sendErrorResponse(e,102,`Failed to load symbols from executable file: ${t.toString()}`)}},t=>{this.sendErrorResponse(e,103,`Failed to launch GDB: ${t.toString()}`)})}customRequest(e,t,s){switch(e){case"set-force-disassembly":t.body={success:!0},this.forceDisassembly=s.force,this.stopped&&(this.activeEditorPath=null,this.sendEvent(new u.ContinuedEvent(this.currentThreadId,!0)),this.sendEvent(new h.StoppedEvent(this.stoppedReason,this.currentThreadId,!0))),this.sendResponse(t);break;case"load-function-symbols":t.body={functionSymbols:this.symbolTable.getFunctionSymbols()},this.sendResponse(t);break;case"set-active-editor":this.activeEditorPath=s.path,t.body={},this.sendResponse(t);break;case"get-arguments":t.body=this.args,this.sendResponse(t);break;case"read-memory":this.customReadMemoryRequest(t,s.address,s.length);break;case"write-memory":this.customWriteMemoryRequest(t,s.address,s.data);break;case"read-registers":this.customReadRegistersRequest(t);break;case"read-register-list":this.customReadRegisterListRequest(t);break;case"disassemble":this.disassembleRequest(t,s);break;case"execute-command":let e=s.command;e=e.startsWith("-")?e.substring(1):`interpreter-exec console "${e}"`,this.miDebugger.sendCommand(e).then(e=>{t.body=e.resultRecords,this.sendResponse(t)},e=>{t.body=e,this.sendErrorResponse(t,110,"Unable to execute command")});break;default:t.body={error:"Invalid command."},this.sendResponse(t)}}disassembleRequest(e,t){return o(this,void 0,void 0,function*(){if(t.function)try{const s=yield this.getDisassemblyForFunction(t.function,t.file);e.body={instructions:s.instructions,name:s.name,file:s.file,address:s.address,length:s.length},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,1,`Unable to disassemble: ${t.toString()}`)}else if(t.startAddress)try{let s=this.symbolTable.getFunctionAtAddress(t.startAddress);if(s)s=yield this.getDisassemblyForFunction(s.name,s.file),e.body={instructions:s.instructions,name:s.name,file:s.file,address:s.address,length:s.length},this.sendResponse(e);else{const s=yield this.getDisassemblyForAddresses(t.startAddress,t.length||256);e.body={instructions:s},this.sendResponse(e)}}catch(t){this.sendErrorResponse(e,1,`Unable to disassemble: ${t.toString()}`)}else this.sendErrorResponse(e,1,"Unable to disassemble; invalid parameters.")})}getDisassemblyForFunction(e,t){return o(this,void 0,void 0,function*(){const s=this.symbolTable.getFunctionByName(e,t);if(!s)throw new Error(`Unable to find function with name ${e}.`);if(s.instructions)return s;const r=s.address,i=s.address+s.length,n=(yield this.miDebugger.sendCommand(`data-disassemble -s ${(0,c.hexFormat)(r,8)} -e ${(0,c.hexFormat)(i,8)} -- 2`)).result("asm_insns").map(e=>({address:f.MINode.valueOf(e,"address"),functionName:f.MINode.valueOf(e,"func-name"),offset:parseInt(f.MINode.valueOf(e,"offset")),instruction:f.MINode.valueOf(e,"inst"),opcodes:f.MINode.valueOf(e,"opcodes")}));return s.instructions=n,s})}getDisassemblyForAddresses(e,t){return o(this,void 0,void 0,function*(){const s=e+t;return(yield this.miDebugger.sendCommand(`data-disassemble -s ${(0,c.hexFormat)(e,8)} -e ${(0,c.hexFormat)(s,8)} -- 2`)).result("asm_insns").map(e=>({address:f.MINode.valueOf(e,"address"),functionName:f.MINode.valueOf(e,"func-name"),offset:parseInt(f.MINode.valueOf(e,"offset")),instruction:f.MINode.valueOf(e,"inst"),opcodes:f.MINode.valueOf(e,"opcodes")}))})}customReadMemoryRequest(e,t,s){this.miDebugger.examineMemory(t,s).then(s=>{const r=s.match(/[0-9a-f]{2}/g).map(e=>parseInt(e,16));e.body={startAddress:t,endAddress:t+r.length,bytes:r},this.sendResponse(e)},t=>{e.body={error:t},this.sendErrorResponse(e,114,`Unable to read memory: ${t.toString()}`)})}customWriteMemoryRequest(e,t,s){const r=(0,c.hexFormat)(t,8);this.miDebugger.sendCommand(`data-write-memory-bytes ${r} ${s}`).then(t=>{this.sendResponse(e)},t=>{e.body={error:t},this.sendErrorResponse(e,114,`Unable to write memory: ${t.toString()}`)})}customReadRegistersRequest(e){this.miDebugger.sendCommand("data-list-register-values x").then(t=>{if("done"===t.resultRecords.resultClass){const s=t.resultRecords.results[0][1];e.body=s.map(e=>{const t={};return e.forEach(e=>{t[e[0]]=e[1]}),t})}else e.body={error:"Unable to parse response"};this.sendResponse(e)},t=>{e.body={error:t},this.sendErrorResponse(e,115,`Unable to read registers: ${t.toString()}`)})}customReadRegisterListRequest(e){this.miDebugger.sendCommand("data-list-register-names").then(t=>{if("done"===t.resultRecords.resultClass){let s;t.resultRecords.results.forEach(e=>{"register-names"===e[0]&&(s=e[1])}),e.body=s}else e.body={error:t.resultRecords.results};this.sendResponse(e)},t=>{e.body={error:t},this.sendErrorResponse(e,116,`Unable to read register list: ${t.toString()}`)})}disconnectRequest(e,t){this.miDebugger&&(this.attached?this.miDebugger.detach():this.miDebugger.stop(!0)),this.sendResponse(e)}terminateRequest(e,t){this.miDebugger&&this.miDebugger.stop(),this.sendResponse(e)}restartRequest(e,t){const s=()=>{this.miDebugger.restart(['interpreter-exec console "pio_restart_target"']).then(t=>{this.sendResponse(e),(0,l.setTimeout)(()=>{this.stopped=!0,this.stoppedReason="restart",this.sendEvent(new u.ContinuedEvent(this.currentThreadId,!0)),this.sendEvent(new h.StoppedEvent("restart",this.currentThreadId,!0))},50)},t=>{this.sendErrorResponse(e,6,`Could not restart: ${t}`)})};this.stopped?s():(this.miDebugger.once("generic-stopped",s),this.miDebugger.sendCommand("exec-interrupt"))}handleAdapterOutput(e){this.sendEvent(new h.AdapterOutputEvent(e,"out"))}handleMsg(e,t){"target"===e&&(e="stdout"),"log"===e&&(e="stderr"),this.sendEvent(new u.OutputEvent(t,e))}handleRunning(e){this.stopped=!1,this.sendEvent(new u.ContinuedEvent(this.currentThreadId,!0)),this.sendEvent(new E(this.currentThreadId,!0))}handleBreakpoint(e){const t=parseInt(e.record("thread-id")||this.currentThreadId);this.stopped=!0,this.stoppedReason="breakpoint",this.sendEvent(new h.StoppedEvent("breakpoint",t,!0)),this.sendEvent(new x("breakpoint",t))}handleBreak(e){this.stopped=!0,this.stoppedReason="step",this.sendEvent(new h.StoppedEvent("step",this.currentThreadId,!0)),this.sendEvent(new x("step",this.currentThreadId))}handlePause(e){this.stopped=!0,this.stoppedReason="user request",this.sendEvent(new h.StoppedEvent("user request",this.currentThreadId,!0)),this.sendEvent(new x("user request",this.currentThreadId))}handleThreadCreated(e){this.sendEvent(new u.ThreadEvent("started",e.threadId))}handleThreadExited(e){this.sendEvent(new u.ThreadEvent("exited",e.threadId))}handleThreadSelected(e){this.currentThreadId=e.threadId,this.sendEvent(new u.ThreadEvent("selected",e.threadId))}stopEvent(e){this.started||(this.crashed=!0),this.quit||(this.stopped=!0,this.stoppedReason="exception",this.sendEvent(new h.StoppedEvent("exception",this.currentThreadId,!0)),this.sendEvent(new x("exception",this.currentThreadId)))}quitEvent(){this.quit=!0,this.sendEvent(new u.TerminatedEvent)}launchError(e){this.handleMsg("stderr",`Could not start debugger process > ${e.toString()}\n`),this.quitEvent()}setFunctionBreakPointsRequest(e,t){if(!t.breakpoints||!t.breakpoints.length)return;const s=s=>o(this,void 0,void 0,function*(){const r=[];t.breakpoints.forEach(e=>{r.push(this.miDebugger.addBreakPoint({raw:e.name,condition:e.condition,countCondition:e.hitCondition}))});try{const t=yield Promise.all(r),s=[];t.forEach(e=>{e[0]&&s.push({line:e[1].line})}),e.body={breakpoints:s},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,10,t.toString())}s&&(yield this.miDebugger.sendCommand("exec-continue"))}),r=()=>o(this,void 0,void 0,function*(){this.stopped?yield s(!1):(this.miDebugger.sendCommand("exec-interrupt"),this.miDebugger.once("generic-stopped",()=>{s(!0)}))});this.debugReady?r():this.miDebugger.once("debug-ready",r)}setBreakPointsRequest(e,t){const s=s=>o(this,void 0,void 0,function*(){this.debugReady=!0;const r=(this.breakpointMap.get(t.source.path)||[]).map(e=>e.number);try{yield this.miDebugger.removeBreakpoints(r),this.breakpointMap.set(t.source.path,[]);const s=[],i=decodeURIComponent(t.source.path);if(i.startsWith("disassembly:/")){const e=(0,c.parseQuery)(i.substr(i.indexOf("?"))),r=yield this.getDisassemblyForFunction(e.func,e.file);t.breakpoints.forEach(e=>{if(e.line<=r.instructions.length){const i=r.instructions[e.line-1];s.push(this.miDebugger.addBreakPoint({file:t.source.path,line:e.line,condition:e.condition,countCondition:e.hitCondition,raw:i.address}))}})}else t.breakpoints.forEach(e=>{s.push(this.miDebugger.addBreakPoint({file:t.source.path,line:e.line,condition:e.condition,countCondition:e.hitCondition}))});const n=(yield Promise.all(s)).filter(e=>null!==e);e.body={breakpoints:n.map(e=>({line:e.line,id:e.number,verified:!0}))},this.breakpointMap.set(t.source.path,n),this.sendResponse(e)}catch(t){this.sendErrorResponse(e,9,t.toString())}s&&(yield this.miDebugger.sendCommand("exec-continue"))}),r=()=>o(this,void 0,void 0,function*(){this.stopped?yield s(!1):(yield this.miDebugger.sendCommand("exec-interrupt"),this.miDebugger.once("generic-stopped",()=>{s(!0)}))});this.debugReady?r():this.miDebugger.once("debug-ready",r)}threadsRequest(e){return o(this,void 0,void 0,function*(){if(!this.stopped)return e.body={threads:[]},void this.sendResponse(e);try{const t=yield this.miDebugger.sendCommand("thread-list-ids"),s=t.result("thread-ids").map(e=>parseInt(e[1])),r=t.result("current-thread-id");r?this.currentThreadId=parseInt(r):(yield this.miDebugger.sendCommand(`thread-select ${s[0]}`),this.currentThreadId=s[0]);const i=(yield Promise.all(s.map(e=>this.miDebugger.sendCommand(`thread-info ${e}`)))).map(e=>{let t=e.result("threads");if(1===t.length){t=t[0];const e=parseInt(f.MINode.valueOf(t,"id")),s=f.MINode.valueOf(t,"target-id"),r=f.MINode.valueOf(t,"details");return new u.Thread(e,r||s)}return null}).filter(e=>null!==e);e.body={threads:i},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,1,`Unable to get thread information: ${t}`)}})}stackTraceRequest(e,t){return o(this,void 0,void 0,function*(){try{const s=yield this.miDebugger.getStack(t.threadId,t.startFrame,t.levels),r=[];for(const e of s){const s=65535&(t.threadId<<8|255&e.level),i=e.file;let n=this.forceDisassembly||!i;if(n||(n=!(yield this.checkFileExists(i))),!n&&this.activeEditorPath&&this.activeEditorPath.startsWith("disassembly://")){const t=this.symbolTable.getFunctionByName(e.function,e.fileName);t&&(0,c.encodeDisassembly)(t.name,t.file)===this.activeEditorPath&&(n=!0)}try{if(n){const t=yield this.getDisassemblyForFunction(e.function,e.fileName);let i=-1;if(t.instructions.forEach((t,s)=>{t.address===e.address&&(i=s+1)}),-1!==i){const n=(0,c.encodeDisassembly)(t.name,t.file);r.push(new u.StackFrame(s,`${e.function}@${e.address}`,new u.Source(t.name,n),i,0))}else r.push(new u.StackFrame(s,e.function+"@"+e.address,null,e.line,0))}else r.push(new u.StackFrame(s,e.function+"@"+e.address,new u.Source(e.fileName,i),e.line,0))}catch(t){r.push(new u.StackFrame(s,e.function+"@"+e.address,null,e.line,0))}}e.body={stackFrames:r},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,12,`Failed to get Stack Trace: ${t.toString()}`)}})}configurationDoneRequest(e,t){this.sendResponse(e)}scopesRequest(e,t){const s=new Array;s.push(new u.Scope("Local",parseInt(t.frameId),!1)),s.push(new u.Scope("Global",254,!1)),s.push(new u.Scope("Static",y+parseInt(t.frameId),!1)),e.body={scopes:s},this.sendResponse(e)}createVariable(e,t){return t?this.variableHandles.create(new v(e,t)):this.variableHandles.create(e)}findOrCreateVariable(e){let t;return this.variableHandlesReverse.hasOwnProperty(e.name)?t=this.variableHandlesReverse[e.name]:(t=this.createVariable(e),this.variableHandlesReverse[e.name]=t),e.isCompound()?t:0}getVarObjByName(e,t){return o(this,void 0,void 0,function*(){let s;try{(yield this.miDebugger.varUpdate(t)).result("changelist").forEach(e=>{const t=f.MINode.valueOf(e,"name"),s=this.variableHandlesReverse[t];this.variableHandles.get(s).applyChanges(e)});const e=this.variableHandlesReverse[t];s=this.variableHandles.get(e)}catch(r){if(!(r instanceof p.MIError&&"Variable object not found"===r.message))throw r;s=yield this.miDebugger.varCreate(e,t);const i=this.findOrCreateVariable(s);s.exp=e,s.id=i}return s})}stackVariablesRequest(e,t,s,r){return o(this,void 0,void 0,function*(){const r=[];try{const i=yield this.miDebugger.getStackVariables(e,t);for(const e of i)try{const t=`var_local_${e.name}`,s=yield this.getVarObjByName(e.name,t);r.push(s.toProtocolVariable())}catch(t){r.push({name:e.name,value:`<${t}>`,variablesReference:0})}s.body={variables:r},this.sendResponse(s)}catch(e){this.sendErrorResponse(s,1,`Could not expand variable: ${e}`)}})}globalVariablesRequest(e,t){return o(this,void 0,void 0,function*(){const t=this.symbolTable.getGlobalVariables(),s=[];try{for(const e of t){const t=`var_global_${e.name}`,r=yield this.getVarObjByName(e.name,t);s.push(r.toProtocolVariable())}e.body={variables:s},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,1,`Could not get global variable information: ${t}`)}})}staticVariablesRequest(e,t,s,r){return o(this,void 0,void 0,function*(){const r=[];try{const i=(yield this.miDebugger.getFrame(e,t)).fileName,n=this.symbolTable.getStaticVariables(i);for(const e of n){const t=`var_static_${i}_${e.name}`,s=yield this.getVarObjByName(e.name,t);r.push(s.toProtocolVariable())}s.body={variables:r},this.sendResponse(s)}catch(e){this.sendErrorResponse(s,1,`Could not get global variable information: ${e}`)}})}variableMembersRequest(e,t,s){return o(this,void 0,void 0,function*(){let s;try{s=yield this.miDebugger.evalExpression(JSON.stringify(e));try{let i=(0,b.expandValue)(this.createVariable.bind(this),s.result("value"),e,s);i?("string"==typeof i[0]&&(i=[{name:"",value:(r=i,"object"==typeof r?void 0!==r.length?r.join(", "):JSON.stringify(r):r),variablesReference:0}]),t.body={variables:i},this.sendResponse(t)):this.sendErrorResponse(t,2,"Could not expand variable")}catch(e){this.sendErrorResponse(t,2,`Could not expand variable: ${e}`)}}catch(e){this.sendErrorResponse(t,1,`Could not expand variable: ${e}`)}var r})}variablesRequest(e,t){return o(this,void 0,void 0,function*(){let s;if(254===t.variablesReference)return this.globalVariablesRequest(e,t);if(t.variablesReference>=256&&t.variablesReference>>8;return this.stackVariablesRequest(r,s,e,t)}if(t.variablesReference>=y&&t.variablesReference<=R){const s=255&t.variablesReference,r=(65280&t.variablesReference)>>>8;return this.staticVariablesRequest(r,s,e,t)}if(s=this.variableHandles.get(t.variablesReference),"string"==typeof s)return this.variableMembersRequest(s,e,t);if("object"==typeof s)if(s instanceof p.VariableObject){const t=s;try{const r=(yield this.miDebugger.varListChildren(s.name)).map(e=>{const s=this.findOrCreateVariable(e);return e.id=s,/^\d+$/.test(e.exp)?e.fullExp=`${t.fullExp||t.exp}[${e.exp}]`:e.fullExp=`${t.fullExp||t.exp}.${e.exp}`,e.toProtocolVariable()});e.body={variables:r},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,1,`Could not expand variable: ${t}`)}}else if(s instanceof v){const t=s;if(t.options.arg){const s=[];let r=!0,i=0;const n=()=>{e.body={variables:s},this.sendResponse(e)},a=()=>o(this,void 0,void 0,function*(){const o=yield this.miDebugger.evalExpression(JSON.stringify(`${t.name}+${i})`));try{const d=(0,b.expandValue)(this.createVariable.bind(this),o.result("value"),t.name,o);if(d)if("string"==typeof d){if(""===d){if(!r)return n();r=!1}else if('"'!==d[0])return s.push({name:"[err]",value:d,variablesReference:0}),n();s.push({name:`[${i++}]`,value:d,variablesReference:0}),a()}else s.push({name:"[err]",value:d,variablesReference:0}),n();else this.sendErrorResponse(e,15,"Could not expand variable")}catch(t){this.sendErrorResponse(e,14,`Could not expand variable: ${t}`)}});a()}else this.sendErrorResponse(e,13,`Unimplemented variable request options: ${JSON.stringify(t.options)}`)}else e.body={variables:s},this.sendResponse(e);else e.body={variables:[]},this.sendResponse(e)})}evaluateRequest(e,t){return o(this,void 0,void 0,function*(){if("watch"===t.context)try{const s=`watch_${a.createHash("md5").update(t.expression).digest("hex")}}`,r=yield this.getVarObjByName(t.expression,s);e.body={result:r.value,variablesReference:r.id},this.sendResponse(e)}catch(t){e.body={result:`<${t.toString()}>`,variablesReference:0},this.sendErrorResponse(e,7,t.toString())}else if("hover"===t.context)try{const s=yield this.miDebugger.evalExpression(t.expression);e.body={variablesReference:0,result:s.result("value")},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,7,t.toString())}else this.miDebugger.sendUserInput(t.expression).then(t=>{e.body=void 0===t?{result:"",variablesReference:0}:{result:JSON.stringify(t),variablesReference:0},this.sendResponse(e)},t=>{this.sendErrorResponse(e,8,t.toString())})})}setVariableRequest(e,t){return o(this,void 0,void 0,function*(){try{let s=t.name;const r=this.variableHandles.get(t.variablesReference);r?s=`${r.name}.${t.name}`:254===t.variablesReference?s=`var_global_${t.name}`:t.variablesReference>=256&&t.variablesReference=y&&t.variablesReference<=R&&(s=`var_static_${t.name}`);const i=yield this.miDebugger.varAssign(s,t.value);e.body={value:i.result("value")},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,11,`Could not update variable: ${t}`)}})}pauseRequest(e,t){this.miDebugger.interrupt(t.threadId).then(t=>{this.sendResponse(e)},t=>{this.sendErrorResponse(e,3,`Could not pause: ${t}`)})}continueRequest(e,t){this.miDebugger.continue(t.threadId).then(t=>{e.body={allThreadsContinued:!0},this.sendResponse(e)},t=>{this.sendErrorResponse(e,2,`Could not continue: ${t}`)})}stepInRequest(e,t){return o(this,void 0,void 0,function*(){try{let s=this.forceDisassembly;if(!s){const e=yield this.miDebugger.getFrame(t.threadId,0);if(s=!(yield this.checkFileExists(e.file)),this.activeEditorPath&&this.activeEditorPath.startsWith("disassembly://")){const t=this.symbolTable.getFunctionByName(e.function,e.fileName);(0,c.encodeDisassembly)(t.name,t.file)===this.activeEditorPath&&(s=!0)}}yield this.miDebugger.step(t.threadId,s),this.sendResponse(e)}catch(t){this.sendErrorResponse(e,6,`Could not step over: ${t}`)}})}stepOutRequest(e,t){this.miDebugger.stepOut(t.threadId).then(t=>{this.sendResponse(e)},t=>{this.sendErrorResponse(e,5,`Could not step out: ${t}`)})}nextRequest(e,t){return o(this,void 0,void 0,function*(){try{let s=this.forceDisassembly;if(!s){const e=yield this.miDebugger.getFrame(t.threadId,0);if(s=!(yield this.checkFileExists(e.file)),this.activeEditorPath&&this.activeEditorPath.startsWith("disassembly://")){const t=this.symbolTable.getFunctionByName(e.function,e.fileName);(0,c.encodeDisassembly)(t.name,t.file)===this.activeEditorPath&&(s=!0)}}yield this.miDebugger.next(t.threadId,s),this.sendResponse(e)}catch(t){this.sendErrorResponse(e,6,`Could not step over: ${t}`)}})}checkFileExists(e){return e?this.fileExistsCache.has(e)?Promise.resolve(this.fileExistsCache.get(e)):new Promise((t,s)=>{d.exists(e,s=>{this.fileExistsCache.set(e,s),t(s)})}):Promise.resolve(!1)}}t.GDBDebugSession=O,u.DebugSession.run(O)},175:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.expandValue=t.isExpandable=void 0;const r=s(74),i=/^([a-zA-Z_\-][a-zA-Z0-9_\-]*|\[\d+\])\s*=\s*/,n=/^[a-zA-Z_\-][a-zA-Z0-9_\-]*/,o=/^\<.+?\>/,a=/^(0x[0-9a-fA-F]+\s*)"/,d=/^0x[0-9a-fA-F]+/,l=/^0x0+\b/,u=/^(\d+) ['"]/,h=/^\d+(\.\d+)?/;t.isExpandable=function(e){return 0===(e=e.trim()).length?0:e.startsWith("{...}")?2:"{"===e[0]?1:e.startsWith("true")||e.startsWith("false")||l.exec(e)||a.exec(e)?0:d.exec(e)?2:(u.exec(e)||h.exec(e)||n.exec(e)||o.exec(e),0)},t.expandValue=function(e,t,s="",c){const p=()=>{if('"'!==(t=t.trim())[0]&&"'"!==t[0])return"";let e=1,s=!0;const r=t[0];let i=t.substr(1),n=!1;for(;s;)n?n=!1:"\\"===i[0]?n=!0:i[0]===r&&(s=!1),i=i.substr(1),e++;const o=t.substr(0,e).trim();return t=t.substr(e).trim(),o},b=[s];let m="";const f=e=>{let t="",s="";return b.push(e),b.forEach(e=>{if(s="",""===e);else if(e.startsWith("["))t+=e;else if(t){for(;e.startsWith("*");)s+="*",e=e.substr(1);t=t+"."+e}else t=e}),b.pop(),s+t};let g,v,y,R,x;return g=()=>'"'===(t=t.trim())[0]?p():"{"===t[0]?(()=>{if("{"!==(t=t.trim())[0])return;if("}"===(t=t.substr(1).trim())[0])return t=t.substr(1).trim(),[];if(t.startsWith("...")&&"}"===(t=t.substr(3).trim())[0])return t=t.substr(1).trim(),"<...>";const e=t.indexOf("="),s=t.indexOf("{"),r=t.indexOf(",");let i=s;if(-1!==r&&ri||-1===e){const e=[];b.push("[0]");let s=g();b.pop(),e.push(x("[0]",s));let r=0;for(;;){if(b.push("["+ ++r+"]"),s=v(),!s){b.pop();break}b.pop(),e.push(x("["+r+"]",s))}return t=t.substr(1).trim(),e}let n=y(!0);if(n){const e=[];for(e.push(n);n=R(!0);)e.push(n);return t=t.substr(1).trim(),e}})():(()=>{let e,s;return 0===(t=t.trim()).length?s=void 0:t.startsWith("true")?(s="true",t=t.substr(4).trim()):t.startsWith("false")?(s="false",t=t.substr(5).trim()):(e=l.exec(t))?(s="",t=t.substr(e[0].length).trim()):(e=a.exec(t))?(t=t.substr(e[1].length).trim(),s=p()):(e=d.exec(t))?(s="*"+e[0],t=t.substr(e[0].length).trim()):(e=u.exec(t))?(s=e[1],t=t.substr(e[0].length-1),s+=" "+p()):(e=h.exec(t))||(e=n.exec(t))||(e=o.exec(t))?(s=e[0],t=t.substr(e[0].length).trim()):s=t,s})(),y=(e=!1)=>{t=t.trim();const s=i.exec(t);if(!s)return;t=t.substr(s[0].length).trim();const r=m=s[1];e&&b.push(m);const n=g();return e&&b.pop(),x(r,n)},x=(t,s)=>{let i=0;return"object"==typeof s&&(i=e(s),s="Object"),"string"==typeof s&&s.startsWith("*0x")&&(c&&"1"===r.MINode.valueOf(c,"arg")?(i=e(f("*("+t),{arg:!0}),s=""):(i=e(f("*"+t)),s="Object@"+s)),"string"==typeof s&&s.startsWith("<...>")&&(i=e(f(t)),s="..."),{name:t,value:s,variablesReference:i}},v=()=>{if(","===(t=t.trim())[0])return t=t.substr(1).trim(),g()},R=(e=!1)=>{if(","===(t=t.trim())[0])return t=t.substr(1).trim(),y(e)},t=t.trim(),g()}},922:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,i)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return i(t,e),t},o=this&&this.__awaiter||function(e,t,s,r){return new(s||(s=Promise))(function(i,n){function o(e){try{d(r.next(e))}catch(e){n(e)}}function a(e){try{d(r.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s(function(e){e(t)})).then(o,a)}d((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.MI2=t.escape=void 0;const a=n(s(81)),d=s(361),l=s(253),u=s(74);function h(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}t.escape=h;const c=/^(?:\d*|undefined)[\*\+\=]|[\~\@\&\^]/,p=/(?:\d*|undefined)\(gdb\)/,b=/\d+/;function m(e){return!c.exec(e)}class f extends d.EventEmitter{constructor(e,t){super(),this.application=e,this.args=t,this.currentToken=1,this.handlers={},this.debugReadyFired=!1}connect(e,t){return new Promise((s,r)=>{const i=[...this.args],n=Object.create(process.env);process.env.PLATFORMIO_PATH&&(n.PATH=process.env.PLATFORMIO_PATH,n.Path=process.env.PLATFORMIO_PATH),this.process=a.spawn(this.application,i,{cwd:e,env:n,shell:"win32"===process.platform}),this.process.stdout.on("data",this.stdout.bind(this)),this.process.stderr.on("data",this.stderr.bind(this)),this.process.on("exit",(()=>{this.emit("quit")}).bind(this)),this.process.on("error",(e=>{this.emit("launcherror",e)}).bind(this));const o=[this.sendCommand("gdb-set target-async on",!0),...t.map(e=>this.sendCommand(e))];Promise.all(o).then(()=>{s(!0)},r)})}stdout(e){this.buffer+="string"==typeof e?e:e.toString("utf8");const t=this.buffer.lastIndexOf("\n");-1!==t&&(this.onOutput(this.buffer.substr(0,t)),this.buffer=this.buffer.substr(t+1)),this.buffer.length&&this.onOutputPartial(this.buffer)&&(this.buffer="")}stderr(e){this.errbuf+="string"==typeof e?e:e.toString("utf8");const t=this.errbuf.lastIndexOf("\n");-1!==t&&(this.onOutputStderr(this.errbuf.substr(0,t)),this.errbuf=this.errbuf.substr(t+1)),this.errbuf.length&&(this.logNoNewLine("stderr",this.errbuf),this.errbuf="")}onOutputStderr(e){e.split("\n").forEach(e=>{this.log("stderr",e)})}onOutputPartial(e){return!!m(e)&&(this.logNoNewLine("stdout",e),!0)}onOutput(e){e.split("\n").forEach(e=>{if(m(e))p.exec(e)||this.log("stdout",e);else{const t=(0,u.parseMI)(e);this.debugOutput&&this.log("log","GDB -> App: "+JSON.stringify(t));let s=!1;void 0!==t.token&&this.handlers[t.token]&&(this.handlers[t.token](t),delete this.handlers[t.token],s=!0),!s&&t.resultRecords&&"error"===t.resultRecords.resultClass&&this.log("stderr",t.result("msg")||e),t.outOfBandRecord&&(t.outOfBandRecord.forEach(e=>{if(e.isStream)e.content.includes("PlatformIO: Initialization completed")&&(this.debugReadyTimeout=setTimeout(()=>{this.debugReadyFired=!0,this.emit("debug-ready")},200),this.once("generic-stopped",()=>{this.debugReadyFired||(clearTimeout(this.debugReadyTimeout),this.emit("debug-ready"))})),this.log(e.type,e.content);else if("exec"===e.type)if(this.emit("exec-async-output",t),"running"===e.asyncClass)this.emit("running",t);else if("stopped"===e.asyncClass){const e=t.record("reason");"breakpoint-hit"===e?this.emit("breakpoint",t):"end-stepping-range"===e?this.emit("step-end",t):"function-finished"===e?this.emit("step-out-end",t):"signal-received"===e?this.emit("signal-stop",t):"exited-normally"===e?this.emit("exited-normally",t):"exited"===e?(this.log("stderr","Program exited with code "+t.record("exit-code")),this.emit("exited-normally",t)):(this.debugReadyFired&&this.log("console","Not implemented stop reason (assuming exception): "+e),this.emit("stopped",t)),this.emit("generic-stopped",t)}else this.log("log",JSON.stringify(t));else if("notify"===e.type)if("thread-created"===e.asyncClass){const e=t.result("id"),s=t.result("group-id");this.emit("thread-created",{threadId:e,threadGroupId:s})}else if("thread-exited"===e.asyncClass){const e=t.result("id"),s=t.result("group-id");this.emit("thread-exited",{threadId:e,threadGroupId:s})}else if("thread-selected"===e.asyncClass){const e=t.result("id");this.emit("thread-selected",{threadId:e})}}),s=!0),void 0===t.token&&void 0===t.resultRecords&&0===t.outOfBandRecord.length&&(s=!0),s||this.log("log","Unhandled: "+JSON.stringify(t))}})}stop(e=!1){if(e){const e=this.process,t=setTimeout(()=>{process.kill(-e.pid)},1e3);this.process.on("exit",e=>{clearTimeout(t)})}this.sendRaw("-gdb-exit")}detach(){const e=this.process,t=setTimeout(()=>{process.kill(-e.pid)},1e3);this.process.on("exit",e=>{clearTimeout(t)}),this.sendRaw("-target-detach")}interrupt(e){return new Promise((t,s)=>{this.sendCommand(`exec-interrupt --thread ${e}`).then(e=>{t("done"===e.resultRecords.resultClass)},s)})}continue(e){return new Promise((t,s)=>{this.sendCommand(`exec-continue --thread ${e}`).then(e=>{t("running"===e.resultRecords.resultClass)},s)})}next(e,t){return new Promise((s,r)=>{const i=t?"exec-next-instruction":"exec-next";this.sendCommand(`${i} --thread ${e}`).then(e=>{s("running"===e.resultRecords.resultClass)},r)})}step(e,t){return new Promise((s,r)=>{const i=t?"exec-step-instruction":"exec-step";this.sendCommand(`${i} --thread ${e}`).then(e=>{s("running"===e.resultRecords.resultClass)},r)})}stepOut(e){return new Promise((t,s)=>{this.sendCommand(`exec-finish --thread ${e}`).then(e=>{t("running"===e.resultRecords.resultClass)},s)})}restart(e){return this._sendCommandSequence(e)}_sendCommandSequence(e){return new Promise((t,s)=>{const r=(e=>{if(0===e.length)return void t(!0);const i=e[0];this.sendCommand(i).then(t=>{r(e.slice(1))},s)}).bind(this);r(e)})}changeVariable(e,t){return this.sendCommand("gdb-set var "+e+"="+t)}setBreakPointCondition(e,t){return this.sendCommand("break-condition "+e+" "+t)}addBreakPoint(e){return new Promise((t,s)=>{let r="";if(e.countCondition)if(">"===e.countCondition[0])r+="-i "+b.exec(e.countCondition.substr(1))[0]+" ";else{const t=b.exec(e.countCondition)[0];t.length!==e.countCondition.length?(this.log("stderr","Unsupported break count expression: '"+e.countCondition+"'. Only supports 'X' for breaking once after X times or '>X' for ignoring the first X breaks"),r+="-t "):0!==parseInt(t)&&(r+="-t -i "+parseInt(t)+" ")}e.raw?r+="*"+h(e.raw):r+='"'+h(e.file)+":"+e.line+'"',this.sendCommand(`break-insert ${r}`).then(r=>{if("done"===r.resultRecords.resultClass){const i=parseInt(r.result("bkpt.number"));e.number=i,e.condition?this.setBreakPointCondition(i,e.condition).then(s=>{"done"===s.resultRecords.resultClass?t(e):t(null)},s):t(e)}else t(null)},s)})}removeBreakpoints(e){return new Promise((t,s)=>{if(0===e.length)t(!0);else{const r="break-delete "+e.join(" ");this.sendCommand(r).then(e=>{t("done"===e.resultRecords.resultClass)},s)}})}getFrame(e,t){return new Promise((s,r)=>{const i=`stack-info-frame --thread ${e} --frame ${t}`;this.sendCommand(i).then(e=>{const t=e.result("frame"),r=u.MINode.valueOf(t,"level"),i=u.MINode.valueOf(t,"addr"),n=u.MINode.valueOf(t,"func"),o=u.MINode.valueOf(t,"file"),a=u.MINode.valueOf(t,"fullname");let d=0;const l=u.MINode.valueOf(t,"line");l&&(d=parseInt(l)),s({address:i,fileName:o,file:a,function:n,level:r,line:d})},r)})}getStack(e,t,s){return new Promise((r,i)=>{this.sendCommand(`stack-list-frames --thread ${e} ${t} ${s}`).then(e=>{const t=e.result("stack"),s=[];t.forEach(e=>{const t=u.MINode.valueOf(e,"@frame.level"),r=u.MINode.valueOf(e,"@frame.addr"),i=u.MINode.valueOf(e,"@frame.func"),n=u.MINode.valueOf(e,"@frame.file"),o=u.MINode.valueOf(e,"@frame.fullname");let a=0;const d=u.MINode.valueOf(e,"@frame.line");d&&(a=parseInt(d));const l=parseInt(u.MINode.valueOf(e,"@frame.from"));s.push({address:r,fileName:n,file:o,function:i||l,level:t,line:a})}),r(s)},i)})}getStackVariables(e,t){return o(this,void 0,void 0,function*(){const s=(yield this.sendCommand(`stack-list-variables --thread ${e} --frame ${t} --simple-values`)).result("variables"),r=[];for(const e of s){const t=u.MINode.valueOf(e,"name"),s=u.MINode.valueOf(e,"value"),i=u.MINode.valueOf(e,"type");r.push({name:t,valueStr:s,type:i,raw:e})}return r})}examineMemory(e,t){return o(this,void 0,void 0,function*(){let s="",r=e;for(;t>0;){const e=t>1024?1024:t;s+=(yield this.sendCommand(`data-read-memory-bytes 0x${r.toString(16)} ${e}`)).result("memory[0].contents"),t-=e,r+=e}return s})}evalExpression(e){return new Promise((t,s)=>{this.sendCommand("data-evaluate-expression "+e).then(e=>{t(e)},s)})}varCreate(e,t="-"){return o(this,void 0,void 0,function*(){const s=yield this.sendCommand(`var-create ${t} @ "${e}"`);return new l.VariableObject(s.result(""))})}varEvalExpression(e){return o(this,void 0,void 0,function*(){return this.sendCommand(`var-evaluate-expression ${e}`)})}varListChildren(e){return o(this,void 0,void 0,function*(){return((yield this.sendCommand(`var-list-children --all-values ${e}`)).result("children")||[]).map(e=>new l.VariableObject(e[1]))})}varUpdate(e="*"){return o(this,void 0,void 0,function*(){return this.sendCommand(`var-update --all-values ${e}`)})}varAssign(e,t){return o(this,void 0,void 0,function*(){return this.sendCommand(`var-assign ${e} ${t}`)})}logNoNewLine(e,t){this.emit("msg",e,t)}log(e,t){this.emit("msg",e,"\n"===t[t.length-1]?t:t+"\n")}sendUserInput(e){return e.startsWith("-")?this.sendCommand(e.substr(1)):this.sendCommand(`interpreter-exec console "${e}"`)}sendRaw(e){this.printCalls&&this.log("log",e),this.process.stdin.write(e+"\n")}sendCommand(e,t=!1){const s=this.currentToken++;return new Promise((r,i)=>{this.handlers[s]=s=>{s&&s.resultRecords&&"error"===s.resultRecords.resultClass?t?(this.log("stderr",`WARNING: Error executing command '${e}'`),r(s)):i(new l.MIError(s.result("msg")||"Internal error",e)):r(s)},this.sendRaw(s+"-"+e)})}isReady(){return!!this.process}}t.MI2=f},253:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MIError=t.VariableObject=void 0;const r=s(74);t.VariableObject=class{constructor(e){this.name=r.MINode.valueOf(e,"name"),this.exp=r.MINode.valueOf(e,"exp"),this.numchild=parseInt(r.MINode.valueOf(e,"numchild")),this.type=r.MINode.valueOf(e,"type"),this.value=r.MINode.valueOf(e,"value"),this.threadId=r.MINode.valueOf(e,"thread-id"),this.frozen=!!r.MINode.valueOf(e,"frozen"),this.dynamic=!!r.MINode.valueOf(e,"dynamic"),this.displayhint=r.MINode.valueOf(e,"displayhint"),this.hasMore=!!r.MINode.valueOf(e,"has_more")}applyChanges(e){this.value=r.MINode.valueOf(e,"value"),r.MINode.valueOf(e,"type_changed")&&(this.type=r.MINode.valueOf(e,"new_type")),this.dynamic=!!r.MINode.valueOf(e,"dynamic"),this.displayhint=r.MINode.valueOf(e,"displayhint"),this.hasMore=!!r.MINode.valueOf(e,"has_more")}isCompound(){return this.numchild>0||"{...}"===this.value||this.dynamic&&("array"===this.displayhint||"map"===this.displayhint)}toProtocolVariable(){return{name:this.exp,evaluateName:this.fullExp||this.exp,value:void 0===this.value?"":this.value,type:this.type,presentationHint:{kind:this.displayhint},variablesReference:this.id}}};class i{constructor(e,t){Object.defineProperty(this,"name",{get:()=>this.constructor.name}),Object.defineProperty(this,"message",{get:()=>e}),Object.defineProperty(this,"source",{get:()=>t}),Error.captureStackTrace(this,this.constructor)}toString(){return`${this.message} (from ${this.source})`}}t.MIError=i,Object.setPrototypeOf(i,Object.create(Error.prototype)),i.prototype.constructor=i},74:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseMI=t.MINode=void 0;const s=/^[0-7]{3}/;class r{constructor(e,t,s){this.token=e,this.outOfBandRecord=t,this.resultRecords=s}static valueOf(e,t){if(!e)return;const s=/^\.?([a-zA-Z_\-][a-zA-Z0-9_\-]*)/,r=/^\[(\d+)\](?:$|\.)/;if(!(t=t.trim()))return e;let i=e;do{let e=s.exec(t);if(e){if(t=t.substr(e[0].length),!i.length||"string"==typeof i)return;{const t=[];for(const s of i)s[0]===e[1]&&t.push(s[1]);if(t.length>1)i=t;else{if(1!==t.length)return;i=t[0]}}}else if("@"===t[0])i=[i],t=t.substr(1);else{if(e=r.exec(t),!e)return;t=t.substr(e[0].length);const s=parseInt(e[1]);if(i.length&&"string"!=typeof i&&s>=0&&s{if('"'===e[0]){const[t,s]=l(e);return e=s,t}if("{"===e[0]||"["===e[0]){const t="["===e[0];if("}"===(e=e.substr(1))[0]||"]"===e[0])return e=e.substr(1),[];if(t){let t=p();if(t){const s=[];for(s.push(t);void 0!==(t=m());)s.push(t);return e=e.substr(1),s}}let s=b();if(s){const t=[];for(t.push(s);s=f();)t.push(s);return e=e.substr(1),t}e=(t?"[":"{")+e}},b=()=>{const t=a.exec(e);if(t)return e=e.substr(t[0].length+1),[t[1],p()]},m=()=>{if(","===e[0])return e=e.substr(1),p()},f=()=>{if(","===e[0])return e=e.substr(1),b()};g=i.exec(e);){if(e=e.substr(g[0].length),g[1]&&void 0===t&&"undefined"!==g[1]&&(t=parseInt(g[1])),g[2]){const t=d.exec(e);e=e.substr(t[1].length);const r={isStream:!1,type:h[g[2]],asyncClass:t[1],output:[]};let i;for(;i=f();)r.output.push(i);s.push(r)}else if(g[3]){const[t,r]=l(e);e=r;const i={isStream:!0,type:c[g[3]],content:t};s.push(i)}e=e.replace(o,"")}if(g=n.exec(e)){let s;for(e=e.substr(g[0].length),g[1]&&void 0===t&&(t=parseInt(g[1])),u={resultClass:g[2],results:[]};s=f();)u.results.push(s);e=e.replace(o,"")}return new r(t,s||[],u)}},434:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,i)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolTable=void 0;const o=n(s(81)),a=n(s(147)),d=n(s(17)),l=s(200),u=/^([0-9a-f]{8})\s([lg\ !])([w\ ])([C\ ])([W\ ])([I\ ])([dD\ ])([FfO\ ])\s([^\s]+)\s([0-9a-f]+)\s(.*)\r?$/,h=/^_Z[^\d]*(\d+)(.+)$/,c={F:l.SymbolType.Function,f:l.SymbolType.File,O:l.SymbolType.Object," ":l.SymbolType.Normal},p={l:l.SymbolScope.Local,g:l.SymbolScope.Global," ":l.SymbolScope.Neither,"!":l.SymbolScope.Both};t.SymbolTable=class{constructor(e,t){this.toolchainBinDir=e,this.executable=t,this.symbols=[]}loadSymbols(){let e="";if(a.readdirSync(this.toolchainBinDir).forEach(t=>{t.includes("objdump")&&a.existsSync(d.join(this.toolchainBinDir,t))&&(e=d.join(this.toolchainBinDir,t))}),!e)throw new Error('Could not find "objdump" program');const t=o.spawnSync(e,["--syms",this.executable]).stdout.toString().split("\n");let s=null;for(const e of t){const t=e.match(u);if(!t)continue;const r=c[t[8]],i=p[t[2]];let n=t[11].trim(),o=!1;if("d"===t[7]&&"f"===t[8])s=n;else{n.startsWith(".hidden")&&(n=n.substring(7).trim(),o=!0);const e=n.match(h);if(e){if(r!==l.SymbolType.Function)continue;const t=parseInt(e[1]);if(n=e[2].substr(0,t),e[2].length>t){const s=e[2].substr(t).match(/^(\d+)(.+)$/);s&&(n+="::"+s[2].substr(0,parseInt(s[1])))}}this.symbols.push({address:parseInt(t[1],16),type:r,scope:i,section:t[9].trim(),length:parseInt(t[10],16),name:n,file:i===l.SymbolScope.Local?s:null,instructions:null,hidden:o})}}}getFunctionAtAddress(e){const t=this.symbols.filter(t=>t.type===l.SymbolType.Function&&t.address<=e&&t.address+t.length>e);if(t&&0!==t.length)return t[0]}getFunctionSymbols(){return this.symbols.filter(e=>e.type===l.SymbolType.Function)}getGlobalVariables(){return this.symbols.filter(e=>e.type===l.SymbolType.Object&&e.scope===l.SymbolScope.Global)}getStaticVariables(e){return this.symbols.filter(t=>t.type===l.SymbolType.Object&&t.scope===l.SymbolScope.Local&&t.file===e)}getFunctionByName(e,t){let s=this.symbols.filter(s=>s.type===l.SymbolType.Function&&s.scope===l.SymbolScope.Local&&s.name===e&&s.file===t);return 0!==s.length?s[0]:(s=this.symbols.filter(t=>t.type===l.SymbolType.Function&&t.scope!==l.SymbolScope.Local&&t.name===e),0!==s.length?s[0]:null)}}},200:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolScope=t.SymbolType=t.TelemetryEvent=t.StoppedEvent=t.AdapterOutputEvent=t.NumberFormat=void 0;const r=s(797);var i,n,o;(i=t.NumberFormat||(t.NumberFormat={}))[i.Auto=0]="Auto",i[i.Hexidecimal=1]="Hexidecimal",i[i.Decimal=2]="Decimal",i[i.Binary=3]="Binary";class a extends r.Event{constructor(e,t){super("adapter-output",{content:e,type:t})}}t.AdapterOutputEvent=a;class d extends r.Event{constructor(e,t,s){super("stopped",{reason:e,threadId:t,allThreadsStopped:s})}}t.StoppedEvent=d;class l extends r.Event{constructor(e,t,s,r={}){super("record-event",{category:e,action:t,label:s,parameters:r})}}t.TelemetryEvent=l,(o=t.SymbolType||(t.SymbolType={}))[o.Function=0]="Function",o[o.File=1]="File",o[o.Object=2]="Object",o[o.Normal=3]="Normal",(n=t.SymbolScope||(t.SymbolScope={}))[n.Local=0]="Local",n[n.Global=1]="Global",n[n.Neither=2]="Neither",n[n.Both=3]="Both"},593:(e,t)=>{function s(e,t){let s=0;const r=e+t-1;for(let t=e;t<=r;t++)s=(s|1<>>0;return s}Object.defineProperty(t,"__esModule",{value:!0}),t.encodeDisassembly=t.parseQuery=t.extractBits=t.createMask=t.binaryFormat=t.hexFormat=void 0,t.hexFormat=function(e,t=8,s=!0){let r=e.toString(16);for(;r.length>>0).toString(2);for(;i.length>>t>>>0},t.parseQuery=function(e){const t={},s=("?"===e[0]?e.substr(1):e).split("&");for(const e of s){const s=e.split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1]||"")}return t},t.encodeDisassembly=function(e,t){let s="disassembly:///";return t&&(s+=`${t}:`),s+=`${e}.dbgasm?func=${e}&file=${t||""}`,s}},81:e=>{e.exports=require("child_process")},113:e=>{e.exports=require("crypto")},361:e=>{e.exports=require("events")},147:e=>{e.exports=require("fs")},17:e=>{e.exports=require("path")},512:e=>{e.exports=require("timers")},797:t=>{t.exports=e}},s={};return function e(r){var i=s[r];if(void 0!==i)return i.exports;var n=s[r]={exports:{}};return t[r].call(n.exports,n,n.exports,e),n.exports}(370)})()}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@vscode/debugadapter")):"function"==typeof define&&define.amd?define(["@vscode/debugadapter"],t):"object"==typeof exports?exports["platformio-vscode-debug"]=t(require("@vscode/debugadapter")):e["platformio-vscode-debug"]=t(e["@vscode/debugadapter"])}(global,e=>(()=>{"use strict";var t={284(e,t,s){var r,n=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,n)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=r(e),o=0;o{this.debugReady=!0,this.stopped=!0,this.stoppedReason="start",this.sendEvent(new c.StoppedEvent("start",this.currentThreadId,!0)),this.sendEvent(new O("start",this.currentThreadId))}),this.miDebugger.connect(this.args.cwd,['interpreter-exec console "source .pioinit"',"enable-pretty-printing"]).then(()=>{this.symbolTable=new v.SymbolTable(this.args.toolchainBinDir,this.args.executable);try{this.symbolTable.loadSymbols(),this.started=!0,this.sendResponse(e)}catch(t){this.args.toolchainBinDir&&this.sendErrorResponse(e,102,`Failed to load symbols from executable file: ${t.toString()}`)}},t=>{this.sendErrorResponse(e,103,`Failed to launch GDB: ${t.toString()}`)})}customRequest(e,t,s){switch(e){case"set-force-disassembly":t.body={success:!0},this.forceDisassembly=s.force,this.stopped&&(this.activeEditorPath=null,this.sendEvent(new h.ContinuedEvent(this.currentThreadId,!0)),this.sendEvent(new c.StoppedEvent(this.stoppedReason,this.currentThreadId,!0))),this.sendResponse(t);break;case"load-function-symbols":t.body={functionSymbols:this.symbolTable.getFunctionSymbols()},this.sendResponse(t);break;case"set-active-editor":this.activeEditorPath=s.path,t.body={},this.sendResponse(t);break;case"get-arguments":t.body=this.args,this.sendResponse(t);break;case"read-memory":this.customReadMemoryRequest(t,s.address,s.length);break;case"write-memory":this.customWriteMemoryRequest(t,s.address,s.data);break;case"read-registers":this.customReadRegistersRequest(t);break;case"read-register-list":this.customReadRegisterListRequest(t);break;case"disassemble":this.disassembleRequest(t,s);break;case"execute-command":let e=s.command;e=e.startsWith("-")?e.substring(1):`interpreter-exec console "${e}"`,this.miDebugger.sendCommand(e).then(e=>{t.body=e.resultRecords,this.sendResponse(t)},e=>{t.body=e,this.sendErrorResponse(t,110,"Unable to execute command")});break;default:t.body={error:"Invalid command."},this.sendResponse(t)}}disassembleRequest(e,t){return a(this,void 0,void 0,function*(){if(t.function)try{const s=yield this.getDisassemblyForFunction(t.function,t.file);e.body={instructions:s.instructions,name:s.name,file:s.file,address:s.address,length:s.length},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,1,`Unable to disassemble: ${t.toString()}`)}else if(t.startAddress)try{let s=this.symbolTable.getFunctionAtAddress(t.startAddress);if(s)s=yield this.getDisassemblyForFunction(s.name,s.file),e.body={instructions:s.instructions,name:s.name,file:s.file,address:s.address,length:s.length},this.sendResponse(e);else{const s=yield this.getDisassemblyForAddresses(t.startAddress,t.length||256);e.body={instructions:s},this.sendResponse(e)}}catch(t){this.sendErrorResponse(e,1,`Unable to disassemble: ${t.toString()}`)}else this.sendErrorResponse(e,1,"Unable to disassemble; invalid parameters.")})}getDisassemblyForFunction(e,t){return a(this,void 0,void 0,function*(){const s=this.symbolTable.getFunctionByName(e,t);if(!s)throw new Error(`Unable to find function with name ${e}.`);if(s.instructions)return s;const r=s.address,n=s.address+s.length,i=(yield this.miDebugger.sendCommand(`data-disassemble -s ${(0,p.hexFormat)(r,8)} -e ${(0,p.hexFormat)(n,8)} -- 2`)).result("asm_insns").map(e=>({address:g.MINode.valueOf(e,"address"),functionName:g.MINode.valueOf(e,"func-name"),offset:parseInt(g.MINode.valueOf(e,"offset")),instruction:g.MINode.valueOf(e,"inst"),opcodes:g.MINode.valueOf(e,"opcodes")}));return s.instructions=i,s})}getDisassemblyForAddresses(e,t){return a(this,void 0,void 0,function*(){const s=e+t;return(yield this.miDebugger.sendCommand(`data-disassemble -s ${(0,p.hexFormat)(e,8)} -e ${(0,p.hexFormat)(s,8)} -- 2`)).result("asm_insns").map(e=>({address:g.MINode.valueOf(e,"address"),functionName:g.MINode.valueOf(e,"func-name"),offset:parseInt(g.MINode.valueOf(e,"offset")),instruction:g.MINode.valueOf(e,"inst"),opcodes:g.MINode.valueOf(e,"opcodes")}))})}customReadMemoryRequest(e,t,s){this.miDebugger.examineMemory(t,s).then(s=>{const r=s.match(/[0-9a-f]{2}/g).map(e=>parseInt(e,16));e.body={startAddress:t,endAddress:t+r.length,bytes:r},this.sendResponse(e)},t=>{e.body={error:t},this.sendErrorResponse(e,114,`Unable to read memory: ${t.toString()}`)})}customWriteMemoryRequest(e,t,s){const r=(0,p.hexFormat)(t,8);this.miDebugger.sendCommand(`data-write-memory-bytes ${r} ${s}`).then(t=>{this.sendResponse(e)},t=>{e.body={error:t},this.sendErrorResponse(e,114,`Unable to write memory: ${t.toString()}`)})}customReadRegistersRequest(e){this.miDebugger.sendCommand("data-list-register-values x").then(t=>{if("done"===t.resultRecords.resultClass){const s=t.resultRecords.results[0][1];e.body=s.map(e=>{const t={};return e.forEach(e=>{t[e[0]]=e[1]}),t})}else e.body={error:"Unable to parse response"};this.sendResponse(e)},t=>{e.body={error:t},this.sendErrorResponse(e,115,`Unable to read registers: ${t.toString()}`)})}customReadRegisterListRequest(e){this.miDebugger.sendCommand("data-list-register-names").then(t=>{if("done"===t.resultRecords.resultClass){let s;t.resultRecords.results.forEach(e=>{"register-names"===e[0]&&(s=e[1])}),e.body=s}else e.body={error:t.resultRecords.results};this.sendResponse(e)},t=>{e.body={error:t},this.sendErrorResponse(e,116,`Unable to read register list: ${t.toString()}`)})}disconnectRequest(e,t){this.miDebugger&&(this.attached?this.miDebugger.detach():this.miDebugger.stop(!0)),this.sendResponse(e)}terminateRequest(e,t){this.miDebugger&&this.miDebugger.stop(),this.sendResponse(e)}restartRequest(e,t){const s=()=>{this.miDebugger.restart(['interpreter-exec console "pio_restart_target"']).then(t=>{this.sendResponse(e),(0,u.setTimeout)(()=>{this.stopped=!0,this.stoppedReason="restart",this.sendEvent(new h.ContinuedEvent(this.currentThreadId,!0)),this.sendEvent(new c.StoppedEvent("restart",this.currentThreadId,!0))},50)},t=>{this.sendErrorResponse(e,6,`Could not restart: ${t}`)})};this.stopped?s():(this.miDebugger.once("generic-stopped",s),this.miDebugger.sendCommand("exec-interrupt"))}handleAdapterOutput(e){this.sendEvent(new c.AdapterOutputEvent(e,"out"))}handleMsg(e,t){"target"===e&&(e="stdout"),"log"===e&&(e="stderr"),this.sendEvent(new h.OutputEvent(t,e))}handleRunning(e){this.stopped=!1,this.sendEvent(new h.ContinuedEvent(this.currentThreadId,!0)),this.sendEvent(new E(this.currentThreadId,!0))}handleBreakpoint(e){const t=parseInt(e.record("thread-id")||this.currentThreadId);this.stopped=!0,this.stoppedReason="breakpoint",this.sendEvent(new c.StoppedEvent("breakpoint",t,!0)),this.sendEvent(new O("breakpoint",t))}handleBreak(e){this.stopped=!0,this.stoppedReason="step",this.sendEvent(new c.StoppedEvent("step",this.currentThreadId,!0)),this.sendEvent(new O("step",this.currentThreadId))}handlePause(e){this.stopped=!0,this.stoppedReason="user request",this.sendEvent(new c.StoppedEvent("user request",this.currentThreadId,!0)),this.sendEvent(new O("user request",this.currentThreadId))}handleThreadCreated(e){this.sendEvent(new h.ThreadEvent("started",e.threadId))}handleThreadExited(e){this.sendEvent(new h.ThreadEvent("exited",e.threadId))}handleThreadSelected(e){this.currentThreadId=e.threadId,this.sendEvent(new h.ThreadEvent("selected",e.threadId))}stopEvent(e){this.started||(this.crashed=!0),this.quit||(this.stopped=!0,this.stoppedReason="exception",this.sendEvent(new c.StoppedEvent("exception",this.currentThreadId,!0)),this.sendEvent(new O("exception",this.currentThreadId)))}quitEvent(){this.quit=!0,this.sendEvent(new h.TerminatedEvent)}launchError(e){this.handleMsg("stderr",`Could not start debugger process > ${e.toString()}\n`),this.quitEvent()}setFunctionBreakPointsRequest(e,t){if(!t.breakpoints||!t.breakpoints.length)return;const s=s=>a(this,void 0,void 0,function*(){const r=[];t.breakpoints.forEach(e=>{r.push(this.miDebugger.addBreakPoint({raw:e.name,condition:e.condition,countCondition:e.hitCondition}))});try{const t=yield Promise.all(r),s=[];t.forEach(e=>{e[0]&&s.push({line:e[1].line})}),e.body={breakpoints:s},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,10,t.toString())}s&&(yield this.miDebugger.sendCommand("exec-continue"))}),r=()=>a(this,void 0,void 0,function*(){this.stopped?yield s(!1):(this.miDebugger.sendCommand("exec-interrupt"),this.miDebugger.once("generic-stopped",()=>{s(!0)}))});this.debugReady?r():this.miDebugger.once("debug-ready",r)}setBreakPointsRequest(e,t){const s=s=>a(this,void 0,void 0,function*(){this.debugReady=!0;const r=(this.breakpointMap.get(t.source.path)||[]).map(e=>e.number);try{yield this.miDebugger.removeBreakpoints(r),this.breakpointMap.set(t.source.path,[]);const s=[],n=decodeURIComponent(t.source.path);if(n.startsWith("disassembly:/")){const e=(0,p.parseQuery)(n.substr(n.indexOf("?"))),r=yield this.getDisassemblyForFunction(e.func,e.file);t.breakpoints.forEach(e=>{if(e.line<=r.instructions.length){const n=r.instructions[e.line-1];s.push(this.miDebugger.addBreakPoint({file:t.source.path,line:e.line,condition:e.condition,countCondition:e.hitCondition,raw:n.address}))}})}else t.breakpoints.forEach(e=>{s.push(this.miDebugger.addBreakPoint({file:t.source.path,line:e.line,condition:e.condition,countCondition:e.hitCondition}))});const i=(yield Promise.all(s)).filter(e=>null!==e);e.body={breakpoints:i.map(e=>({line:e.line,id:e.number,verified:!0}))},this.breakpointMap.set(t.source.path,i),this.sendResponse(e)}catch(t){this.sendErrorResponse(e,9,t.toString())}s&&(yield this.miDebugger.sendCommand("exec-continue"))}),r=()=>a(this,void 0,void 0,function*(){this.stopped?yield s(!1):(yield this.miDebugger.sendCommand("exec-interrupt"),this.miDebugger.once("generic-stopped",()=>{s(!0)}))});this.debugReady?r():this.miDebugger.once("debug-ready",r)}threadsRequest(e){return a(this,void 0,void 0,function*(){if(!this.stopped)return e.body={threads:[]},void this.sendResponse(e);try{const t=yield this.miDebugger.sendCommand("thread-list-ids"),s=t.result("thread-ids").map(e=>parseInt(e[1])),r=t.result("current-thread-id");r?this.currentThreadId=parseInt(r):(yield this.miDebugger.sendCommand(`thread-select ${s[0]}`),this.currentThreadId=s[0]);const n=(yield Promise.all(s.map(e=>this.miDebugger.sendCommand(`thread-info ${e}`)))).map(e=>{let t=e.result("threads");if(1===t.length){t=t[0];const e=parseInt(g.MINode.valueOf(t,"id")),s=g.MINode.valueOf(t,"target-id"),r=g.MINode.valueOf(t,"details");return new h.Thread(e,r||s)}return null}).filter(e=>null!==e);e.body={threads:n},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,1,`Unable to get thread information: ${t}`)}})}stackTraceRequest(e,t){return a(this,void 0,void 0,function*(){try{const s=yield this.miDebugger.getStack(t.threadId,t.startFrame,t.levels),r=[];for(const e of s){const s=65535&(t.threadId<<8|255&e.level),n=e.file;let i=this.forceDisassembly||!n;if(i||(i=!(yield this.checkFileExists(n))),!i&&this.activeEditorPath&&this.activeEditorPath.startsWith("disassembly://")){const t=this.symbolTable.getFunctionByName(e.function,e.fileName);t&&(0,p.encodeDisassembly)(t.name,t.file)===this.activeEditorPath&&(i=!0)}try{if(i){const t=yield this.getDisassemblyForFunction(e.function,e.fileName);let n=-1;if(t.instructions.forEach((t,s)=>{t.address===e.address&&(n=s+1)}),-1!==n){const i=(0,p.encodeDisassembly)(t.name,t.file);r.push(new h.StackFrame(s,`${e.function}@${e.address}`,new h.Source(t.name,i),n,0))}else r.push(new h.StackFrame(s,e.function+"@"+e.address,null,e.line,0))}else r.push(new h.StackFrame(s,e.function+"@"+e.address,new h.Source(e.fileName,n),e.line,0))}catch(t){r.push(new h.StackFrame(s,e.function+"@"+e.address,null,e.line,0))}}e.body={stackFrames:r},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,12,`Failed to get Stack Trace: ${t.toString()}`)}})}configurationDoneRequest(e,t){this.sendResponse(e)}scopesRequest(e,t){const s=new Array;s.push(new h.Scope("Local",parseInt(t.frameId),!1)),s.push(new h.Scope("Global",254,!1)),s.push(new h.Scope("Static",R+parseInt(t.frameId),!1)),e.body={scopes:s},this.sendResponse(e)}createVariable(e,t){return t?this.variableHandles.create(new y(e,t)):this.variableHandles.create(e)}findOrCreateVariable(e){let t;return this.variableHandlesReverse.hasOwnProperty(e.name)?t=this.variableHandlesReverse[e.name]:(t=this.createVariable(e),this.variableHandlesReverse[e.name]=t),e.isCompound()?t:0}getVarObjByName(e,t){return a(this,void 0,void 0,function*(){let s;try{(yield this.miDebugger.varUpdate(t)).result("changelist").forEach(e=>{const t=g.MINode.valueOf(e,"name"),s=this.variableHandlesReverse[t];this.variableHandles.get(s).applyChanges(e)});const e=this.variableHandlesReverse[t];s=this.variableHandles.get(e)}catch(r){if(!(r instanceof b.MIError&&"Variable object not found"===r.message))throw r;s=yield this.miDebugger.varCreate(e,t);const n=this.findOrCreateVariable(s);s.exp=e,s.id=n}return s})}stackVariablesRequest(e,t,s,r){return a(this,void 0,void 0,function*(){const r=[];try{const n=yield this.miDebugger.getStackVariables(e,t);for(const e of n)try{const t=`var_local_${e.name}`,s=yield this.getVarObjByName(e.name,t);r.push(s.toProtocolVariable())}catch(t){r.push({name:e.name,value:`<${t}>`,variablesReference:0})}s.body={variables:r},this.sendResponse(s)}catch(e){this.sendErrorResponse(s,1,`Could not expand variable: ${e}`)}})}globalVariablesRequest(e,t){return a(this,void 0,void 0,function*(){const t=this.symbolTable.getGlobalVariables(),s=[];try{for(const e of t){const t=`var_global_${e.name}`,r=yield this.getVarObjByName(e.name,t);s.push(r.toProtocolVariable())}e.body={variables:s},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,1,`Could not get global variable information: ${t}`)}})}staticVariablesRequest(e,t,s,r){return a(this,void 0,void 0,function*(){const r=[];try{const n=(yield this.miDebugger.getFrame(e,t)).fileName,i=this.symbolTable.getStaticVariables(n);for(const e of i){const t=`var_static_${n}_${e.name}`,s=yield this.getVarObjByName(e.name,t);r.push(s.toProtocolVariable())}s.body={variables:r},this.sendResponse(s)}catch(e){this.sendErrorResponse(s,1,`Could not get global variable information: ${e}`)}})}variableMembersRequest(e,t,s){return a(this,void 0,void 0,function*(){let s;try{s=yield this.miDebugger.evalExpression(JSON.stringify(e));try{let n=(0,m.expandValue)(this.createVariable.bind(this),s.result("value"),e,s);n?("string"==typeof n[0]&&(n=[{name:"",value:(r=n,"object"==typeof r?void 0!==r.length?r.join(", "):JSON.stringify(r):r),variablesReference:0}]),t.body={variables:n},this.sendResponse(t)):this.sendErrorResponse(t,2,"Could not expand variable")}catch(e){this.sendErrorResponse(t,2,`Could not expand variable: ${e}`)}}catch(e){this.sendErrorResponse(t,1,`Could not expand variable: ${e}`)}var r})}variablesRequest(e,t){return a(this,void 0,void 0,function*(){let s;if(254===t.variablesReference)return this.globalVariablesRequest(e,t);if(t.variablesReference>=256&&t.variablesReference>>8;return this.stackVariablesRequest(r,s,e,t)}if(t.variablesReference>=R&&t.variablesReference<=x){const s=255&t.variablesReference,r=(65280&t.variablesReference)>>>8;return this.staticVariablesRequest(r,s,e,t)}if(s=this.variableHandles.get(t.variablesReference),"string"==typeof s)return this.variableMembersRequest(s,e,t);if("object"==typeof s)if(s instanceof b.VariableObject){const t=s;try{const r=(yield this.miDebugger.varListChildren(s.name)).map(e=>{const s=this.findOrCreateVariable(e);return e.id=s,/^\d+$/.test(e.exp)?e.fullExp=`${t.fullExp||t.exp}[${e.exp}]`:e.fullExp=`${t.fullExp||t.exp}.${e.exp}`,e.toProtocolVariable()});e.body={variables:r},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,1,`Could not expand variable: ${t}`)}}else if(s instanceof y){const t=s;if(t.options.arg){const s=[];let r=!0,n=0;const i=()=>{e.body={variables:s},this.sendResponse(e)},o=()=>a(this,void 0,void 0,function*(){const a=yield this.miDebugger.evalExpression(JSON.stringify(`${t.name}+${n})`));try{const d=(0,m.expandValue)(this.createVariable.bind(this),a.result("value"),t.name,a);if(d)if("string"==typeof d){if(""===d){if(!r)return i();r=!1}else if('"'!==d[0])return s.push({name:"[err]",value:d,variablesReference:0}),i();s.push({name:`[${n++}]`,value:d,variablesReference:0}),o()}else s.push({name:"[err]",value:d,variablesReference:0}),i();else this.sendErrorResponse(e,15,"Could not expand variable")}catch(t){this.sendErrorResponse(e,14,`Could not expand variable: ${t}`)}});o()}else this.sendErrorResponse(e,13,`Unimplemented variable request options: ${JSON.stringify(t.options)}`)}else e.body={variables:s},this.sendResponse(e);else e.body={variables:[]},this.sendResponse(e)})}evaluateRequest(e,t){return a(this,void 0,void 0,function*(){if("watch"===t.context)try{const s=`watch_${d.createHash("md5").update(t.expression).digest("hex")}}`,r=yield this.getVarObjByName(t.expression,s);e.body={result:r.value,variablesReference:r.id},this.sendResponse(e)}catch(t){e.body={result:`<${t.toString()}>`,variablesReference:0},this.sendErrorResponse(e,7,t.toString())}else if("hover"===t.context)try{const s=yield this.miDebugger.evalExpression(t.expression);e.body={variablesReference:0,result:s.result("value")},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,7,t.toString())}else this.miDebugger.sendUserInput(t.expression).then(t=>{e.body=void 0===t?{result:"",variablesReference:0}:{result:JSON.stringify(t),variablesReference:0},this.sendResponse(e)},t=>{this.sendErrorResponse(e,8,t.toString())})})}setVariableRequest(e,t){return a(this,void 0,void 0,function*(){try{let s=t.name;const r=this.variableHandles.get(t.variablesReference);r?s=`${r.name}.${t.name}`:254===t.variablesReference?s=`var_global_${t.name}`:t.variablesReference>=256&&t.variablesReference=R&&t.variablesReference<=x&&(s=`var_static_${t.name}`);const n=yield this.miDebugger.varAssign(s,t.value);e.body={value:n.result("value")},this.sendResponse(e)}catch(t){this.sendErrorResponse(e,11,`Could not update variable: ${t}`)}})}pauseRequest(e,t){this.miDebugger.interrupt(t.threadId).then(t=>{this.sendResponse(e)},t=>{this.sendErrorResponse(e,3,`Could not pause: ${t}`)})}continueRequest(e,t){this.miDebugger.continue(t.threadId).then(t=>{e.body={allThreadsContinued:!0},this.sendResponse(e)},t=>{this.sendErrorResponse(e,2,`Could not continue: ${t}`)})}stepInRequest(e,t){return a(this,void 0,void 0,function*(){try{let s=this.forceDisassembly;if(!s){const e=yield this.miDebugger.getFrame(t.threadId,0);if(s=!(yield this.checkFileExists(e.file)),this.activeEditorPath&&this.activeEditorPath.startsWith("disassembly://")){const t=this.symbolTable.getFunctionByName(e.function,e.fileName);(0,p.encodeDisassembly)(t.name,t.file)===this.activeEditorPath&&(s=!0)}}yield this.miDebugger.step(t.threadId,s),this.sendResponse(e)}catch(t){this.sendErrorResponse(e,6,`Could not step over: ${t}`)}})}stepOutRequest(e,t){this.miDebugger.stepOut(t.threadId).then(t=>{this.sendResponse(e)},t=>{this.sendErrorResponse(e,5,`Could not step out: ${t}`)})}nextRequest(e,t){return a(this,void 0,void 0,function*(){try{let s=this.forceDisassembly;if(!s){const e=yield this.miDebugger.getFrame(t.threadId,0);if(s=!(yield this.checkFileExists(e.file)),this.activeEditorPath&&this.activeEditorPath.startsWith("disassembly://")){const t=this.symbolTable.getFunctionByName(e.function,e.fileName);(0,p.encodeDisassembly)(t.name,t.file)===this.activeEditorPath&&(s=!0)}}yield this.miDebugger.next(t.threadId,s),this.sendResponse(e)}catch(t){this.sendErrorResponse(e,6,`Could not step over: ${t}`)}})}checkFileExists(e){return e?this.fileExistsCache.has(e)?Promise.resolve(this.fileExistsCache.get(e)):new Promise((t,s)=>{l.exists(e,s=>{this.fileExistsCache.set(e,s),t(s)})}):Promise.resolve(!1)}}t.GDBDebugSession=I,h.DebugSession.run(I)},821(e,t,s){Object.defineProperty(t,"__esModule",{value:!0}),t.isExpandable=function(e){return 0===(e=e.trim()).length?0:e.startsWith("{...}")?2:"{"===e[0]?1:e.startsWith("true")||e.startsWith("false")||l.exec(e)||a.exec(e)?0:d.exec(e)?2:(u.exec(e)||h.exec(e)||i.exec(e)||o.exec(e),0)},t.expandValue=function(e,t,s="",c){const p=()=>{if('"'!==(t=t.trim())[0]&&"'"!==t[0])return"";let e=1,s=!0;const r=t[0];let n=t.substr(1),i=!1;for(;s;)i?i=!1:"\\"===n[0]?i=!0:n[0]===r&&(s=!1),n=n.substr(1),e++;const o=t.substr(0,e).trim();return t=t.substr(e).trim(),o},b=[s];let m="";const f=e=>{let t="",s="";return b.push(e),b.forEach(e=>{if(s="",""===e);else if(e.startsWith("["))t+=e;else if(t){for(;e.startsWith("*");)s+="*",e=e.substr(1);t=t+"."+e}else t=e}),b.pop(),s+t};let g,v,y,R,x;return g=()=>'"'===(t=t.trim())[0]?p():"{"===t[0]?(()=>{if("{"!==(t=t.trim())[0])return;if("}"===(t=t.substr(1).trim())[0])return t=t.substr(1).trim(),[];if(t.startsWith("...")&&"}"===(t=t.substr(3).trim())[0])return t=t.substr(1).trim(),"<...>";const e=t.indexOf("="),s=t.indexOf("{"),r=t.indexOf(",");let n=s;if(-1!==r&&rn||-1===e){const e=[];b.push("[0]");let s=g();b.pop(),e.push(x("[0]",s));let r=0;for(;;){if(b.push("["+ ++r+"]"),s=v(),!s){b.pop();break}b.pop(),e.push(x("["+r+"]",s))}return t=t.substr(1).trim(),e}let i=y(!0);if(i){const e=[];for(e.push(i);i=R(!0);)e.push(i);return t=t.substr(1).trim(),e}})():(()=>{let e,s;return 0===(t=t.trim()).length?s=void 0:t.startsWith("true")?(s="true",t=t.substr(4).trim()):t.startsWith("false")?(s="false",t=t.substr(5).trim()):(e=l.exec(t))?(s="",t=t.substr(e[0].length).trim()):(e=a.exec(t))?(t=t.substr(e[1].length).trim(),s=p()):(e=d.exec(t))?(s="*"+e[0],t=t.substr(e[0].length).trim()):(e=u.exec(t))?(s=e[1],t=t.substr(e[0].length-1),s+=" "+p()):(e=h.exec(t))||(e=i.exec(t))||(e=o.exec(t))?(s=e[0],t=t.substr(e[0].length).trim()):s=t,s})(),y=(e=!1)=>{t=t.trim();const s=n.exec(t);if(!s)return;t=t.substr(s[0].length).trim();const r=m=s[1];e&&b.push(m);const i=g();return e&&b.pop(),x(r,i)},x=(t,s)=>{let n=0;return"object"==typeof s&&(n=e(s),s="Object"),"string"==typeof s&&s.startsWith("*0x")&&(c&&"1"===r.MINode.valueOf(c,"arg")?(n=e(f("*("+t),{arg:!0}),s=""):(n=e(f("*"+t)),s="Object@"+s)),"string"==typeof s&&s.startsWith("<...>")&&(n=e(f(t)),s="..."),{name:t,value:s,variablesReference:n}},v=()=>{if(","===(t=t.trim())[0])return t=t.substr(1).trim(),g()},R=(e=!1)=>{if(","===(t=t.trim())[0])return t=t.substr(1).trim(),y(e)},t=t.trim(),g()};const r=s(645),n=/^([a-zA-Z_\-][a-zA-Z0-9_\-]*|\[\d+\])\s*=\s*/,i=/^[a-zA-Z_\-][a-zA-Z0-9_\-]*/,o=/^\<.+?\>/,a=/^(0x[0-9a-fA-F]+\s*)"/,d=/^0x[0-9a-fA-F]+/,l=/^0x0+\b/,u=/^(\d+) ['"]/,h=/^\d+(\.\d+)?/},232(e,t,s){var r,n=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,n)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[t.length]=s);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=r(e),o=0;o{const n=[...this.args],i=Object.create(process.env);process.env.PLATFORMIO_PATH&&(i.PATH=process.env.PLATFORMIO_PATH,i.Path=process.env.PLATFORMIO_PATH),this.process=d.spawn(this.application,n,{cwd:e,env:i,shell:"win32"===process.platform}),this.process.stdout.on("data",this.stdout.bind(this)),this.process.stderr.on("data",this.stderr.bind(this)),this.process.on("exit",(()=>{this.emit("quit")}).bind(this)),this.process.on("error",(e=>{this.emit("launcherror",e)}).bind(this));const o=[this.sendCommand("gdb-set target-async on",!0),...t.map(e=>this.sendCommand(e))];Promise.all(o).then(()=>{s(!0)},r)})}stdout(e){this.buffer+="string"==typeof e?e:e.toString("utf8");const t=this.buffer.lastIndexOf("\n");-1!==t&&(this.onOutput(this.buffer.substr(0,t)),this.buffer=this.buffer.substr(t+1)),this.buffer.length&&this.onOutputPartial(this.buffer)&&(this.buffer="")}stderr(e){this.errbuf+="string"==typeof e?e:e.toString("utf8");const t=this.errbuf.lastIndexOf("\n");-1!==t&&(this.onOutputStderr(this.errbuf.substr(0,t)),this.errbuf=this.errbuf.substr(t+1)),this.errbuf.length&&(this.logNoNewLine("stderr",this.errbuf),this.errbuf="")}onOutputStderr(e){e.split("\n").forEach(e=>{this.log("stderr",e)})}onOutputPartial(e){return!!f(e)&&(this.logNoNewLine("stdout",e),!0)}onOutput(e){e.split("\n").forEach(e=>{if(f(e))b.exec(e)||this.log("stdout",e);else{const t=(0,h.parseMI)(e);this.debugOutput&&this.log("log","GDB -> App: "+JSON.stringify(t));let s=!1;void 0!==t.token&&this.handlers[t.token]&&(this.handlers[t.token](t),delete this.handlers[t.token],s=!0),!s&&t.resultRecords&&"error"===t.resultRecords.resultClass&&this.log("stderr",t.result("msg")||e),t.outOfBandRecord&&(t.outOfBandRecord.forEach(e=>{if(e.isStream)e.content.includes("PlatformIO: Initialization completed")&&(this.debugReadyTimeout=setTimeout(()=>{this.debugReadyFired=!0,this.emit("debug-ready")},200),this.once("generic-stopped",()=>{this.debugReadyFired||(clearTimeout(this.debugReadyTimeout),this.emit("debug-ready"))})),this.log(e.type,e.content);else if("exec"===e.type)if(this.emit("exec-async-output",t),"running"===e.asyncClass)this.emit("running",t);else if("stopped"===e.asyncClass){const e=t.record("reason");"breakpoint-hit"===e?this.emit("breakpoint",t):"end-stepping-range"===e?this.emit("step-end",t):"function-finished"===e?this.emit("step-out-end",t):"signal-received"===e?this.emit("signal-stop",t):"exited-normally"===e?this.emit("exited-normally",t):"exited"===e?(this.log("stderr","Program exited with code "+t.record("exit-code")),this.emit("exited-normally",t)):(this.debugReadyFired&&this.log("console","Not implemented stop reason (assuming exception): "+e),this.emit("stopped",t)),this.emit("generic-stopped",t)}else this.log("log",JSON.stringify(t));else if("notify"===e.type)if("thread-created"===e.asyncClass){const e=t.result("id"),s=t.result("group-id");this.emit("thread-created",{threadId:e,threadGroupId:s})}else if("thread-exited"===e.asyncClass){const e=t.result("id"),s=t.result("group-id");this.emit("thread-exited",{threadId:e,threadGroupId:s})}else if("thread-selected"===e.asyncClass){const e=t.result("id");this.emit("thread-selected",{threadId:e})}}),s=!0),void 0===t.token&&void 0===t.resultRecords&&0===t.outOfBandRecord.length&&(s=!0),s||this.log("log","Unhandled: "+JSON.stringify(t))}})}stop(e=!1){if(e){const e=this.process,t=setTimeout(()=>{process.kill(-e.pid)},1e3);this.process.on("exit",e=>{clearTimeout(t)})}this.sendRaw("-gdb-exit")}detach(){const e=this.process,t=setTimeout(()=>{process.kill(-e.pid)},1e3);this.process.on("exit",e=>{clearTimeout(t)}),this.sendRaw("-target-detach")}interrupt(e){return new Promise((t,s)=>{this.sendCommand(`exec-interrupt --thread ${e}`).then(e=>{t("done"===e.resultRecords.resultClass)},s)})}continue(e){return new Promise((t,s)=>{this.sendCommand(`exec-continue --thread ${e}`).then(e=>{t("running"===e.resultRecords.resultClass)},s)})}next(e,t){return new Promise((s,r)=>{const n=t?"exec-next-instruction":"exec-next";this.sendCommand(`${n} --thread ${e}`).then(e=>{s("running"===e.resultRecords.resultClass)},r)})}step(e,t){return new Promise((s,r)=>{const n=t?"exec-step-instruction":"exec-step";this.sendCommand(`${n} --thread ${e}`).then(e=>{s("running"===e.resultRecords.resultClass)},r)})}stepOut(e){return new Promise((t,s)=>{this.sendCommand(`exec-finish --thread ${e}`).then(e=>{t("running"===e.resultRecords.resultClass)},s)})}restart(e){return this._sendCommandSequence(e)}_sendCommandSequence(e){return new Promise((t,s)=>{const r=(e=>{if(0===e.length)return void t(!0);const n=e[0];this.sendCommand(n).then(t=>{r(e.slice(1))},s)}).bind(this);r(e)})}changeVariable(e,t){return this.sendCommand("gdb-set var "+e+"="+t)}setBreakPointCondition(e,t){return this.sendCommand("break-condition "+e+" "+t)}addBreakPoint(e){return new Promise((t,s)=>{let r="";if(e.countCondition)if(">"===e.countCondition[0])r+="-i "+m.exec(e.countCondition.substr(1))[0]+" ";else{const t=m.exec(e.countCondition)[0];t.length!==e.countCondition.length?(this.log("stderr","Unsupported break count expression: '"+e.countCondition+"'. Only supports 'X' for breaking once after X times or '>X' for ignoring the first X breaks"),r+="-t "):0!==parseInt(t)&&(r+="-t -i "+parseInt(t)+" ")}e.raw?r+="*"+c(e.raw):r+='"'+c(e.file)+":"+e.line+'"',this.sendCommand(`break-insert ${r}`).then(r=>{if("done"===r.resultRecords.resultClass){const n=parseInt(r.result("bkpt.number"));e.number=n,e.condition?this.setBreakPointCondition(n,e.condition).then(s=>{"done"===s.resultRecords.resultClass?t(e):t(null)},s):t(e)}else t(null)},s)})}removeBreakpoints(e){return new Promise((t,s)=>{if(0===e.length)t(!0);else{const r="break-delete "+e.join(" ");this.sendCommand(r).then(e=>{t("done"===e.resultRecords.resultClass)},s)}})}getFrame(e,t){return new Promise((s,r)=>{const n=`stack-info-frame --thread ${e} --frame ${t}`;this.sendCommand(n).then(e=>{const t=e.result("frame"),r=h.MINode.valueOf(t,"level"),n=h.MINode.valueOf(t,"addr"),i=h.MINode.valueOf(t,"func"),o=h.MINode.valueOf(t,"file"),a=h.MINode.valueOf(t,"fullname");let d=0;const l=h.MINode.valueOf(t,"line");l&&(d=parseInt(l)),s({address:n,fileName:o,file:a,function:i,level:r,line:d})},r)})}getStack(e,t,s){return new Promise((r,n)=>{this.sendCommand(`stack-list-frames --thread ${e} ${t} ${s}`).then(e=>{const t=e.result("stack"),s=[];t.forEach(e=>{const t=h.MINode.valueOf(e,"@frame.level"),r=h.MINode.valueOf(e,"@frame.addr"),n=h.MINode.valueOf(e,"@frame.func"),i=h.MINode.valueOf(e,"@frame.file"),o=h.MINode.valueOf(e,"@frame.fullname");let a=0;const d=h.MINode.valueOf(e,"@frame.line");d&&(a=parseInt(d));const l=parseInt(h.MINode.valueOf(e,"@frame.from"));s.push({address:r,fileName:i,file:o,function:n||l,level:t,line:a})}),r(s)},n)})}getStackVariables(e,t){return a(this,void 0,void 0,function*(){const s=(yield this.sendCommand(`stack-list-variables --thread ${e} --frame ${t} --simple-values`)).result("variables"),r=[];for(const e of s){const t=h.MINode.valueOf(e,"name"),s=h.MINode.valueOf(e,"value"),n=h.MINode.valueOf(e,"type");r.push({name:t,valueStr:s,type:n,raw:e})}return r})}examineMemory(e,t){return a(this,void 0,void 0,function*(){let s="",r=e;for(;t>0;){const e=t>1024?1024:t;s+=(yield this.sendCommand(`data-read-memory-bytes 0x${r.toString(16)} ${e}`)).result("memory[0].contents"),t-=e,r+=e}return s})}evalExpression(e){return new Promise((t,s)=>{this.sendCommand("data-evaluate-expression "+e).then(e=>{t(e)},s)})}varCreate(e){return a(this,arguments,void 0,function*(e,t="-"){const s=yield this.sendCommand(`var-create ${t} @ "${e}"`);return new u.VariableObject(s.result(""))})}varEvalExpression(e){return a(this,void 0,void 0,function*(){return this.sendCommand(`var-evaluate-expression ${e}`)})}varListChildren(e){return a(this,void 0,void 0,function*(){return((yield this.sendCommand(`var-list-children --all-values ${e}`)).result("children")||[]).map(e=>new u.VariableObject(e[1]))})}varUpdate(){return a(this,arguments,void 0,function*(e="*"){return this.sendCommand(`var-update --all-values ${e}`)})}varAssign(e,t){return a(this,void 0,void 0,function*(){return this.sendCommand(`var-assign ${e} ${t}`)})}logNoNewLine(e,t){this.emit("msg",e,t)}log(e,t){this.emit("msg",e,"\n"===t[t.length-1]?t:t+"\n")}sendUserInput(e){return e.startsWith("-")?this.sendCommand(e.substr(1)):this.sendCommand(`interpreter-exec console "${e}"`)}sendRaw(e){this.printCalls&&this.log("log",e),this.process.stdin.write(e+"\n")}sendCommand(e,t=!1){const s=this.currentToken++;return new Promise((r,n)=>{this.handlers[s]=s=>{s&&s.resultRecords&&"error"===s.resultRecords.resultClass?t?(this.log("stderr",`WARNING: Error executing command '${e}'`),r(s)):n(new u.MIError(s.result("msg")||"Internal error",e)):r(s)},this.sendRaw(s+"-"+e)})}isReady(){return!!this.process}}t.MI2=g},465(e,t,s){Object.defineProperty(t,"__esModule",{value:!0}),t.MIError=t.VariableObject=void 0;const r=s(645);t.VariableObject=class{constructor(e){this.name=r.MINode.valueOf(e,"name"),this.exp=r.MINode.valueOf(e,"exp"),this.numchild=parseInt(r.MINode.valueOf(e,"numchild")),this.type=r.MINode.valueOf(e,"type"),this.value=r.MINode.valueOf(e,"value"),this.threadId=r.MINode.valueOf(e,"thread-id"),this.frozen=!!r.MINode.valueOf(e,"frozen"),this.dynamic=!!r.MINode.valueOf(e,"dynamic"),this.displayhint=r.MINode.valueOf(e,"displayhint"),this.hasMore=!!r.MINode.valueOf(e,"has_more")}applyChanges(e){this.value=r.MINode.valueOf(e,"value"),r.MINode.valueOf(e,"type_changed")&&(this.type=r.MINode.valueOf(e,"new_type")),this.dynamic=!!r.MINode.valueOf(e,"dynamic"),this.displayhint=r.MINode.valueOf(e,"displayhint"),this.hasMore=!!r.MINode.valueOf(e,"has_more")}isCompound(){return this.numchild>0||"{...}"===this.value||this.dynamic&&("array"===this.displayhint||"map"===this.displayhint)}toProtocolVariable(){return{name:this.exp,evaluateName:this.fullExp||this.exp,value:void 0===this.value?"":this.value,type:this.type,presentationHint:{kind:this.displayhint},variablesReference:this.id}}};class n{constructor(e,t){Object.defineProperty(this,"name",{get:()=>this.constructor.name}),Object.defineProperty(this,"message",{get:()=>e}),Object.defineProperty(this,"source",{get:()=>t}),Error.captureStackTrace(this,this.constructor)}toString(){return`${this.message} (from ${this.source})`}}t.MIError=n,Object.setPrototypeOf(n,Object.create(Error.prototype)),n.prototype.constructor=n},645(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MINode=void 0,t.parseMI=function(e){let t;const s=[];let u;const h={"*":"exec","+":"status","=":"notify"},c={"~":"console","@":"target","&":"log"};let p,b,m,f,g;for(p=()=>{if('"'===e[0]){const[t,s]=l(e);return e=s,t}if("{"===e[0]||"["===e[0]){const t="["===e[0];if("}"===(e=e.substr(1))[0]||"]"===e[0])return e=e.substr(1),[];if(t){let t=p();if(t){const s=[];for(s.push(t);void 0!==(t=m());)s.push(t);return e=e.substr(1),s}}let s=b();if(s){const t=[];for(t.push(s);s=f();)t.push(s);return e=e.substr(1),t}e=(t?"[":"{")+e}},b=()=>{const t=a.exec(e);if(t)return e=e.substr(t[0].length+1),[t[1],p()]},m=()=>{if(","===e[0])return e=e.substr(1),p()},f=()=>{if(","===e[0])return e=e.substr(1),b()};g=n.exec(e);){if(e=e.substr(g[0].length),g[1]&&void 0===t&&"undefined"!==g[1]&&(t=parseInt(g[1])),g[2]){const t=d.exec(e);e=e.substr(t[1].length);const r={isStream:!1,type:h[g[2]],asyncClass:t[1],output:[]};let n;for(;n=f();)r.output.push(n);s.push(r)}else if(g[3]){const[t,r]=l(e);e=r;const n={isStream:!0,type:c[g[3]],content:t};s.push(n)}e=e.replace(o,"")}if(g=i.exec(e)){let s;for(e=e.substr(g[0].length),g[1]&&void 0===t&&(t=parseInt(g[1])),u={resultClass:g[2],results:[]};s=f();)u.results.push(s);e=e.replace(o,"")}return new r(t,s||[],u)};const s=/^[0-7]{3}/;class r{constructor(e,t,s){this.token=e,this.outOfBandRecord=t,this.resultRecords=s}static valueOf(e,t){if(!e)return;const s=/^\.?([a-zA-Z_\-][a-zA-Z0-9_\-]*)/,r=/^\[(\d+)\](?:$|\.)/;if(!(t=t.trim()))return e;let n=e;do{let e=s.exec(t);if(e){if(t=t.substr(e[0].length),!n.length||"string"==typeof n)return;{const t=[];for(const s of n)s[0]===e[1]&&t.push(s[1]);if(t.length>1)n=t;else{if(1!==t.length)return;n=t[0]}}}else if("@"===t[0])n=[n],t=t.substr(1);else{if(e=r.exec(t),!e)return;t=t.substr(e[0].length);const s=parseInt(e[1]);if(n.length&&"string"!=typeof n&&s>=0&&s{t.includes("objdump")&&d.existsSync(l.join(this.toolchainBinDir,t))&&(e=l.join(this.toolchainBinDir,t))}),!e)throw new Error('Could not find "objdump" program');const t=a.spawnSync(e,["--syms",this.executable]).stdout.toString().split("\n");let s=null;for(const e of t){const t=e.match(h);if(!t)continue;const r=p[t[8]],n=b[t[2]];let i=t[11].trim(),o=!1;if("d"===t[7]&&"f"===t[8])s=i;else{i.startsWith(".hidden")&&(i=i.substring(7).trim(),o=!0);const e=i.match(c);if(e){if(r!==u.SymbolType.Function)continue;const t=parseInt(e[1]);if(i=e[2].substr(0,t),e[2].length>t){const s=e[2].substr(t).match(/^(\d+)(.+)$/);s&&(i+="::"+s[2].substr(0,parseInt(s[1])))}}this.symbols.push({address:parseInt(t[1],16),type:r,scope:n,section:t[9].trim(),length:parseInt(t[10],16),name:i,file:n===u.SymbolScope.Local?s:null,instructions:null,hidden:o})}}}getFunctionAtAddress(e){const t=this.symbols.filter(t=>t.type===u.SymbolType.Function&&t.address<=e&&t.address+t.length>e);if(t&&0!==t.length)return t[0]}getFunctionSymbols(){return this.symbols.filter(e=>e.type===u.SymbolType.Function)}getGlobalVariables(){return this.symbols.filter(e=>e.type===u.SymbolType.Object&&e.scope===u.SymbolScope.Global)}getStaticVariables(e){return this.symbols.filter(t=>t.type===u.SymbolType.Object&&t.scope===u.SymbolScope.Local&&t.file===e)}getFunctionByName(e,t){let s=this.symbols.filter(s=>s.type===u.SymbolType.Function&&s.scope===u.SymbolScope.Local&&s.name===e&&s.file===t);return 0!==s.length?s[0]:(s=this.symbols.filter(t=>t.type===u.SymbolType.Function&&t.scope!==u.SymbolScope.Local&&t.name===e),0!==s.length?s[0]:null)}}},799(e,t,s){Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolScope=t.SymbolType=t.TelemetryEvent=t.StoppedEvent=t.AdapterOutputEvent=t.NumberFormat=void 0;const r=s(161);var n,i,o;!function(e){e[e.Auto=0]="Auto",e[e.Hexidecimal=1]="Hexidecimal",e[e.Decimal=2]="Decimal",e[e.Binary=3]="Binary"}(n||(t.NumberFormat=n={}));class a extends r.Event{constructor(e,t){super("adapter-output",{content:e,type:t})}}t.AdapterOutputEvent=a;class d extends r.Event{constructor(e,t,s){super("stopped",{reason:e,threadId:t,allThreadsStopped:s})}}t.StoppedEvent=d;class l extends r.Event{constructor(e,t,s,r={}){super("record-event",{category:e,action:t,label:s,parameters:r})}}t.TelemetryEvent=l,function(e){e[e.Function=0]="Function",e[e.File=1]="File",e[e.Object=2]="Object",e[e.Normal=3]="Normal"}(i||(t.SymbolType=i={})),function(e){e[e.Local=0]="Local",e[e.Global=1]="Global",e[e.Neither=2]="Neither",e[e.Both=3]="Both"}(o||(t.SymbolScope=o={}))},185(e,t){function s(e,t){let s=0;const r=e+t-1;for(let t=e;t<=r;t++)s=(s|1<>>0;return s}Object.defineProperty(t,"__esModule",{value:!0}),t.hexFormat=function(e,t=8,s=!0){let r=e.toString(16);for(;r.length>>0).toString(2);for(;n.length>>t>>>0},t.parseQuery=function(e){const t={},s=("?"===e[0]?e.substr(1):e).split("&");for(const e of s){const s=e.split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1]||"")}return t},t.encodeDisassembly=function(e,t){let s="disassembly:///";return t&&(s+=`${t}:`),s+=`${e}.dbgasm?func=${e}&file=${t||""}`,s}},317(e){e.exports=require("child_process")},982(e){e.exports=require("crypto")},434(e){e.exports=require("events")},896(e){e.exports=require("fs")},928(e){e.exports=require("path")},557(e){e.exports=require("timers")},161(t){t.exports=e}},s={};return function e(r){var n=s[r];if(void 0!==n)return n.exports;var i=s[r]={exports:{}};return t[r].call(i.exports,i,i.exports,e),i.exports}(284)})()); \ No newline at end of file diff --git a/dist/extension.js b/dist/extension.js index f8de7b9..a35b1f4 100644 --- a/dist/extension.js +++ b/dist/extension.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("copy-paste"),require("vscode"),require("vscode-debugadapter"),require("xml2js")):"function"==typeof define&&define.amd?define(["copy-paste","vscode","vscode-debugadapter","xml2js"],t):"object"==typeof exports?exports["platformio-vscode-debug"]=t(require("copy-paste"),require("vscode"),require("vscode-debugadapter"),require("xml2js")):e["platformio-vscode-debug"]=t(e["copy-paste"],e.vscode,e["vscode-debugadapter"],e.xml2js)}(global,function(e,t,r,i){return(()=>{"use strict";var s={200:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolScope=t.SymbolType=t.TelemetryEvent=t.StoppedEvent=t.AdapterOutputEvent=t.NumberFormat=void 0;const i=r(797);var s,n,o;(s=t.NumberFormat||(t.NumberFormat={}))[s.Auto=0]="Auto",s[s.Hexidecimal=1]="Hexidecimal",s[s.Decimal=2]="Decimal",s[s.Binary=3]="Binary";class a extends i.Event{constructor(e,t){super("adapter-output",{content:e,type:t})}}t.AdapterOutputEvent=a;class d extends i.Event{constructor(e,t,r){super("stopped",{reason:e,threadId:t,allThreadsStopped:r})}}t.StoppedEvent=d;class h extends i.Event{constructor(e,t,r,i={}){super("record-event",{category:e,action:t,label:r,parameters:i})}}t.TelemetryEvent=h,(o=t.SymbolType||(t.SymbolType={}))[o.Function=0]="Function",o[o.File=1]="File",o[o.Object=2]="Object",o[o.Normal=3]="Normal",(n=t.SymbolScope||(t.SymbolScope={}))[n.Local=0]="Local",n[n.Global=1]="Global",n[n.Neither=2]="Neither",n[n.Both=3]="Both"},112:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t},o=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function o(e){try{d(i.next(e))}catch(e){n(e)}}function a(e){try{d(i.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}d((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.deactivate=t.activate=void 0;const a=n(r(316)),d=n(r(100)),h=r(200),l=r(593),u=r(244),c=r(414),m=r(10),p=r(533),f=r(315),g=r(144),b=r(376);class y{constructor(e){this.adapterOutputChannel=null,this.functionSymbols=null,this.context=e,this.registerProvider=new b.RegisterTreeProvider,this.peripheralProvider=new g.PeripheralTreeProvider,this.memoryTreeProvider=new f.MemoryTreeProvider,this.disassemblyTreeProvider=new m.DisassemblyTreeProvider,this.memoryContentProvider=new p.MemoryContentProvider;const t=d.window.createTreeView("platformio-debug.peripherals",{treeDataProvider:this.peripheralProvider});e.subscriptions.push(d.debug.registerDebugConfigurationProvider("platformio-debug",new u.PlatformIODebugConfigurationProvider),t,t.onDidExpandElement(this.peripheralProvider.onDidExpandElement.bind(this.peripheralProvider)),t.onDidCollapseElement(this.peripheralProvider.onDidCollapseElement.bind(this.peripheralProvider)),d.window.registerTreeDataProvider("platformio-debug.registers",this.registerProvider),d.window.registerTreeDataProvider("platformio-debug.memory",this.memoryTreeProvider),d.window.registerTreeDataProvider("platformio-debug.disassembly",this.disassemblyTreeProvider),d.workspace.registerTextDocumentContentProvider("examinememory",this.memoryContentProvider),d.workspace.registerTextDocumentContentProvider("disassembly",new c.DisassemblyContentProvider),d.commands.registerCommand("platformio-debug.peripherals.updateNode",this.peripheralsUpdateNode.bind(this)),d.commands.registerCommand("platformio-debug.peripherals.selectedNode",this.peripheralsSelectedNode.bind(this)),d.commands.registerCommand("platformio-debug.peripherals.copyValue",this.peripheralsCopyValue.bind(this)),d.commands.registerCommand("platformio-debug.peripherals.setFormat",this.peripheralsSetFormat.bind(this)),d.commands.registerCommand("platformio-debug.registers.selectedNode",this.registersSelectedNode.bind(this)),d.commands.registerCommand("platformio-debug.registers.copyValue",this.registersCopyValue.bind(this)),d.commands.registerCommand("platformio-debug.registers.setFormat",this.registersSetFormat.bind(this)),d.commands.registerCommand("platformio-debug.memory.deleteHistoryItem",this.memoryDeleteHistoryItem.bind(this)),d.commands.registerCommand("platformio-debug.memory.clearHistory",this.memoryClearHistory.bind(this)),d.commands.registerCommand("platformio-debug.examineMemory",this.examineMemory.bind(this)),d.commands.registerCommand("platformio-debug.viewDisassembly",this.showDisassembly.bind(this)),d.commands.registerCommand("platformio-debug.setForceDisassembly",this.setForceDisassembly.bind(this)),d.debug.onDidReceiveDebugSessionCustomEvent(this.receivedCustomEvent.bind(this)),d.debug.onDidStartDebugSession(this.debugSessionStarted.bind(this)),d.debug.onDidTerminateDebugSession(this.debugSessionTerminated.bind(this)),d.window.onDidChangeActiveTextEditor(this.activeEditorChanged.bind(this)),d.window.onDidChangeTextEditorSelection(e=>{e&&e.textEditor.document.fileName.endsWith(".dbgmem")&&this.memoryContentProvider.handleSelection(e)}))}isPIODebugSession(){return d.debug.activeDebugSession&&"platformio-debug"===d.debug.activeDebugSession.type}activeEditorChanged(e){if(!e||!this.isPIODebugSession())return;const t=e.document.uri;"file"===t.scheme?d.debug.activeDebugSession.customRequest("set-active-editor",{path:t.path}):"disassembly"===t.scheme&&d.debug.activeDebugSession.customRequest("set-active-editor",{path:`${t.scheme}://${t.authority}${t.path}`})}showDisassembly(){return o(this,void 0,void 0,function*(){if(this.isPIODebugSession()){if(!this.functionSymbols)try{const e=yield d.debug.activeDebugSession.customRequest("load-function-symbols");this.functionSymbols=e.functionSymbols}catch(e){d.window.showErrorMessage("Unable to load symbol table. Disassembly view unavailable.")}try{const e=yield d.window.showInputBox({placeHolder:"main",ignoreFocusOut:!0,prompt:"Function Name to Disassemble"}),t=this.functionSymbols.filter(t=>t.name===e);let r;if(1===t.length)r=(0,l.encodeDisassembly)(t[0].name,t[0].file);else{if(!(t.length>1))return void d.window.showErrorMessage(`No function with name ${e} found.`);{const e=yield d.window.showQuickPick(t.map(e=>({label:e.name,name:e.name,file:e.file,scope:e.scope,description:e.scope===h.SymbolScope.Global?"Global Scope":`Static in ${e.file}`})),{ignoreFocusOut:!0});r=(0,l.encodeDisassembly)(e.name,e.file)}}r&&d.window.showTextDocument(d.Uri.parse(r))}catch(e){d.window.showErrorMessage("Unable to show disassembly.")}}else d.window.showErrorMessage("No debugging session available")})}setForceDisassembly(e){const t=e=>{const t="Forced"===e;return this.disassemblyTreeProvider.updateForcedState(t),d.debug.activeDebugSession.customRequest("set-force-disassembly",{force:t})};if(e)return t(e);d.window.showQuickPick([{label:"Auto",description:"Show disassembly for functions when source cannot be located."},{label:"Forced",description:"Always show disassembly for functions."}],{matchOnDescription:!0,ignoreFocusOut:!0}).then(e=>{t(e.label)},e=>{})}memoryDeleteHistoryItem(e){const[t,r]=e.label.split("+");this.memoryTreeProvider.deleteHistory(t,r)}memoryClearHistory(){this.memoryTreeProvider.clearHistory()}examineMemory(e,t){function r(e){return/^0x[0-9a-f]{1,8}$/i.test(e)||/^[0-9]+$/i.test(e)?e:null}if(this.isPIODebugSession())return e&&t?this.showMemoryContent(e,t):void d.window.showInputBox({placeHolder:"Prefix with 0x for hexidecimal format",ignoreFocusOut:!0,prompt:"A start memory address"}).then(e=>{r(e)?d.window.showInputBox({placeHolder:"Prefix with 0x for hexidecimal format",ignoreFocusOut:!0,prompt:"How many bytes to read?"}).then(t=>{r(t)?(this.memoryTreeProvider.pushHistory(e,t),this.showMemoryContent(e,t)):d.window.showErrorMessage("Invalid length entered")},e=>{}):d.window.showErrorMessage("Invalid memory address entered")},e=>{});d.window.showErrorMessage("No debugging session available")}showMemoryContent(e,t){d.workspace.openTextDocument(d.Uri.parse(`examinememory:///Memory%20[${e}+${t}].dbgmem?address=${e}&length=${t}×tamp=${(new Date).getTime()}`)).then(e=>{d.window.showTextDocument(e,{viewColumn:2,preview:!1})},e=>{d.window.showErrorMessage(`Failed to examine memory: ${e}`)})}peripheralsUpdateNode(e){e.node.performUpdate().then(e=>{e&&this.peripheralProvider.refresh()},e=>{d.window.showErrorMessage(`Unable to update value: ${e.toString()}`)})}peripheralsSelectedNode(e){e.recordType!==g.RecordType.Field&&(e.expanded=!e.expanded),e.selected().then(e=>{e&&this.peripheralProvider.refresh()},e=>{})}peripheralsCopyValue(e){const t=e.node.getCopyValue();t&&a.copy(t)}peripheralsSetFormat(e){return o(this,void 0,void 0,function*(){const t=yield d.window.showQuickPick([{label:"Auto",description:"Automatically choose format (Inherits from parent)",value:h.NumberFormat.Auto},{label:"Hex",description:"Format value in hexidecimal",value:h.NumberFormat.Hexidecimal},{label:"Decimal",description:"Format value in decimal",value:h.NumberFormat.Decimal},{label:"Binary",description:"Format value in binary",value:h.NumberFormat.Binary}]);e.node.setFormat(t.value),this.peripheralProvider.refresh()})}registersSelectedNode(e){e.recordType!==b.RecordType.Field&&(e.expanded=!e.expanded)}registersCopyValue(e){const t=e.node.getCopyValue();t&&a.copy(t)}registersSetFormat(e){return o(this,void 0,void 0,function*(){const t=yield d.window.showQuickPick([{label:"Auto",description:"Automatically choose format (Inherits from parent)",value:h.NumberFormat.Auto},{label:"Hex",description:"Format value in hexidecimal",value:h.NumberFormat.Hexidecimal},{label:"Decimal",description:"Format value in decimal",value:h.NumberFormat.Decimal},{label:"Binary",description:"Format value in binary",value:h.NumberFormat.Binary}]);e.node.setFormat(t.value),this.registerProvider.refresh()})}debugSessionStarted(e){"platformio-debug"===e.type&&(this.functionSymbols=null,e.customRequest("get-arguments").then(e=>{this.registerProvider.debugSessionStarted(this.context.workspaceState.get("debugRegistersTreeState")),this.peripheralProvider.debugSessionStarted(e.svdPath,this.context.workspaceState.get("debugPeripheralsTreeState")),this.memoryTreeProvider.debugSessionStarted(this.context.workspaceState.get("debugMemoryTreeState")),this.disassemblyTreeProvider.debugSessionStarted()},e=>{console.error(e)}))}debugSessionTerminated(e){"platformio-debug"===e.type&&(this.context.workspaceState.update("debugRegistersTreeState",this.registerProvider.dumpSettings()),this.context.workspaceState.update("debugPeripheralsTreeState",this.peripheralProvider.dumpSettings()),this.context.workspaceState.update("debugMemoryTreeState",this.memoryTreeProvider.dumpSettings()),this.registerProvider.debugSessionTerminated(),this.peripheralProvider.debugSessionTerminated(),this.memoryTreeProvider.debugSessionTerminated(),this.disassemblyTreeProvider.debugSessionTerminated())}receivedCustomEvent(e){if(this.isPIODebugSession())switch(e.event){case"custom-stop":this.receivedStopEvent(e);break;case"custom-continued":this.receivedContinuedEvent(e);break;case"adapter-output":this.receivedAdapterOutput(e);break;case"record-event":this.receivedEvent(e)}}receivedStopEvent(e){this.peripheralProvider.debugStopped(),this.registerProvider.debugStopped(),d.workspace.textDocuments.filter(e=>e.fileName.endsWith(".dbgmem")).forEach(e=>{this.memoryContentProvider.update(e)})}receivedContinuedEvent(e){this.peripheralProvider.debugContinued(),this.registerProvider.debugContinued()}receivedEvent(e){}receivedAdapterOutput(e){this.adapterOutputChannel||(this.adapterOutputChannel=d.window.createOutputChannel("Adapter Output"));let t=e.body.content;t.endsWith("\n")||(t+="\n"),this.adapterOutputChannel.append(t)}}t.activate=function(e){return new y(e)},t.deactivate=function(){}},244:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t},o=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function o(e){try{d(i.next(e))}catch(e){n(e)}}function a(e){try{d(i.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}d((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.PlatformIODebugConfigurationProvider=void 0;const a=n(r(100));t.PlatformIODebugConfigurationProvider=class{constructor(){}resolveDebugConfiguration(e,t,r){return o(this,void 0,void 0,function*(){return t.cwd=e?e.uri.fsPath:a.workspace.rootPath,t})}}},414:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.DisassemblyContentProvider=void 0;const o=n(r(100)),a=r(593);t.DisassemblyContentProvider=class{provideTextDocumentContent(e,t){return new Promise((t,r)=>{const i=(0,a.parseQuery)(e.query);o.debug.activeDebugSession.customRequest("disassemble",{function:i.func,file:i.file}).then(e=>{const r=e.instructions;let i="";r.forEach(e=>{i+=`${e.address}: ${this.padEnd(15,e.opcodes)} \t${e.instruction}\n`}),t(i)},e=>{o.window.showErrorMessage(e.message),r(e.message)})})}padEnd(e,t){for(let r=t.length;r{const i=(0,a.parseQuery)(e.query),s=i.address.startsWith("0x")?parseInt(i.address.substring(2),16):parseInt(i.address,10),n=i.length.startsWith("0x")?parseInt(i.length.substring(2),16):parseInt(i.length,10);o.debug.activeDebugSession.customRequest("read-memory",{address:s,length:n||32}).then(e=>{const r=e.bytes;let i=s-s%16;const o=s-i;let d="";d+=" Offset: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F \t\n",d+=(0,a.hexFormat)(i,8,!1)+": ";let h="";for(let e=0;e=127&&t<=159?".":String.fromCharCode(r[e]),(s+e)%16==15&&e{o.window.showErrorMessage(`Unable to read memory from ${(0,a.hexFormat)(s,8)} to ${(0,a.hexFormat)(s+n,8)}`),r(e.toString())})})}update(e){this._onDidChange.fire(e.uri)}getOffset(e){if(e.line<1||e.character=this.firstBytePos&&e.character<=this.lastBytePos?t+=Math.floor(r/3):e.character>=this.firstAsciiPos&&(t+=e.character-this.firstAsciiPos),t}getPosition(e,t=!1){const r=1+Math.floor(e/16);let i=e%16;return t?i+=this.firstAsciiPos:i=this.firstBytePos+3*i,new o.Position(r,i)}getRanges(e,t,r){const i=this.getPosition(e,r);let s=this.getPosition(t,r);s=new o.Position(s.line,s.character+(r?1:2));const n=[],a=r?this.firstAsciiPos:this.firstBytePos,d=r?this.lastAsciiPos:this.lastBytePos;for(let e=i.line;e<=s.line;++e){const t=new o.Position(e,e===i.line?i.character:a),r=new o.Position(e,e===s.line?s.character:d);n.push(new o.Range(t,r))}return n}handleSelection(e){const t=e.textEditor.document.lineCount;if(e.selections[0].start.line+1===t||e.selections[0].end.line+1===t)return void e.textEditor.setDecorations(this.smallDecorationType,[]);const r=this.getOffset(e.selections[0].start),i=this.getOffset(e.selections[0].end);if(void 0===r||void 0===i)return void e.textEditor.setDecorations(this.smallDecorationType,[]);let s=this.getRanges(r,i,!1);s=s.concat(this.getRanges(r,i,!0)),e.textEditor.setDecorations(this.smallDecorationType,s)}}},315:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.MemoryTreeProvider=void 0;const o=n(r(100));t.MemoryTreeProvider=class{constructor(){this._onDidChangeTreeData=new o.EventEmitter,this.onDidChangeTreeData=this._onDidChangeTreeData.event,this.history=[]}refresh(){this._onDidChangeTreeData.fire()}dumpSettings(){return this.history}getChildren(e){if(!o.debug.activeDebugSession)return[];if(this.history.length)return this.getHistoryNodes();const t=new o.TreeItem("Enter address...");return t.command={title:"Enter memory address...",command:"platformio-debug.examineMemory"},[t]}getHistoryNodes(){return this.history.map(e=>{const t=new o.TreeItem(e);return t.command={title:`Examine memory at ${e}`,command:"platformio-debug.examineMemory",arguments:e.split("+")},t})}getTreeItem(e){return e}pushHistory(e,t){const r=`${e}+${t}`;this.history.includes(r)||(this.history.push(r),this.refresh())}deleteHistory(e,t){const r=`${e}+${t}`;this.history.includes(r)&&(this.history=this.history.filter(e=>e!==r),this.refresh())}clearHistory(){this.history=[],this.refresh()}debugSessionStarted(e){this.history=e||[],this.refresh()}debugSessionTerminated(){this.history=[],this.refresh()}}},144:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t},o=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function o(e){try{d(i.next(e))}catch(e){n(e)}}function a(e){try{d(i.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}d((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.PeripheralTreeProvider=t.FieldNode=t.RegisterNode=t.ClusterNode=t.PeripheralNode=t.BaseNode=t.TreeNode=t.AccessType=t.RecordType=void 0;const a=n(r(147)),d=n(r(100)),h=n(r(167)),l=r(200),u=r(593);var c,m;!function(e){e[e.Peripheral=1]="Peripheral",e[e.Register=2]="Register",e[e.Field=3]="Field",e[e.Cluster=4]="Cluster"}(c=t.RecordType||(t.RecordType={})),function(e){e[e.ReadOnly=1]="ReadOnly",e[e.ReadWrite=2]="ReadWrite",e[e.WriteOnly=3]="WriteOnly"}(m=t.AccessType||(t.AccessType={}));const p={"read-only":m.ReadOnly,"write-only":m.WriteOnly,"read-write":m.ReadWrite,writeOnce:m.WriteOnly,"read-writeOnce":m.ReadWrite};class f extends d.TreeItem{constructor(e,t,r,i){super(e,t),this.label=e,this.collapsibleState=t,this.contextValue=r,this.node=i,this.command={command:"platformio-debug.peripherals.selectedNode",arguments:[i],title:"Selected Node"},this.tooltip=(i?i.description:void 0)||e}}t.TreeNode=f;class g{constructor(e){this.recordType=e,this.expanded=!1,this.format=l.NumberFormat.Auto}selected(){return Promise.resolve(!1)}update(){return Promise.resolve(!1)}performUpdate(){return Promise.resolve(!1)}getChildren(){return[]}getTreeNode(){return null}getCopyValue(){return null}setFormat(e){this.format=e}}function b(e){return/^0b([01]+)$/i.test(e)?parseInt(e.substring(2),2):/^0x([0-9a-f]+)$/i.test(e)?parseInt(e.substring(2),16):/^[0-9]+/i.test(e)?parseInt(e,10):/^#[0-1]+/i.test(e)?parseInt(e.substring(1),2):void 0}function y(e,t){if(-1!==e.indexOf(",")){const r=e.split(",").map(e=>e.trim());if(r.length!==t)throw new Error("dimIndex Element has invalid specification.");return r}if(/^([0-9]+)\-([0-9]+)$/i.test(e)){const r=e.split("-").map(e=>b(e)),i=r[0];if(r[1]-i+1e.offset>t.offset?1:-1)}addChild(e){this.children.push(e),this.children.sort((e,t)=>e.offset>t.offset?1:-1)}getBytes(e,t){try{return new Uint8Array(this.currentValue.slice(e,e+t))}catch(e){return new Uint8Array(0)}}getAddress(e){return this.baseAddress+e}getFormat(){return this.format}update(){return new Promise((e,t)=>{this.expanded?d.debug.activeDebugSession.customRequest("read-memory",{address:this.baseAddress,length:this.totalLength>32768?32768:this.totalLength}).then(t=>{this.currentValue=t.bytes,this.children.forEach(e=>e.update()),e(!0)},e=>{t(e)}):e(!1)})}selected(){return this.update()}dumpSettings(){const e=[];return(this.format!==l.NumberFormat.Auto||this.expanded)&&e.push({node:`${this.name}`,expanded:this.expanded,format:this.format}),this.children.forEach(t=>{e.push(...t.dumpSettings(`${this.name}`))}),e}_findByPath(e){if(0===e.length)return this;const t=this.children.find(t=>t.name===e[0]);return t?t._findByPath(e.slice(1)):null}}t.PeripheralNode=w;class x extends g{constructor(e,t){super(c.Cluster),this.parent=e,this.children=[],this.name=t.name,this.description=t.description,this.offset=t.addressOffset,this.accessType=t.accessType||m.ReadWrite,this.size=t.size||e.size,this.resetValue=t.resetValue||e.resetValue,this.parent.addChild(this)}getTreeNode(){const e=`${this.name} [${(0,u.hexFormat)(this.offset,0)}]`;return new f(e,this.expanded?d.TreeItemCollapsibleState.Expanded:d.TreeItemCollapsibleState.Collapsed,"cluster",this)}getChildren(){return this.children}setChildren(e){this.children=e.slice(0,e.length),this.children.sort((e,t)=>e.offset>t.offset?1:-1)}addChild(e){this.children.push(e),this.children.sort((e,t)=>e.offset>t.offset?1:-1)}getBytes(e,t){return this.parent.getBytes(this.offset+e,t)}getAddress(e){return this.parent.getAddress(this.offset+e)}getFormat(){return this.format!==l.NumberFormat.Auto?this.format:this.parent.getFormat()}update(){return Promise.resolve(!0)}dumpSettings(e){const t=[];return(this.format!==l.NumberFormat.Auto||this.expanded)&&t.push({node:`${e}.${this.name}`,expanded:this.expanded,format:this.format}),this.children.forEach(r=>{t.push(...r.dumpSettings(`${e}.${this.name}`))}),t}_findByPath(e){if(0===e.length)return this;const t=this.children.find(t=>t.name===e[0]);return t?t._findByPath(e.slice(1)):null}}t.ClusterNode=x;class P extends g{constructor(e,t){super(c.Register),this.parent=e,this.children=[],this.name=t.name,this.description=t.description,this.offset=t.addressOffset,this.accessType=t.accessType||e.accessType,this.size=t.size||e.size,this.resetValue=void 0!==t.resetValue?t.resetValue:e.resetValue,this.currentValue=this.resetValue,this.hexLength=Math.ceil(this.size/4),this.maxValue=Math.pow(2,this.size),this.binaryRegex=new RegExp(`^0b[01]{1,${this.size}}$`,"i"),this.hexRegex=new RegExp(`^0x[0-9a-f]{1,${this.hexLength}}$`,"i"),this.parent,this.parent.addChild(this)}reset(){this.currentValue=this.resetValue}extractBits(e,t){return(0,u.extractBits)(this.currentValue,e,t)}updateBits(e,t,r){return new Promise((i,s)=>{const n=Math.pow(2,t);if(r>n)return s(`Value entered is invalid. Maximum value for this field is ${n-1} (${(0,u.hexFormat)(n-1,0)})`);const o=(0,u.createMask)(e,t),a=r<";else switch(this.getFormat()){case l.NumberFormat.Decimal:t+=` = ${this.currentValue.toString()}`;break;case l.NumberFormat.Binary:t+=` = ${(0,u.binaryFormat)(this.currentValue,4*this.hexLength,!1,!0)}`;break;default:t+=` = ${(0,u.hexFormat)(this.currentValue,this.hexLength)}`}const r=this.children&&this.children.length>0?this.expanded?d.TreeItemCollapsibleState.Expanded:d.TreeItemCollapsibleState.Collapsed:d.TreeItemCollapsibleState.None;return new f(t,r,e,this)}getChildren(){return this.children||[]}setChildren(e){this.children=e.slice(0,e.length),this.children.sort((e,t)=>e.offset>t.offset?1:-1)}addChild(e){this.children.push(e),this.children.sort((e,t)=>e.offset>t.offset?1:-1)}getFormat(){return this.format!==l.NumberFormat.Auto?this.format:this.parent.getFormat()}getCopyValue(){switch(this.getFormat()){case l.NumberFormat.Decimal:return this.currentValue.toString();case l.NumberFormat.Binary:return(0,u.binaryFormat)(this.currentValue,4*this.hexLength);default:return(0,u.hexFormat)(this.currentValue,this.hexLength)}}performUpdate(){return new Promise((e,t)=>{d.window.showInputBox({prompt:"Enter new value: (prefix hex with 0x, binary with 0b)"}).then(r=>{let i;if(r.match(this.hexRegex))i=parseInt(r.substr(2),16);else if(r.match(this.binaryRegex))i=parseInt(r.substr(2),2);else{if(!r.match(/^[0-9]+/))return t("Value entered is not a valid format.");if(i=parseInt(r,10),i>=this.maxValue)return t(`Value entered (${i}) is greater than the maximum value of ${this.maxValue}`)}this.updateValueInternal(i).then(e,t)})})}updateValueInternal(e){const t=this.parent.getAddress(this.offset),r=[],i=this.size/8;for(let t=0;t>>=8;let s=i.toString(16);1===s.length&&(s="0"+s),r[t]=s}return new Promise((e,i)=>{d.debug.activeDebugSession.customRequest("write-memory",{address:t,data:r.join("")}).then(t=>{this.parent.update().then(()=>{},()=>{}),e(!0)},i)})}update(){const e=this.size/8,t=this.parent.getBytes(this.offset,e),r=Buffer.from(t);switch(e){case 1:this.currentValue=r.readUInt8(0);break;case 2:this.currentValue=r.readUInt16LE(0);break;case 4:this.currentValue=r.readUInt32LE(0);break;default:d.window.showErrorMessage(`Register ${this.name} has invalid size: ${this.size}. Should be 8, 16 or 32.`)}return this.children.forEach(e=>e.update()),Promise.resolve(!0)}dumpSettings(e){const t=[];return(this.format!==l.NumberFormat.Auto||this.expanded)&&t.push({node:`${e}.${this.name}`,expanded:this.expanded,format:this.format}),this.children.forEach(r=>{t.push(...r.dumpSettings(`${e}.${this.name}`))}),t}_findByPath(e){return 0===e.length?this:1===e.length?this.children.find(t=>t.name===e[0]):null}}t.RegisterNode=P;class S extends g{constructor(e,t){if(super(c.Field),this.parent=e,this.name=t.name,this.description=t.description,this.offset=t.offset,this.width=t.width,t.accessType?e.accessType===m.ReadOnly&&t.accessType!==m.ReadOnly?this.accessType=m.ReadOnly:e.accessType===m.WriteOnly&&t.accessType!==m.WriteOnly?this.accessType=m.WriteOnly:this.accessType=t.accessType:this.accessType=e.accessType,t.enumeration){this.enumeration=t.enumeration,this.enumerationMap={},this.enumerationValues=[];for(const e in t.enumeration){const r=t.enumeration[e].name;this.enumerationValues.push(r),this.enumerationMap[r]=e}}this.parent.addChild(this)}getTreeNode(){const e=this.parent.extractBits(this.offset,this.width);let t=null,r=this.name;const i=this.offset;let s="field";if(r+=`[${this.offset+this.width-1}:${i}]`,"reserved"===this.name.toLowerCase())s="field-res";else if(this.accessType===m.WriteOnly)r+=" - ";else{let i="";switch(this.getFormat()){case l.NumberFormat.Decimal:i=e.toString();break;case l.NumberFormat.Binary:i=(0,u.binaryFormat)(e,this.width);break;case l.NumberFormat.Hexidecimal:i=(0,u.hexFormat)(e,Math.ceil(this.width/4),!0);break;default:i=this.width>=4?(0,u.hexFormat)(e,Math.ceil(this.width/4),!0):(0,u.binaryFormat)(e,this.width)}this.enumeration&&this.enumeration[e]?(t=this.enumeration[e],r+=` = ${t.name} (${i})`):r+=` = ${i}`}return this.parent.accessType===m.ReadOnly&&(s="field-ro"),new f(r,d.TreeItemCollapsibleState.None,s,this)}performUpdate(){return new Promise((e,t)=>{this.enumeration?d.window.showQuickPick(this.enumerationValues).then(r=>{if(void 0===r)return t("Input not selected");const i=this.enumerationMap[r];this.parent.updateBits(this.offset,this.width,i).then(e,t)}):d.window.showInputBox({prompt:"Enter new value: (prefix hex with 0x, binary with 0b)"}).then(r=>{const i=b(r);if(void 0===i)return t("Unable to parse input value.");this.parent.updateBits(this.offset,this.width,i).then(e,t)})})}getCopyValue(){const e=this.parent.extractBits(this.offset,this.width);switch(this.getFormat()){case l.NumberFormat.Decimal:return e.toString();case l.NumberFormat.Binary:return(0,u.binaryFormat)(e,this.width);case l.NumberFormat.Hexidecimal:return(0,u.hexFormat)(e,Math.ceil(this.width/4),!0);default:return this.width>=4?(0,u.hexFormat)(e,Math.ceil(this.width/4),!0):(0,u.binaryFormat)(e,this.width)}}getFormat(){return this.format!==l.NumberFormat.Auto?this.format:this.parent.getFormat()}dumpSettings(e){return this.format!==l.NumberFormat.Auto?[{node:`${e}.${this.name}`,format:this.format}]:[]}_findByPath(e){return 0===e.length?this:null}}t.FieldNode=S,t.PeripheralTreeProvider=class{constructor(){this._onDidChangeTreeData=new d.EventEmitter,this.onDidChangeTreeData=this._onDidChangeTreeData.event,this.peripherials=[],this.loaded=!1,this.viewExpanded=!1}refresh(){this._onDidChangeTreeData.fire()}dumpSettings(){const e=[];return this.peripherials.forEach(t=>{e.push(...t.dumpSettings())}),e}_parseFields(e,t){const r=[];return e.map(e=>{let i,s;const n=e.description?e.description[0]:"";if(e.bitOffset&&e.bitWidth)i=b(e.bitOffset[0]),s=b(e.bitWidth[0]);else if(e.bitRange){let t=e.bitRange[0];t=t.substring(1,t.length-1),t=t.split(":");const r=b(t[0]),n=b(t[1]);s=r-n+1,i=n}else{if(!e.msb||!e.lsb)throw new Error(`Unable to parse SVD file: field ${e.name[0]} must have either bitOffset and bitWidth elements, bitRange Element, or msb and lsb elements.`);{const t=b(e.msb[0]),r=b(e.lsb[0]);s=t-r+1,i=r}}let o=null;e.enumeratedValues&&(o={},e.enumeratedValues[0].enumeratedValue.map(e=>{if(e.value&&e.value.length>0){const t=e.name[0],r=e.description?e.description[0]:t,i=b(e.value[0].toLowerCase());o[i]=new v(t,r,i)}}));const a={name:e.name[0],description:n,offset:i,width:s,enumeration:o};if(e.dim){if(!e.dimIncrement)throw new Error(`Unable to parse SVD file: field ${e.name[0]} has dim element, with no dimIncrement element.`);const s=b(e.dim[0]),n=b(e.dimIncrement[0]);let o=[];if(e.dimIndex)o=y(e.dimIndex[0],s);else for(let e=0;e{const i={};if(e.description&&(i.description=e.description[0]),e.access&&(i.accessType=p[e.access[0]]),e.size&&(i.size=b(e.size[0])),e.resetValue&&(i.resetValue=b(e.resetValue[0])),e.dim){if(!e.dimIncrement)throw new Error(`Unable to parse SVD file: register ${e.name[0]} has dim element, with no dimIncrement element.`);const s=b(e.dim[0]),n=b(e.dimIncrement[0]);let o=[];if(e.dimIndex)o=y(e.dimIndex[0],s);else for(let e=0;ee.offsett.offset?1:0),r}_parseClusters(e,t){const r=[];return e?(e.forEach(e=>{const i={};if(e.description&&(i.description=e.description[0]),e.access&&(i.accessType=p[e.access[0]]),e.size&&(i.size=b(e.size[0])),e.resetValue&&(i.resetValue=b(e.resetValue)),e.dim){if(!e.dimIncrement)throw new Error(`Unable to parse SVD file: cluster ${e.name[0]} has dim element, with no dimIncrement element.`);const s=b(e.dim[0]),n=b(e.dimIncrement[0]);let o=[];if(e.dimIndex)o=y(e.dimIndex[0],s);else for(let e=0;e{a.readFile(e,"utf8",(e,i)=>{if(e)return r(e);h.parseString(i,(e,i)=>{if(e)return r(e);try{const e={},r={accessType:m.ReadWrite,size:32,resetValue:0};i.device.resetValue&&(r.resetValue=b(i.device.resetValue[0])),i.device.size&&(r.size=b(i.device.size[0])),i.device.access&&(r.accessType=p[i.device.access[0]]),i.device.peripherals[0].peripheral.forEach(t=>{const r=t.name[0];e[r]=t});for(const t in e){const r=e[t];if(r.$&&r.$.derivedFrom){const i=e[r.$.derivedFrom];e[t]=Object.assign(Object.assign({},i),r)}}this.peripherials=[];for(const t in e)this.peripherials.push(this._parsePeripheral(e[t],r));return this.peripherials.sort((e,t)=>e.groupName>t.groupName?1:e.groupNamet.name?1:e.namee.name===t[0]);return r?r._findByPath(t.slice(1)):null}getTreeItem(e){return e}getChildren(e){return this.viewExpanded=!0,d.debug.activeDebugSession?this.peripherials.length>0?e?e.node.getChildren().map(e=>e.getTreeNode()):this.peripherials.map(e=>e.getTreeNode()):(this.loaded||this._update(),[new f(this.svdPath?"Loading...":"No Information",d.TreeItemCollapsibleState.None,"message",null)]):[]}_load(){return o(this,void 0,void 0,function*(){if(this.svdPath)return this.loaded=!0,this.peripherials=[],new Promise(e=>{setTimeout(()=>o(this,void 0,void 0,function*(){try{yield this._loadSVD(this.svdPath),this.initialSettings&&this.initialSettings.forEach(e=>{const t=this._findNodeByPath(e.node);t&&(t.expanded=e.expanded||!1,t.format=e.format)})}catch(e){this.peripherials=[],d.window.showErrorMessage(`Unable to parse SVD file: ${e.toString()}`)}e(!0)}),1e3)})})}_update(){return o(this,void 0,void 0,function*(){if(this.viewExpanded){this.loaded||(yield this._load());try{yield Promise.all(this.peripherials.map(e=>e.update()))}catch(e){}this.refresh()}})}onDidExpandElement(e){e.element.node.expanded=!0,e.element.node.update(),this.refresh()}onDidCollapseElement(e){e.element.node.expanded=!1}debugSessionStarted(e,t){this.peripherials=[],this.loaded=!1,this.svdPath=e,this.initialSettings=t}debugSessionTerminated(){this.peripherials=[],this.loaded=!1,this.refresh()}debugStopped(){return this._update()}debugContinued(){}}},376:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.RegisterTreeProvider=t.FieldNode=t.RegisterNode=t.BaseNode=t.TreeNode=t.RecordType=void 0;const o=n(r(100)),a=r(200),d=r(593);var h;!function(e){e[e.Register=0]="Register",e[e.Field=1]="Field"}(h=t.RecordType||(t.RecordType={}));class l extends o.TreeItem{constructor(e,t,r,i){super(e,t),this.label=e,this.collapsibleState=t,this.contextValue=r,this.node=i,this.command={command:"platformio-debug.registers.selectedNode",arguments:[i],title:"Selected Node"}}}t.TreeNode=l;class u{constructor(e){this.recordType=e,this.format=a.NumberFormat.Auto,this.expanded=!1}getChildren(){return[]}getTreeNode(){return null}getCopyValue(){return null}setFormat(e){this.format=e}}t.BaseNode=u;class c extends u{constructor(e,t){super(h.Register),this.name=e,this.index=t,"XPSR"===e.toUpperCase()||"CPSR"===e.toUpperCase()?this.fields=[new m("Negative Flag (N)",31,1,this),new m("Zero Flag (Z)",30,1,this),new m("Carry or borrow flag (C)",29,1,this),new m("Overflow Flag (V)",28,1,this),new m("Saturation Flag (Q)",27,1,this),new m("GE",16,4,this),new m("Interrupt Number",0,8,this),new m("ICI/IT",25,2,this),new m("ICI/IT",10,6,this),new m("Thumb State (T)",24,1,this)]:"CONTROL"===e.toUpperCase()&&(this.fields=[new m("FPCA",2,1,this),new m("SPSEL",1,1,this),new m("nPRIV",0,1,this)]),this.currentValue=0}extractBits(e,t){return(0,d.extractBits)(this.currentValue,e,t)}getTreeNode(){let e=`${this.name} = `;switch(this.getFormat()){case a.NumberFormat.Decimal:e+=this.currentValue.toString();break;case a.NumberFormat.Binary:e+=(0,d.binaryFormat)(this.currentValue,32,!1,!0);break;default:e+=(0,d.hexFormat)(this.currentValue,8)}return this.fields&&this.fields.length>0?new l(e,this.expanded?o.TreeItemCollapsibleState.Expanded:o.TreeItemCollapsibleState.Collapsed,"register",this):new l(e,o.TreeItemCollapsibleState.None,"register",this)}getChildren(){return this.fields}setValue(e){this.currentValue=e}getCopyValue(){switch(this.getFormat()){case a.NumberFormat.Decimal:return this.currentValue.toString();case a.NumberFormat.Binary:return(0,d.binaryFormat)(this.currentValue,32);default:return(0,d.hexFormat)(this.currentValue,8)}}getFormat(){return this.format}dumpSettings(){const e=[];return(this.expanded||this.format!==a.NumberFormat.Auto)&&e.push({node:this.name,format:this.format,expanded:this.expanded}),this.fields&&e.push(...this.fields.map(e=>e.dumpSettings()).filter(e=>null!==e)),e}}t.RegisterNode=c;class m extends u{constructor(e,t,r,i){super(h.Field),this.name=e,this.offset=t,this.size=r,this.register=i}getTreeNode(){const e=this.register.extractBits(this.offset,this.size);let t=`${this.name} = `;switch(this.getFormat()){case a.NumberFormat.Decimal:t+=e.toString();break;case a.NumberFormat.Binary:t+=(0,d.binaryFormat)(e,this.size,!1,!0);break;case a.NumberFormat.Hexidecimal:t+=(0,d.hexFormat)(e,Math.ceil(this.size/4),!0);break;default:t+=this.size>=4?(0,d.hexFormat)(e,Math.ceil(this.size/4),!0):(0,d.binaryFormat)(e,this.size,!1,!0)}return new l(t,o.TreeItemCollapsibleState.None,"field",this)}getCopyValue(){const e=this.register.extractBits(this.offset,this.size);switch(this.getFormat()){case a.NumberFormat.Decimal:return e.toString();case a.NumberFormat.Binary:return(0,d.binaryFormat)(e,this.size);case a.NumberFormat.Hexidecimal:return(0,d.hexFormat)(e,Math.ceil(this.size/4),!0);default:return this.size>=4?(0,d.hexFormat)(e,Math.ceil(this.size/4),!0):(0,d.binaryFormat)(e,this.size)}}getFormat(){return this.format===a.NumberFormat.Auto?this.register.getFormat():this.format}dumpSettings(){return this.format!==a.NumberFormat.Auto?{node:`${this.register.name}.${this.name}`,format:this.format}:null}}t.FieldNode=m,t.RegisterTreeProvider=class{constructor(){this._onDidChangeTreeData=new o.EventEmitter,this.onDidChangeTreeData=this._onDidChangeTreeData.event,this.loaded=!1,this.viewExpanded=!1,this.registers=[],this.registerMap={}}refresh(){this._onDidChangeTreeData.fire()}dumpSettings(){const e=[];return this.registers.forEach(t=>{e.push(...t.dumpSettings())}),e}fetchRegisterList(){o.debug.activeDebugSession&&(this.loaded?this._fetchRegisterValues():o.debug.activeDebugSession.customRequest("read-register-list").then(e=>{this.loaded=!0,this.createRegisters(e),this._fetchRegisterValues()}))}_fetchRegisterValues(){o.debug.activeDebugSession.customRequest("read-registers").then(e=>{e.forEach(e=>{const t=parseInt(e.number,10),r=parseInt(e.value,16),i=this.registerMap[t];i&&i.setValue(r)}),this.refresh()})}getTreeItem(e){return e}createRegisters(e){this.registerMap={},this.registers=[],e.forEach((e,t)=>{if(e){const r=new c(e,t);this.registers.push(r),this.registerMap[t]=r}}),this.initialSettings&&this.initialSettings.forEach(e=>{if(-1===e.node.indexOf(".")){const t=this.registers.find(t=>t.name===e.node);t&&(e.expanded&&(t.expanded=e.expanded),e.format&&t.setFormat(e.format))}else{const[t,r]=e.node.split("."),i=this.registers.find(e=>e.name===t);if(i){const t=i.getChildren().find(e=>e.name===r);t&&e.format&&t.setFormat(e.format)}}}),this.refresh()}updateRegisterValues(e){e.forEach(e=>{this.registerMap[e.number].setValue(e.value)}),this.refresh()}getChildren(e){return this.viewExpanded=!0,o.debug.activeDebugSession?this.registers.length>0?e?e.node.getChildren().map(e=>e.getTreeNode()):this.registers.map(e=>e.getTreeNode()):(this.loaded||setTimeout(()=>this.fetchRegisterList(),1e3),[new l("Loading...",o.TreeItemCollapsibleState.None,"message",null)]):[]}debugSessionTerminated(){this.loaded=!1,this.registers=[],this.registerMap={},this.refresh()}debugSessionStarted(e){this.loaded=!1,this.registers=[],this.registerMap={},this.initialSettings=e}debugStopped(){this.viewExpanded&&this.fetchRegisterList()}debugContinued(){}}},593:(e,t)=>{function r(e,t){let r=0;const i=e+t-1;for(let t=e;t<=i;t++)r=(r|1<>>0;return r}Object.defineProperty(t,"__esModule",{value:!0}),t.encodeDisassembly=t.parseQuery=t.extractBits=t.createMask=t.binaryFormat=t.hexFormat=void 0,t.hexFormat=function(e,t=8,r=!0){let i=e.toString(16);for(;i.length>>0).toString(2);for(;s.length>>t>>>0},t.parseQuery=function(e){const t={},r=("?"===e[0]?e.substr(1):e).split("&");for(const e of r){const r=e.split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1]||"")}return t},t.encodeDisassembly=function(e,t){let r="disassembly:///";return t&&(r+=`${t}:`),r+=`${e}.dbgasm?func=${e}&file=${t||""}`,r}},147:e=>{e.exports=require("fs")},316:t=>{t.exports=e},100:e=>{e.exports=t},797:e=>{e.exports=r},167:e=>{e.exports=i}},n={};return function e(t){var r=n[t];if(void 0!==r)return r.exports;var i=n[t]={exports:{}};return s[t].call(i.exports,i,i.exports,e),i.exports}(112)})()}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@vscode/debugadapter"),require("vscode"),require("xml2js")):"function"==typeof define&&define.amd?define(["@vscode/debugadapter","vscode","xml2js"],t):"object"==typeof exports?exports["platformio-vscode-debug"]=t(require("@vscode/debugadapter"),require("vscode"),require("xml2js")):e["platformio-vscode-debug"]=t(e["@vscode/debugadapter"],e.vscode,e.xml2js)}(global,(e,t,r)=>(()=>{"use strict";var i={799(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolScope=t.SymbolType=t.TelemetryEvent=t.StoppedEvent=t.AdapterOutputEvent=t.NumberFormat=void 0;const i=r(161);var s,n,o;!function(e){e[e.Auto=0]="Auto",e[e.Hexidecimal=1]="Hexidecimal",e[e.Decimal=2]="Decimal",e[e.Binary=3]="Binary"}(s||(t.NumberFormat=s={}));class a extends i.Event{constructor(e,t){super("adapter-output",{content:e,type:t})}}t.AdapterOutputEvent=a;class d extends i.Event{constructor(e,t,r){super("stopped",{reason:e,threadId:t,allThreadsStopped:r})}}t.StoppedEvent=d;class h extends i.Event{constructor(e,t,r,i={}){super("record-event",{category:e,action:t,label:r,parameters:i})}}t.TelemetryEvent=h,function(e){e[e.Function=0]="Function",e[e.File=1]="File",e[e.Object=2]="Object",e[e.Normal=3]="Normal"}(n||(t.SymbolType=n={})),function(e){e[e.Local=0]="Local",e[e.Global=1]="Global",e[e.Neither=2]="Neither",e[e.Both=3]="Both"}(o||(t.SymbolScope=o={}))},265(e,t,r){var i,s=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o{e&&e.textEditor.document.fileName.endsWith(".dbgmem")&&this.memoryContentProvider.handleSelection(e)}))}isPIODebugSession(){return d.debug.activeDebugSession&&"platformio-debug"===d.debug.activeDebugSession.type}activeEditorChanged(e){if(!e||!this.isPIODebugSession())return;const t=e.document.uri;"file"===t.scheme?d.debug.activeDebugSession.customRequest("set-active-editor",{path:t.path}):"disassembly"===t.scheme&&d.debug.activeDebugSession.customRequest("set-active-editor",{path:`${t.scheme}://${t.authority}${t.path}`})}showDisassembly(){return a(this,void 0,void 0,function*(){if(this.isPIODebugSession()){if(!this.functionSymbols)try{const e=yield d.debug.activeDebugSession.customRequest("load-function-symbols");this.functionSymbols=e.functionSymbols}catch(e){d.window.showErrorMessage("Unable to load symbol table. Disassembly view unavailable.")}try{const e=yield d.window.showInputBox({placeHolder:"main",ignoreFocusOut:!0,prompt:"Function Name to Disassemble"}),t=this.functionSymbols.filter(t=>t.name===e);let r;if(1===t.length)r=(0,l.encodeDisassembly)(t[0].name,t[0].file);else{if(!(t.length>1))return void d.window.showErrorMessage(`No function with name ${e} found.`);{const e=yield d.window.showQuickPick(t.map(e=>({label:e.name,name:e.name,file:e.file,scope:e.scope,description:e.scope===h.SymbolScope.Global?"Global Scope":`Static in ${e.file}`})),{ignoreFocusOut:!0});r=(0,l.encodeDisassembly)(e.name,e.file)}}r&&d.window.showTextDocument(d.Uri.parse(r))}catch(e){d.window.showErrorMessage("Unable to show disassembly.")}}else d.window.showErrorMessage("No debugging session available")})}setForceDisassembly(e){const t=e=>{const t="Forced"===e;return this.disassemblyTreeProvider.updateForcedState(t),d.debug.activeDebugSession.customRequest("set-force-disassembly",{force:t})};if(e)return t(e);d.window.showQuickPick([{label:"Auto",description:"Show disassembly for functions when source cannot be located."},{label:"Forced",description:"Always show disassembly for functions."}],{matchOnDescription:!0,ignoreFocusOut:!0}).then(e=>{t(e.label)},e=>{})}memoryDeleteHistoryItem(e){const[t,r]=e.label.split("+");this.memoryTreeProvider.deleteHistory(t,r)}memoryClearHistory(){this.memoryTreeProvider.clearHistory()}examineMemory(e,t){function r(e){return/^0x[0-9a-f]{1,8}$/i.test(e)||/^[0-9]+$/i.test(e)?e:null}if(this.isPIODebugSession())return e&&t?this.showMemoryContent(e,t):void d.window.showInputBox({placeHolder:"Prefix with 0x for hexidecimal format",ignoreFocusOut:!0,prompt:"A start memory address"}).then(e=>{r(e)?d.window.showInputBox({placeHolder:"Prefix with 0x for hexidecimal format",ignoreFocusOut:!0,prompt:"How many bytes to read?"}).then(t=>{r(t)?(this.memoryTreeProvider.pushHistory(e,t),this.showMemoryContent(e,t)):d.window.showErrorMessage("Invalid length entered")},e=>{}):d.window.showErrorMessage("Invalid memory address entered")},e=>{});d.window.showErrorMessage("No debugging session available")}showMemoryContent(e,t){d.workspace.openTextDocument(d.Uri.parse(`examinememory:///Memory%20[${e}+${t}].dbgmem?address=${e}&length=${t}×tamp=${(new Date).getTime()}`)).then(e=>{d.window.showTextDocument(e,{viewColumn:2,preview:!1})},e=>{d.window.showErrorMessage(`Failed to examine memory: ${e}`)})}peripheralsUpdateNode(e){e.node.performUpdate().then(e=>{e&&this.peripheralProvider.refresh()},e=>{d.window.showErrorMessage(`Unable to update value: ${e.toString()}`)})}peripheralsSelectedNode(e){e.recordType!==g.RecordType.Field&&(e.expanded=!e.expanded),e.selected().then(e=>{e&&this.peripheralProvider.refresh()},e=>{})}peripheralsCopyValue(e){const t=e.node.getCopyValue();t&&d.env.clipboard.writeText(t)}peripheralsSetFormat(e){return a(this,void 0,void 0,function*(){const t=yield d.window.showQuickPick([{label:"Auto",description:"Automatically choose format (Inherits from parent)",value:h.NumberFormat.Auto},{label:"Hex",description:"Format value in hexidecimal",value:h.NumberFormat.Hexidecimal},{label:"Decimal",description:"Format value in decimal",value:h.NumberFormat.Decimal},{label:"Binary",description:"Format value in binary",value:h.NumberFormat.Binary}]);e.node.setFormat(t.value),this.peripheralProvider.refresh()})}registersSelectedNode(e){e.recordType!==b.RecordType.Field&&(e.expanded=!e.expanded)}registersCopyValue(e){const t=e.node.getCopyValue();t&&d.env.clipboard.writeText(t)}registersSetFormat(e){return a(this,void 0,void 0,function*(){const t=yield d.window.showQuickPick([{label:"Auto",description:"Automatically choose format (Inherits from parent)",value:h.NumberFormat.Auto},{label:"Hex",description:"Format value in hexidecimal",value:h.NumberFormat.Hexidecimal},{label:"Decimal",description:"Format value in decimal",value:h.NumberFormat.Decimal},{label:"Binary",description:"Format value in binary",value:h.NumberFormat.Binary}]);e.node.setFormat(t.value),this.registerProvider.refresh()})}debugSessionStarted(e){"platformio-debug"===e.type&&(this.functionSymbols=null,e.customRequest("get-arguments").then(e=>{this.registerProvider.debugSessionStarted(this.context.workspaceState.get("debugRegistersTreeState")),this.peripheralProvider.debugSessionStarted(e.svdPath,this.context.workspaceState.get("debugPeripheralsTreeState")),this.memoryTreeProvider.debugSessionStarted(this.context.workspaceState.get("debugMemoryTreeState")),this.disassemblyTreeProvider.debugSessionStarted()},e=>{console.error(e)}))}debugSessionTerminated(e){"platformio-debug"===e.type&&(this.context.workspaceState.update("debugRegistersTreeState",this.registerProvider.dumpSettings()),this.context.workspaceState.update("debugPeripheralsTreeState",this.peripheralProvider.dumpSettings()),this.context.workspaceState.update("debugMemoryTreeState",this.memoryTreeProvider.dumpSettings()),this.registerProvider.debugSessionTerminated(),this.peripheralProvider.debugSessionTerminated(),this.memoryTreeProvider.debugSessionTerminated(),this.disassemblyTreeProvider.debugSessionTerminated())}receivedCustomEvent(e){if(this.isPIODebugSession())switch(e.event){case"custom-stop":this.receivedStopEvent(e);break;case"custom-continued":this.receivedContinuedEvent(e);break;case"adapter-output":this.receivedAdapterOutput(e);break;case"record-event":this.receivedEvent(e)}}receivedStopEvent(e){this.peripheralProvider.debugStopped(),this.registerProvider.debugStopped(),d.workspace.textDocuments.filter(e=>e.fileName.endsWith(".dbgmem")).forEach(e=>{this.memoryContentProvider.update(e)})}receivedContinuedEvent(e){this.peripheralProvider.debugContinued(),this.registerProvider.debugContinued()}receivedEvent(e){}receivedAdapterOutput(e){this.adapterOutputChannel||(this.adapterOutputChannel=d.window.createOutputChannel("Adapter Output"));let t=e.body.content;t.endsWith("\n")||(t+="\n"),this.adapterOutputChannel.append(t)}}},22(e,t,r){var i,s=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o{const i=(0,d.parseQuery)(e.query);a.debug.activeDebugSession.customRequest("disassemble",{function:i.func,file:i.file}).then(e=>{const r=e.instructions;let i="";r.forEach(e=>{i+=`${e.address}: ${this.padEnd(15,e.opcodes)} \t${e.instruction}\n`}),t(i)},e=>{a.window.showErrorMessage(e.message),r(e.message)})})}padEnd(e,t){for(let r=t.length;r{const i=(0,d.parseQuery)(e.query),s=i.address.startsWith("0x")?parseInt(i.address.substring(2),16):parseInt(i.address,10),n=i.length.startsWith("0x")?parseInt(i.length.substring(2),16):parseInt(i.length,10);a.debug.activeDebugSession.customRequest("read-memory",{address:s,length:n||32}).then(e=>{const r=e.bytes;let i=s-s%16;const o=s-i;let a="";a+=" Offset: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F \t\n",a+=(0,d.hexFormat)(i,8,!1)+": ";let h="";for(let e=0;e=127&&t<=159?".":String.fromCharCode(r[e]),(s+e)%16==15&&e{a.window.showErrorMessage(`Unable to read memory from ${(0,d.hexFormat)(s,8)} to ${(0,d.hexFormat)(s+n,8)}`),r(e.toString())})})}update(e){this._onDidChange.fire(e.uri)}getOffset(e){if(e.line<1||e.character=this.firstBytePos&&e.character<=this.lastBytePos?t+=Math.floor(r/3):e.character>=this.firstAsciiPos&&(t+=e.character-this.firstAsciiPos),t}getPosition(e,t=!1){const r=1+Math.floor(e/16);let i=e%16;return t?i+=this.firstAsciiPos:i=this.firstBytePos+3*i,new a.Position(r,i)}getRanges(e,t,r){const i=this.getPosition(e,r);let s=this.getPosition(t,r);s=new a.Position(s.line,s.character+(r?1:2));const n=[],o=r?this.firstAsciiPos:this.firstBytePos,d=r?this.lastAsciiPos:this.lastBytePos;for(let e=i.line;e<=s.line;++e){const t=new a.Position(e,e===i.line?i.character:o),r=new a.Position(e,e===s.line?s.character:d);n.push(new a.Range(t,r))}return n}handleSelection(e){const t=e.textEditor.document.lineCount;if(e.selections[0].start.line+1===t||e.selections[0].end.line+1===t)return void e.textEditor.setDecorations(this.smallDecorationType,[]);const r=this.getOffset(e.selections[0].start),i=this.getOffset(e.selections[0].end);if(void 0===r||void 0===i)return void e.textEditor.setDecorations(this.smallDecorationType,[]);let s=this.getRanges(r,i,!1);s=s.concat(this.getRanges(r,i,!0)),e.textEditor.setDecorations(this.smallDecorationType,s)}}},485(e,t,r){var i,s=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o{const t=new a.TreeItem(e);return t.command={title:`Examine memory at ${e}`,command:"platformio-debug.examineMemory",arguments:e.split("+")},t})}getTreeItem(e){return e}pushHistory(e,t){const r=`${e}+${t}`;this.history.includes(r)||(this.history.push(r),this.refresh())}deleteHistory(e,t){const r=`${e}+${t}`;this.history.includes(r)&&(this.history=this.history.filter(e=>e!==r),this.refresh())}clearHistory(){this.history=[],this.refresh()}debugSessionStarted(e){this.history=e||[],this.refresh()}debugSessionTerminated(){this.history=[],this.refresh()}}},413(e,t,r){var i,s=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;oe.trim());if(r.length!==t)throw new Error("dimIndex Element has invalid specification.");return r}if(/^([0-9]+)\-([0-9]+)$/i.test(e)){const r=e.split("-").map(e=>y(e)),i=r[0];if(r[1]-i+1e.offset>t.offset?1:-1)}addChild(e){this.children.push(e),this.children.sort((e,t)=>e.offset>t.offset?1:-1)}getBytes(e,t){try{return new Uint8Array(this.currentValue.slice(e,e+t))}catch(e){return new Uint8Array(0)}}getAddress(e){return this.baseAddress+e}getFormat(){return this.format}update(){return new Promise((e,t)=>{this.expanded?h.debug.activeDebugSession.customRequest("read-memory",{address:this.baseAddress,length:this.totalLength>32768?32768:this.totalLength}).then(t=>{this.currentValue=t.bytes,this.children.forEach(e=>e.update()),e(!0)},e=>{t(e)}):e(!1)})}selected(){return this.update()}dumpSettings(){const e=[];return(this.format!==u.NumberFormat.Auto||this.expanded)&&e.push({node:`${this.name}`,expanded:this.expanded,format:this.format}),this.children.forEach(t=>{e.push(...t.dumpSettings(`${this.name}`))}),e}_findByPath(e){if(0===e.length)return this;const t=this.children.find(t=>t.name===e[0]);return t?t._findByPath(e.slice(1)):null}}t.PeripheralNode=x;class P extends b{constructor(e,t){super(m.Cluster),this.parent=e,this.children=[],this.name=t.name,this.description=t.description,this.offset=t.addressOffset,this.accessType=t.accessType||p.ReadWrite,this.size=t.size||e.size,this.resetValue=t.resetValue||e.resetValue,this.parent.addChild(this)}getTreeNode(){const e=`${this.name} [${(0,c.hexFormat)(this.offset,0)}]`;return new g(e,this.expanded?h.TreeItemCollapsibleState.Expanded:h.TreeItemCollapsibleState.Collapsed,"cluster",this)}getChildren(){return this.children}setChildren(e){this.children=e.slice(0,e.length),this.children.sort((e,t)=>e.offset>t.offset?1:-1)}addChild(e){this.children.push(e),this.children.sort((e,t)=>e.offset>t.offset?1:-1)}getBytes(e,t){return this.parent.getBytes(this.offset+e,t)}getAddress(e){return this.parent.getAddress(this.offset+e)}getFormat(){return this.format!==u.NumberFormat.Auto?this.format:this.parent.getFormat()}update(){return Promise.resolve(!0)}dumpSettings(e){const t=[];return(this.format!==u.NumberFormat.Auto||this.expanded)&&t.push({node:`${e}.${this.name}`,expanded:this.expanded,format:this.format}),this.children.forEach(r=>{t.push(...r.dumpSettings(`${e}.${this.name}`))}),t}_findByPath(e){if(0===e.length)return this;const t=this.children.find(t=>t.name===e[0]);return t?t._findByPath(e.slice(1)):null}}t.ClusterNode=P;class S extends b{constructor(e,t){super(m.Register),this.parent=e,this.children=[],this.name=t.name,this.description=t.description,this.offset=t.addressOffset,this.accessType=t.accessType||e.accessType,this.size=t.size||e.size,this.resetValue=void 0!==t.resetValue?t.resetValue:e.resetValue,this.currentValue=this.resetValue,this.hexLength=Math.ceil(this.size/4),this.maxValue=Math.pow(2,this.size),this.binaryRegex=new RegExp(`^0b[01]{1,${this.size}}$`,"i"),this.hexRegex=new RegExp(`^0x[0-9a-f]{1,${this.hexLength}}$`,"i"),this.parent,this.parent.addChild(this)}reset(){this.currentValue=this.resetValue}extractBits(e,t){return(0,c.extractBits)(this.currentValue,e,t)}updateBits(e,t,r){return new Promise((i,s)=>{const n=Math.pow(2,t);if(r>n)return s(`Value entered is invalid. Maximum value for this field is ${n-1} (${(0,c.hexFormat)(n-1,0)})`);const o=(0,c.createMask)(e,t),a=r<";else switch(this.getFormat()){case u.NumberFormat.Decimal:t+=` = ${this.currentValue.toString()}`;break;case u.NumberFormat.Binary:t+=` = ${(0,c.binaryFormat)(this.currentValue,4*this.hexLength,!1,!0)}`;break;default:t+=` = ${(0,c.hexFormat)(this.currentValue,this.hexLength)}`}const r=this.children&&this.children.length>0?this.expanded?h.TreeItemCollapsibleState.Expanded:h.TreeItemCollapsibleState.Collapsed:h.TreeItemCollapsibleState.None;return new g(t,r,e,this)}getChildren(){return this.children||[]}setChildren(e){this.children=e.slice(0,e.length),this.children.sort((e,t)=>e.offset>t.offset?1:-1)}addChild(e){this.children.push(e),this.children.sort((e,t)=>e.offset>t.offset?1:-1)}getFormat(){return this.format!==u.NumberFormat.Auto?this.format:this.parent.getFormat()}getCopyValue(){switch(this.getFormat()){case u.NumberFormat.Decimal:return this.currentValue.toString();case u.NumberFormat.Binary:return(0,c.binaryFormat)(this.currentValue,4*this.hexLength);default:return(0,c.hexFormat)(this.currentValue,this.hexLength)}}performUpdate(){return new Promise((e,t)=>{h.window.showInputBox({prompt:"Enter new value: (prefix hex with 0x, binary with 0b)"}).then(r=>{let i;if(r.match(this.hexRegex))i=parseInt(r.substr(2),16);else if(r.match(this.binaryRegex))i=parseInt(r.substr(2),2);else{if(!r.match(/^[0-9]+/))return t("Value entered is not a valid format.");if(i=parseInt(r,10),i>=this.maxValue)return t(`Value entered (${i}) is greater than the maximum value of ${this.maxValue}`)}this.updateValueInternal(i).then(e,t)})})}updateValueInternal(e){const t=this.parent.getAddress(this.offset),r=[],i=this.size/8;for(let t=0;t>>=8;let s=i.toString(16);1===s.length&&(s="0"+s),r[t]=s}return new Promise((e,i)=>{h.debug.activeDebugSession.customRequest("write-memory",{address:t,data:r.join("")}).then(t=>{this.parent.update().then(()=>{},()=>{}),e(!0)},i)})}update(){const e=this.size/8,t=this.parent.getBytes(this.offset,e),r=Buffer.from(t);switch(e){case 1:this.currentValue=r.readUInt8(0);break;case 2:this.currentValue=r.readUInt16LE(0);break;case 4:this.currentValue=r.readUInt32LE(0);break;default:h.window.showErrorMessage(`Register ${this.name} has invalid size: ${this.size}. Should be 8, 16 or 32.`)}return this.children.forEach(e=>e.update()),Promise.resolve(!0)}dumpSettings(e){const t=[];return(this.format!==u.NumberFormat.Auto||this.expanded)&&t.push({node:`${e}.${this.name}`,expanded:this.expanded,format:this.format}),this.children.forEach(r=>{t.push(...r.dumpSettings(`${e}.${this.name}`))}),t}_findByPath(e){return 0===e.length?this:1===e.length?this.children.find(t=>t.name===e[0]):null}}t.RegisterNode=S;class O extends b{constructor(e,t){if(super(m.Field),this.parent=e,this.name=t.name,this.description=t.description,this.offset=t.offset,this.width=t.width,t.accessType?e.accessType===p.ReadOnly&&t.accessType!==p.ReadOnly?this.accessType=p.ReadOnly:e.accessType===p.WriteOnly&&t.accessType!==p.WriteOnly?this.accessType=p.WriteOnly:this.accessType=t.accessType:this.accessType=e.accessType,t.enumeration){this.enumeration=t.enumeration,this.enumerationMap={},this.enumerationValues=[];for(const e in t.enumeration){const r=t.enumeration[e].name;this.enumerationValues.push(r),this.enumerationMap[r]=e}}this.parent.addChild(this)}getTreeNode(){const e=this.parent.extractBits(this.offset,this.width);let t=null,r=this.name;const i=this.offset;let s="field";if(r+=`[${this.offset+this.width-1}:${i}]`,"reserved"===this.name.toLowerCase())s="field-res";else if(this.accessType===p.WriteOnly)r+=" - ";else{let i="";switch(this.getFormat()){case u.NumberFormat.Decimal:i=e.toString();break;case u.NumberFormat.Binary:i=(0,c.binaryFormat)(e,this.width);break;case u.NumberFormat.Hexidecimal:i=(0,c.hexFormat)(e,Math.ceil(this.width/4),!0);break;default:i=this.width>=4?(0,c.hexFormat)(e,Math.ceil(this.width/4),!0):(0,c.binaryFormat)(e,this.width)}this.enumeration&&this.enumeration[e]?(t=this.enumeration[e],r+=` = ${t.name} (${i})`):r+=` = ${i}`}return this.parent.accessType===p.ReadOnly&&(s="field-ro"),new g(r,h.TreeItemCollapsibleState.None,s,this)}performUpdate(){return new Promise((e,t)=>{this.enumeration?h.window.showQuickPick(this.enumerationValues).then(r=>{if(void 0===r)return t("Input not selected");const i=this.enumerationMap[r];this.parent.updateBits(this.offset,this.width,i).then(e,t)}):h.window.showInputBox({prompt:"Enter new value: (prefix hex with 0x, binary with 0b)"}).then(r=>{const i=y(r);if(void 0===i)return t("Unable to parse input value.");this.parent.updateBits(this.offset,this.width,i).then(e,t)})})}getCopyValue(){const e=this.parent.extractBits(this.offset,this.width);switch(this.getFormat()){case u.NumberFormat.Decimal:return e.toString();case u.NumberFormat.Binary:return(0,c.binaryFormat)(e,this.width);case u.NumberFormat.Hexidecimal:return(0,c.hexFormat)(e,Math.ceil(this.width/4),!0);default:return this.width>=4?(0,c.hexFormat)(e,Math.ceil(this.width/4),!0):(0,c.binaryFormat)(e,this.width)}}getFormat(){return this.format!==u.NumberFormat.Auto?this.format:this.parent.getFormat()}dumpSettings(e){return this.format!==u.NumberFormat.Auto?[{node:`${e}.${this.name}`,format:this.format}]:[]}_findByPath(e){return 0===e.length?this:null}}t.FieldNode=O,t.PeripheralTreeProvider=class{constructor(){this._onDidChangeTreeData=new h.EventEmitter,this.onDidChangeTreeData=this._onDidChangeTreeData.event,this.peripherials=[],this.loaded=!1,this.viewExpanded=!1}refresh(){this._onDidChangeTreeData.fire()}dumpSettings(){const e=[];return this.peripherials.forEach(t=>{e.push(...t.dumpSettings())}),e}_parseFields(e,t){const r=[];return e.map(e=>{let i,s;const n=e.description?e.description[0]:"";if(e.bitOffset&&e.bitWidth)i=y(e.bitOffset[0]),s=y(e.bitWidth[0]);else if(e.bitRange){let t=e.bitRange[0];t=t.substring(1,t.length-1),t=t.split(":");const r=y(t[0]),n=y(t[1]);s=r-n+1,i=n}else{if(!e.msb||!e.lsb)throw new Error(`Unable to parse SVD file: field ${e.name[0]} must have either bitOffset and bitWidth elements, bitRange Element, or msb and lsb elements.`);{const t=y(e.msb[0]),r=y(e.lsb[0]);s=t-r+1,i=r}}let o=null;e.enumeratedValues&&(o={},e.enumeratedValues[0].enumeratedValue.map(e=>{if(e.value&&e.value.length>0){const t=e.name[0],r=e.description?e.description[0]:t,i=y(e.value[0].toLowerCase());o[i]=new w(t,r,i)}}));const a={name:e.name[0],description:n,offset:i,width:s,enumeration:o};if(e.dim){if(!e.dimIncrement)throw new Error(`Unable to parse SVD file: field ${e.name[0]} has dim element, with no dimIncrement element.`);const s=y(e.dim[0]),n=y(e.dimIncrement[0]);let o=[];if(e.dimIndex)o=v(e.dimIndex[0],s);else for(let e=0;e{const i={};if(e.description&&(i.description=e.description[0]),e.access&&(i.accessType=f[e.access[0]]),e.size&&(i.size=y(e.size[0])),e.resetValue&&(i.resetValue=y(e.resetValue[0])),e.dim){if(!e.dimIncrement)throw new Error(`Unable to parse SVD file: register ${e.name[0]} has dim element, with no dimIncrement element.`);const s=y(e.dim[0]),n=y(e.dimIncrement[0]);let o=[];if(e.dimIndex)o=v(e.dimIndex[0],s);else for(let e=0;ee.offsett.offset?1:0),r}_parseClusters(e,t){const r=[];return e?(e.forEach(e=>{const i={};if(e.description&&(i.description=e.description[0]),e.access&&(i.accessType=f[e.access[0]]),e.size&&(i.size=y(e.size[0])),e.resetValue&&(i.resetValue=y(e.resetValue)),e.dim){if(!e.dimIncrement)throw new Error(`Unable to parse SVD file: cluster ${e.name[0]} has dim element, with no dimIncrement element.`);const s=y(e.dim[0]),n=y(e.dimIncrement[0]);let o=[];if(e.dimIndex)o=v(e.dimIndex[0],s);else for(let e=0;e{d.readFile(e,"utf8",(e,i)=>{if(e)return r(e);l.parseString(i,(e,i)=>{if(e)return r(e);try{const e={},r={accessType:p.ReadWrite,size:32,resetValue:0};i.device.resetValue&&(r.resetValue=y(i.device.resetValue[0])),i.device.size&&(r.size=y(i.device.size[0])),i.device.access&&(r.accessType=f[i.device.access[0]]),i.device.peripherals[0].peripheral.forEach(t=>{const r=t.name[0];e[r]=t});for(const t in e){const r=e[t];if(r.$&&r.$.derivedFrom){const i=e[r.$.derivedFrom];e[t]=Object.assign(Object.assign({},i),r)}}this.peripherials=[];for(const t in e)this.peripherials.push(this._parsePeripheral(e[t],r));return this.peripherials.sort((e,t)=>e.groupName>t.groupName?1:e.groupNamet.name?1:e.namee.name===t[0]);return r?r._findByPath(t.slice(1)):null}getTreeItem(e){return e}getChildren(e){return this.viewExpanded=!0,h.debug.activeDebugSession?this.peripherials.length>0?e?e.node.getChildren().map(e=>e.getTreeNode()):this.peripherials.map(e=>e.getTreeNode()):(this.loaded||this._update(),[new g(this.svdPath?"Loading...":"No Information",h.TreeItemCollapsibleState.None,"message",null)]):[]}_load(){return a(this,void 0,void 0,function*(){if(this.svdPath)return this.loaded=!0,this.peripherials=[],new Promise(e=>{setTimeout(()=>a(this,void 0,void 0,function*(){try{yield this._loadSVD(this.svdPath),this.initialSettings&&this.initialSettings.forEach(e=>{const t=this._findNodeByPath(e.node);t&&(t.expanded=e.expanded||!1,t.format=e.format)})}catch(e){this.peripherials=[],h.window.showErrorMessage(`Unable to parse SVD file: ${e.toString()}`)}e(!0)}),1e3)})})}_update(){return a(this,void 0,void 0,function*(){if(this.viewExpanded){this.loaded||(yield this._load());try{yield Promise.all(this.peripherials.map(e=>e.update()))}catch(e){}this.refresh()}})}onDidExpandElement(e){e.element.node.expanded=!0,e.element.node.update(),this.refresh()}onDidCollapseElement(e){e.element.node.expanded=!1}debugSessionStarted(e,t){this.peripherials=[],this.loaded=!1,this.svdPath=e,this.initialSettings=t}debugSessionTerminated(){this.peripherials=[],this.loaded=!1,this.refresh()}debugStopped(){return this._update()}debugContinued(){}}},307(e,t,r){var i,s=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=i(e),o=0;o0?new u(e,this.expanded?a.TreeItemCollapsibleState.Expanded:a.TreeItemCollapsibleState.Collapsed,"register",this):new u(e,a.TreeItemCollapsibleState.None,"register",this)}getChildren(){return this.fields}setValue(e){this.currentValue=e}getCopyValue(){switch(this.getFormat()){case d.NumberFormat.Decimal:return this.currentValue.toString();case d.NumberFormat.Binary:return(0,h.binaryFormat)(this.currentValue,32);default:return(0,h.hexFormat)(this.currentValue,8)}}getFormat(){return this.format}dumpSettings(){const e=[];return(this.expanded||this.format!==d.NumberFormat.Auto)&&e.push({node:this.name,format:this.format,expanded:this.expanded}),this.fields&&e.push(...this.fields.map(e=>e.dumpSettings()).filter(e=>null!==e)),e}}t.RegisterNode=m;class p extends c{constructor(e,t,r,i){super(l.Field),this.name=e,this.offset=t,this.size=r,this.register=i}getTreeNode(){const e=this.register.extractBits(this.offset,this.size);let t=`${this.name} = `;switch(this.getFormat()){case d.NumberFormat.Decimal:t+=e.toString();break;case d.NumberFormat.Binary:t+=(0,h.binaryFormat)(e,this.size,!1,!0);break;case d.NumberFormat.Hexidecimal:t+=(0,h.hexFormat)(e,Math.ceil(this.size/4),!0);break;default:t+=this.size>=4?(0,h.hexFormat)(e,Math.ceil(this.size/4),!0):(0,h.binaryFormat)(e,this.size,!1,!0)}return new u(t,a.TreeItemCollapsibleState.None,"field",this)}getCopyValue(){const e=this.register.extractBits(this.offset,this.size);switch(this.getFormat()){case d.NumberFormat.Decimal:return e.toString();case d.NumberFormat.Binary:return(0,h.binaryFormat)(e,this.size);case d.NumberFormat.Hexidecimal:return(0,h.hexFormat)(e,Math.ceil(this.size/4),!0);default:return this.size>=4?(0,h.hexFormat)(e,Math.ceil(this.size/4),!0):(0,h.binaryFormat)(e,this.size)}}getFormat(){return this.format===d.NumberFormat.Auto?this.register.getFormat():this.format}dumpSettings(){return this.format!==d.NumberFormat.Auto?{node:`${this.register.name}.${this.name}`,format:this.format}:null}}t.FieldNode=p,t.RegisterTreeProvider=class{constructor(){this._onDidChangeTreeData=new a.EventEmitter,this.onDidChangeTreeData=this._onDidChangeTreeData.event,this.loaded=!1,this.viewExpanded=!1,this.registers=[],this.registerMap={}}refresh(){this._onDidChangeTreeData.fire()}dumpSettings(){const e=[];return this.registers.forEach(t=>{e.push(...t.dumpSettings())}),e}fetchRegisterList(){a.debug.activeDebugSession&&(this.loaded?this._fetchRegisterValues():a.debug.activeDebugSession.customRequest("read-register-list").then(e=>{this.loaded=!0,this.createRegisters(e),this._fetchRegisterValues()}))}_fetchRegisterValues(){a.debug.activeDebugSession.customRequest("read-registers").then(e=>{e.forEach(e=>{const t=parseInt(e.number,10),r=parseInt(e.value,16),i=this.registerMap[t];i&&i.setValue(r)}),this.refresh()})}getTreeItem(e){return e}createRegisters(e){this.registerMap={},this.registers=[],e.forEach((e,t)=>{if(e){const r=new m(e,t);this.registers.push(r),this.registerMap[t]=r}}),this.initialSettings&&this.initialSettings.forEach(e=>{if(-1===e.node.indexOf(".")){const t=this.registers.find(t=>t.name===e.node);t&&(e.expanded&&(t.expanded=e.expanded),e.format&&t.setFormat(e.format))}else{const[t,r]=e.node.split("."),i=this.registers.find(e=>e.name===t);if(i){const t=i.getChildren().find(e=>e.name===r);t&&e.format&&t.setFormat(e.format)}}}),this.refresh()}updateRegisterValues(e){e.forEach(e=>{this.registerMap[e.number].setValue(e.value)}),this.refresh()}getChildren(e){return this.viewExpanded=!0,a.debug.activeDebugSession?this.registers.length>0?e?e.node.getChildren().map(e=>e.getTreeNode()):this.registers.map(e=>e.getTreeNode()):(this.loaded||setTimeout(()=>this.fetchRegisterList(),1e3),[new u("Loading...",a.TreeItemCollapsibleState.None,"message",null)]):[]}debugSessionTerminated(){this.loaded=!1,this.registers=[],this.registerMap={},this.refresh()}debugSessionStarted(e){this.loaded=!1,this.registers=[],this.registerMap={},this.initialSettings=e}debugStopped(){this.viewExpanded&&this.fetchRegisterList()}debugContinued(){}}},185(e,t){function r(e,t){let r=0;const i=e+t-1;for(let t=e;t<=i;t++)r=(r|1<>>0;return r}Object.defineProperty(t,"__esModule",{value:!0}),t.hexFormat=function(e,t=8,r=!0){let i=e.toString(16);for(;i.length>>0).toString(2);for(;s.length>>t>>>0},t.parseQuery=function(e){const t={},r=("?"===e[0]?e.substr(1):e).split("&");for(const e of r){const r=e.split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1]||"")}return t},t.encodeDisassembly=function(e,t){let r="disassembly:///";return t&&(r+=`${t}:`),r+=`${e}.dbgasm?func=${e}&file=${t||""}`,r}},896(e){e.exports=require("fs")},161(t){t.exports=e},850(e){e.exports=t},602(e){e.exports=r}},s={};return function e(t){var r=s[t];if(void 0!==r)return r.exports;var n=s[t]={exports:{}};return i[t].call(n.exports,n,n.exports,e),n.exports}(265)})()); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 07efcef..5fba51a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,57 +9,30 @@ "version": "1.4.1", "hasInstallScript": true, "dependencies": { - "copy-paste": "^1.3.0", - "vscode-debugadapter": "1.35.0", - "vscode-debugprotocol": "1.35.0", - "xml2js": "^0.4.23" + "@vscode/debugadapter": "^1.68.0", + "@vscode/debugprotocol": "^1.68.0", + "xml2js": "^0.6.2" }, "devDependencies": { - "@types/node": "^12.0.0", - "@types/vscode": "~1.44.0", - "ts-loader": "^9.2.6", - "tslint": "^6.1.3", - "typescript": "^4.5.5", - "webpack": "~5.68.0", - "webpack-cli": "~4.9.2" + "@types/node": "^22.0.0", + "@types/vscode": "~1.82.0", + "ts-loader": "^9.5.4", + "typescript": "^5.9.3", + "webpack": "~5.105.4", + "webpack-cli": "~6.0.1" }, "engines": { - "vscode": "^1.35.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", - "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/helper-validator-identifier": "^7.28.5", - "js-tokens": "^4.0.0", - "picocolors": "^1.1.1" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.28.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", - "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" + "vscode": "^1.82.0" } }, "node_modules/@discoveryjs/json-ext": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", - "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.6.3.tgz", + "integrity": "sha512-4B4OijXeVNOPZlYA2oEwWOTkzyltLao+xbotHQeqN++Rv27Y6s818+n2Qkp8q+Fxhn0t/5lA5X1Mxktud8eayQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=10.0.0" + "node": ">=14.17.0" } }, "node_modules/@jridgewell/gen-mapping": { @@ -135,9 +108,9 @@ } }, "node_modules/@types/estree": { - "version": "0.0.50", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", - "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "dev": true, "license": "MIT" }, @@ -149,87 +122,108 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "12.20.55", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", - "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/vscode": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.44.0.tgz", - "integrity": "sha512-WJZtZlinE3meRdH+I7wTsIhpz/GLhqEQwmPGeh4s1irWLwMzCeTV8WZ+pgPTwrDXoafVUWwo1LiZ9HJVHFlJSQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@webassemblyjs/ast": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "version": "22.19.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.15.tgz", + "integrity": "sha512-F0R/h2+dsy5wJAUe3tAU6oqa2qbWY5TpNfL/RGmo1y38hiyO1w3x2jPtt76wmuaJI4DQnOBu21cNXQ2STIUUWg==", "dev": true, "license": "MIT", "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/vscode": { + "version": "1.82.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.82.0.tgz", + "integrity": "sha512-VSHV+VnpF8DEm8LNrn8OJ8VuUNcBzN3tMvKrNpbhhfuVjFm82+6v44AbDhLvVFgCzn6vs94EJNTp7w8S6+Q1Rw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vscode/debugadapter": { + "version": "1.68.0", + "resolved": "https://registry.npmjs.org/@vscode/debugadapter/-/debugadapter-1.68.0.tgz", + "integrity": "sha512-D6gk5Fw2y4FV8oYmltoXpj+VAZexxJFopN/mcZ6YcgzQE9dgq2L45Aj3GLxScJOD6GeLILcxJIaA8l3v11esGg==", + "license": "MIT", + "dependencies": { + "@vscode/debugprotocol": "1.68.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@vscode/debugprotocol": { + "version": "1.68.0", + "resolved": "https://registry.npmjs.org/@vscode/debugprotocol/-/debugprotocol-1.68.0.tgz", + "integrity": "sha512-2J27dysaXmvnfuhFGhfeuxfHRXunqNPxtBoR3koiTOA9rdxWNDTa1zIFLCFMSHJ9MPTPKFcBeblsyaCJCIlQxg==", + "license": "MIT" + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", + "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", + "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", "dev": true, "license": "MIT" }, "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", + "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", "dev": true, "license": "MIT" }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", - "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", + "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", "dev": true, "license": "MIT" }, "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", + "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", "dev": true, "license": "MIT", "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", + "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", "dev": true, "license": "MIT" }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", - "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", + "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", "dev": true, "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" } }, "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", - "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", + "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", "dev": true, "license": "MIT", "dependencies": { @@ -237,9 +231,9 @@ } }, "node_modules/@webassemblyjs/leb128": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", - "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", + "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -247,114 +241,122 @@ } }, "node_modules/@webassemblyjs/utf8": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", - "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", + "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", "dev": true, "license": "MIT" }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", - "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", + "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", "dev": true, "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/helper-wasm-section": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-opt": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", - "@webassemblyjs/wast-printer": "1.11.1" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", - "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", + "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", "dev": true, "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", - "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", + "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", "dev": true, "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", - "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", + "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", "dev": true, "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", - "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", + "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", "dev": true, "license": "MIT", "dependencies": { - "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/ast": "1.14.1", "@xtuc/long": "4.2.2" } }, "node_modules/@webpack-cli/configtest": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz", - "integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-3.0.1.tgz", + "integrity": "sha512-u8d0pJ5YFgneF/GuvEiDA61Tf1VDomHHYMjv/wc9XzYj7nopltpG96nXN5dJRstxZhcNpV1g+nT6CydO7pHbjA==", "dev": true, "license": "MIT", + "engines": { + "node": ">=18.12.0" + }, "peerDependencies": { - "webpack": "4.x.x || 5.x.x", - "webpack-cli": "4.x.x" + "webpack": "^5.82.0", + "webpack-cli": "6.x.x" } }, "node_modules/@webpack-cli/info": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz", - "integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-3.0.1.tgz", + "integrity": "sha512-coEmDzc2u/ffMvuW9aCjoRzNSPDl/XLuhPdlFRpT9tZHmJ/039az33CE7uH+8s0uL1j5ZNtfdv0HkfaKRBGJsQ==", "dev": true, "license": "MIT", - "dependencies": { - "envinfo": "^7.7.3" + "engines": { + "node": ">=18.12.0" }, "peerDependencies": { - "webpack-cli": "4.x.x" + "webpack": "^5.82.0", + "webpack-cli": "6.x.x" } }, "node_modules/@webpack-cli/serve": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz", - "integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-3.0.1.tgz", + "integrity": "sha512-sbgw03xQaCLiT6gcY/6u3qBDn01CWw/nbaXl3gTdTFuJJ75Gffv3E3DBpgvY2fkkrdS1fpjaXNOmJlnbtKauKg==", "dev": true, "license": "MIT", + "engines": { + "node": ">=18.12.0" + }, "peerDependencies": { - "webpack-cli": "4.x.x" + "webpack": "^5.82.0", + "webpack-cli": "6.x.x" }, "peerDependenciesMeta": { "webpack-dev-server": { @@ -389,28 +391,30 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", - "deprecated": "package has been renamed to acorn-import-attributes", + "node_modules/acorn-import-phases": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz", + "integrity": "sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==", "dev": true, "license": "MIT", + "engines": { + "node": ">=10.13.0" + }, "peerDependencies": { - "acorn": "^8" + "acorn": "^8.14.0" } }, "node_modules/ajv": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", - "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", + "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", "dev": true, "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -435,38 +439,17 @@ } } }, - "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", - "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", + "node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", "dev": true, "license": "MIT", "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" + "fast-deep-equal": "^3.1.3" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-formats/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "license": "MIT" - }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "license": "MIT", "peerDependencies": { - "ajv": "^6.9.1" + "ajv": "^8.8.2" } }, "node_modules/ansi-styles": { @@ -485,23 +468,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "license": "MIT", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, "node_modules/baseline-browser-mapping": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz", @@ -515,17 +481,6 @@ "node": ">=6.0.0" } }, - "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/braces": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", @@ -580,16 +535,6 @@ "dev": true, "license": "MIT" }, - "node_modules/builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/caniuse-lite": { "version": "1.0.30001777", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001777.tgz", @@ -687,21 +632,6 @@ "dev": true, "license": "MIT" }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, - "node_modules/copy-paste": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/copy-paste/-/copy-paste-1.5.3.tgz", - "integrity": "sha512-qOnFo+8l8vemGmdcoCiD7gPTefkXEg2rivYE+EBtuKOj754eFivkGhGAM9e/xqShrpuVE11evSxGnHwVAUK1Iw==", - "dependencies": { - "iconv-lite": "^0.4.8" - } - }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -717,16 +647,6 @@ "node": ">= 8" } }, - "node_modules/diff": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", - "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/electron-to-chromium": { "version": "1.5.307", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.307.tgz", @@ -762,9 +682,9 @@ } }, "node_modules/es-module-lexer": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", - "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", + "integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==", "dev": true, "license": "MIT" }, @@ -778,16 +698,6 @@ "node": ">=6" } }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -802,20 +712,6 @@ "node": ">=8.0.0" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "license": "BSD-2-Clause", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -859,30 +755,6 @@ "node": ">=0.8.x" } }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, - "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -890,13 +762,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "license": "MIT" - }, "node_modules/fast-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", @@ -961,13 +826,6 @@ "flat": "cli.js" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "license": "ISC" - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -978,41 +836,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", @@ -1050,28 +873,6 @@ "node": ">= 0.4" } }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=10.17.0" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/import-local": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", @@ -1092,33 +893,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "license": "ISC" - }, "node_modules/interpret": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.10" + "node": ">=10.13.0" } }, "node_modules/is-core-module": { @@ -1160,19 +942,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1221,38 +990,17 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/js-yaml": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", - "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", - "dev": true, - "license": "MIT", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true, "license": "MIT" }, "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true, "license": "MIT" }, @@ -1337,50 +1085,6 @@ "node": ">= 0.6" } }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "license": "MIT", - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -1395,45 +1099,6 @@ "dev": true, "license": "MIT" }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -1483,16 +1148,6 @@ "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -1543,27 +1198,17 @@ "node": ">=8" } }, - "node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/rechoir": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", - "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", "dev": true, "license": "MIT", "dependencies": { - "resolve": "^1.9.0" + "resolve": "^1.20.0" }, "engines": { - "node": ">= 0.10" + "node": ">= 10.13.0" } }, "node_modules/require-from-string": { @@ -1620,12 +1265,6 @@ "node": ">=8" } }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" - }, "node_modules/sax": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/sax/-/sax-1.5.0.tgz", @@ -1636,15 +1275,16 @@ } }, "node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", "dev": true, "license": "MIT", "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" }, "engines": { "node": ">= 10.13.0" @@ -1703,13 +1343,6 @@ "node": ">=8" } }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" - }, "node_modules/source-map": { "version": "0.7.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", @@ -1741,23 +1374,6 @@ "node": ">=0.10.0" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -1851,63 +1467,6 @@ } } }, - "node_modules/terser-webpack-plugin/node_modules/ajv": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz", - "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/terser-webpack-plugin/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/terser-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "license": "MIT" - }, - "node_modules/terser-webpack-plugin/node_modules/schema-utils": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", - "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" - }, - "engines": { - "node": ">= 10.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -1942,140 +1501,10 @@ "webpack": "^5.0.0" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true, - "license": "0BSD" - }, - "node_modules/tslint": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", - "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", - "deprecated": "TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.3", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.13.0", - "tsutils": "^2.29.0" - }, - "bin": { - "tslint": "bin/tslint" - }, - "engines": { - "node": ">=4.8.0" - }, - "peerDependencies": { - "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev" - } - }, - "node_modules/tslint/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/tslint/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "license": "MIT" - }, - "node_modules/tslint/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/tslint/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "^1.8.1" - }, - "peerDependencies": { - "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev" - } - }, "node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -2083,9 +1512,16 @@ "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, "node_modules/update-browserslist-db": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", @@ -2117,34 +1553,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/vscode-debugadapter": { - "version": "1.35.0", - "resolved": "https://registry.npmjs.org/vscode-debugadapter/-/vscode-debugadapter-1.35.0.tgz", - "integrity": "sha512-Au90Iowj6TuD5uDMaTnxOjl/9hQN0Yoky1TV1Cjjr7jPdxTQpALBRW09Y2LzkIXUVICXlAqxWL9zL8BpzI30jg==", - "deprecated": "This package has been renamed to @vscode/debugadapter, please update to the new name", - "license": "MIT", - "dependencies": { - "mkdirp": "^0.5.1", - "vscode-debugprotocol": "1.35.0" - } - }, - "node_modules/vscode-debugprotocol": { - "version": "1.35.0", - "resolved": "https://registry.npmjs.org/vscode-debugprotocol/-/vscode-debugprotocol-1.35.0.tgz", - "integrity": "sha512-+OMm11R1bGYbpIJ5eQIkwoDGFF4GvBz3Ztl6/VM+/RNNb2Gjk2c0Ku+oMmfhlTmTlPCpgHBsH4JqVCbUYhu5bA==", - "deprecated": "This package has been renamed to @vscode/debugprotocol, please update to the new name", - "license": "MIT" - }, "node_modules/watchpack": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.1.tgz", @@ -2160,36 +1568,37 @@ } }, "node_modules/webpack": { - "version": "5.68.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.68.0.tgz", - "integrity": "sha512-zUcqaUO0772UuuW2bzaES2Zjlm/y3kRBQDVFVCge+s2Y8mwuUTdperGaAv65/NtRL/1zanpSJOq/MD8u61vo6g==", + "version": "5.105.4", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.105.4.tgz", + "integrity": "sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw==", "dev": true, "license": "MIT", "dependencies": { - "@types/eslint-scope": "^3.7.0", - "@types/estree": "^0.0.50", - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/wasm-edit": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", - "acorn": "^8.4.1", - "acorn-import-assertions": "^1.7.6", - "browserslist": "^4.14.5", + "@types/eslint-scope": "^3.7.7", + "@types/estree": "^1.0.8", + "@types/json-schema": "^7.0.15", + "@webassemblyjs/ast": "^1.14.1", + "@webassemblyjs/wasm-edit": "^1.14.1", + "@webassemblyjs/wasm-parser": "^1.14.1", + "acorn": "^8.16.0", + "acorn-import-phases": "^1.0.3", + "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.8.3", - "es-module-lexer": "^0.9.0", + "enhanced-resolve": "^5.20.0", + "es-module-lexer": "^2.0.0", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^4.2.0", + "graceful-fs": "^4.2.11", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.3.1", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.0", - "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.3", - "watchpack": "^2.3.1", - "webpack-sources": "^3.2.3" + "schema-utils": "^4.3.3", + "tapable": "^2.3.0", + "terser-webpack-plugin": "^5.3.17", + "watchpack": "^2.5.1", + "webpack-sources": "^3.3.4" }, "bin": { "webpack": "bin/webpack.js" @@ -2208,41 +1617,40 @@ } }, "node_modules/webpack-cli": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.2.tgz", - "integrity": "sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-6.0.1.tgz", + "integrity": "sha512-MfwFQ6SfwinsUVi0rNJm7rHZ31GyTcpVE5pgVA3hwFRb7COD4TzjUUwhGWKfO50+xdc2MQPuEBBJoqIMGt3JDw==", "dev": true, "license": "MIT", "dependencies": { - "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.1.1", - "@webpack-cli/info": "^1.4.1", - "@webpack-cli/serve": "^1.6.1", + "@discoveryjs/json-ext": "^0.6.1", + "@webpack-cli/configtest": "^3.0.1", + "@webpack-cli/info": "^3.0.1", + "@webpack-cli/serve": "^3.0.1", "colorette": "^2.0.14", - "commander": "^7.0.0", - "execa": "^5.0.0", + "commander": "^12.1.0", + "cross-spawn": "^7.0.3", + "envinfo": "^7.14.0", "fastest-levenshtein": "^1.0.12", "import-local": "^3.0.2", - "interpret": "^2.2.0", - "rechoir": "^0.7.0", - "webpack-merge": "^5.7.3" + "interpret": "^3.1.1", + "rechoir": "^0.8.0", + "webpack-merge": "^6.0.1" }, "bin": { "webpack-cli": "bin/cli.js" }, "engines": { - "node": ">=10.13.0" + "node": ">=18.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" }, "peerDependencies": { - "webpack": "4.x.x || 5.x.x" + "webpack": "^5.82.0" }, "peerDependenciesMeta": { - "@webpack-cli/generators": { - "optional": true - }, - "@webpack-cli/migrate": { - "optional": true - }, "webpack-bundle-analyzer": { "optional": true }, @@ -2252,28 +1660,28 @@ } }, "node_modules/webpack-cli/node_modules/commander": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", - "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "dev": true, "license": "MIT", "engines": { - "node": ">= 10" + "node": ">=18" } }, "node_modules/webpack-merge": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", - "integrity": "sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-6.0.1.tgz", + "integrity": "sha512-hXXvrjtx2PLYx4qruKl+kyRSLc52V+cCvMxRjmKwoA+CBbbF5GfIBtR6kCvl0fYGqTUPKB+1ktVmTHqMOzgCBg==", "dev": true, "license": "MIT", "dependencies": { "clone-deep": "^4.0.1", "flat": "^5.0.2", - "wildcard": "^2.0.0" + "wildcard": "^2.0.1" }, "engines": { - "node": ">=10.0.0" + "node": ">=18.0.0" } }, "node_modules/webpack-sources": { @@ -2309,17 +1717,10 @@ "dev": true, "license": "MIT" }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "license": "ISC" - }, "node_modules/xml2js": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", + "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", "license": "MIT", "dependencies": { "sax": ">=0.6.0", diff --git a/package.json b/package.json index 826d8ee..952c51d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "PlatformIO Debugger for VSCode", "main": "dist/extension.js", "engines": { - "vscode": "^1.35.0" + "vscode": "^1.82.0" }, "repository": { "type": "git", @@ -12,22 +12,19 @@ }, "scripts": { "build": "webpack --mode production", - "lint": "tslint ./src/**/*.ts", "postinstall": "node ./node_modules/@types/vscode/bin/install || true" }, "dependencies": { - "copy-paste": "^1.3.0", - "vscode-debugadapter": "1.35.0", - "vscode-debugprotocol": "1.35.0", - "xml2js": "^0.4.23" + "@vscode/debugadapter": "^1.68.0", + "@vscode/debugprotocol": "^1.68.0", + "xml2js": "^0.6.2" }, "devDependencies": { - "@types/node": "^12.0.0", - "@types/vscode": "~1.44.0", - "ts-loader": "^9.2.6", - "tslint": "^6.1.3", - "typescript": "^4.5.5", - "webpack": "~5.68.0", - "webpack-cli": "~4.9.2" + "@types/node": "^22.0.0", + "@types/vscode": "~1.82.0", + "ts-loader": "^9.5.4", + "typescript": "^5.9.3", + "webpack": "~5.105.4", + "webpack-cli": "~6.0.1" } } diff --git a/src/backend/adapter.ts b/src/backend/adapter.ts index b1a4d74..4e2a94f 100644 --- a/src/backend/adapter.ts +++ b/src/backend/adapter.ts @@ -14,7 +14,7 @@ import { Scope, Source, ContinuedEvent, -} from 'vscode-debugadapter'; +} from '@vscode/debugadapter'; import { StoppedEvent, AdapterOutputEvent } from '../common'; import { hexFormat, encodeDisassembly, parseQuery } from '../utils'; import { VariableObject, MIError } from './mi2/types'; diff --git a/src/common.ts b/src/common.ts index 68c1008..866a1bc 100644 --- a/src/common.ts +++ b/src/common.ts @@ -1,4 +1,4 @@ -import { Event } from 'vscode-debugadapter'; +import { Event } from '@vscode/debugadapter'; export enum NumberFormat { Auto = 0, diff --git a/src/extension.ts b/src/extension.ts index 1972795..d31185b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,4 +1,3 @@ -import * as copyPaste from 'copy-paste'; import * as vscode from 'vscode'; import { NumberFormat, SymbolScope } from './common'; import { encodeDisassembly } from './utils'; @@ -287,7 +286,7 @@ class PlatformIODebugExtension { private peripheralsCopyValue(node: any): void { const value = node.node.getCopyValue(); if (value) { - copyPaste.copy(value); + vscode.env.clipboard.writeText(value); } } @@ -311,7 +310,7 @@ class PlatformIODebugExtension { private registersCopyValue(node: any): void { const value = node.node.getCopyValue(); if (value) { - copyPaste.copy(value); + vscode.env.clipboard.writeText(value); } } diff --git a/src/frontend/disassembly_tree_provider.ts b/src/frontend/disassembly_tree_provider.ts index 529952d..c090f73 100644 --- a/src/frontend/disassembly_tree_provider.ts +++ b/src/frontend/disassembly_tree_provider.ts @@ -1,7 +1,7 @@ import * as vscode from 'vscode'; export class DisassemblyTreeProvider implements vscode.TreeDataProvider { - private _onDidChangeTreeData = new vscode.EventEmitter(); + private _onDidChangeTreeData = new vscode.EventEmitter(); public onDidChangeTreeData = this._onDidChangeTreeData.event; private forced: boolean = false; diff --git a/src/frontend/memory_tree_provider.ts b/src/frontend/memory_tree_provider.ts index 79f598c..bf348ef 100644 --- a/src/frontend/memory_tree_provider.ts +++ b/src/frontend/memory_tree_provider.ts @@ -1,7 +1,7 @@ import * as vscode from 'vscode'; export class MemoryTreeProvider implements vscode.TreeDataProvider { - private _onDidChangeTreeData = new vscode.EventEmitter(); + private _onDidChangeTreeData = new vscode.EventEmitter(); public onDidChangeTreeData = this._onDidChangeTreeData.event; private history: string[] = []; diff --git a/src/frontend/peripheral.ts b/src/frontend/peripheral.ts index 2a00a34..4130193 100644 --- a/src/frontend/peripheral.ts +++ b/src/frontend/peripheral.ts @@ -737,7 +737,7 @@ export class FieldNode extends BaseNode { // ============================================================================ export class PeripheralTreeProvider implements vscode.TreeDataProvider { - private _onDidChangeTreeData = new vscode.EventEmitter(); + private _onDidChangeTreeData = new vscode.EventEmitter(); public onDidChangeTreeData = this._onDidChangeTreeData.event; private peripherials: PeripheralNode[] = []; private loaded: boolean = false; diff --git a/src/frontend/registers.ts b/src/frontend/registers.ts index e37f9e5..1908f91 100644 --- a/src/frontend/registers.ts +++ b/src/frontend/registers.ts @@ -215,7 +215,7 @@ export class FieldNode extends BaseNode { } export class RegisterTreeProvider implements vscode.TreeDataProvider { - private _onDidChangeTreeData = new vscode.EventEmitter(); + private _onDidChangeTreeData = new vscode.EventEmitter(); public onDidChangeTreeData = this._onDidChangeTreeData.event; private loaded: boolean = false; private viewExpanded: boolean = false; diff --git a/webpack.config.js b/webpack.config.js index cdd9d7a..06ee623 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -16,8 +16,7 @@ module.exports = [ }, externals: { vscode: 'vscode', - 'copy-paste': 'copy-paste', - 'vscode-debugadapter': 'vscode-debugadapter', + '@vscode/debugadapter': '@vscode/debugadapter', xml2js: 'xml2js', }, resolve: { @@ -47,8 +46,7 @@ module.exports = [ }, externals: { vscode: 'vscode', - 'copy-paste': 'copy-paste', - 'vscode-debugadapter': 'vscode-debugadapter', + '@vscode/debugadapter': '@vscode/debugadapter', xml2js: 'xml2js', }, resolve: {