version 1.5, 2000/08/22 05:04:26 |
version 1.7, 2000/12/22 10:03:31 |
|
|
* 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.4 2000/08/21 08:31:46 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/debug.c,v 1.6 2000/12/05 01:24:56 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 153 void debug_init() { |
|
Line 153 void debug_init() { |
|
for ( n = 0; dckwd[n].id != D_UNKNOWN; n++ ); |
for ( n = 0; dckwd[n].id != D_UNKNOWN; n++ ); |
for ( i = 0; i < n; i++ ) |
for ( i = 0; i < n; i++ ) |
MKNODE(dckwd[i].names,debcom[i],0); |
MKNODE(dckwd[i].names,debcom[i],0); |
#if defined(THINK_C) |
|
strcpy(buf,"dbxinit"); |
|
#else |
|
home = (char *)getenv("HOME"); |
home = (char *)getenv("HOME"); |
if ( home ) |
if ( home ) |
strcpy(buf,home); |
strcpy(buf,home); |
else |
else |
buf[0] = 0; |
buf[0] = 0; |
strcat(buf,"/.dbxinit"); |
strcat(buf,"/.dbxinit"); |
#endif |
|
if ( (fp = fopen(".dbxinit","r")) || (fp = fopen(buf,"r")) ) { |
if ( (fp = fopen(".dbxinit","r")) || (fp = fopen(buf,"r")) ) { |
while ( fgets(buf,BUFSIZ,fp) ) { |
while ( fgets(buf,BUFSIZ,fp) ) { |
stoarg(buf,&ac,av); |
stoarg(buf,&ac,av); |
|
|
#endif |
#endif |
char buf[BUFSIZ]; |
char buf[BUFSIZ]; |
char prompt[BUFSIZ]; |
char prompt[BUFSIZ]; |
char *p,*pe; |
char *p,*pe,*line; |
NODE tn; |
NODE tn; |
extern int kernelmode,do_fep; |
extern int kernelmode,do_fep; |
NODE pvss; |
NODE pvss; |
|
|
else |
else |
return; |
return; |
#endif |
#endif |
#if defined(VISUAL) || defined(THINK_C) |
#if defined(VISUAL) |
suspend_timer(); |
suspend_timer(); |
#endif |
#endif |
pvss = PVSS; debug_mode = 1; |
pvss = PVSS; debug_mode = 1; |
|
|
fputc('\0',stderr); |
fputc('\0',stderr); |
setjmp(debug_env); |
setjmp(debug_env); |
while ( 1 ) { |
while ( 1 ) { |
if ( !do_server_in_X11 ) |
#if FEP |
fputs(prompt,stderr); |
if ( !do_fep ) |
|
#endif |
|
if ( !do_server_in_X11 ) |
|
fputs(prompt,stderr); |
bzero(buf,BUFSIZ); |
bzero(buf,BUFSIZ); |
while ( 1 ) { |
while ( 1 ) { |
|
#if FEP |
|
if ( do_fep ) { |
|
line = (char *)readline_console(prompt); |
|
strcpy(buf,line); free(line); |
|
} else |
|
#endif |
{ |
{ |
int len; |
int len; |
|
|
|
|
if ( kernelmode ) |
if ( kernelmode ) |
fputc('\0',stderr); |
fputc('\0',stderr); |
debug_mode = 0; |
debug_mode = 0; |
#if defined(THINK_C) |
#if !defined(VISUAL) |
show_debug_window(0); |
|
resume_timer(); |
|
#elif !defined(VISUAL) |
|
if ( do_server_in_X11 ) |
if ( do_server_in_X11 ) |
#endif |
#endif |
show_debug_window(0); |
show_debug_window(0); |
|
|
int i; |
int i; |
int ln; |
int ln; |
FUNC r; |
FUNC r; |
#if defined(THINK_C) |
|
void setDir(short); |
|
#endif |
|
|
|
if ( !ac ) |
if ( !ac ) |
ln = curline; |
ln = curline; |
|
|
} |
} |
if ( !targetf ) |
if ( !targetf ) |
return; |
return; |
#if defined(THINK_C) |
|
setDir(targetf->f.usrf->vol); |
|
#endif |
|
fp = fopen(targetf->f.usrf->fname,"r"); |
fp = fopen(targetf->f.usrf->fname,"r"); |
#if defined(THINK_C) |
|
resetDir(); |
|
#endif |
|
if ( !fp ) { |
if ( !fp ) { |
fprintf(stderr,"\"%s\" not found\n",targetf->name); |
fprintf(stderr,"\"%s\" not found\n",targetf->name); |
return; |
return; |