Code change:
Type: <bBug</bI am developing a VS code debugger extension by inheriting from DebugSession class. I implement disassembleRequest method to support disassembly view. But now there is a strange bug which I am not sure whether it is the bug of VS code or not. When disassembly view is firstly open, it shows wrong addresses and instructions. But after I scroll mouse up and down to manually refresh disassembly view, it shows correct addresses and instructions. So it seems it is a refresh issue. I have inspected the returned data to VS code and I am sure data is correct. BTW, if the returned data deos not contain source information, then the address and data is correct. I also post a question in stackoverflow: The question contains two picutures which should be able to describe my issue. Thanks! VS Code version: Code 1.82.0 (, 2023-09-06T22:07:07.438Z) OS version: WindowsNT x64 10.0. Modes: <details<summarySystem Info</summary </details<details<summaryExtensions (9)</summaryExtensionVersion ------ biosdbgv44.1.2 vscode-eslint2.4.2 workspace-storage-cleanup1.1.5 isort2023.10.1 python2023.16.0 vscode-pylance2023.9.10 cpptools1.17.5 hexeditor1.9.12 memory-viewer0.0.1 </details<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --
Could you try this in the latest VS Code Insiders build? A bunch of disassembly view fixes just went in
I test on the latest VS code insiders 1.83.0, and the issue still exists. Please see below pictures When disassembly view is firstly open: ! After scroll mouse up and down to refresh disassembly view: !
Can you please either share your extension/a reproduction, or share a log of the DAP messages sent and received by your debugger?
Hi Connor, I have sent disassembly message to your email Thanks! Bill Zhang
Hi Connor, below is the implementation of disassembleRequest: protected async disassembleRequest(response: DebugProtocol.DisassembleResponse, args: DebugProtocol.DisassembleArguments) { try { const baseAddress = args.memoryReference; const offset = 0; const instructionOffset = args.instructionOffset 0; const instructionCount = args.instructionCount; const input = { baseAddress: baseAddress, offset: offset, instructionOffset: instructionOffset, instructionCount: instructionCount }; const instructionList: BIOSDBGInstruction[] = []; const output = await callRpcMethod("Disassemble", input); for (const item of output) { const addressHex = '0x' + item.address; const instruction = new BIOSDBGInstruction(addressHex, item.instruction, item.instructionBytes); if (item.sourcePath !== "" && item.lineNumber 0) { instruction.location = this.createSource(item.sourcePath); = item.lineNumber; } (instruction); } = { instructions: instructionList }; } finally { this.sendResponse(response); } }
Yep, got it, thanks. My plate is full right now but I'll look into this within the next couple weeks.
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!
Tested with 1.84.0-insiders, it seems that this issue is fixed. Thanks!

Related discussion:
text: let textModel: ITextModel | undefined = undefined; const sourceSB = new StringBuilder(10000); const ref = await this.textModelService.createModelReference(sourceURI); <ins> if (templateData.currentElement.element !== element) { return; // avoid a race, #192831 } </ins> textModel = ref.object.textEditorModel; templateData.cellDisposable.push(ref);