This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
JokerRH's profile picture

debug library

Started by JokerRH, 06 February 2013 - 10:02 PM
JokerRH #1
Posted 06 February 2013 - 11:02 PM
Title: debug library

(suggestion) Is it possible to add the debug library? that would make debugging programs way easier…
(This mainly concerns the debug.getInfo() function)
sorry if I have to ask it here, but i cannot start a new topic yet.

thanks.
Cloudy #2
Posted 07 February 2013 - 04:29 AM
Nah. It is disabled because it could be used to break outside our sandbox - and we don't want that.
NeverCast #3
Posted 07 February 2013 - 10:25 AM
Not to mention hack every single application!
getLocal pl0x?

It could be used for some sweet hacks, but it could also be used very maliciously. I believe via the debug api you can import or call native functions, native in this case being Java. new File("/boot/vmlinuz").delete() anyone?

Hence why it is nil'd out by the sandbox. Sorry Joker.
JokerRH #4
Posted 07 February 2013 - 10:48 AM
Shure, but what about only functions that are 'harmless'. What I would need in my programs would be the debug.getInfo(…).name function for example to make a console.
Or, you said that it is "disabled". Is there a way to enable it?
tesla1889 #5
Posted 07 February 2013 - 11:52 AM
Nah. It is disabled because it could be used to break outside our sandbox - and we don't want that.

why not sandbox the debug library?

you did it for io and os
Cloudy #6
Posted 07 February 2013 - 02:22 PM
No, we didn't sandbox those libraries. We wrote our own replacements.
tesla1889 #7
Posted 07 February 2013 - 02:41 PM
No, we didn't sandbox those libraries. We wrote our own replacements.


ok. it still wouldnt be that hard to sandbox debug.

if you want, i could PM you a script that will do that as long as it's run while the debug library is still in play
Cloudy #8
Posted 07 February 2013 - 02:50 PM
No debug lib!
tesla1889 #9
Posted 07 February 2013 - 06:30 PM
here is a sandboxed debug
Cloudy #10
Posted 07 February 2013 - 08:28 PM
Tough, it isn't getting in. It is just too big of a security risk. Sorry.
tesla1889 #11
Posted 07 February 2013 - 09:34 PM
Tough, it isn't getting in. It is just too big of a security risk. Sorry.

i dont really care about it that much