From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 902B97F616 for ; Thu, 23 Feb 2017 17:49:54 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=tom.j.ridge@googlemail.com; spf=Pass smtp.mailfrom=tom.j.ridge@googlemail.com; spf=None smtp.helo=postmaster@mail-oi0-f48.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of tom.j.ridge@googlemail.com) identity=pra; client-ip=209.85.218.48; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of tom.j.ridge@googlemail.com designates 209.85.218.48 as permitted sender) identity=mailfrom; client-ip=209.85.218.48; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-oi0-f48.google.com) identity=helo; client-ip=209.85.218.48; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="postmaster@mail-oi0-f48.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3Aoa39zBYDxE2rvDNsj/CtK7b/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpc2+bnLW6fgltlLVR4KTs6sC0LuL9fmwEj1YqdbZ6TZZL8wKD0dEwe?= =?us-ascii?q?wt3CUeQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYn?= =?us-ascii?q?br+tQt2ap42N2uuz45zeZRlTzHr4OOsqbUb+kQKEl9cfh8NNLbo21BDJo2dTM7?= =?us-ascii?q?BX22xAJF+eklD7/Mjmr7B59CEFh/Ukv/RBXar3N/AkSrkeDnI8Mmw66Y7vtALf?= =?us-ascii?q?ZQSI4XQYX2Afkx4OCA/AukKpFqztuzf347IukBKROtf7GPVtAWyv?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CVAACkEa9YhjDaVdFdGQEBAQEBAQEBA?= =?us-ascii?q?QEBBwEBAQEBFAEBAQEBAQEBAQEBBwEBAQEBhQ8Hg1SbY5AIkHkHQxQBAQEBAQE?= =?us-ascii?q?BAQEBARIBAQEICwsKHS+CMwQBHQEEghYBAQQBIwQZATgBAwELAQUFBAcDCioCA?= =?us-ascii?q?iISAQUBHAYTiAgDgVEBAw0IogA/jAOBbDqDCQWDXAoZJw2DfgELHgIGEospglG?= =?us-ascii?q?FCYJfBY9NjEeSJJERkWEUHoEVNoEhEhAPBB9TF4JbgUqCDUA1AYl2gU8BAQE?= X-IPAS-Result: =?us-ascii?q?A0CVAACkEa9YhjDaVdFdGQEBAQEBAQEBAQEBBwEBAQEBFAE?= =?us-ascii?q?BAQEBAQEBAQEBBwEBAQEBhQ8Hg1SbY5AIkHkHQxQBAQEBAQEBAQEBARIBAQEIC?= =?us-ascii?q?wsKHS+CMwQBHQEEghYBAQQBIwQZATgBAwELAQUFBAcDCioCAiISAQUBHAYTiAg?= =?us-ascii?q?DgVEBAw0IogA/jAOBbDqDCQWDXAoZJw2DfgELHgIGEospglGFCYJfBY9NjEeSJ?= =?us-ascii?q?JERkWEUHoEVNoEhEhAPBB9TF4JbgUqCDUA1AYl2gU8BAQE?= X-IronPort-AV: E=Sophos;i="5.35,198,1484002800"; d="scan'208,217";a="261834269" Received: from mail-oi0-f48.google.com ([209.85.218.48]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 23 Feb 2017 17:49:53 +0100 Received: by mail-oi0-f48.google.com with SMTP id 62so20502252oih.2 for ; Thu, 23 Feb 2017 08:49:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ov5wlCTjrxtzFj11TeIIGamlA9B6kYb18O4w6snhyzo=; b=FyqtGczTpchUdUtL9o4l9PEOlg3rwmvvD8OfbpgkHMh1StfUpyC3AixUGf2yb6ZrrZ y52lc7G0i6Q/+AtnGyp7aDTOEMw1XX/AZLea04Wlhb/Fraqn+2MKrMvLOFQcrskknR/i qMUDywscFshXFk7Zy9NnpXUN9jzgvkXKVmtAx/idAwyDyxWTX+TPjc3KP4K2zA18b8lj D1WDyMKc/JY/RYMyCxnkJbee6+pFrJjXNqHdI3q67XFw2Oja4S312J78Xbhjcg21osor JEgoxhB4KrQK4+0z6EsVvcMpq1ruTkh4h4srkSdfsUjBa3xFOWUXLXvlqlZVK+RHhKi+ UjHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ov5wlCTjrxtzFj11TeIIGamlA9B6kYb18O4w6snhyzo=; b=UDvkiOaG/kCUOxbUZz9zxM/tAhlIrtAYGDLcxIKDlZqxcSreaTIVi0e7nFnhl9yzDR Ez3iMCCiajKQhLAjTNoP1ljqKNcuRcyfEW3s6k830N4yEu8FmWTkcdLIZzj3/MSV/k/r 3DE+FrbSXlhAE77fe/w8NNOXZytupwhZmWiB6hVdm5b2Cl9bebz9gOlMNRZSu0rqwys4 Q3XIt0xYxahaL9/VAYHvRn8PefENQwZ+5I9xIRPQYmNetPeRXczSAALBo/UlXQsGNE5m hxHvPihMSKSWCY2AwVrla3oAkJJOHqLU0oqvZEsNqWEdpAooEi1H+XeU0hn/RCsoiwK2 9S9w== X-Gm-Message-State: AMke39n6Lp83bLiF0x/2m91/2S70r01dzIYrr4DUW/73jiMJrq3j64OfRCREdvsFURNqnMO6VV3ta63RYoBYMw== X-Received: by 10.202.213.76 with SMTP id m73mr12785890oig.122.1487868592673; Thu, 23 Feb 2017 08:49:52 -0800 (PST) MIME-Version: 1.0 Sender: tom.j.ridge@googlemail.com Received: by 10.74.144.129 with HTTP; Thu, 23 Feb 2017 08:49:32 -0800 (PST) In-Reply-To: References: From: Tom Ridge Date: Thu, 23 Feb 2017 16:49:32 +0000 X-Google-Sender-Auth: 95Ks0egSEG1B-AbueXZSxc-C-Mc Message-ID: To: Ivan Gotovchits Cc: caml-list Content-Type: multipart/alternative; boundary=001a113adaa4f05b570549356629 Subject: Re: [Caml-list] OCamldebug --001a113adaa4f05b570549356629 Content-Type: text/plain; charset=UTF-8 Regarding `#install_printer`, can you explain more? The type "Key_value_types.key" is equal to string (in this particular case). However, this type is produced via module application, and so I cannot construct a printer that can print values of type "Key_value_types.key" before program execution (which seems to be required for #install_printer). Somehow I seem to want to tell ocamldebug that Key_value_types.key is in fact equal to string. Or alternatively coerce kra (using Obj.magic) to string type so that it can easily be printed by ocamldebug? On 23 February 2017 at 16:31, Ivan Gotovchits wrote: > Probably it is an abstract type, that is represented as string. In any > case you can use the `#install_printer` directive to enable printing any > type. The argument > is a function of type `t -> Format.formatter -> unit`, where `t` is a name > of your type. > > On Thu, Feb 23, 2017 at 11:24 AM, Tom Ridge com> wrote: > >> Dear All, >> >> I am debugging some code. For various reasons I have started to use >> ocamldebug rather than printf. >> >> I should say that ocamldebug is excellent. Really excellent. Especially >> the "backwards" stepping. >> >> However, sometimes I want to see the value of a particular variable. I >> can use the "p" (print) command as: >> >> (ocd) p kra >> kra: Key_value_types.key = >> >> The problem is that I know that kra is a string. But ocamldebug only >> shows . >> >> Admittedly the code is functorized. But I have a feeling I should be able >> to tweak something to get ocamldebug to print the value of kra. >> >> Any ideas? >> >> T >> > > --001a113adaa4f05b570549356629 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Regarding `#install_printer`, can you explain more? The ty= pe "Key_value_types.key" is equal to string (in this particular c= ase). However, this type is produced via module application, and so I canno= t construct a printer that can print values of type "Key_value_types.k= ey" before program execution (which seems to be required for #install_= printer).=C2=A0

