From users-return-3826-archive-asf-public=cust-asf.ponee.io@groovy.apache.org Thu Nov 22 13:27:23 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C9078180645 for ; Thu, 22 Nov 2018 13:27:22 +0100 (CET) Received: (qmail 99626 invoked by uid 500); 22 Nov 2018 12:27:21 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 99616 invoked by uid 99); 22 Nov 2018 12:27:21 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Nov 2018 12:27:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 4E03718CB01 for ; Thu, 22 Nov 2018 12:27:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.701 X-Spam-Level: X-Spam-Status: No, score=-0.701 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id OlbSoZVGnHOz for ; Thu, 22 Nov 2018 12:27:19 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id E5D1260FC8 for ; Thu, 22 Nov 2018 12:27:18 +0000 (UTC) Received: from [192.168.1.4] ([77.190.33.194]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lqhaw-1flXa32CMU-00eIe0 for ; Thu, 22 Nov 2018 13:27:17 +0100 Subject: Re: Breakpoints aren't working on NetBeans for dynamically loaded Groovy To: users@groovy.apache.org References: From: Jochen Theodorou Message-ID: <1e50ad0a-984f-5e23-88fc-2fd8a176c616@gmx.org> Date: Thu, 22 Nov 2018 13:27:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:dCMW1Vo9ZpV8H2m2erRhLW15rT9b617lNPGvsQGWP/KOynYt6oN dTHokBRTUmGXq1Kc3gs4mFA4V45/tqPpqe6Ip3d0pCsLrEWalSe9J902ALmgj31mnVz4MuG B84/UdNJOnVmBLu+xyVhB6quWDeAwUCOEv5Ui/Jz3nGmZysBkBPx3LUmvQmDNrpn+/r5vbp kQI7AhWLfhwDCN92bCYUw== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZedNB38uGPM=:dW+jV1ZP8gtjM93YcwCJkK UQinrGf4gVzM6T6WkgghOESMqoR5uNlrTuRcj0SpuHd2SwUuxl+NbOlQ7T49Chtdmkw+uI4k/ eum9dxUIBYGOC1us5E42sM95peWexU325iSJ0TZ6ykZgpRBdtQ9CfAPDMQyY3ZpJjmwB/krhu 6txy5SmPsQOgNzR+sgo9/X25Bm3MUWR5Tp6ZceiHTGbqo3LPlnPX/SSptK2acocC4NYAXGNHM PIP2sqHlwnnPIokHpv8kQhtKcw1c3R3RvpVDo+HoY2M+VHbViWbPFfJKTlc0xPdTulUqQmv1o Wucv+anG3q+dDMsXD5od0vDv60S4O/KDUIWjRaccgtnULCQyDrjqYZ3niWXQo5rVdH96CiUpe ZmOjrNLzCRo5RYZUZFcYKXbS5EEuWa5m+oRajvfr9axnqLVO7MdmUS0EV76Wmz5FBKsBw/p6O 6c8dWOoJ7SkFnGgnUG2+qiLyEJW/pqpI2Gp+TORP2XDoO37edK+oqCheG+zhP2KgK60B1gG9r uj4OIQ5lWxlvGPyTP24EV3o/S5CngCVgupcVrcGBpreJd4BJsKbXq75mpEuTQ1gZK3jgrICKq PJvLQHLnHy1QO8RnCeEJuIObM2NJ1JsZ/q0qmImdDx1U425AdARRusc5OCOOWZOA4LBBcOplL 5SPGrXkJHN+n2QsiiMsmQb3MlA9eMs6KwA12o/NGY0Pb30I2R1RNgXaZ7hU5o/TbZw3DTikMZ BP6xOCZbP+1WZx8kkNZBQTJbOiwUGRVwRq/Cts6hgPDXtjRufXKfehYGVDNDBhD5th/VjCNhw c6t8ZgpjqCdQDVJihoYwLfizHRx5nMZ5u1EmRik2W2kjqFGfbXmawTiNChI7VoEKps0w/Yk8E b1RPzmd+DgqjkGkwNGn9rIwgG6w6xc3wljcBOkpDAcJbHWNckpIuu6EqPjGD0w On 17.11.18 20:30, Blake McBride wrote: > Greetings, > > I am using Groovy 2.4.15 under NetBeans 8.2 and Java 8 on a 64 bit Linux > box. > > I am dynamically loading Groovy with the following code: > > if (groovyLoader == null) > groovyLoader = new GroovyClassLoader(GroovyClass.class.getClassLoader()); > groovyClass = groovyLoader.parseClass(new GroovyCodeSource(new File(path > + sourceFile)), false); > > > Doing it this way, when debugging the loaded class, I am able to set > breakpoints from within IntelliJ and it works as expected.  However, > NetBeans ignores the breakpoints. > > I do a similar thing with Java files, and NetBeans honors those breakpoints. since it works under Intellij, it means it cannot be broken totally on our side. Afaik both use the Java debugger behind the scenes. And afaik you just tell the debugger to stop at that line in that and that class. Or at that class in a certain method, maybe at a certain variable init.. To set a breakpoint in a groovy class You need thus to know the class name. Maybe Netbeans is unable to generate such a name for something that is not a regular source file? Frankly this is all very much speculation. I would actucally suggest you create an issue for netbeans to get somebody on the netbeans teams with knowledge on the debugger interface to notice it, and then we can continue to analyse this together. Since there is no real documentation about how to plant line number information in the bytecode to let jdb and others stop at the right position, this is all a lot of trial and error. We do have several issues around debugging we cannot really resolve, because we miss the required information. At least I have yet to meet a person that can tell me. Who knows, maybe there is one in the netbeans team. bye Jochen