=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/parse/debug.c,v retrieving revision 1.8 retrieving revision 1.14 diff -u -p -r1.8 -r1.14 --- OpenXM_contrib2/asir2000/parse/debug.c 2001/08/20 09:03:27 1.8 +++ OpenXM_contrib2/asir2000/parse/debug.c 2003/03/07 06:39:59 1.14 @@ -45,33 +45,15 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/parse/debug.c,v 1.7 2000/12/22 10:03:31 saito Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/parse/debug.c,v 1.13 2003/03/07 03:12:31 noro Exp $ */ #include "ca.h" #include "parse.h" #include -#if PARI +#if defined(PARI) #include "genpari.h" #endif -void show_stack(VS); -void change_stack(int,NODE *); -void showpos(void); -void printvars(char *,VS); -void println(int,char **,int); -void bp(SNODE); -void searchsn(SNODE *,int,SNODE **); -void showbp(int); -void showbps(void); -void delbp(int,char **); -int searchbp(void); -void clearbp(FUNC); -void settp(char *); -void setbp(char *); -void setf(int,char **); -void show_alias(char *); -void add_alias(char *,char *); - extern do_server_in_X11,do_file; typedef enum { @@ -96,7 +78,7 @@ static int curline = 1; extern NODE PVSS; extern unsigned int evalstatline; extern int debug_mode; -extern jmp_buf debug_env; +extern JMP_BUF debug_env; char *debcom[] = { "next", @@ -167,14 +149,15 @@ void debug_init() { } fclose(fp); } +#if 0 #if !defined(VISUAL) if ( do_server_in_X11 ) init_cmdwin(); #endif +#endif } -void add_alias(com,alias) -char *com,*alias; +void add_alias(char *com,char *alias) { int i; NODE tn; @@ -189,8 +172,7 @@ char *com,*alias; } } -void show_alias(alias) -char *alias; +void show_alias(char *alias) { int i; NODE tn; @@ -215,8 +197,7 @@ char *alias; } } -void debug(f) -SNODE f; +void debug(SNODE f) { int ac,i,n; did id; @@ -227,12 +208,15 @@ SNODE f; #endif char buf[BUFSIZ]; char prompt[BUFSIZ]; - char *p,*pe,*line; + char *p,*pe; +#if !defined(VISUAL) + char *line; +#endif NODE tn; extern int do_fep; NODE pvss; -#if !MPI && !defined(VISUAL) +#if !defined(MPI) && !defined(VISUAL) if ( !isatty(fileno(stdin)) && !do_server_in_X11 ) if ( do_file ) ExitAsir(); @@ -248,7 +232,7 @@ SNODE f; #endif show_debug_window(1); sprintf(prompt,"(debug) "); - setjmp(debug_env); + SETJMP(debug_env); while ( 1 ) { #if FEP if ( !do_fep ) @@ -365,9 +349,7 @@ LAST: show_debug_window(0); } -void setf(ac,av) -int ac; -char **av; +void setf(int ac,char **av) { FUNC r; @@ -392,8 +374,7 @@ static struct { static int bpindex = 0; -void setbp(p) -char *p; +void setbp(char *p) { int ac; char *av[BUFSIZ]; @@ -475,8 +456,7 @@ char *p; } } -void settp(p) -char *p; +void settp(char *p) { int ac; char *_av[BUFSIZ]; @@ -561,8 +541,7 @@ char *p; } } -void clearbp(f) -FUNC f; +void clearbp(FUNC f) { int i; @@ -587,9 +566,7 @@ int searchbp() return bpindex++; } -void delbp(ac,av) -int ac; -char **av; +void delbp(int ac,char **av) { int n; @@ -610,8 +587,7 @@ void showbps() { showbp(i); } -void showbp(n) -int n; +void showbp(int n) { if ( bpt[n].snp ) if ( bpt[n].texpr ) @@ -646,10 +622,7 @@ int n; } } -void searchsn(fp,n,fpp) -SNODE *fp; -int n; -SNODE **fpp; +void searchsn(SNODE *fp,int n,SNODE **fpp) { NODE tn; SNODE sn; @@ -706,8 +679,7 @@ SNODE **fpp; } } -void bp(f) -SNODE f; +void bp(SNODE f) { int ln; @@ -728,16 +700,13 @@ SNODE f; CPVS->usrf->name,ln,CPVS->usrf->f.usrf->fname); targetf = CPVS->usrf; curline = ln; println(0,0,1); -#if !MPI && !defined(VISUAL) +#if !defined(MPI) && !defined(VISUAL) if ( do_server_in_X11 || isatty(0) ) #endif debug(f); } -void println(ac,av,l) -int ac; -char **av; -int l; +void println(int ac,char **av,int l) { FILE *fp; char buf[BUFSIZ+1]; @@ -778,9 +747,7 @@ int l; fclose(fp); } -void printvars(s,vs) -char *s; -VS vs; +void printvars(char *s,VS vs) { FNODE expr; char *p; @@ -794,12 +761,12 @@ VS vs; } if ( exprparse(vs==GPVS?0:vs->usrf,s,&expr) ) { cpvs = CPVS; CPVS = vs; - if ( !(err = setjmp(debug_env)) ) + if ( !(err = SETJMP(debug_env)) ) val = eval(expr); CPVS = cpvs; if ( !err ) { -#if PARI -#if PARI1 +#if defined(PARI) +#if defined(PARI1) outfile = stderr; #else pari_outfile = stderr; @@ -817,8 +784,8 @@ VS vs; #if defined(VISUAL_LIB) w_noflush_stderr(0); #endif -#if PARI -#if PARI1 +#if defined(PARI) +#if defined(PARI1) outfile = stdout; #else pari_outfile = stdout; @@ -848,8 +815,7 @@ void showpos() } } -void showpos_to_string(buf) -char *buf; +void showpos_to_string(char *buf) { NODE n; VS vs; @@ -871,9 +837,7 @@ char *buf; } } -void change_stack(level,pvss) -int level; -NODE *pvss; +void change_stack(int level,NODE *pvss) { extern NODE PVSS; NODE n; @@ -893,8 +857,7 @@ NODE *pvss; targetf = vs->usrf; curline = vs->at; } -void show_stack(vs) -VS vs; +void show_stack(VS vs) { fprintf(stderr,"#%d %s(), line %d in \"%s\"\n", ((VS)BDY(PVSS))->level-vs->level,vs->usrf->name,vs->at,vs->usrf->f.usrf->fname);