From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q44MSbDQ020238 for ; Sat, 5 May 2012 00:28:37 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvMBAF9XpE9KfVIqkGdsb2JhbAArGrJjCCIBAQEBCQkNBxQEI4IJAQEBAwESAiwBATcBBAsLCxYlDwEEDRMBBQEiEyKHXAEDBgUEByqcIQkDimaEMQGFBQpADYlNBooLhwKWAoERii6DIz2EDA X-IronPort-AV: E=Sophos;i="4.75,533,1330902000"; d="scan'208";a="156826283" Received: from mail-wg0-f42.google.com ([74.125.82.42]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 05 May 2012 00:28:32 +0200 Received: by wgbds11 with SMTP id ds11so1607791wgb.3 for ; Fri, 04 May 2012 15:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=XEdzNFtv7tC2JqJjcEEvbnmzrnEzlK6EdfUXa/ubYYs=; b=YKk+uTfVcm3CwoE8EdF8z1EBUu72gk8ZQHs+oDOV8mTls4WYb2SLR408ZQou+d5kVz S7f+su/lGZSbFAgMjq6+q/PfjdpkJz5XvFa2y1MMSuYuLNVo2Ak945aeN5SjB5aqI2La K3oJGk9X1ujsvAxjdoCc4T2LrKKSzYni70KSL8EaVNJfkfpM4wLj1h7qp6txsd3yK+GX Ltbaok/f3t6tbhvC4Vs2L68hqnKdbKWkCucsal2TpfbeN62s+VIqw/i/p/o5eYK0WQNI I9YYGtVbVC3tUob65BgVhg93GGGJgz2gRjHhLLl61zavDLmTluxnMjX23QA0p8I4Nu1U 0Gfw== Received: by 10.216.144.228 with SMTP id n78mr1175526wej.100.1336170511704; Fri, 04 May 2012 15:28:31 -0700 (PDT) Received: from spec-desktop.danmey.org (cpc1-cmbg12-0-0-cust201.5-4.cable.virginmedia.com. [86.9.116.202]) by mx.google.com with ESMTPS id 6sm863377wiz.1.2012.05.04.15.28.29 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 May 2012 15:28:30 -0700 (PDT) From: Wojciech Meyer To: Joel Reymont Cc: caml-list@inria.fr References: Date: Fri, 04 May 2012 23:28:32 +0100 In-Reply-To: (Joel Reymont's message of "Fri, 4 May 2012 21:56:51 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Caml-list] debugging c wrappers Hello Joel, Joel Reymont writes: > How do I look inside the values in C functions called from OCaml when > running in gdb? > > I swear there's a way but I don't remember it now. > > For example, I want to check if a particular value is a variant > constructor and whether its first argument is a closure. > > Help! In general case this is not currently possible, but I think there is some work going on by OCamlPro for better gdb integration [1], if you are talking about showing precise types - as it needs some extra debug information. To see if it's a variant constructor, array, string or closure etc. you can look at the tag however. There is a Python script by Ygrek [2] that probably to some extent does what you want. - Wojciech [1] http://caml.inria.fr/mantis/view.php?id=5487 [2] http://ygrek.org.ua/p/code/mlvalues.py.html