[BACK]Return to debug.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / parse

Diff for /OpenXM_contrib2/asir2000/parse/debug.c between version 1.11 and 1.17

version 1.11, 2001/12/25 02:39:06 version 1.17, 2006/02/25 06:33:31
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  *   *
  * $OpenXM: OpenXM_contrib2/asir2000/parse/debug.c,v 1.10 2001/10/09 01:36:23 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/parse/debug.c,v 1.16 2006/02/08 02:11:19 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
 #include <ctype.h>  #include <ctype.h>
 #if PARI  #if defined(PARI)
 #include "genpari.h"  #include "genpari.h"
 #endif  #endif
   
Line 216  void debug(SNODE f)
Line 216  void debug(SNODE f)
         extern int do_fep;          extern int do_fep;
         NODE pvss;          NODE pvss;
   
 #if !MPI && !defined(VISUAL)  #if !defined(MPI) && !defined(VISUAL)
         if ( !isatty(fileno(stdin)) && !do_server_in_X11 )          if ( !isatty(fileno(stdin)) && !do_server_in_X11 )
                 if ( do_file )                  if ( do_file )
                         ExitAsir();                          ExitAsir();
Line 355  void setf(int ac,char **av)
Line 355  void setf(int ac,char **av)
   
         if ( !ac )          if ( !ac )
                 return;                  return;
         searchf(usrf,av[0],&r);          searchuf(av[0],&r);
         if ( r ) {          if ( r ) {
                 targetf = r;                  targetf = r;
                 curline = targetf->f.usrf->startl;                  curline = targetf->f.usrf->startl;
Line 381  void setbp(char *p)
Line 381  void setbp(char *p)
         char *buf,*savp;          char *buf,*savp;
         char *fname;          char *fname;
         FUNC r;          FUNC r;
         USRF t;          USRF uf,t;
         SNODE *snp = 0;          SNODE *snp = 0;
         FNODE cond;          FNODE cond;
         NODE tn;          NODE tn;
Line 393  void setbp(char *p)
Line 393  void setbp(char *p)
         if ( !strcmp(av[0],"at") ) {          if ( !strcmp(av[0],"at") ) {
                 if ( !targetf )                  if ( !targetf )
                         return;                          return;
                 n = atoi(av[1]); fname = targetf->f.usrf->fname;                  n = atoi(av[1]);
                 for ( tn = usrf; tn; tn = NEXT(tn) ) {                  uf = targetf->f.usrf;
                   fname = uf->fname;
                   tn = uf->module?uf->module->usrf_list:usrf;
                   for ( ; tn; tn = NEXT(tn) ) {
                         r = (FUNC)BDY(tn); t = r->f.usrf;                          r = (FUNC)BDY(tn); t = r->f.usrf;
                         if ( t && t->fname && !strcmp(t->fname,fname)                          if ( t && t->fname && !strcmp(t->fname,fname)
                                 && ( t->startl <= n ) && ( n <= t->endl ) )                                  && ( t->startl <= n ) && ( n <= t->endl ) )
Line 408  void setbp(char *p)
Line 411  void setbp(char *p)
                 }                  }
                 at = 1; searchsn(&BDY(t),n,&snp);                  at = 1; searchsn(&BDY(t),n,&snp);
         } else if ( !strcmp(av[0],"in") ) {          } else if ( !strcmp(av[0],"in") ) {
                 searchf(usrf,av[1],&r);                  searchuf(av[1],&r);
                 if ( !r ) {                  if ( !r ) {
                         fprintf(stderr,"%s() : no such function\n",av[1]);                          fprintf(stderr,"%s() : no such function\n",av[1]);
                         return;                          return;
Line 494  void settp(char *p)
Line 497  void settp(char *p)
                 }                  }
                 at = 1; searchsn(&BDY(t),n,&snp);                  at = 1; searchsn(&BDY(t),n,&snp);
         } else if ( !strcmp(av[0],"in") ) {          } else if ( !strcmp(av[0],"in") ) {
                 searchf(usrf,av[1],&r);                  searchuf(av[1],&r);
                 if ( !r ) {                  if ( !r ) {
                         fprintf(stderr,"%s() : no such function\n",av[1]);                          fprintf(stderr,"%s() : no such function\n",av[1]);
                         return;                          return;
Line 700  void bp(SNODE f)
Line 703  void bp(SNODE f)
                 CPVS->usrf->name,ln,CPVS->usrf->f.usrf->fname);                  CPVS->usrf->name,ln,CPVS->usrf->f.usrf->fname);
         targetf = CPVS->usrf; curline = ln;          targetf = CPVS->usrf; curline = ln;
         println(0,0,1);          println(0,0,1);
 #if !MPI && !defined(VISUAL)  #if !defined(MPI) && !defined(VISUAL)
         if ( do_server_in_X11 || isatty(0) )          if ( do_server_in_X11 || isatty(0) )
 #endif  #endif
                 debug(f);                  debug(f);
Line 719  void println(int ac,char **av,int l)
Line 722  void println(int ac,char **av,int l)
         else if ( isdigit(av[0][0]) )          else if ( isdigit(av[0][0]) )
                 ln = atoi(av[0]);                  ln = atoi(av[0]);
         else {          else {
                 searchf(usrf,av[0],&r);                  searchuf(av[0],&r);
                 if ( r && r->id != A_UNDEF ) {                  if ( r && r->id != A_UNDEF ) {
                         targetf = r;                          targetf = r;
                         ln = r->f.usrf->startl;                          ln = r->f.usrf->startl;
Line 765  void printvars(char *s,VS vs)
Line 768  void printvars(char *s,VS vs)
                         val = eval(expr);                          val = eval(expr);
                 CPVS = cpvs;                  CPVS = cpvs;
                 if ( !err ) {                  if ( !err ) {
 #if PARI  #if defined(PARI)
 #if PARI1  #if defined(PARI1)
                         outfile = stderr;                          outfile = stderr;
 #else  #else
                         pari_outfile = stderr;                          pari_outfile = stderr;
Line 784  void printvars(char *s,VS vs)
Line 787  void printvars(char *s,VS vs)
 #if defined(VISUAL_LIB)  #if defined(VISUAL_LIB)
                         w_noflush_stderr(0);                          w_noflush_stderr(0);
 #endif  #endif
 #if PARI  #if defined(PARI)
 #if PARI1  #if defined(PARI1)
                         outfile = stdout;                          outfile = stdout;
 #else  #else
                         pari_outfile = stdout;                          pari_outfile = stdout;
Line 835  void showpos_to_string(char *buf)
Line 838  void showpos_to_string(char *buf)
                         buf += strlen(buf);                          buf += strlen(buf);
                 }                  }
         }          }
   }
   
   /* [[file,line,name],...] */
   
   extern int at_root;
   
   void showpos_to_list(LIST *r)
   {
           NODE n,u,u1,t;
           VS vs;
           STRING null,name,fname;
           LIST l;
           Q q;
   
           u = 0;
           if ( PVSS ) {
                   if ( cur_binf ) {
                           /* builtin : [0,0,name] */
                           MKSTR(null,"");
                           MKSTR(name,cur_binf->name);
                           t = mknode(3,null,name,0);
                           MKLIST(l,t);
                           MKNODE(u1,l,0); u = u1;
                   }
                   ((VS)BDY(PVSS))->at = evalstatline;
                   for ( n = PVSS; n; n = NEXT(n) ) {
                           vs = (VS)BDY(n);
                           MKSTR(fname,vs->usrf->f.usrf->fname);
                           STOQ(vs->at,q);
                           MKSTR(name,vs->usrf->name);
                           t = mknode(3,fname,name,q);
                           MKLIST(l,t);
                           MKNODE(u1,l,u); u = u1;
                   }
           }
           /* line number at the toplevel */
           MKSTR(fname,"toplevel"); STOQ(at_root,q);
           t = mknode(2,fname,q); MKLIST(l,t); MKNODE(u1,l,u); u = u1;
   
           MKLIST(*r,u);
 }  }
   
 void change_stack(int level,NODE *pvss)  void change_stack(int level,NODE *pvss)

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.17

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>