Skip to content
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

Packed modules: miscommunication emacs/ocamldebug #7540

Open
vicuna opened this issue May 24, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented May 24, 2017

Original bug ID: 7540
Reporter: herbelin
Status: acknowledged (set by @xavierleroy on 2017-10-10T12:29:17Z)
Resolution: open
Priority: normal
Severity: minor
Version: 4.04.1
Category: tools (ocaml{lex,yacc,dep,debug,...})

Bug description

[ Original summary was: Packed modules: setting "break" broken in ocamldebug + miscommunication emacs/ocamldebug. First issue is solved. ]

There seems to be a bug with ocamldebug on packed modules. In the reproducible script below, the first "break" works but the second gives "Can't find any event there". Note however that executing step by step works well.

This seems related to the call to "Hashtbl.add all_events_by_module md sorted_evl" in Symbols.read_symbols which binds all modules of a pack to the name of the first module.

There is also a communication bug when calling ocamldebug from emacs (at least using tuareg). Commands of the form break @ "b" # 10 are sent while ocamldebug tolerance is only about adding .ml or uncapitalizing the first letter of a (possibly qualified) module name.

Steps to reproduce

echo "let f x = x" > a.ml
echo "open A;; f 1" > b.ml
ocamlc -g -c a.ml b.ml
ocamlc -g -pack -o p.cmo a.cmo b.cmo
ocamlc -g -o a.out p.cmo
ocamldebug a.out
break @ B.P # 10
break @ A.P # 9

Additional information

Since I already tried a fix for testing, I shall try to submit it to the PR system in case it can ever save time.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 24, 2017

Comment author: @mshinwell

Please submit a Github PR with your fix (https://github.com/ocaml/ocaml), thanks.

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 9, 2017

Comment author: @xavierleroy

Hugo, we're still interested in your code (the one that attempts to fix the loading of events in ocamldebug). Having your code as a possible fix or at least a starting point would help us a lot. Thank you.

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 10, 2017

Comment author: herbelin

Hi Xavier, regarding the fix to ocamldebug, I had submitted #1179 which has been merged on Jul 19 (23ba478).

I had another issue with tuareg which does not support sending breakpoints to ocamldebug when modules are in a pack. I reported this at ocaml/tuareg#136 but I have no clue how to fix that, since either tuareg should get a way to know that some files are in a pack, or ocamldebug being able to recover the fully qualified module name from the base name, but this would somehow defeat the purpose of packing.

Actually, the issue seems to exist also for the version of camldebug.el shipped with ocaml (

"@ \"%m\" # %c")
).

@vicuna

This comment has been minimized.

Copy link
Author

commented Oct 10, 2017

Comment author: @xavierleroy

Sorry, I missed the Github pull request. Thanks for the info. Updating this PR to reflect that only the ocamldebug/emacs problem remains.

@vicuna vicuna added the tools label Mar 14, 2019

@nojb nojb added the ocamldebug label Mar 15, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.