Debugger Console View

hey,

i am currently implementing a debugger for Corona. The debugger (or better said, the debugger actions) are working, but the Console is not.
In my DebugRunner (extending ProgramRunner) i return my sessions RunContentDescriptor in the doExecute(...) method. My Console got, a Listener to StdOut which should print to the console (something like console.print("fizzbuzz")). The Listener is executed, my console got the message but the Console Tab is not displaying anything.

Any help or advise? Questions about my source?

I apperently get the feeling i know IntelliJ's Source better than my own, but still can't figure out why stuff is not working. I even compared the "new RunContentBuilder(exeResult, environment).showRunContent(session.getRunContentDescriptor);" [this works, i don't know why...] to the "session.getRunContentDescriptor();" Queue/stacktrace/building process/whatever you want to call it. I can't really see a difference, both ways are, more or less, executed the same way. Still the desireable way is not working (session.getRunCo.... you get the drift).

 

Here is what i am trying to achieve:

and here what is working but i don't want to have:

my code:

@Nullable
@Override
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException {
FileDocumentManager.getInstance().saveAllDocuments();

runProfileState = state;
environment = env;

session = XDebuggerManager.getInstance(env.getProject()).startSession(env, new CoronaDebugProcessStarter(this));

// ofc, one is commented out in the real code
return session.getRunContentDescriptor(); // not working stuff
return new RunContentBuilder(executionResult, environment).showRunContent(session.getRunContentDescriptor()); // working
0
32 comments

Hi, you need to use XDebuggerManager.startSessionAndShowTab, this will initialize debugger tabs.

And override your debug process createConsole to return your own console.

0
Avatar
Felix Dörschner

Thank you for your response. 

  1. If i use your mentioned method i get two consoles. Sadly both of them not working,
  2. createConsole uses my own console. If i debug everything and look into the values, everything there does have my Console. The session, the "new RunContentBuilder", everything :/

Any other idea?

0

Ok, do not use startSessionAndShowTab, use startSession :)

If you see your console inside XDebugSessionTab, try to debug ConsoleViewImpl.print, are you getting there?

0
Avatar
Felix Dörschner

Yes I do. The second picture actually shows, that my console is actually printing. But into the wrong ui. Overall the ConsoleViewImpl doesn't seem to be the problem. 

I actually compared both construction ways:

  1. new RunContentBuilder(executionResult, environment).showRunContent(session.getRunContentDescriptor())
  2. session.getRunContentDescriptor();

and both seem to be constructed in nearly the same way with the only difference, that the Console-ID ("ConsoleContent") is (1) from another enumaration than from the (2) one. Both are the same string though.

0

Also check your debug process doGetProcessHandler, it should return appropriate ProcessHandler, otherwise the process do not get startNotify

0
Avatar
Felix Dörschner

yes it is the correct ProcessHandler. Otherwise the "new RunContentBui....."-attempt wouldn't be working, would it?!

edit: Of course I checked that in Debug Mode, just to be sure that i don't work on assumptions here :D

0

RunContentBuilder does not depend on doGetProcessHandler, make sure that doGetProcessHandler returns executionResult.getProcessHandler()

To clarify where we are, you can see that ConsoleViewImpl.print is hit in debugger but the output does not go to the debugger console?

0
Avatar
Felix Dörschner

exactly! 

i implemented my own ConsoleViewRunningState, just to get Breakpoints and System Outputs (see.Screenshot)

the System.outs are printed and if I would toggle a breakpoint there, that ofc would be hit too...

0
Avatar
Felix Dörschner

I just checked my DebugProcess Impl. I did override doGetProcessHandler and it is returning what you said - the executionResult.getProcessHandler()

0

try to debug inside ConsoleViewImpl.flushDeferredText, if the console document text is updated, then probably console in the debugger tab is not the same in the end...

0
Avatar
Felix Dörschner

I checked that and overrid the method. It is still called and everytime "this" is my derivation (which does nothing on it's own, also a clone which is for me and system.outs)

Funny side effect i saw: i don't remember the exact moment when it happend, but this yellow arrow symbol, which is for "hey i updated" blinked twice (or thrice). Still the console was empty though

0
Avatar
Felix Dörschner

and please, remove this "Answered" Label since I don't know how and the question is not answered yet :D 

0
Avatar
Felix Dörschner

Uploaded it over uploads.jetbrains.com. Filename is: "Corona Lua Plugin.zip"

0

Hi, thanks!

With the provided sources I was able to reproduce the issue. However if I remove all extra code from CoronaDebugRunner.doExecute it starts working.

Please also try to restore debug toolwindow layout. It may have saved incorrect values.

0
Avatar
Felix Dörschner

Did you mean the "Restore Default Layout (Shift + F12)", right? That didn't work unfortunately :/ 

If you meant another funtion, could you please point out where it is? I am too blind to see it :D

0

Please also try to hide the console tab and show it again with an arrow button at the top right. Does content appear after that?

Or after restore layout?

0
Avatar
Felix Dörschner

Hey, thanks for all the suggestions, tried both, both don't work :/ It's a mysterium for me why my stuff is working at your place :/

0

As a last resort, try to set a breakpoint at Java.awt.Container.remove(int) with a class filter "com.intellij.execution.ui.layout.impl.GridCellImpl$ProviderWrapper", do you stop there?

If so then your console is placed somewhere else (like new RunContentBuilder(executionResult, env).showRunContent(session.getRunContentDescriptor()) does):

0
Avatar
Felix Dörschner

First of all. I cannot really emphazise enough, how grateful I am for all your support.

But sadly, even this does not work :/ this is, what i was supposed to be doing, right?!

0

yes, this is correct... and is it hit in case you leave that "new RunContentBuilder(executionResult, environment).showRunContent(session.getRunContentDescriptor())" code before returning in doExecute? (it should)

 

0
Avatar
Felix Dörschner

yes, it does!

0

Unfortunately, I'm out of ideas. If I could reproduce it here, I'd definitely help you, sorry.

Please let me know when you know what it was.

0
Avatar
Felix Dörschner

And, unfortunately you were the first person who got this working :/ I got the "ready to deploy .jar"-file to one of my colleagues and he also had no messages.

So i think we can cut out some configuration problems that i got with my IDE.

The only resemblance we (my colleague and I) have is, that we both got the Lua plugin by sylvanaar installed (but not activated). Could that interfere with my plugin, even though only my Lua/Corona version is activated?

edit: what exactly did you do at the start? You got my ressources, installed the Corona SDK and started via Debug mode? Or did you do something else entirely?

edit2: I uninstalled the other Lua plugin now and started, but that did not help. Was a pretty wild guess though

0

This is strange, I opened your sources in 2016.1.2, compiled it and run it in debug mode.

In the opened IDEA I created a simple Lua project and debug it with with Corona SDK.

(With installed Lua plugin 1.0.87-145)

0
Avatar
Felix Dörschner

Does not work in 2015.0.3 (colleague) and 2016.1.1. But I guess the sources did not change that drastically from 2016.1.1 to 1.2, right?!

installed and activated Lua plugin? That should run into internal IDE problems (because of same file ending etc.)

0
Avatar
Felix Dörschner

"new" development... now no console at all is working. Neither the runcontenbuilder one, nor the session one :/

 

0
Avatar
Felix Dörschner

i have no idea... 

0

Please sign in to leave a comment.