[BACK]Return to db.k CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097 / debug

File: [local] / OpenXM / src / k097 / debug / db.k (download)

Revision 1.1.1.1 (vendor branch), Fri Oct 8 02:12:15 1999 UTC (24 years, 7 months ago) by maekawa
Branch: OpenXM, MAIN
CVS Tags: maekawa-ipv6, R_1_3_1-2, RELEASE_20000124, RELEASE_1_3_1_13b, RELEASE_1_2_3_12, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, RELEASE_1_1_3, RELEASE_1_1_2, KNOPPIX_2006, HEAD, DEB_REL_1_2_3-9, ALPHA
Changes since 1.1: +0 -0 lines

o import OpenXM sources

if (K00_verbose) {
  Println(" debug/db.k (db.ccc), 1997, 3/2 (Sun) : checking debug functions of kxx");
  Println(" Type in test0(). ");
}

sm1(" /pushVariables {localVariables}  def ");
sm1(" /popVariables {restoreVariables} def ");
if (K00_verbose) {
  Println(" Overloaded on pushVariables and popVariables.");
}
sm1(" [(CatchCtrlC) 1] system_variable ");
sm1(" [(Strict) 1] system_variable ");
if (K00_verbose) {
  Println(" ctrl-C signal is caught in KSexecuteString() and <<Warning>> is regarded as an error.");
}

def test0() {
  sm1(" [(ErrorMessageMode) 2] system_variable ");
  sm1(" [(WarningMessageMode) 2] system_variable ");
  fib(15);
  sm1(" db.where.es ");  /* This line will not be executed. */
}

def void Where() {
  Println("CurrentContext is ...");
  sm1(" [(CurrentContextp)] system_variable {message} primmsg ");
  Println("VariableStack trace is....");
  sm1(" db.where ");
  Println("DebugStack trace is ....");
  sm1(" db.where.ds ");
  Println("To clear VariableStack, DebugStack and ErrorStack, type in Cleards().");
}

def void Cleards() {
  Print("Clearing DebugStack and ErrorStack...");
  sm1(" db.clear.ds db.clear.es ");
  Println(" ");
  Print("Restoring variables....");
  sm1(" db.restore  ");
  sm1(" [  ] localVariables ");  
  /* push [ ] for this function, otherwise this function exits with error.*/
  Println("Done");
}

def fib(n) {
  local ans,a,b;
  Print("fib of "); Println(n);
  if (n < 2) {return(1);}
  a = n-1; b = n-2;
  if (a == 11) {
    a[i] = 2;  /* We cause an error. */
  }
  ans = fib(a) + fib(b);
  return(ans);
}