I would like to submit two patches for code review.
They introduce concrete support for OCaml native debugging, granted that you have access to the native compiler with DWARF emission support (see https://github.com/ocaml/ocaml/pull/574)
This adds about 2000 lines of code.
The type system isn’t particularly complex here, every value is considered as an unsigned integer, and interpretation of the value is left to an external debugging layer made in OCaml.
The language plugin handles function name demangling for breakpoints too.
No tests for now. Is it fine to commit binaries with the patchs?
What type of binaries do you want to commit in?
Generally we don’t like putting binaries to the repository because they are not human readable so it is hard to review/diff them and they will only run on a single platform and a single architecture while we support a lot of different configuration.
I don’t like the idea of not having tests. Promising tests and actually delivering on them are two entirely different things. And without them, we just end up with broken code and nobody to maintain it
I understand your concern.
I guess it could be possible to create a conditional test exercised on a particular condition (like the presence of the native compiler), and skipped otherwise.
Is it possible for new files to trigger regressions? Most of the changes concern the language plugins, AST context and DWARF parser.
To be frank, I do not like that either. I could add the test the DWARF emission feature hit OCaml packages.
Anyway, here are the patches. I would be fine with just the code review if the absence of tests is a bother.
I ran check-lldb before and after applying the patches, and AFAIK I didn’t introduce any regressions.
0002-Demangling-OCaml-function-symbols.patch (5.56 KB)
0001-Add-support-for-OCaml-native-debugging.patch (59.1 KB)
Can you upload your patches to http://reviews.llvm.org/differential/ as we do all code reviews in that system?