capturing output of remote run process [message #24828] |
Tue, 03 June 2008 07:33  |
Eclipse User |
|
|
|
Hi All,
I am using eclipse 3.4M7 with 0.95RC2 DLTK and RSE-SDK-3.0RC1.
In my IDE,I am able to create a project in remote location (unix) with the
help of Remote System Explorer.
I am able to create scripts under that project in remote location. I have
set interpreter details of remote location and when I try to run the
script , it succesfully forms the command line and fires it. But I am not
getting any output in the console.
Is there any option to capture the output of the remote process and show
it in console?
Please Help.
regards,
Abhijit.
|
|
|
|
|
Re: capturing output of remote run process [message #25052 is a reply to message #24982] |
Thu, 05 June 2008 02:37   |
Eclipse User |
|
|
|
Hi Abhijit,
I suppose what problem is not in console. But in remote execution.
Could you please try to debug RSEExecEnvironment.exec() method from org.eclipse.dltk.rse.core plugin.
This method is called on command execution for remote host. To check that is works, please add System.out.println() in
MyHostShellProcessAdapter.shellOutputChanged() method. All output from RSE execution are came here.
Do you use ssh or dstore connection? Does your remote host contain "bash"?
We called it as command interpreter. This unifies passing of environment variables, etc.
Best regards,
Andrei Sobolev.
> Hi Andrei,
> Thank you for your help. I would reiterate our query to be more clear.
>
> I have created my IDE for our domain language using DLTK framework
> (using eclipse 3.4M7 with 0.95RC2 DLTK and RSE-SDK-3.0RC1.) We have
> referred ruby IDE for the same.
>
> -> 1) Do you use DLTK launching infrastructure? Or you have your own.
> We are using DLTK launching infrastructure.
>
> -> 2) Does it not work only for Remote projects? And work for local.
>
> Yes.
> I have created scripts under both local as well as remote projects. I
> have set interpreter details for both locations (local and remote).
>
> when I try to run the local script (in local project),it succesfully
> forms the command line and fires it and shows the output in console of
> IDE. But when I try to run the remote script (in remote project),it
> succesfully forms the command line and fires it but does not show the
> output in console of IDE. i.e. It shows the output in the console only
> for scripts in local projects but not for scripts in Remote projects.
>
> ->3) Do you want to use standard eclipse input/output console, provided
> by debug plugin? Or you want your own console?
>
> Yes, I want the output of scripts (for remote project) execution to be
> displayed in standard console provided by DEbugPlugin.
> I tried to set IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE to null in
> launch method of LaunchConfigurationDelegate in following way :
>
> launch.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOL E, null);
>
> Here launch is an object of ILaunch. But it doesn't work. Is this the
> right way or am I doing it wrongly?
>
> Please Help.
>
> Thanks & regards,
> Abhijit.
>
|
|
|
|
Re: capturing output of remote run process [message #25380 is a reply to message #25340] |
Tue, 10 June 2008 02:11   |
Eclipse User |
|
|
|
Hi Abhijit,
We have fix in 0.95RC3, which uses endsWith() in this place.
Could you please check 0.95RC3.
Best regards,
Andrei Sobolev.
> Hi Andrei,
>
> I have done as you said i.e to put System.out.println() in
> MyHostShellProcessAdapter.shellOutputChanged() method.
>
> I have checked the output in the method and it is coming in the method.
> However, in this method there is a for loop, inside which we are
> checking "if (line.trim().equals(this.pattern1)) ". But in our case,
> when we log on to unix terminal, we have to chose a module area and then
> command prompt appear. Hence, there is a mismatch in the output. The
> pattern appears in form "<command prompt>pattern1"; hence the equals
> method fails.
>
> So in this case we changed the if statement to use endswith instead of
> equals-"if (line.trim().endsWith(this.pattern1))". When we do this
> change, the output appears in the console.
> Can we somehow get a handle at this point to customise the method to
> follow our logon procedure into unix terminal and then call
> MyHostShellProcessAdapter.shellOutputChanged() so that the existing code
> may work?
>
> Thanks & regards,
> Abhijit.
>
>
|
|
|
|
|
|
|
Re: capturing output of remote run process [message #26093 is a reply to message #25806] |
Tue, 17 June 2008 02:40  |
Eclipse User |
|
|
|
hi Andrei,
There is one more possible solution. The second if condition shown below-
if (trimLine.endsWith(this.pattern1)) {
if (!trimLine.equals(this.pattern1)) {
//code goes here
}
}
can be changed to - if ((prefixCounter == 1) &&
!trimLine.equals(this.pattern1)) {}
So that the second condition will be tested only for closing pattern and
not for opening.
Thanks & regards,
Abhijit.
|
|
|
Powered by
FUDForum. Page generated in 0.05378 seconds