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

Re: a few practical details #2534

Closed
vicuna opened this issue Jul 22, 2000 · 5 comments
Closed

Re: a few practical details #2534

vicuna opened this issue Jul 22, 2000 · 5 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jul 22, 2000

Original bug ID: 165
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hi,

Thank you for your message to the Caml mailing list.

However your message seems to be a bug report; hence I send it to the
relevant mailing list

caml-bugs@inria.fr

Thank again for your interest in Caml.

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/

  • ocamldebug uses $PATH to find the prog to debug. This is quite annoying if you
    don't have ``.'' in your path (as it should be :) you get:

% ocamldebug best
Objective Caml Debugger version 3.00

(ocd) run
Loading program... Program not found.
(ocd)

i must not be the first to be annoyed by this...

As for now, i just patched camldebug.el to workaround this (as anyway,
ocamldebug can't be used standalone on command line with no readline! By the way
what about adding readline support to ocaml and ocamldebug?)

  • could it be added to the documentation that ocamldebug and ocamlbrowser should
    not be stripped, unless they don't work the way they should (the worse is
    maybe that they work just like ocamlrun, making you go crazy trying to find out
    what the hell is going on, moreover together with the PATH pb!)

  • are there any good solutions to debug tk-enabled programs? As for now, i
    managed it by adding the different librairies i'm using to compilation of
    ocamldebug, need the source at hand though. The second problem is of course that
    back debugging doesn't work (you get Xlib: unexpected async reply (sequence
    0x6a8)!), so sad when you're already addicted to it!

  • lastly, a bug (is it?) on axp:

pixel@alpha:~>ocaml
Objective Caml version 3.00

1.0 /. 0. ;;

zsh: floating point exception ocaml

whereas on ix86 & sparc it gives:

pixel@leia:~>ocaml
Objective Caml version 3.00

1.0 /. 0.0 ;;

  • : float = inf

Thanks, cu Pixel.

