ZeroBrane studio
#1
Hi,

has anyone been successful in using ZeroBrane studio ( http://studio.zerobrane.com/ , available "for free" at github https://github.com/pkulchenko/ZeroBraneStudio ) to debug MCS plugins? It sure looks like a really nice IDE with very advanced features, and it could probably be used for debugging as well, it only needs a bit of initial work - defining the "debugger metadata" to use.

I might give it a try, but I don't feel like it right now Smile Maybe later on.
Reply
Thanks given by:
#2
How does it compare with Decoda?
Reply
Thanks given by:
#3
Feature-wise it's almost like comparing notepad (Decoda) to MSVC (ZeroBrane). From what I've seen so far, I'm really impressed with the advanced features - mainly the ability to detect errors while typing (using undefined globals, type checking etc.) and perhaps it can even provide MCS-specific code completion.
Also it seems that it is multi-platform, so our Linux guys could finally get a Lua IDE that works on their OSs Smile
Reply
Thanks given by:
#4
(02-23-2014, 12:30 AM)xoft Wrote: Feature-wise it's almost like comparing notepad (Decoda) to MSVC (ZeroBrane). From what I've seen so far, I'm really impressed with the advanced features - mainly the ability to detect errors while typing (using undefined globals, type checking etc.) and perhaps it can even provide MCS-specific code completion.
Also it seems that it is multi-platform, so our Linux guys could finally get a Lua IDE that works on their OSs Smile

Xoft, glad you liked the IDE. You should be able to try debugging MCS plugins with ZBS; I have instructions for "generic" remote debugging with ZBS here: http://studio.zerobrane.com/doc-remote-debugging.html . You can also specify MCS-specific auto-complete information; I've posted documentation and examples on how this can be done here: http://studio.zerobrane.com/doc-api-auto-complete.html . There are also several API descriptions for various engines in api/lua folder.

I'll be checking the thread in case you decide to give it a try and have any questions Wink... Paul.
Reply
Thanks given by:
#5
Paul's links are 404ing on me, because the forum linkified the dot as well. For those wondering, the correct links are:
http://studio.zerobrane.com/doc-remote-debugging.html
http://studio.zerobrane.com/doc-api-auto-complete.html
Thanks, Paul. Smile

The API definition docs examples seem a bit mis-formatted, my firefox is truncating the code without providing any scrollbar.

With any luck, we could generate the autocompletion data by our APIDump plugin.
Reply
Thanks given by:
#6
I tried to use remote debugging in my own project but it didn't work at all. I have compiled Lua into my project (static linked), could this be the problem and should I use the dll?
Reply
Thanks given by:
#7
Is there any documentation on adding a new "interpreter"? I'd like to try my luck with adding MCServer as the interpreter, but the existing interpreters are pretty dense with code, it's rather discouraging.
Reply
Thanks given by:
#8
(somehow the two responses have merged...)

(02-24-2014, 05:19 PM)xoft Wrote: Paul's links are 404ing on me, because the forum linkified the dot as well.

Indeed. I updated the post to add space before the dot. Thanks for the heads up!

> The API definition docs examples seem a bit mis-formatted, my firefox is truncating the code without providing any scrollbar.

Yes, there are some long lines, but they should copy just fine. Still I'll update them to fit on the screen.

> Is there any documentation on adding a new "interpreter"? I'd like to try my luck with adding MCServer as the interpreter, but the existing interpreters are pretty dense with code, it's rather discouraging.

Take a look here: http://studio.zerobrane.com/doc-plugin.h...nterpreter . It's described as part of the plugin interface, but the interpreter code is exactly the same: in one case it's returned (from the interpreter) and in another it's used in AddInterpreter call.

Also, since you'd need to integrate auto-complete/API descriptions, you can do it from the plugin as well, which will leave you with one file instead of two. I'm working on a plugin repository that should provide an easy way to distribute and install those plugins.

Paul.

(02-24-2014, 10:54 PM)FakeTruth Wrote: I tried to use remote debugging in my own project but it didn't work at all. I have compiled Lua into my project (static linked), could this be the problem and should I use the dll?

Yes, this can be problematic. What happens is this: you have an internal interpreter (statically linked), but socket library is linked against lua51.dll that is included with ZBS. So when you do require"socket" (directly or indirectly through require"mobdebug"), it loads socket.dll, which loads lua51.dll and you end up with two lua engines (and one of them may be "normal" lua and another LuaJIT), which leads to a crash.

There are two ways to deal with it:

(1) statically compile luasocket into your executable that has lua interpreter. That's what some engines do, like love2d.
(2) use a "proxy" DLL that replaces lua51.dll and will simply forward calls to your "static" executable. You can see some details here (http://studio.zerobrane.com/doc-lua52-debugging.html ) described in the context of Lua52 interpreter, but the same thing applies to statically compiled lua51 interpreter as well.

I can provide a proxy DLL if you want to experiment with it. In fact, I've been thinking about including it in the build/ folder of the IDE for cases like this. You'd just need to drop it into the same folder as your executable and the debugging should work.
Reply
Thanks given by:
#9
Working with ZBS is a bit cumbersome due to the fact that our plugins can span over multiple files, the studio has hard time dealing with that. For example the project analysis only works on a single file, not on the entire "plugin" (in the MCS sense).

As for the interpreter, I don't quite follow what all those functions get for parameters and what they are expected to do and what to return.

The API part will be difficult, too, since some of our API functions are overloaded - they support multiple different sets of parameters, although technically they are all under the same function name. Take for example the constructors for cBoundingBox class ( http://mc-server.xoft.cz/LuaAPI/cBoundingBox.html ) - there are four of them. I haven't seen anything in the ZBS API specs that would allow this.
Reply
Thanks given by:
#10
> Working with ZBS is a bit cumbersome due to the fact that our plugins can span over multiple files, the studio has hard time dealing with that. For example the project analysis only works on a single file, not on the entire "plugin" (in the MCS sense).

Do you mean static code analyzer? Yes, the analysis is done only in the current file. The rest of the functionality doesn't depend on any particular project/file structure.

> As for the interpreter, I don't quite follow what all those functions get for parameters and what they are expected to do and what to return.

The "interpreter" logic sets some parameters (like redirect) and calls whatever executable is needed. For "normal" Lua interpreter, it's "lua" or "lua.exe". The bulk of the functionality is to figure out where the executable is on different platform and how to run it with the current file/project.

> The API part will be difficult, too, since some of our API functions are overloaded - they support multiple different sets of parameters, although technically they are all under the same function name. Take for example the constructors for cBoundingBox class ( http://mc-server.xoft.cz/LuaAPI/cBoundingBox.html ) - there are four of them. I haven't seen anything in the ZBS API specs that would allow this.

You are right; there is nothing that handles overloaded functions. In one case where this came up I suggested to use one signature to specify args/returns and put the rest in the description itself. I've been thinking about ways to support this, but it's not likely to be implemented earlier than v0.42.

Here is an example of how this may look:

return {
cBoundingBox = {
args = "(MinX, MaxX, MinY, MaxY, MinZ, MaxZ)",
description = [[(cBoundingBox) cBoundingBox (OtherBoundingBox)
(cBoundingBox) cBoundingBox (Min, Max)
(cBoundingBox) cBoundingBox (Pos, Radius, Height)
Creates a new bounding box...
]],
returns = "(cBoundingBox)",
type = "function"
},
}

Save this as api/lua/mc.lua and add "mc" to api = {"wxwidgets","baselib","mc"} in interpreters/luabase.lua if you want to enable this in "default" Lua interpreter.
Reply
Thanks given by:




Users browsing this thread: 3 Guest(s)