Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] OCamlRun -D?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] OCamlRun -D?
> How can I use the ocaml debugger to debug a program that uses ncurses?
> I can't run the program from inside the debugger as the mixture of
> ncurses output from my program, and the non-ncurses output from the
> debugger produces garbage.
> 
> The manual seems to hint that I can run the program, and then run the
> debugger externally (on a different virtual terminal), and then connect
> the debugger to the program.  The key to this is passing the -D <socket>
> parameter to ocamlrun, as mentioned in section 16.8.6 of the manual.
> Except that ocamlrun does not recognise the -D parameter.  :(

Yes, the manual is outdated and will be fixed.  You can achieve the
desired effect by setting the CAML_DEBUG_SOCKET environment variable
before running the program:

In terminal 1:

        ocamldebug myprog
        set loadingmode manual
        run
           (it prints a socket path, e.g. /tmp/camldebug9960)

In terminal 2:
        CAML_DEBUG_SOCKET=/tmp/camldebug9960 myprog

Hope this helps,

- Xavier Leroy

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners