Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007540OCamltools (ocaml{lex,yacc,dep,debug,...})public2017-05-24 16:562017-10-10 14:29
Reporterherbelin 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.04.1 
Target VersionFixed in Version 
Summary0007540: Packed modules: miscommunication emacs/ocamldebug
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 Reproduceecho "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 InformationSince I already tried a fix for testing, I shall try to submit it to the PR system in case it can ever save time.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0017811)
shinwell (developer)
2017-05-24 16:58

Please submit a Github PR with your fix (https://github.com/ocaml/ocaml [^]), thanks.
(0018521)
xleroy (administrator)
2017-10-09 20:08

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.
(0018530)
herbelin (reporter)
2017-10-10 12:34

Hi Xavier, regarding the fix to ocamldebug, I had submitted https://github.com/ocaml/ocaml/pull/1179 [^] which has been merged on Jul 19 (https://github.com/ocaml/ocaml/commit/23ba4788f0a30e4c64565e9a08bc6557b58b95bf [^]).

I had another issue with tuareg which does not support sending breakpoints to ocamldebug when modules are in a pack. I reported this at https://github.com/ocaml/tuareg/issues/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 (https://github.com/ocaml/ocaml/blob/019f469aa36c65d5436c0cc107aff310aa399735/emacs/camldebug.el#L190 [^]).
(0018532)
xleroy (administrator)
2017-10-10 14:29

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

- Issue History
Date Modified Username Field Change
2017-05-24 16:56 herbelin New Issue
2017-05-24 16:58 shinwell Note Added: 0017811
2017-06-02 16:42 shinwell Status new => acknowledged
2017-10-02 14:00 doligez Status acknowledged => feedback
2017-10-09 20:08 xleroy Note Added: 0018521
2017-10-10 12:34 herbelin Note Added: 0018530
2017-10-10 12:34 herbelin Status feedback => new
2017-10-10 14:29 xleroy Note Added: 0018532
2017-10-10 14:29 xleroy Severity major => minor
2017-10-10 14:29 xleroy Status new => acknowledged
2017-10-10 14:29 xleroy Summary Packed modules: setting "break" broken in ocamldebug + miscommunication emacs/ocamldebug => Packed modules: miscommunication emacs/ocamldebug
2017-10-10 14:29 xleroy Description Updated View Revisions


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker