anchor.diff:      Log = sys:get_debug(log, Debug, []),
       DefaultStatus = [{data, [{"State", State}]}],
       Specfic =
  -	case erlang:function_exported(Mod, format_status, 2) of
  -	    true ->
  -		case catch Mod:format_status(Opt, [PDict, State]) of
  -		    {'EXIT', _} -> DefaultStatus;
  +    case erlang:function_exported(Mod, format_status, 2) of
  +        true ->
  +        case catch Mod:format_status(Opt, [PDict, State]) of
  +            {'EXIT', _} -> DefaultStatus;
                       StatusList when is_list(StatusList) -> StatusList;
  -		    Else -> [Else]
  -		end;
  -	    _ ->
  -		DefaultStatus
  -	end,
  +            Else -> [Else]
  +        end;
  +        _ ->
  +        DefaultStatus
  +    end,
       [{header, Header},
        {data, [{"Status", SysState},
  -	     {"Parent", Parent},
  -	     {"Logged events", Log}]} |
  +         {"Parent", Parent},
  +         {"Logged events", Log}]} |
        Specfic].
  
positive.code:     ok;
  error_info(Reason, Name, Msg, State, Debug) ->
      Reason1 = 
  	case Reason of
  	    {undef,[{M,F,A,L}|MFAs]} ->
  		case code:is_loaded(M) of
  		    false ->
  			{'module could not be loaded',[{M,F,A,L}|MFAs]};
  		    _ ->
  			case erlang:function_exported(M, F, length(A)) of
  			    true ->
  				Reason;
  			    false ->
  				{'function not exported',[{M,F,A,L}|MFAs]}
  			end
  		end;
  	    _ ->
  		Reason
  	end,    
      format("** Generic server ~p terminating \n"
             "** Last message in was ~p~n"
             "** When Server state == ~p~n"
             "** Reason for termination == ~n** ~p~n",
  	   [Name, Msg, State, Reason1]),
      sys:print_log(Debug),
      ok.
  
  
negative.code: 
  debug_options(Name, Opts) ->
      case opt(debug, Opts) of
      {ok, Options} -> dbg_options(Name, Options);
      _ -> dbg_options(Name, [])
      end.
  
  dbg_options(Name, []) ->
      Opts = 
      case init:get_argument(generic_debug) of
          error ->
          [];
          _ ->
          [log, statistics]
      end,
      dbg_opts(Name, Opts);
  dbg_options(Name, Opts) ->
      dbg_opts(Name, Opts).
  
  dbg_opts(Name, Opts) ->
      case catch sys:debug_options(Opts) of
      {'EXIT',_} ->
          format("~p: ignoring erroneous debug options - ~p~n",
             [Name, Opts]),
          [];
      Dbg ->
          Dbg
      end.
  
  get_proc_name(Pid) when is_pid(Pid) ->
      Pid;
  get_proc_name({local, Name}) ->
      case process_info(self(), registered_name) of
      {registered_name, Name} ->
          Name;
      {registered_name, _Name} ->
          exit(process_not_registered);
      [] ->
          exit(process_not_registered)
      end;    
  get_proc_name({global, Name}) ->
      case global:whereis_name(Name) of
      undefined ->
          exit(process_not_registered_globally);
      Pid when Pid =:= self() ->
          Name;
      _Pid ->
          exit(process_not_registered_globally)
      end;
  get_proc_name({via, Mod, Name}) ->
      case Mod:whereis_name(Name) of
      undefined ->
          exit({process_not_registered_via, Mod});
      Pid when Pid =:= self() ->
          Name;
      _Pid ->
          exit({process_not_registered_via, Mod})
      end.
  
  get_parent() ->
      case get('$ancestors') of
      [Parent | _] when is_pid(Parent)->
              Parent;
          [Parent | _] when is_atom(Parent)->
              name_to_pid(Parent);
      _ ->
          exit(process_was_not_started_by_proc_lib)
      end.
  
  name_to_pid(Name) ->
      case whereis(Name) of
      undefined ->
          case global:whereis_name(Name) of
          undefined ->
              exit(could_not_find_registered_name);
          Pid ->
              Pid
          end;
      Pid ->
          Pid
      end.
  
  %%-----------------------------------------------------------------
  