Somehow I seem to want to tell ocamldebu= g that Key_value_types.key is in fact equal to string. Or alternatively coe= rce kra (using Obj.magic) to string type so that it can easily be printed b= y ocamldebug?



On 23 February 2017 at 16:31, Ivan Go= tovchits <ivg@ieee.org> wrote:
=
Probably it is an abstract type, that is represented as st= ring. In any case you can use the `#install_printer` directive to enable pr= inting any type. The argument
is a function of type `t -> Format.for= matter=C2=A0-> unit`, where `t` is a name of your type.=C2=A0

On Thu, Feb 23, 2017 at 11:24 AM, Tom Ridge <tom.j.ridge+list@googlemail.com> wrote:
Dear All,

I = am debugging some code. For various reasons I have started to use ocamldebu= g rather than printf.

I should say that ocamldebug= is excellent. Really excellent. Especially the "backwards" stepp= ing.

However, sometimes I want to see the value of= a particular variable. I can use the "p" (print) command as:

(ocd) p kra
kra: Key_value_types.key = =3D <abstr>

The problem is that I know= that kra is a string. But ocamldebug only shows <abstr>.=C2=A0
=

Admittedly the code is functorized. But I have a feelin= g I should be able to tweak something to get ocamldebug to print the value = of kra.

Any ideas?

T


--001a113adaa4f05b570549356629--