=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/parse/debug.c,v retrieving revision 1.10 retrieving revision 1.15 diff -u -p -r1.10 -r1.15 --- OpenXM_contrib2/asir2000/parse/debug.c 2001/10/09 01:36:23 1.10 +++ OpenXM_contrib2/asir2000/parse/debug.c 2003/05/14 07:08:48 1.15 @@ -45,12 +45,12 @@ * 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.9 2001/10/05 03:21:27 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/parse/debug.c,v 1.14 2003/03/07 06:39:59 noro Exp $ */ #include "ca.h" #include "parse.h" #include -#if PARI +#if defined(PARI) #include "genpari.h" #endif @@ -78,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", @@ -216,7 +216,7 @@ void debug(SNODE f) 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(); @@ -232,7 +232,7 @@ void debug(SNODE f) #endif show_debug_window(1); sprintf(prompt,"(debug) "); - setjmp(debug_env); + SETJMP(debug_env); while ( 1 ) { #if FEP if ( !do_fep ) @@ -355,7 +355,7 @@ void setf(int ac,char **av) if ( !ac ) return; - searchf(usrf,av[0],&r); + searchuf(av[0],&r); if ( r ) { targetf = r; curline = targetf->f.usrf->startl; @@ -381,7 +381,7 @@ void setbp(char *p) char *buf,*savp; char *fname; FUNC r; - USRF t; + USRF uf,t; SNODE *snp = 0; FNODE cond; NODE tn; @@ -393,8 +393,11 @@ void setbp(char *p) if ( !strcmp(av[0],"at") ) { if ( !targetf ) return; - n = atoi(av[1]); fname = targetf->f.usrf->fname; - for ( tn = usrf; tn; tn = NEXT(tn) ) { + n = atoi(av[1]); + 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; if ( t && t->fname && !strcmp(t->fname,fname) && ( t->startl <= n ) && ( n <= t->endl ) ) @@ -408,7 +411,7 @@ void setbp(char *p) } at = 1; searchsn(&BDY(t),n,&snp); } else if ( !strcmp(av[0],"in") ) { - searchf(usrf,av[1],&r); + searchuf(av[1],&r); if ( !r ) { fprintf(stderr,"%s() : no such function\n",av[1]); return; @@ -494,7 +497,7 @@ void settp(char *p) } at = 1; searchsn(&BDY(t),n,&snp); } else if ( !strcmp(av[0],"in") ) { - searchf(usrf,av[1],&r); + searchuf(av[1],&r); if ( !r ) { fprintf(stderr,"%s() : no such function\n",av[1]); return; @@ -700,7 +703,7 @@ void bp(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); @@ -719,7 +722,7 @@ void println(int ac,char **av,int l) else if ( isdigit(av[0][0]) ) ln = atoi(av[0]); else { - searchf(usrf,av[0],&r); + searchuf(av[0],&r); if ( r && r->id != A_UNDEF ) { targetf = r; ln = r->f.usrf->startl; @@ -761,12 +764,12 @@ void printvars(char *s,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; @@ -784,8 +787,8 @@ void printvars(char *s,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;