-
Notifications
You must be signed in to change notification settings - Fork 123
Support multi-threading #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multi-threading #129
Conversation
return []; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh any reason for this change? Could you include some test what this is supposed to fix or what didn't work in the tests file please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember the exact command that caused it, but it was to do with an mi command returning {} followed by other data, where the other data was getting lost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added an (artificial) test, which I can confirm did fail before this patch.
0bd44f1
to
16ca7a9
Compare
ok while quickly going over the changes I didn't notice any major issues so I will do more extensive testing later with all supported debuggers (not sure if mago supports multithreading, but it's just a side product anyway to allow D people on windows to debug if they really want to). I don't really know anything about async in js so I need to lookup if any thread safety issues can occur there or if it's just fancy promises. Otherwise I don't know how I feel about all the missing semicolons and using But this seems like a good and useful PR, thanks |
async in JS is effectively equivalent to promise I've only tested with gdb so YMMV, single-threaded functionality shouldn't change with other compilers though I think. |
16ca7a9
to
e44a590
Compare
e44a590
to
596674f
Compare
Gentle reminder. |
sorry was kind of busy with other stuff and didn't really feel like reviewing something large, I can do it now |
I can merge this as it is now because it is a good start, but I would prefer it if there were some |
Thanks for the review, I've added some defensive ifs and TODOs. Regarding the breakpoints being verified, I think there's some semantic difference between breakpoints being verified, and being enabled. Since I get the "done" response back from lldb, I assume they're verified as far as lldb is concerned (modulo lldb mi bugs), but they might not actually be enabled because of various reasons. Regardless, there's a new callback-based breakpoint API coming, so that might do a better job of maintaining breakpoint state. |
7e04ff5
to
a7b89c3
Compare
src/mibase.ts
Outdated
@@ -256,13 +258,24 @@ export class MI2DebugSession extends DebugSession { | |||
} | |||
|
|||
protected threadsRequest(response: DebugProtocol.ThreadsResponse): void { | |||
if (!this.miDebugger) { | |||
this.sendResponse(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm this should also return so the next call doesn't crash
Not sure why it only happens for this function but this fixes the error in the console.
Fixes #36. Not everything works perfectly, in particular non-varobj local don't have a well-defined thread, but it's a good base to build on. I'm not 100% sure about the logic behind VAR_HANDLES_START, so the current array size increase may be overkills
Also includes some odds-and-ends fixing parsing and reference printing.