Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Staticjpl's avatar
Staticjpl
Honored Guest
4 months ago
Solved

Issues with Oculus Debugger for VS Code

Hello all, I've been trying to get debug attachment to running process on headset for two days now. I normally use Rider but I had installed and setup VSCode to use the Oculus Debugger.

I however was not able to attach a running instance on headset.

I get an error where the Oculus Plugin doesn't download the LLDB files

Here is the Log.

 Create debug adapter with configuration:
{"name":"Oculus (Development) Attach","request":"attach","type":"fb-lldb","android":{"application":{"package":"com.example.project","activity":"com.epicgames.unreal.GameActivity"},"lldbConfig":{"librarySearchPaths":["\\\"C:/PROJECT/Binaries/Android/Symbols_arm64\\\""],"lldbPreTargetCreateCommands":["command script import \\\"C:/PROJECT/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py\\\""],"lldbPostTargetCreateCommands":["process handle --pass true --stop false --notify true SIGILL"]}},"__configurationTarget":5,"terminateCommands":[]}
C:\Users\User\.oculus_debugger_runtime Exists!
C:\Users\User\.oculus_debugger_runtime Exists!
Previous download directory exists, removing C:\Users\User\.oculus_debugger_runtime\lldb
Previous download directory exists, removing C:\Users\User\.oculus_debugger_runtime\debugcito
Exception: Error: Can't download LLDB: invalid content length
Stack trace: {Error: Can't download LLDB: invalid content length
    at c:\Users\User\.vscode\extensions\oculus.oculus-vscode-debugger-1.0.8\dist\extension.js:17:39876
    at new Promise (<anonymous>)
    at c:\Users\User\.vscode\extensions\oculus.oculus-vscode-debugger-1.0.8\dist\extension.js:17:39747
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Ee._downloadWithProgress (c:\Users\User\.vscode\extensions\oculus.oculus-vscode-debugger-1.0.8\dist\extension.js:17:39572)
    at async Ee._downloadAndInstallWithProgress (c:\Users\User\.vscode\extensions\oculus.oculus-vscode-debugger-1.0.8\dist\extension.js:17:39295)}
Exception: Error: Can't download Oculus Runtime: invalid content length
Stack trace: {Error: Can't download Oculus Runtime: invalid content length
    at c:\Users\User\.vscode\extensions\oculus.oculus-vscode-debugger-1.0.8\dist\extension.js:17:39876
    at new Promise (<anonymous>)
    at c:\Users\User\.vscode\extensions\oculus.oculus-vscode-debugger-1.0.8\dist\extension.js:17:39747
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Ee._downloadWithProgress (c:\Users\User\.vscode\extensions\oculus.oculus-vscode-debugger-1.0.8\dist\extension.js:17:39572)
    at async Ee._downloadAndInstallWithProgress (c:\Users\User\.vscode\extensions\oculus.oculus-vscode-debugger-1.0.8\dist\extension.js:17:39295)}

After this I gave up so I tried installing lldb-server manually onto the headset and was able to get the server running and connect to it via VSCode running using my own launch commands. I got pretty close but I wasn't able to properly attach with permissions of the running game. Instead it was default attaching to a 0 stub process.

If anyone can figure out how I can actually hit break points in C++ on the running process of the headset.

I've verified that the apk I side loaded is debugable and everything seems fine. Setting up a working system like this seems like undocumented territory.