src/dbgtool.c
/************************************************************************/
/*									*/
/*				b t					*/
/*									*/
/*	Print the names of the frames on the stack.  Equivalent to	*/
/*	the Lisp DEBUGGER's BT! command.				*/
/*									*/
/*		Changed		26 Aug 1987	NMitani			*/
/*		Changed   May 4, 1988	Take(for URaid)			*/
/*									*/
/************************************************************************/
b t

Print the names of the frames on the stack.  Equivalent to
the Lisp DEBUGGER's BT. command.

Changed         26 Aug 1987     NMitani
Changed   May 4, 1988   Take(for URaid)
b t Print the names of the frames on the stack . Equivalent to the Lisp DEBUGGER ' s BT . command . Changed 26 Aug 1987 NMitani Changed May 4 1988 Take ( for URaid )
void bt1(FX *startFX) {
  FX *fx;
  struct fnhead *fnobj;
  FX *get_nextFX(FX * fx);
  int fnum = 0;
  BT_lines = 0;
  fx = startFX;
  URaid_FXarray[fnum] = fx;
  printf("%3d : ", fnum++);
#ifdef BIGVM
  fnobj = (struct fnhead *)Addr68k_from_LADDR(fx->fnheader);
#else
  fnobj = (struct fnhead *)Addr68k_from_LADDR(((int)fx->hi2fnheader << 16) | fx->lofnheader);
#endif 
  printf("   0x%x : ", LADDR_from_68k(fx));
  print(fnobj->framename);
  putchar('\n');
  BT_morep;
  while ((fnobj->framename != ATOM_T) && (fx->alink != 11)) {
    if (fnum > URMAXFXNUM - 1) {
      printf("***There are more than 100 stack frames.\n");
      printf(
          "If you want to continue, Uraid will smash its internal table for FX pointer. Do you "
          "accept?(Y or N)\n");
      {
        int c;
        c = getchar();
        fflush(stdin);
        if ((c == 'Y') || (c == 'y')) {
          fnum = 0;
          memset(URaid_FXarray, 0, URMAXFXNUM * 4);
        } else
          goto bt1_exit;
      }
    }
    fx = get_nextFX(fx);
#ifdef BIGVM
    fnobj = (struct fnhead *)Addr68k_from_LADDR(fx->fnheader);
#else
    fnobj = (struct fnhead *)Addr68k_from_LADDR(((int)fx->hi2fnheader << 16) | fx->lofnheader);
#endif 
    URaid_FXarray[fnum] = fx;
    printf("%3d : ", fnum++);
    printf("   0x%x : ", LADDR_from_68k(fx));
    print(fnobj->framename);
    putchar('\n');
    BT_morep;
  }
  if (fnobj->framename != ATOM_T) {
    printf(">>root frame for contextsw<<\n");
    putchar('\n');
    BT_morep;
  }
bt1_exit:
  URaid_ArrMAXIndex = fnum - 1;
  URaid_currentFX = 0;
}
void bt1 ( FX * startFX ) { FX * fx ; struct fnhead * fnobj ; FX * get_nextFX ( FX * fx ) ; int fnum = 0 ; BT_lines = 0 ; fx = startFX ; URaid_FXarray [ fnum ] = fx ; printf ( " " , fnum ++ ) ; #ifdef BIGVM fnobj = ( struct fnhead * ) Addr68k_from_LADDR ( fx -> fnheader ) ; #else fnobj = ( struct fnhead * ) Addr68k_from_LADDR ( ( ( int ) fx -> hi2fnheader << 16 ) | fx -> lofnheader ) ; #endif printf ( " " , LADDR_from_68k ( fx ) ) ; print ( fnobj -> framename ) ; putchar ( ' \n ' ) ; BT_morep ; while ( ( fnobj -> framename != ATOM_T ) && ( fx -> alink != 11 ) ) { if ( fnum > URMAXFXNUM - 1 ) { printf ( " \n " ) ; printf ( " " " \n " ) ; { int c ; c = getchar ( ) ; fflush ( stdin ) ; if ( ( c == ' ' ) || ( c == ' ' ) ) { fnum = 0 ; memset ( URaid_FXarray , 0 , URMAXFXNUM * 4 ) ; } else goto bt1_exit ; } } fx = get_nextFX ( fx ) ; #ifdef BIGVM fnobj = ( struct fnhead * ) Addr68k_from_LADDR ( fx -> fnheader ) ; #else fnobj = ( struct fnhead * ) Addr68k_from_LADDR ( ( ( int ) fx -> hi2fnheader << 16 ) | fx -> lofnheader ) ; #endif URaid_FXarray [ fnum ] = fx ; printf ( " " , fnum ++ ) ; printf ( " " , LADDR_from_68k ( fx ) ) ; print ( fnobj -> framename ) ; putchar ( ' \n ' ) ; BT_morep ; } if ( fnobj -> framename != ATOM_T ) { printf ( " \n " ) ; putchar ( ' \n ' ) ; BT_morep ; } bt1_exit : URaid_ArrMAXIndex = fnum - 1 ; URaid_currentFX = 0 ; }
b t
b t
/* BIGVM */ /* Internal buf overflow,more than 100 stacks */ /* BIGVM */