Thanks Jinfeng, that was helpful.  This web page provides ways to look at the 
generated source under "Debugging":  http://unkrig.de/w/Janino
Dave Oshinsky

-----Original Message-----
From: Jinfeng Ni [mailto:jinfengn...@gmail.com] 
Sent: Tuesday, June 07, 2016 2:46 PM
To: dev
Subject: Re: generation and compilation of code at runtime?

You can not set break point in the run-time generated code; IDEA does not have 
the source code, since it's generated in run-time dynamically.

However, you can check the generated source code by enabling log of 
"JaninoClassCompiler" (or JDKClassCompiler in case large source file) and look 
for the source code in log. FilterTemplate2.java:51 should match the line 
number in the generated source code.  You may also set break point at 
ProjectRecordBatch.innerNext(ProjectRecordBatch.java:12
or MaterializedField.getPrecision(MaterializedField.java:169), either the 
caller of generated method, or the method called by the generated code.

Hope this helps.


On Tue, Jun 7, 2016 at 11:21 AM, Dave Oshinsky <doshin...@commvault.com> wrote:
> I'm trying to debug what's going on with 
> https://issues.apache.org/jira/browse/DRILL-4704.  Some selects involving an 
> equality test for a decimal value don't work properly (details in the JIRA).  
> With Intellij IDEA debugger remotely attached to Drill 1.6.0, I'm seeing some 
> stack frames like these:
>
> "28a8f4b3-7e41-05d9-e4d6-aa63d3717bee:frag:0:0@9112" daemon prio=10 tid=0x3c 
> nid=NA runnable
>   java.lang.Thread.State: RUNNABLE
>           at 
> org.apache.drill.exec.record.MaterializedField.getPrecision(MaterializedField.java:169)
>           at 
> org.apache.drill.exec.test.generated.ProjectorGen0.doEval(ProjectorTemplate.java:43)
>           at 
> org.apache.drill.exec.test.generated.ProjectorGen0.projectRecords(ProjectorTemplate.java:62)
>           at 
> org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.doWork(ProjectRecordBatch.java:172)
>           at 
> org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:93)
>           at 
> org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNe
> xt(ProjectRecordBatch.java:12
> ...
> 28a8f4b3-7e41-05d9-e4d6-aa63d3717bee:frag:0:0@9112" daemon prio=10 tid=0x3c 
> nid=NA runnable
>   java.lang.Thread.State: RUNNABLE
>           at 
> org.apache.drill.exec.record.MaterializedField.getScale(MaterializedField.java:166)
>           at 
> org.apache.drill.exec.test.generated.FiltererGen1.doEval(FilterTemplate2.java:51)
>           at 
> org.apache.drill.exec.test.generated.FiltererGen1.filterBatchNoSV(FilterTemplate2.java:99)
>           at 
> org.apache.drill.exec.test.generated.FiltererGen1.filterBatch(FilterTemplate2.java:72)
>           at 
> org.apache.drill.exec.physical.impl.filter.FilterRecordBatch.doWork(Fi
> lterRecordBatch.java:82)
> ....
>
> In either case, the indicated FilterTemplate2 or ProjectorTemplate is in a 
> different package org.apache.drill.exec.test.generated  than that of the 
> corresponding Java in the Drill 1.6.0 source code, and line numbers don't 
> match.  For someone who is trying to understand what's going on using the 
> debugger (usually a good strategy), it's difficult to follow what is 
> happening at runtime.  It's looking like code is generated from the template 
> code at runtime, compiled at runtime, and that's why I'm unable to debug 
> symbolically into those classes.
>
> Can someone who understands Drill far better than I do shed some light?  What 
> is a good way to debug this problem?
>
> Thanks,
> Dave Oshinsky
>
>
>
>
>
> ***************************Legal Disclaimer***************************
> "This communication may contain confidential and privileged material 
> for the sole use of the intended recipient. Any unauthorized review, 
> use or distribution by others is strictly prohibited. If you have 
> received the message by mistake, please advise the sender by reply email and 
> delete the message. Thank you."
> **********************************************************************




***************************Legal Disclaimer***************************
"This communication may contain confidential and privileged material for the
sole use of the intended recipient. Any unauthorized review, use or distribution
by others is strictly prohibited. If you have received the message by mistake,
please advise the sender by reply email and delete the message. Thank you."
**********************************************************************

Reply via email to