Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jbrave
Channel Surfer

loss of contextual data in functions on STOP or BREAK

I've been encountering this in various circumstances when trying to debug various functions. When the function encounters a STOP command or is interrupted with ctrl-c, most of the variables are invalid or uninitialized. This most often seems to occur in functions that have roURLTransfers in them (which is really a pain as these are the ones I most need data from), especially functions containing asynchronous transfers.

Has anyone else seen this?

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
6 REPLIES 6
destruk
Binge Watcher

Re: loss of contextual data in functions on STOP or BREAK

I'm sure it's a valid issue. What you could do is enable logging with telnet
telnet -f c:\log.txt 192.168.1.xxx 8085

Then you could use prints throughout the execution of your app for debugging and log all the prints of all the variables you are wanting to track in realtime.
0 Kudos
kbenson
Visitor

Re: loss of contextual data in functions on STOP or BREAK

BrightScript is function scoped, so within a function all variables besides ones assigned inside or passed in would be invalid. If you referring to variables you are assigning in the function itself, I would think they should have a value, but maybe it's an out-of-order execution of operations thing (language optimization).

You can use "up" to move the debugger context p the function chain if you want to see the state of other portions of your code.
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos
renojim
Community Streaming Expert

Re: loss of contextual data in functions on STOP or BREAK

My big problem with pressing Ctrl-C to interrupt execution is that it more often than not exits to the main menu and I can't do anything. I don't know if stop produces the same behavior, but it's annoying that Ctrl-C does.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
TheEndless
Channel Surfer

Re: loss of contextual data in functions on STOP or BREAK

"renojim" wrote:
My big problem with pressing Ctrl-C to interrupt execution is that it more often than not exits to the main menu and I can't do anything. I don't know if stop produces the same behavior, but it's annoying that Ctrl-C does.

-JT

I have that problem using PuTTY, but not with Windows telnet, so that could be some obscure setting in your telnet client.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
jbrave
Channel Surfer

Re: loss of contextual data in functions on STOP or BREAK

The issue is within the context of a function, and the up / down thing does not always work. I sometimes even get a "no source" prompt from the debugger, like it loses even the little bit of information it has in its tiny brain at this point. The one thing that does work though is the "last" command.

"destruk" wrote:
I'm sure it's a valid issue. What you could do is enable logging with telnet
telnet -f c:\log.txt 192.168.1.xxx 8085

Then you could use prints throughout the execution of your app for debugging and log all the prints of all the variables you are wanting to track in realtime.


Yeah, this is a good idea. Hey, didn't the Roku folks promise us an upgrade to the debugger for Christmas last year?

viewtopic.php?f=34&t=32853&p=207252&hilit=debugger#p206861
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
renojim
Community Streaming Expert

Re: loss of contextual data in functions on STOP or BREAK

"TheEndless" wrote:
I have that problem using PuTTY, but not with Windows telnet, so that could be some obscure setting in your telnet client.

Thanks! I'm using PuTTY. I'll have to try something different. Did you find a way to get PuTTY to work?

Edit: I just tried Windows telnet - same thing. 😞
Edit #2: Windows telnet seemed to work most of the time, but not every time. I turned off the "Return key sends Telnet New Line instead of ^M" setting in PuTTY under Connection-Telnet and PuTTY seems to work much better, but still not every time.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos