Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support debugging multithreaded programs until they create threads (#…
…10594) ocamldebug has never worked with multithreaded programs: multiple threads mess up the communication protocol with the debugger, and the fork()-based checkpointing mechanism breaks too. Up to 4.11, the debugger would work fine until the first thread was created. Then, bizarre errors would be reported. In 4.12 (commit e678885), a check was added, causing any program linked with the threads library to report a fatal error at start-up time when run under the debugger. As reported in #10517, this check is too strong: some programs just happen to be linked with the threads library, e.g. because they use LWT, but may never start a thread. There's no reason to refuse to debug these programs. This commit reverts the 4.12 change and adds a check in Thread.create that aborts the program if it is run under the debugger. This way, programs linked with the threads library can still be debugged until the point where they create new threads.
- Loading branch information