OC Systems

Home | Contact | Advanced Search 

Technology

How do I log the contents of an array?

You must specify the bounds of the array in the log statement:

probe thread
{
  probe <subprogram>
  {
    on_entry
    {
      log("Items = ", Items[0 .. 9]);
    }
  }
}

If the array bounds are dynamic (as most are), you can compute them first:

   on_entry
   {
     int last;
     for (last = 0; $Items[last] != 0; last++)
     {
       ; /* do nothing but count */
     }
     log ("Items = ", $Items[0 .. last-1]);
   }

Aprobe Technology Overview

Schedule a web demo

Contact us