I have recently added a few messages for when functions return without completing to give an idea as to the reason. I wondered if there is a variable or function which can be called to enter the line number this happened on to the message any how?
A quick Gooling and I saw mentions of C calls (which is calling a function written in C correct?) for debugging but didn’t fully understand or read that deeply. Would this be the only way to go about it? Are C calls even support in the API?
I’m using a lua-based error handling system with my dear relic vader. The idea is to execute all functions as protected calls (I think pcall() or xpcall() ), and exit those functions with an error() -function. When using error() in a protected call, the lua script won’t bog out, but just exit ‘gracefully’ and I kinda recall one of these (pcall() or xpcall()) will give some sort of stack report with line numbers and all. But I don’t think they present the line number as a single argument. In which case you’d have to parse the stack for the line number separately and maybe that’s not worth the trouble.
I’m pretty certain that the Renoise-native lua interpreter doesn’t come with such a feature -
but perhaps, you are thinking about the remdebug library?
Here’s a guide on how to work with that, but it’s relatively complex to set up and use.
Most of the time, running an external debug is overkill and simple print statements would suffice.
Personally, I use this pseudo-secret feature in Renoise
print(“Some normal text”)
print("*** Some shaded text")
The asterisks will offer shaded output instead of the normal output.
Along with the pattern-maching TRACE method in Duplex, this is able to cover most of my debugging needs
My scripts are so basic that just putting a little message (as I have) and maybe adding the name of the function will give me enough information to find the section to need, so not worth going into much effort if it’s not easily read. If it was I would have used it though. Thanks for the responses.