xref

Peter H|gfeldt <>
Fri Apr 26 19:24:39 CEST 2002


On Fri, 26 Apr 2002, Joe Armstrong wrote:

You just made a very trivial programming error:

> 
>  Does anybody know anything about xref???
> 
>  I want to do a very simple thing.
> 
>  Load kernel and stdlib into xref and ask for a listing of all calls
> to a particular {Mode,Func,Arity}
> 
>  I *thought* that this should be simple.
> 
>  Step one: loading the code ... I tryed
> 
>  go() ->
>     {ok, P} = xref:start(a),
>     add_libs(P, libs()),
>     xref:stop(P).
> 
>  add_libs(P, L) ->
>     foreach(fun(I) ->
> 		    Dir = code:lib_dir(stdlib) ++ "/ebin",
 				       ^^^^^^	
 		    Dir = code:lib_dir(I) ++ "/ebin",

> 		    io:format("adding:~p~n", [Dir]),
> 		    X = xref:add_directory(P, Dir, [{verbose,true}]),    
> 		    io:format("X=~p~n", [X])
> 	    end, L).
> 
>  libs() ->
>     [stdlib, kernel].
> 
> This produces the following error:
> 
> beam_lib: 1 unresolved call
> X={error,xref_base,
>    {module_clash,
>     {beam_lib,
>       "/home/joe/installed/otp_src_R8B-0/lib/stdlib/ebin/beam_lib.beam",
>       "/home/joe/installed/otp_src_R8B-0/lib/stdlib/ebin/beam_lib.beam"}}}
> 
>    The manual page does not document the meaning of this error.
> 
>    *what does this error mean* 
> 
>    /Joe

/Peter




More information about the erlang-questions mailing list