From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 0D7CEBCAE for ; Wed, 13 Jul 2005 15:30:36 +0200 (CEST) Received: from salt.cs.brown.edu (salt.cs.brown.edu [128.148.32.122]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6DDUZhu006377 for ; Wed, 13 Jul 2005 15:30:35 +0200 Received: from localhost (localhost [127.0.0.1]) by salt.cs.brown.edu (Postfix) with ESMTP id 446B615B595 for ; Wed, 13 Jul 2005 09:30:58 -0400 (EDT) Received: from salt.cs.brown.edu ([127.0.0.1]) by localhost (salt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 20357-09 for ; Wed, 13 Jul 2005 09:30:58 -0400 (EDT) Received: from null.cs.brown.edu (null.cs.brown.edu [128.148.38.190]) by salt.cs.brown.edu (Postfix) with ESMTP id 33C3F15B591 for ; Wed, 13 Jul 2005 09:30:58 -0400 (EDT) Received: from point.cs.brown.edu (point [128.148.33.31]) by null.cs.brown.edu (Postfix) with ESMTP id DD2CC148005 for ; Wed, 13 Jul 2005 09:30:32 -0400 (EDT) Received: by point.cs.brown.edu (Postfix, from userid 30102) id CB7607CDC; Wed, 13 Jul 2005 09:30:32 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by point.cs.brown.edu (Postfix) with ESMTP id C057D4545F for ; Wed, 13 Jul 2005 09:30:32 -0400 (EDT) Date: Wed, 13 Jul 2005 09:30:32 -0400 (EDT) From: "Nathaniel J. Gaylinn" X-X-Sender: ngaylinn@point To: caml-list@yquem.inria.fr Subject: OCamldebug breakpoint issues (fwd) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at cs.brown.edu X-Miltered: at nez-perce with ID 42D5177B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocamldebug:01 breakpoints:01 ocamldebug:01 bignum:01 bignum:01 breakpoints:01 something's:01 debugger:01 rec:01 rec:01 arbitrary:01 seems:03 module:03 let:03 let:03 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: I'm having trouble dealing with breakpoints in OCamldebug. The documentation seems to make it clear that you can set a breakpoint at any event in your program, but ONLY at an event. This makes sense to me. The problem is, in practice, I can't seem to set a breakpoint at an arbitrary event. For starters, I used "info events Bignum" to get a list of events for my module (its name is Bignum). Fine. I get a long list of event points. Then I started trying to set breakpoints at each event one after the other. That's when I began to see odd behavior. I can set breakpoints at some events with no difficulty. For instance, "break @ Bignum #31" sets a breakpoint at offset 31 just as it should. With other events, instead of setting a breakpoint where I requested, the breakpoint is put at some earlier event. For instance, "break @ Bignum #50" sets a breakpoint at offset 31. This is odd, since as far as I know I should be able to set a breakpoint at any event. Usually this earlier event is the one right before the event I requested, but sometimes its as many as three events back. What's truly baffling to me, though, is this: if I try to set an event at offset 185 (break @ Bignum #185) a breakpoint is created at offset 168, the event before the one I requested. However, when I try to set a breakpoint at offset 208, I get a breakpoint set at offset 185!!! Either something's very wrong here, or I have a fundamental misunderstanding about how the debugger works with breakpoints. Any tips or suggestions would be greatly appreciated. For reference, the file I refer to in this email is attached for reference. Thank you, -- Nate bignum.ml: let rec longAddWithoutCarry = function [], x -> x | x, [] -> x | hd1 :: tl1, hd2 :: tl2 -> hd1 + hd2 :: longAddWithoutCarry (tl1, tl2) let longAdd (lst1, lst2) = let rec helper = function [], [], 0 -> [] | [], [], carry -> [carry] | [], hd :: tl, carry -> (hd + carry) mod 10 :: helper ([], tl, (hd + carry) / 10) | hd :: tl, [], carry -> (hd + carry) mod 10 :: helper (tl, [], (hd + carry) / 10) | hd1 :: tl1, hd2 :: tl2, carry -> (hd1 + hd2 + carry) mod 10 :: helper (tl1, tl2, (hd1 + hd2 + carry) / 10) in helper (lst1, lst2, 0) let multAll prod lst = List.map (fun x -> x * prod) lst let timesTen lst = 0 :: lst let rec longMult = function [], num2 -> [] | hd :: tl, num2 -> longAdd (multAll hd num2, timesTen (longMult (tl, num2)));; longMult ([3; 2; 1], [2; 1]);; longMult ([2; 1], [3; 2; 1]);; longMult ([9; 7; 6; 5; 4; 3; 2; 1], [8; 1]);; longMult ([], [9; 9; 9; 9; 9; 9]);; longMult ([1], [9; 9; 9; 9; 9; 9]);; longMult ([1; 1; 1; 1; 1; 1; 1; 1; 1], [1; 1; 1; 1; 1; 1; 1; 1; 1]);; let rec forever a = forever a;;