Source files not automatically loaded when starting debugging
When I start debugging from VSCode, the debugger only lists the sections in the outline, but not the source files that contain them.
The source files in my project are in src in the project root, and I've tried adding "additionalSrcFolders": "${workspaceFolder}/src" to my launch.json but that didn't seem to do anything. "Load Sources Automatically" is enabled in the debugger, but I still have to manually load the sources from that menu for them to show up correctly in the debugger.
Breakpoints set in the source code in VSCode also don't seem to work, I assume that must be related - hovering one of those breakpoints when debugging is running shows the following error:
I'm running this on macOS 14.1 with VSCode 1.84.2 and the latest version of Emulicious as of writing.
Edit: It seems like this does work correctly trying the Pokémon Red disassembly with this same setup. Is there some specific flags you need when linking or some other paths I need to specify for it to work right?
Make sure that there is either a file called main.asm or a file with the same filename as your romfile but with .asm as extension.
You are right to assume that breakpoints don't work if the corresponding sources aren't loaded. Because if they aren't loaded, there's no mapping between the sourcecode and your rom.
That was indeed my issue. My main file was called start.asm, renaming it to main.asm makes it work correctly.
It might be a good idea to print some error into the debug console explaining what files it looked for if it can't find your sources so other people don't get stuck on this issue too.
Thanks for your feedback. With today's update, the source file discovery has improved and it should work with start.asm and other names as well now.