fix debugger
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1795 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
73a30641a0
commit
8edd35f303
13
C/sysbits.c
13
C/sysbits.c
@ -2162,12 +2162,17 @@ static Int p_putenv(void)
|
||||
"second arg to putenv/2");
|
||||
return(FALSE);
|
||||
} else s2 = RepAtom(AtomOfTerm(t2))->StrOfAE;
|
||||
p0 = p = Yap_AllocAtomSpace(strlen(s)+strlen(s2)+3);
|
||||
while (!(p0 = p = Yap_AllocAtomSpace(strlen(s)+strlen(s2)+3))) {
|
||||
if (!Yap_growheap(FALSE, MinHeapGap, NULL)) {
|
||||
Yap_Error(OUT_OF_HEAP_ERROR, TermNil, Yap_ErrorMessage);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
while ((*p++ = *s++) != '\0');
|
||||
p[-1] = '=';
|
||||
while ((*p++ = *s2++) != '\0');
|
||||
if (putenv(p0) == 0)
|
||||
return(TRUE);
|
||||
return TRUE;
|
||||
#if HAVE_STRERROR
|
||||
Yap_Error(OPERATING_SYSTEM_ERROR, TermNil,
|
||||
"in putenv(%s)", strerror(errno), p0);
|
||||
@ -2175,11 +2180,11 @@ static Int p_putenv(void)
|
||||
Yap_Error(OPERATING_SYSTEM_ERROR, TermNil,
|
||||
"in putenv(%s)", p0);
|
||||
#endif
|
||||
return (FALSE);
|
||||
return FALSE;
|
||||
#else
|
||||
Yap_Error(SYSTEM_ERROR, TermNil,
|
||||
"putenv not available in this configuration");
|
||||
return (FALSE);
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -166,17 +166,18 @@ read_sig.
|
||||
|
||||
'$protected_env' :-
|
||||
yap_hacks:current_continuations([Env|Envs]),
|
||||
%'$envs'(Envs),
|
||||
yap_hacks:continuation(Env,_,Addr,_),
|
||||
%'$envs'(Envs, Addr),
|
||||
'$skim_envs'(Envs,Addr,Mod,Name,Arity),
|
||||
\+ '$external_call_seen'(Mod,Name,Arity).
|
||||
|
||||
|
||||
% '$envs'([Env|Envs]) :-
|
||||
% '$env_info'(Env,Mod0,Name0,Arity0),
|
||||
% format(user_error,'~a:~w/~w~n',[Mod0,Name0,Arity0]),
|
||||
% '$envs'(Envs).
|
||||
% '$envs'([]).
|
||||
'$envs'([Env|Envs], Addr0) :-
|
||||
yap_hacks:cp_to_predicate(Addr0,Mod0,Name0,Arity0,ClId),
|
||||
format(user_error,'~a:~w/~w ~d~n',[Mod0,Name0,Arity0,ClId]),
|
||||
yap_hacks:continuation(Env,_,Addr,_),
|
||||
'$envs'(Envs, Addr).
|
||||
'$envs'([], _) :- format(user_error,'*****done*****~n',[]).
|
||||
|
||||
'$skim_envs'([Env|Envs],Addr0,Mod,Name,Arity) :-
|
||||
yap_hacks:cp_to_predicate(Addr0, Mod0, Name0, Arity0, _ClId),
|
||||
@ -192,6 +193,6 @@ read_sig.
|
||||
'$allowed'(Name,Arity).
|
||||
'$external_call_seen'(_,_,_).
|
||||
|
||||
'$allowed'('$spycall',3).
|
||||
'$allowed'('$spycall',4).
|
||||
'$allowed'('$query',2).
|
||||
|
||||
|
Reference in New Issue
Block a user