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
Module aliases break debugging with ocamldebug #6841
Comments
Comment author: @garrigue It would have helped a lot to give the error message :-) No source file for NamespaceOne_test. The problem is that the original source file name is not kept in the debugging information. |
Comment author: @garrigue By the way, there are two workarounds to the problem (until we have a real solution).
These are stop-gaps, but should help you. |
Comment author: @garrigue Actually, you can also use the syntax With a good editor, this could be sufficient... |
Comment author: @garrigue The attached patch seems to fix the problem. |
Comment author: @damiendoligez For reference, this is related to the following PRs: |
Comment author: jordojw
It seems that doesn't work in 4.02.1. However, it seems that providing the compiled module name with a character place works, even though providing the compiled module name with the line number does not. |
Comment author: @garrigue
Sorry, there is not "break @ file # char" syntax, this is "break @ module # char". |
Comment author: @garrigue
Actually, what my patch does is different from what I suggested on caml-devel. In most cases this should be sufficient, except if the files have been moved around, in which case we fall back on the original logic. It would be possible to use the basename of the location rather than the module name, but it may well be ambiguous. |
Comment author: @garrigue Fixed at revisions 16022 and 16023 in trunk and 4.02. |
Original bug ID: 6841
Reporter: jordojw
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:47:36Z)
Resolution: fixed
Priority: high
Severity: major
Platform: Mac
OS: OS X
OS Version: 10.10
Version: 4.02.1
Fixed in version: 4.02.2+dev / +rc1
Category: tools (ocaml{lex,yacc,dep,debug,...})
Related to: #6270
Monitored by: @hhugo @yallop
Bug description
First, I apologize if this is not major/high priority. I'm still calibrating the importance of bugs/breaks, but I considered this a major issue because I'm not aware of any quick fixes to the issue (I tried the mailing list) to unblock development/debugging. In short, module aliases can break debugging - I've included the message from the mailing list that explains a quick reproduction of the error:
(Mailing List Message Below):
Module aliases are the encouraged way of grouping modules together. They have worked fine up until the point where I tried to use ocamldebug with them.
Module aliases allow development in the large, by permitting namespacing. I couldn't imagine building anything but a toy project with a few engineers with the restriction that no two files have the same basename! Module aliases to the rescue (thanks to Leo White for the suggestion). But, it seems that module aliases with namespacing make ocamldebug completely unusable. Here's a minimal repro case below. There are two simple namespaces each with a submodules in files named "test.ml". I am using module aliases to namespace them so that there are no collisions. Again, this works fine with everything except the debugger.
I hope I'm just doing something incorrect - if that is the case, I thank you in advance for your patience.
Steps to reproduce
Compile project using module aliases
Additional information
Here is proof that ocamldebug works correctly without namespacing/module aliases:
Working project without module aliases:
File attachments
The text was updated successfully, but these errors were encountered: