TelluIoT / ThingML

The ThingML modelling language
https://github.com/TelluIoT/ThingML
Apache License 2.0
101 stars 32 forks source link

How to generate debug code ? #260

Open fungiboletus opened 5 years ago

fungiboletus commented 5 years ago

It's not documented anywhere but it looks like a few debug annotations exist :

@debug "true"
@debug_fifo "true"
@debug_message_send ".*"
@debug_message_receive ".*"

I did put them in my configuration, but still no debug code is generated. Is there something more to do ?

brice-morin commented 5 years ago

As for now, I think we can consider debugging broken...

We need to revise the way we do debugging, possibly through a ThingML tool

fungiboletus commented 5 years ago

Alright. I patched the JSThingImplCompiler.java : if (debugProfile.isActive() || AnnotatedElementHelper.hasAnnotation(ctx.getCurrentConfiguration(), "debug")) {} Now it generates the code, which is good enough for me so you can take your time thinking about the new debugger.

brice-morin commented 5 years ago

Note that we now have a tool to instrument ThingML with logs (does not yet work for C, though). I can try do write some documentation about it.

ffleurey commented 5 years ago

Actually, the stuff that fungiboletus is deveopping could be a really good test / showcase for the tool you have made Brice and it runs in the browser.

brice-morin commented 5 years ago

Cool :-) I'll make a small tutorial, then

brice-morin commented 5 years ago

OK, this README.MD should get you started.

brice-morin commented 5 years ago

Note that the readme does not explain how to use the dashboard made by @nicolasferry :-) just to get raw logs out of your Thingml programs