
Oak-Beard
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2015
12:20 PM
monitoring the refcnt
Is it possible via the debugger to print the refcnt for an arbitrary variable? If I put a stop statement in my code the debugger will show the refcnt for the immediate scope:
The problem is that if i want to examine the contents of one the roAssociativeArrays I won't see the refcnt of it's contents. For example, i have defined an array 'cpx' that has as one entry a roScreen. Printing the array will not provide the 'refcnt' for the screen:
Is there any way I can get this info?
Thanks
Local Variables:
cpx roAssociativeArray refcnt=4 count:20
global rotINTERFACE:ifGlobal
m roAssociativeArray refcnt=5 count:11
port <uninitialized>
The problem is that if i want to examine the contents of one the roAssociativeArrays I won't see the refcnt of it's contents. For example, i have defined an array 'cpx' that has as one entry a roScreen. Printing the array will not provide the 'refcnt' for the screen:
BrightScript Debugger> print cpx
grid: <Component: roAssociativeArray>
port: <Component: roMessagePort>
activeslotcnt: 3
screen: <Component: roScreen>
Is there any way I can get this info?
Thanks
3 REPLIES 3
Rek
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2015
12:26 PM
Re: monitoring the refcnt
"Oak-Beard" wrote:
Is it possible via the debugger to print the refcnt for an arbitrary variable? If I put a stop statement in my code the debugger will show the refcnt for the immediate scope:
Local Variables:
cpx roAssociativeArray refcnt=4 count:20
global rotINTERFACE:ifGlobal
m roAssociativeArray refcnt=5 count:11
port <uninitialized>
The problem is that if i want to examine the contents of one the roAssociativeArrays I won't see the refcnt of it's contents. For example, i have defined an array 'cpx' that has as one entry a roScreen. Printing the array will not provide the 'refcnt' for the screen:
BrightScript Debugger> print cpx
grid: <Component: roAssociativeArray>
port: <Component: roMessagePort>
activeslotcnt: 3
screen: <Component: roScreen>
Is there any way I can get this info?
Thanks
Once in the debugger, you can assign an element of the AA to a temporary variable then use the `var` command to print the variables again. Something like:
BrightScript Debugger> myVar = cpx.grid
BrightScript Debugger> var
That should now print 'myVar' with a refcnt (increased by 1 for the local var).

Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2015
12:34 PM
Re: monitoring the refcnt
Wow, that's quite a nice trick to know 8-)

Oak-Beard
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2015
02:47 PM
Re: monitoring the refcnt
Thanks! This is exactly what I needed. Very very useful 😄