JamieDStewart / GBA_VSCode_Basic

A 'simple' Game Boy Advance development setup using Visual Studio Code
GNU General Public License v3.0
100 stars 32 forks source link

Debug woes on macOS, can't start a debugger #4

Open taquitos opened 4 years ago

taquitos commented 4 years ago

I was able to adjust various params in the launch.json to point to the right places, and when I launch I get mGBA that just sits there. I went ahead and pressed the stop button in VSCode, and relaunched (like the README instructs) but it never connects.

Do you think mGBA still doesn't do remote debugging and the real problem is I need to get mGBA 0.6.1 to work?

Crash output (if you have any ideas here, QtOpenGL (5.14 - 5.14.2))

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_platform.dylib        0x00007fff66472100 _platform_strncmp + 320
1   com.endrift.mgba-qt             0x00000001065dbc8d mGLES2ShaderInit + 381
2   com.endrift.mgba-qt             0x00000001065db8af mGLES2ContextInit + 591
3   com.endrift.mgba-qt             0x000000010651415e QGBA::PainterGL::PainterGL(int, QGLWidget*) + 334
4   com.endrift.mgba-qt             0x0000000106512523 QGBA::DisplayGL::DisplayGL(QGLFormat const&, QWidget*) + 243
5   com.endrift.mgba-qt             0x0000000106512049 QGBA::Display::create(QWidget*) + 169
6   com.endrift.mgba-qt             0x00000001065a8e01 QGBA::Window::Window(QGBA::ConfigController*, int, QWidget*) + 625
7   com.endrift.mgba-qt             0x0000000106516686 QGBA::GBAApp::newWindow() + 86
8   com.endrift.mgba-qt             0x00000001065021a9 main + 1321
9   com.endrift.mgba-qt             0x0000000106501c74 start + 52
JamieDStewart commented 4 years ago

Hi there, sorry for such a long time without a response. I didn't see this notification come through. Since initially posting this I know that mGBA has had it's GDB implementation working in recent versions. Unfortunately I'm unable to test this out on a Mac right now as I'm locked out of my office until the University re-opens for business in September, so I'm not going to be much help on this one, perhaps you could post your launch.json and task.json files to see what you have configured in them.

irskep commented 3 years ago

I'm having a ~related issue, though for me it's not crashing, it just fails to do anything interesting. It launches mGBA to a white screen and the debugger never gets any symbols. Unfortunately I'm pretty clueless about how gdb and VSCode are supposed to interact so my debugger-debugging abilities are slim to none.

I also noticed VSCode logging an error related to tasks.json:

Error: the description can't be converted into a problem matcher:
{
    "background": {
        "activeOnStart": true,
        "beginsPattern": "^.*debuggerReady.*$",
        "endsPattern": "^.*debuggerReady.*$"
    }
}

I'm not sure if those things are related.

My tasks.json is unmodified except for the mGBA path.

If I run mGBA without -g, it shows the test pattern, but if I run with -g, I just get a white screen.

irskep commented 3 years ago

Solved it.

The basic problem you've been dealing with for Mac support is you need to use open /Applications/mGBA.app --args -g blah.gba instead of calling into the MacOS/mGBA binary. Doing this causes the system to open the app using the GUI app launching mechanism instead of tying it to your terminal's stdout/stderr.

My changes are here, you're welcome to pull them in. Everything seems to work with no hacks. https://github.com/irskep/gbatest/tree/master/.vscode

I also fixed some path casing issues and addressed the VSCode schema error.

taquitos commented 3 years ago

Noice! I'll give it a shot over the next couple of days. Thank you for looking into it!

taquitos commented 3 years ago

Ok, just gave it a go with your fork, works perfectly.