[VS Code] ReadMemory request causes cast exception on macOS
See original GitHub issueI’m issuing a ReadMemory request from a VSCode extension using:
const readMemoryResp = await vscode.debug.activeDebugSession.customRequest('readMemory', { memoryReference: memoryReference, count: count, offset: offset });
It works absolutely fine on Windows. However on macOS (Catalina 10.15.7) the following exception occurs:
“Specified cast is not valid.”
I have traced it to the following line of code:
int hr = ((IDebugMemoryBytesDAP)m_engine).CreateMemoryContext(address, out memoryContext);
in AD7DebugSession.cs in the function GetMemoryContext().
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Troubleshoot Terminal launch failures
The troubleshooting steps, such as checking your settings and enabling logging, apply to all platforms that support VS Code; macOS, Linux, and Windows....
Read more >Running Visual Studio Code on macOS
Launching from the command line · Launch VS Code. · Open the Command Palette (Cmd+Shift+P) and type 'shell command' to find the Shell...
Read more >JavaScript API | Frida • A world-class dynamic instrumentation ...
Observe and reprogram running programs on Windows, macOS, GNU/Linux, iOS, watchOS, tvOS, Android, FreeBSD, and QNX.
Read more >Debugging in Visual Studio Code
One of the great things in Visual Studio Code is debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >VSCode hot reload for Flutter does not work
I'm on a Macbook Pro 2015 running macOS Mojave Version 10.14.2 if that helps. There isn't really any code to show, it's not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep. This most likely is a bug with mono and how it handles embedded interfaces.
We have not had the chance to test
readMemory
requests on macOS/Linux.https://github.com/microsoft/MIEngine/pull/1082 should fix the cast exception, but the cast may still fail in mono. https://github.com/microsoft/MIEngine/pull/1075 is part of the progress to move to .NET Core. It is moving to an SDK styled csproj which should make it easier to convert it from .NET Framework v4.6.2 to .NET Core 5.
@WardenGnaw Many thanks for looking at this issue.
We are using VSCode 1.51.1 and cpptools 1.1.2 out the box, so are using the standard cppdbg.ad7Engine.json.
And I can confirm that the same cast exception happens on Linux.