> I hope I can.
> You have control on the Java process startup 
> (JpsBuiltInFlexCompilerHandler.startCompilerProcess()), you have source 
> code (intellij-plugins/flex/tools/BuiltInFlexCompiler), you have an IDE 
> that can debug and you know how Java debugger establishes connection. 
> That's all you need to debug. May be I'll find time to preconfigure a 
> project and to write detailed steps, but I hope you'll be able to set up 
> without waiting for it.

So, what I did this:

1- Import each of the builtInFlexCompiler modules into a module group
2- Removed the Libs SDK 3.5 / 4.0 / 4.5 and added SDK 3.6 / 4.6
3- added 
-agentlib:jdwp=transport=dt_socket,server=n,address=AsusFred-PC:5661,suspend=y 
to the JpsBuiltInFlexCompilerHandler.startCompilerProcess().
4- Create a new remote debug conf to listen to it.

And it works but would have like to know if there was a cleaner way, I would 
rather attach to the process instead but I wasn't able to setup the conf 
correctly for that.
I can debug and that's the most important, thank you, I will anyway look 
forward to see your solution.

Frédéric THOMAS

> Subject: Re: [IDEA-FlexPlugin] Setup Instructions
> To: dev@flex.apache.org
> From: alexander.doros...@jetbrains.com
> Date: Thu, 10 Sep 2015 16:10:11 +0300
> 
> On 10.09.2015 15:26, Frédéric THOMAS wrote:
> >>> Now, what is the best setup to be able to debug the
> >>> BuiltInFlexCompiler or any other tool?
> >> I added instructions to readme about compiler process debugging.
> > Your instructions are clear
> 
> I'm happy if you find them clear as they are really concise. Only 3 
> sentences are relevant:
> > Compiler is started as a separate Java process (see 
> > com.intellij.compiler.server.BuildManager#launchBuildProcess). In its 
> > turn it starts one more Java process for the Flex compiler (see 
> > JpsBuiltInFlexCompilerHandler#startCompilerProcess).
> > To debug Flex compiler itself you need to setup a project based on the 
> > sources from the corresponding zip files located in 
> > intellij-plugins/flex/lib, configure Remote Debug configuration and 
> > add required VM options to the 
> > JpsBuiltInFlexCompilerHandler.startCompilerProcess() method.
> 
> I noticed an error in these instructions as zips do not contain sources 
> of the flex-compiler.jar. Sources are in 
> intellij-plugins/flex/tools/BuiltInFlexCompiler and subfolders. I'll fix 
> readme. There's a project (.idea folder) configured in this folder but 
> it is not ready to use out-of-the-box. I didn't write any instructions 
> for it yet, I didn't adapt it for external contributors and didn't 
> update it for several years. You may try to base on it or configure your 
> own new project that would contain all sources from this folder.
> 
> > but I probably missed something else because I can't break into the 
> > built-in compiler, neither in implementation of 
> > FlexCompilationTasks->doStart() or FlexCompilationUtils->buildCommand(), 
> > can you help ?
> 
> I hope I can.
> You have control on the Java process startup 
> (JpsBuiltInFlexCompilerHandler.startCompilerProcess()), you have source 
> code (intellij-plugins/flex/tools/BuiltInFlexCompiler), you have an IDE 
> that can debug and you know how Java debugger establishes connection. 
> That's all you need to debug. May be I'll find time to preconfigure a 
> project and to write detailed steps, but I hope you'll be able to set up 
> without waiting for it.
> 
                                          

Reply via email to