Changeset 64d729 in git


Ignore:
Timestamp:
Apr 15, 1999, 7:28:06 PM (24 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
dd9b83cb6123e79d811d45dd8b7d79c748f994e6
Parents:
1518b9cf23aa2598228863099857cedec82668c2
Message:
* hannes: introduced debugger (hook and first implementation)


git-svn-id: file:///usr/local/Singular/svn/trunk@2983 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • Singular/ChangeLog

    r1518b9 r64d729  
     1Thu Apr 15 19:26:07 MET DST 1999 hannes
     2  * start to implement debugger (sdb.h,sdb.cc, febase*, iplib,cc, scanner)
     3
    14Tue Mar 16 15:54:02 MET 1999 hannes
    25  * introduced new routine ERROR(string) (iparith.cc, tok.h)
  • Singular/Makefile.in

    r1518b9 r64d729  
    7272    comm.cc kstd1.cc kstd2.cc kutil.cc lists.cc \
    7373    longalg.cc longrat.cc longrat0.cc \
    74     maps.cc matpol.cc misc.cc \
     74    maps.cc matpol.cc misc.cc sdb.cc \
    7575    mminit.cc modulop.cc sparsmat.cc \
    7676    fglm.cc fglmzero.cc fglmvec.cc fglmgauss.cc fglmhom.cc fglmcomb.cc \
     
    9494        numbers.h stype.h clapconv.h ipconv.h maps.h page.h \
    9595        subexpr.h clapsing.h ipid.h matpol.h polys.h syz.h \
    96         cntrlc.h ipprint.h ring.h timer.h \
     96        cntrlc.h ipprint.h ring.h timer.h sdb.h \
    9797        febase.h ipshell.h shortfl.h tok.h \
    9898        mmemory.h mmprivate.h mmheap.h mmpage.h page.h \
     
    130130     mpsr_Error.o mpsr_Put.o mpsr_PutPoly.o mpsr_GetPoly.o \
    131131     mpsr_Get.o mpsr_GetMisc.o ndbm.o spSpolyLoop.o libparse.o \
    132      find_exec.o getopt.o fereadl.o  mod_raw.o \
     132     find_exec.o getopt.o fereadl.o  mod_raw.o sdb.o \
    133133        pcv.o
    134134
     
    343343     sing_mp.og fglm.og fglmzero.og fglmvec.og fglmgauss.og fglmhom.og\
    344344     algmap.og clapconv.og  clapmem.og clapsing.og \
    345      cntrlc.og  \
     345     cntrlc.og  sdb.og\
    346346     mpsr_Error.og mpsr_Put.og mpsr_PutPoly.og mpsr_GetPoly.og \
    347347     mpsr_Get.og mpsr_GetMisc.og \
     
    419419     sing_mp.op fglm.op fglmzero.op fglmvec.op fglmgauss.op fglmhom.op\
    420420     algmap.op clapconv.op  clapmem.op clapsing.op \
    421      cntrlc.op  \
     421     cntrlc.op  sdb.op\
    422422     mpsr_Error.op mpsr_Put.op mpsr_PutPoly.op mpsr_GetPoly.op \
    423423     mpsr_Get.op mpsr_GetMisc.op \
     
    445445     sing_mp.ob fglm.ob fglmzero.ob fglmvec.ob fglmgauss.ob fglmhom.ob\
    446446     algmap.ob clapconv.ob  clapmem.ob clapsing.ob \
    447      cntrlc.ob  \
     447     cntrlc.ob  sdb.ob \
    448448     mpsr_Error.ob mpsr_Put.ob mpsr_PutPoly.ob mpsr_GetPoly.ob \
    449449     mpsr_Get.ob mpsr_GetMisc.ob \
  • Singular/attrib.cc

    r1518b9 r64d729  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: attrib.cc,v 1.11 1999-03-16 15:33:04 Singular Exp $ */
     4/* $Id: attrib.cc,v 1.12 1999-04-15 17:28:02 Singular Exp $ */
    55
    66/*
     
    267267    procinfo *p=(procinfo *)v->Data();
    268268    if (p->trace_flag!=0)
    269       Print("trace:%d\n",p->trace_flag);
     269      Print("TRACE:%d\n",p->trace_flag);
    270270  }   
    271271  if (hasFlag(v,FLAG_STD))
     
    300300    res->data=(void *)(((ideal)v->Data())->rank);
    301301  }
    302   else if ((v->Typ()==PROC_CMD) && (strcmp(name,"trace")==0))
     302  else if ((v->Typ()==PROC_CMD) && (strcmp(name,"TRACE")==0))
    303303  {
    304304    procinfo *p=(procinfo *)v->Data();
     
    362362    I->rank=max(I->rank,(int)c->Data());
    363363  }
    364   else if ((strcmp(name,"trace")==0)&&(v->Typ()==PROC_CMD))
     364  else if ((strcmp(name,"TRACE")==0)&&(v->Typ()==PROC_CMD))
    365365  {
    366366    if (c->Typ()!=INT_CMD)
    367367    {
    368       WerrorS("attrib `trace` must be int");
     368      WerrorS("attrib `TRACE` must be int");
    369369      return TRUE;
    370370    }
  • Singular/febase.inc

    r1518b9 r64d729  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.inc,v 1.20 1999-03-16 15:33:06 Singular Exp $ */
     4/* $Id: febase.inc,v 1.21 1999-04-15 17:28:02 Singular Exp $ */
    55/*
    66* ABSTRACT: handling of 'voices'
    77*/
    88#include <ctype.h>
     9#include "sdb.h"
     10
     11extern int blocknest; /* scaner.l internal */
    912
    1013int    yy_noeof=0;     // the scanner "state"
     
    154157    case BT_if:
    155158    case BT_else:
    156                      yylineno = yy_blocklineno;
    157                      break;
    158159    case BT_break:
    159160                     yylineno = yy_blocklineno-1;
     
    401402      else
    402403        Print("%s %3d%c ",currentVoice->filename,yylineno,prompt_char);
    403     }
     404     }
    404405    #ifdef HAVE_TCL
    405406    if(tclmode)
     
    426427    Print("{%d}",yylineno);
    427428    mflush();
     429  }
     430  if ((blocknest==0)
     431  && (currentVoice->pi!=NULL)
     432  && (currentVoice->pi->trace_flag&TRACE_BREAKPOINT))
     433  {
     434    sdb(currentVoice, anf, len_s);
    428435  }
    429436  prompt_char = '.';
  • Singular/grammar.y

    r1518b9 r64d729  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: grammar.y,v 1.57 1999-03-19 14:17:58 obachman Exp $ */
     4/* $Id: grammar.y,v 1.58 1999-04-15 17:28:03 Singular Exp $ */
    55/*
    66* ABSTRACT: SINGULAR shell grammatik
     
    594594            if(iiExprArith3(&$$,$1,&$3,&$5,&$7)) YYERROR;
    595595          }
     596        | CMD_23 '(' expr ',' expr ')'
     597          {
     598            if(iiExprArith2(&$$,&$3,$1,&$5,TRUE)) YYERROR;
     599          }
     600        | CMD_23 '(' expr ',' expr ',' expr ')'
     601          {
     602            if(iiExprArith3(&$$,$1,&$3,&$5,&$7)) YYERROR;
     603          }
     604        | CMD_12 '(' expr ')'
     605          {
     606            if(iiExprArith1(&$$,&$3,$1)) YYERROR;
     607          }
     608        | CMD_12 '(' expr ',' expr ')'
     609          {
     610            if(iiExprArith2(&$$,&$3,$1,&$5,TRUE)) YYERROR;
     611          }
     612        | CMD_123 '(' expr ')'
     613          {
     614            if(iiExprArith1(&$$,&$3,$1)) YYERROR;
     615          }
     616        | CMD_123 '(' expr ',' expr ')'
     617          {
     618            if(iiExprArith2(&$$,&$3,$1,&$5,TRUE)) YYERROR;
     619          }
     620        | CMD_123 '(' expr ',' expr ',' expr ')'
     621          {
     622            if(iiExprArith3(&$$,$1,&$3,&$5,&$7)) YYERROR;
     623          }
    596624        | CMD_M '(' ')'
    597625          {
    598626            if(iiExprArithM(&$$,NULL,$1)) YYERROR;
    599627          }
    600         | CMD_23 '(' expr ',' expr ')'
    601           {
    602             if(iiExprArith2(&$$,&$3,$1,&$5,TRUE)) YYERROR;
    603           }
    604         | CMD_23 '(' expr ',' expr ',' expr ')'
    605           {
    606             if(iiExprArith3(&$$,$1,&$3,&$5,&$7)) YYERROR;
    607           }
    608         | CMD_12 '(' expr ')'
    609           {
    610             if(iiExprArith1(&$$,&$3,$1)) YYERROR;
    611           }
    612         | CMD_12 '(' expr ',' expr ')'
    613           {
    614             if(iiExprArith2(&$$,&$3,$1,&$5,TRUE)) YYERROR;
    615           }
    616         | CMD_123 '(' expr ')'
    617           {
    618             if(iiExprArith1(&$$,&$3,$1)) YYERROR;
    619           }
    620         | CMD_123 '(' expr ',' expr ')'
    621           {
    622             if(iiExprArith2(&$$,&$3,$1,&$5,TRUE)) YYERROR;
    623           }
    624         | CMD_123 '(' expr ',' expr ',' expr ')'
    625           {
    626             if(iiExprArith3(&$$,$1,&$3,&$5,&$7)) YYERROR;
     628        | CMD_M '(' exprlist ')'
     629          {
     630            if(iiExprArithM(&$$,&$3,$1)) YYERROR;
    627631          }
    628632        | MATRIX_CMD '(' expr ',' expr ',' expr ')'
     
    637641          {
    638642            if(iiExprArith1(&$$,&$3,INTMAT_CMD)) YYERROR;
    639           }
    640         | CMD_M '(' exprlist ')'
    641           {
    642             if(iiExprArithM(&$$,&$3,$1)) YYERROR;
    643643          }
    644644        | quote_start expr quote_end
     
    15531553              if (currentVoice->ifsw!=2)
    15541554              {
    1555                 char *s=$2+strlen($2)-1;
    1556                 while ((*s=='\0')||(*s=='\n')) s--;
    1557                 s[1]='\0';
    15581555                Warn("`else` without `if` in level %d",myynest);
    15591556              }
  • Singular/iplib.cc

    r1518b9 r64d729  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iplib.cc,v 1.53 1999-04-01 10:09:58 krueger Exp $ */
     4/* $Id: iplib.cc,v 1.54 1999-04-15 17:28:04 Singular Exp $ */
    55/*
    66* ABSTRACT: interpreter: LIB and help
     
    245245  BOOLEAN err=FALSE;
    246246  int old_echo=si_echo;
     247  char save_flags=0;
     248  procinfov pi=NULL;
    247249
    248250  /* init febase ======================================== */
     
    250252  if (pn!=NULL)
    251253  {
    252     procinfov pi;
    253254    pi = IDPROC(pn);
    254255    if(pi!=NULL)
    255256    {
     257      save_flags=pi->trace_flag;
    256258      if( pi->data.s.body==NULL )
    257259      {
    258         iiGetLibProcBuffer(IDPROC(pn));
    259         if (IDPROC(pn)->data.s.body==NULL) return TRUE;
     260        iiGetLibProcBuffer(pi);
     261        if (pi->data.s.body==NULL) return TRUE;
    260262      }
    261       newBuffer( mstrdup(IDPROC(pn)->data.s.body), BT_proc,
    262                  pi, IDPROC(pn)->data.s.body_lineno );
    263     }
    264     //else
    265     //{ // for security only
    266     //  newBuffer( mstrdup(IDSTRING(pn)), BT_proc, IDID(pn) );
    267     //}
     263      newBuffer( mstrdup(pi->data.s.body), BT_proc,
     264                 pi, pi->data.s.body_lineno-(v!=NULL) );
     265    }
    268266  }
    269267  /* generate argument list ======================================*/
     
    280278  /* start interpreter ======================================*/
    281279  myynest++;
    282   //Print("%-*.*s PStart <<%s>>, level:%d\n",2*myynest,2*myynest," ",IDID(pn),myynest);
    283280  err=yyparse();
    284281  killlocals(myynest);
    285282  myynest--;
    286283  si_echo=old_echo;
    287   //Print("%-*.*s PEnd  <<%s>>, level:%d\n",2*myynest,2*myynest," ",IDID(pn),myynest);
    288 
     284  if (pi!=NULL)
     285    pi->trace_flag=save_flags;
    289286  return err;
    290287}
     
    628625  char libnamebuf[128];
    629626  package pack = IDPACKAGE(packhdl);
    630  
     627
    631628  if(pack->language == LANG_NONE) return FALSE;
    632  
     629
    633630  FILE * fp = feFopen( pack->libname, "r", libnamebuf, FALSE);
    634631  if (fp==NULL)
     
    766763  LoadResult = iiLoadLIB(fp, libnamebuf, newlib, NULL, FALSE, tellerror);
    767764#endif /* HAVE_NAMESPACES */
    768  
     765
    769766#ifdef HAVE_NAMESPACES
    770767  if(!LoadResult) IDPACKAGE(pl)->loaded = TRUE;
     
    836833  fclose( yylpin );
    837834  fp = NULL;
    838  
     835
    839836#ifdef HAVE_NAMESPACES
    840837  namespaceroot->pop();
     
    940937  int token;
    941938  char FullName[256];
    942  
     939
    943940  if( *fullname != '/' &&  *fullname != '.' )
    944941    sprintf(FullName, "./%s", newlib);
    945942  else strcpy(FullName, fullname);
    946  
     943
    947944
    948945  if(IsCmd(plib, &token))
     
    965962    {
    966963      Warn("not of typ package.");
    967       goto load_modules_end; 
     964      goto load_modules_end;
    968965    }
    969966  }
     
    974971    WerrorS("dynl_open failed");
    975972    Werror("%s not found", newlib);
    976     goto load_modules_end; 
     973    goto load_modules_end;
    977974  }
    978975  else
     
    988985  namespaceroot->pop();
    989986  return RET;
    990  
     987
    991988}
    992989#endif /* HAVE_DYNAMIC_LOADING */
     
    11441141  FILE * fp = feFopen( newlib, "r", libnamebuf, FALSE );
    11451142  ret = stat(libnamebuf, &sb);
    1146  
     1143
    11471144  if (fp==NULL)
    11481145  {
     
    11741171  }
    11751172  if(isprint(buf[0]) || buf[0]=='\n') { LT = LT_SINGULAR; goto lib_type_end; }
    1176  
     1173
    11771174  lib_type_end:
    11781175  fclose(fp);
  • Singular/ipshell.h

    r1518b9 r64d729  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ipshell.h,v 1.16 1999-03-11 15:58:07 Singular Exp $ */
     6/* $Id: ipshell.h,v 1.17 1999-04-15 17:28:05 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    1818#define TRACE_SHOW_RINGS  8
    1919#define TRACE_SHOW_LINE1  16
     20#define TRACE_BREAKPOINT  32
     21#define TRACE_TMP_BREAKPOINT  64
    2022extern leftv iiCurrArgs;
    2123extern int iiOp; /* the current operation*/
  • Singular/scanner.l

    r1518b9 r64d729  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: scanner.l,v 1.15 1999-03-19 17:42:33 obachman Exp $ */
     5/* $Id: scanner.l,v 1.16 1999-04-15 17:28:06 Singular Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    1919#define ALLOC(a) Alloc((a))
    2020int yylineno  = 0;
    21 static int blocknest = 0;
     21int blocknest = 0;
    2222extern char * yytext;
    2323//extern unsigned char * yytext;
Note: See TracChangeset for help on using the changeset viewer.