diff -r -u -N ocaml-3.00.old/emacs/camldebug.el ocaml-3.00/emacs/camldebug.el
--- ocaml-3.00.old/emacs/camldebug.el Wed Apr 5 20:30:14 2000
+++ ocaml-3.00/emacs/camldebug.el Sat Jul 22 17:51:02 2000
@@ -480,7 +480,7 @@
(make-comint (concat "camldebug-" file)
(substitute-in-file-name camldebug-command-name)
nil

  •             "-emacs" "-cd" default-directory file)
    
  •             "-emacs" "-cd" default-directory (concat "./" file))
    
    (set-process-filter (get-buffer-process (current-buffer))
    'camldebug-filter)
    (set-process-sentinel (get-buffer-process (current-buffer))
@vicuna
Copy link
Author

vicuna commented Jul 25, 2000

Comment author: administrator

  • ocamldebug uses $PATH to find the prog to debug. This is quite
    annoying if you don't have ``.'' in your path (as it should be :)

Yes, that was silly. It's fixed in the working sources.

As for now, i just patched camldebug.el to workaround this (as
anyway, ocamldebug can't be used standalone on command line with no
readline! By the way what about adding readline support to ocaml and
ocamldebug?)

Initially, we hoped that an external line editor such as Ledit could
be used. However, external line editors aren't widespread nowadays.

  • could it be added to the documentation that ocamldebug and
    ocamlbrowser should not be stripped, unless they don't work the
    way they should (the worse is maybe that they work just like
    ocamlrun, making you go crazy trying to find out what the hell is
    going on, moreover together with the PATH pb!)

Right. All programs compiled with "ocamlc -custom" must not be
stripped. This is mentioned in the docs, but the installation
instructions should also say it for ocamldebug and ocamlbrowser.

  • are there any good solutions to debug tk-enabled programs? As for
    now, i managed it by adding the different librairies i'm using to
    compilation of ocamldebug, need the source at hand though. The
    second problem is of course that back debugging doesn't work (you
    get Xlib: unexpected async reply (sequence 0x6a8)!), so sad when
    you're already addicted to it!

Right. I'm afraid reverse execution will never work for programs that
do I/O, especially socket I/O, and especially socket I/O done in an
external C library...

  • lastly, a bug (is it?) on axp:

pixel@alpha:~>ocaml
Objective Caml version 3.00

1.0 /. 0. ;;

zsh: floating point exception ocaml

whereas on ix86 & sparc it gives:

pixel@leia:~>ocaml
Objective Caml version 3.00

1.0 /. 0.0 ;;

  • : float = inf

Well, you'd get the same floating-point exception on an Alpha with a C
program. The Alpha processor doesn't implement all of IEEE arithmetic
in hardware, in particular the treatment of infinities. Since the
OCaml virtual machine is in C, you get the same behavior in OCaml.

This said, there are special flags to the C compiler that allow full
IEEE support via software assistance (-mieee? -fieee? can't remember).
I think we should activate those flags when compiling the bytecode
interpreter, at least. (The native-code compiler is another story.)

Thanks for your feedback,

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jul 25, 2000

Comment author: administrator

Xavier Leroy Xavier.Leroy@inria.fr writes:

[...]

  • could it be added to the documentation that ocamldebug and
    ocamlbrowser should not be stripped, unless they don't work the
    way they should (the worse is maybe that they work just like
    ocamlrun, making you go crazy trying to find out what the hell is
    going on, moreover together with the PATH pb!)

Right. All programs compiled with "ocamlc -custom" must not be
stripped. This is mentioned in the docs, but the installation
instructions should also say it for ocamldebug and ocamlbrowser.

?? i've done a "grep -r -i strip ." in the ocaml source directory and didn't
find any mention about this

[...]

pixel@alpha:~>ocaml
Objective Caml version 3.00

1.0 /. 0. ;;

zsh: floating point exception ocaml

[...]

Well, you'd get the same floating-point exception on an Alpha with a C
program. The Alpha processor doesn't implement all of IEEE arithmetic
in hardware, in particular the treatment of infinities. Since the
OCaml virtual machine is in C, you get the same behavior in OCaml.

This said, there are special flags to the C compiler that allow full
IEEE support via software assistance (-mieee? -fieee? can't remember).

ok, i've rebuilded ocaml with -mieee, and now it works nicely.

the pb i have now is to have the native-code compiler work the same...

pixel@alpha:/tmp>echo "1. /. 0." > t.ml ; ocamlc t.ml ; ./a.out
pixel@alpha:/tmp>echo "1. /. 0." > t.ml ; ocamlopt t.ml ; ./a.out
zsh: floating point exception ./a.out

i've tried passing some -mieee to ocamlopt, but as ocamlopt generates assembler,
i had no luck of course...

as for now, i'll keep the bytecode version which works :)

thanks, cu Pixel.

@vicuna
Copy link
Author

vicuna commented Jul 27, 2000

Comment author: administrator

Right. All programs compiled with "ocamlc -custom" must not be
stripped. This is mentioned in the docs, but the installation
instructions should also say it for ocamldebug and ocamlbrowser.

?? i've done a "grep -r -i strip ." in the ocaml source directory and didn't
find any mention about this

The manual is distributed separately from the sources.

ok, i've rebuilded ocaml with -mieee, and now it works nicely.
the pb i have now is to have the native-code compiler work the same...
i've tried passing some -mieee to ocamlopt, but as ocamlopt
generates assembler, i had no luck of course...

Right. It would be necessary to modify the code generator, so that it
generates enough hooks for the software fix-up code to work, and it's
not obvious at all how to do it.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jul 27, 2000

Comment author: administrator

?? i've done a "grep -r -i strip ." in the ocaml source directory and didn't
find any mention about this

Sorry, I mis-remembered: the "strip" trap wasn't documented in the
manual either. Now, it is.

Thanks for your feedback.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Jul 27, 2000

Comment author: administrator

Debugger problem fixed some time ago. INSTALL file, docs, and Alpha compilation
options fixed 2000-07-27 by XL.

@vicuna vicuna closed this as completed Jul 27, 2000
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant