Create vscode launch configurations when running ./mach ide vscode
Categories
(Developer Infrastructure :: Developer Environment Integration, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: simonf, Unassigned)
Details
Attachments
(1 file)
|
689 bytes,
application/json
|
Details |
It would be great to have launch configurations for debugging Firefox with
- launching a new process
- attaching to an existing process
Comment 1•1 year ago
|
||
Hey :simonf, do you have more details on this?
I found https://code.visualstudio.com/docs/debugtest/debugging-configuration but I assume you already have your own launch.json file, and you want ./mach ide to create one like it? I'm not a vscode user, so I'm unsure of the specifics, but if you can provide the specifics I'd be happy to improve ./mach ide.
Updated•1 year ago
|
| Reporter | ||
Comment 2•1 year ago
|
||
Gijs and Malte, could you share your configurations?
Comment 3•1 year ago
|
||
This is the launch.json I use. It should be usable on both Linux and macOS with the CodeLLDB VSCode extension. The path to the binary and profile in it would need to be generated dynamically when ./mach ide is run. We may want to provide a GDB configuration on Linux though, as that won't require an additional VSCode extension.
Comment 4•1 year ago
|
||
(In reply to Malte Jürgens [:maltejur] from comment #3)
Created attachment 9477806 [details]
Basic lldb launch.jsonThis is the launch.json I use. It should be usable on both Linux and macOS with the CodeLLDB VSCode extension. The path to the binary and profile in it would need to be generated dynamically when
./mach ideis run. We may want to provide a GDB configuration on Linux though, as that won't require an additional VSCode extension.
Right, I think the question here is how we'd determine the binary. I use multiple mozconfigs and objdirs with a single source dir, and if the vscode settings live in the source dir then I don't want to re-run ./mach ide every time I switch. I feel like we should be able to somehow use the active mozconfig's output "by reference" instead of hardcoding it into launch.json, but I don't know if vscode provides any facilities for that.
Updated•1 year ago
|
Comment 5•10 months ago
|
||
I have struggled to get lldb working on VS Code to debug the rust files and this has been very frustrating. This is on Windows so maybe things are different. @malte’s attach config definitely doesn’t work at all.
If someone has a solution to this it would be great to see, also i do think we should be generating a launch file with a working solution for those who don’t want to spend ages setting this up.
Comment 6•10 months ago
|
||
{
"name": "Firefox (attach to content process)",
"type": "lldb",
"request": "attach",
"pid": "${command:pickProcess}",
"initCommands": [
"command source \"${workspaceFolder}/.lldbinit\""
],
"program": "${workspaceFolder}/obj-x86_64-pc-windows-msvc/dist/bin/firefox.exe",
"sourceLanguages": ["c", "cpp", "rust"]
},
Doesn't seem to work for me, i have CodeLLDB installed, firefox built and i think symbols built (xul.pdb has been created)
Comment 7•10 months ago
|
||
I have raised a separate issue here for the CodeLLDB debugging not working, if anyone knows your help would be appreciated:
https://bugzilla.mozilla.org/show_bug.cgi?id=1994666
Comment 8•8 months ago
|
||
After playing with this some more i would add "process handle -s false SIGSYS" to the config as this reduces the amount of exceptions which get thrown that you can't do anything about.
So now my configuration is this:
{
"configurations": [
{
"name": "Firefox (attach to content process)",
"type": "lldb",
"request": "attach",
"pid": "${command:pickProcess}",
"initCommands": [
"command source \"${workspaceFolder}/.lldbinit\"",
"process handle -s false SIGSYS"
],
"sourceLanguages": ["c", "cpp", "rust"]
},
]
}
Description
•