caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: jocelyn.serot@uca.fr
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Problem with ocamldebug 4.06.0
Date: Thu, 19 Jul 2018 17:57:47 +0200	[thread overview]
Message-ID: <CAPFanBGPCY-Uq4d6bRQyzy7==gJDzOGpn3xwk6jpcL9R5oPSFg@mail.gmail.com> (raw)
In-Reply-To: <0E31DD5B-08EE-40C6-80CD-2BC8EDE31964@uca.fr>

Hi Jocelyn,


> i) is there something special to do when using ocamldebug in a multi-directory source file context ?

I don't think so. On the other hand, dynamic linking (with Dynlink) is
not currently supported, in the sense
that no debug information will be available for the dynlinked code.
(It looks like this is not the concern in your case.)

> ii) has someone already encountered this problem

We recently discussed a bug in ocamldebug related to the interplay
between debug information and inlining ( MPR#7554 ), for which there
is a fix by Thomas Refis in the current development version
(4.08+dev), but not in any released version of OCaml -- not 4.07. The
bug is general, but in particular it affects the variables foo, bar,
baz in the following code pattern:

  let (foo, bar, baz) = (e1, e2, e3) in ...

If the source program where you observe your problem is publicly
available, would you mind giving a pointer to the problematic
variables occurrences?

I would encourage you to file a problem report on the OCaml bugtracker
( https://caml.inria.fr/mantis ) to move forward, especially if you
have a repro-case or can at least point us on a publicly-available
version of the source code.

> iii) is there a way to track down where / why the exception was launched (i.e. to debug the debugger)

In theory you can use OCAMLRUNPARAM=b when running the compiler or
debugger, and you get a backtrace. That said, the compiler codebase
was not written with backtraces in mind, and it has a tendency to
catch and re-raise exceptions in a way that does not preserve
backtraces -- so the trace you observe may be inaccurate. This is
something that we could and should improve -- François Bobot proposed
a change that notably improves the statu quo (GPR#374) but it has not
been merged upstream yet.

> iv) is there a chance that the pb is fixed in 4.07.0

Probably not (if you say it's not in the Changes), but with your help
it could very well be fixed in 4.08 :-)
On Thu, Jul 19, 2018 at 4:06 PM Jocelyn Sérot <jocelyn.serot@uca.fr> wrote:
>
> Hello,
>
> I’m experiencing problems when using ocamldebug on a large program.
> Namely, the debugger quits launching an « Not_found » exception as soon as i try to visualize some program variables (print) or dump thef frame
>
> (ocd) …
> (ocd) print t
> Removed breakpoint 1 at 958036: file vhdl.ml, line 113, characters 19-30
> Uncaught exception: Not_found
>
> OCaml-Debugger exited abnormally with code 2
>
> I’ve started to encounter this problem when i recrafted the program in order to use ocamlbuild and distribute the source code in several directories.
> What is annoying is that the problem is not systematic it seems to dependi on the variable to be printed (or at least on the module where it is defined) - which makes isolating a minimum triggering program difficult :(
>
> So my questions are
>
> i) is there something special to do when using ocamldebug in a multi-directory source file context ? I of course tried to add « _build » and « subdir/_build » to the debug « path » using the directory command, w/o success
>
> ii) has someone already encountered this problem
>
> iii) is there a way to track down where / why the exception was launched (i.e. to debug the debugger)
>
> iv) is there a chance that the pb is fixed in 4.07.0 (apparently no since nothing is told about ocamldebug in the release doc).
>
> Any help appreciated
>
> Cheers
>
> Jocelyn
>

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

  reply	other threads:[~2018-07-19 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19 14:05 Jocelyn Sérot
2018-07-19 15:57 ` Gabriel Scherer [this message]
2018-07-19 16:24   ` Jocelyn Sérot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPFanBGPCY-Uq4d6bRQyzy7==gJDzOGpn3xwk6jpcL9R5oPSFg@mail.gmail.com' \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=jocelyn.serot@uca.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).