anchor.diff:          messages,
           message_queue_len,
           current_stacktrace,
  -        binary
  +        binary,
  +        dictionary
       ],
       case erlang:process_info(P, Items) of
           Info when is_list(Info) ->
  -            {binary, Binaries} = lists:keyfind(binary, 1, Info),
  -            [[{pid, P}, {binary_memory, gather_binary_memory(Binaries)} | Info]];
  +            Behaviour = gather_behaviour(Info),
  +            [[
  +                {pid, P},
  +                {binary_memory, gather_binary_memory(Info)},
  +                {ancestry, gather_ancestry(Info)},
  +                {behaviour, Behaviour},
  +                {state, gather_state(P, Behaviour)}
  +                    | Info
  +            ]];
           undefined ->
               []
       end.
   
  -gather_binary_memory(Binaries) ->
  -    lists:foldl(fun({_, Mem, _}, Tot) -> Mem + Tot end, 0, Binaries).
  +gather_binary_memory(Info) ->
  +    lists:foldl(fun({_, Mem, _}, Tot) -> Mem + Tot end, 0, kget(binary, Info)).
  +
  +gather_ancestry(Info) ->
  +    kget('$ancestors', kget(dictionary, Info), []).
  +
  +gather_behaviour(Info) ->
  +    InitialCall = kget('$initial_call', kget(dictionary, Info)),
  +    [CurrentCall | _] = kget(current_stacktrace, Info),
  +    select_behaviour(InitialCall, CurrentCall).
  +
  +gather_state(Pid, {supervisor, _Module}) ->
  +    guard(fun () -> {children, supervisor:which_children(Pid)} end);
  +gather_state(Pid, {gen_server, _Module}) ->
  +    guard(fun () -> {state, sys:get_state(Pid, 100)} end);
  +gather_state(Pid, {gen_fsm, _Module}) ->
  +    guard(fun () -> {State, Extra} = sys:get_state(Pid, 100), {state, State, Extra} end);
  +gather_state(Pid, gen_event) ->
  +    guard(fun () -> {handlers, gen_event:which_handlers(Pid)} end);
  +gather_state(_Pid, undefined) ->
  +    undefined.
  +
  +guard(Fun) ->
  +    try Fun() catch _:_ -> undefined end.
  +
  +select_behaviour({supervisor, Module, _}, _) ->
  +    {supervisor, Module};
  +select_behaviour({Module, init, 1}, Call) when element(1, Call) == gen_server ->
  +    {gen_server, Module};
  +select_behaviour({Module, init, 1}, Call) when element(1, Call) == gen_fsm ->
  +    {gen_fsm, Module};
  +select_behaviour({gen_event, _, _}, _) ->
  +    gen_event;
  +select_behaviour(_, _) ->
  +    undefined.
   
   -spec load(file:name()) -> ok | {error, atom()}.
   
  
positive.code:     pid                := Pid,
      registered_name    := RegName,
      status             := Status,
      initial_call       := InitialCall,
      memory             := Memory,
      reductions         := Reductions,
      messages           := Messages,
      binary_memory      := Binary,
      current_stacktrace := Stacktrace
  }) ->
      Bl = "   - ",
      Pre = "        ",
      PidString = pid_to_list(Pid),
      Name = case RegName of [] -> PidString; _ -> [PidString, $\s, to_bin(RegName)] end,
      [" * ", Name, nl(),
          Bl, "status       : ", to_bin(Status), nl(),
          Bl, "initial call : ", format_call(InitialCall), nl(),
          Bl, "messagebox   : ", format_messages(Messages), nl(),
          Bl, "memory       : ", to_bin(Memory), " bytes", nl(),
          Bl, "binaries     : ", to_bin(Binary), " bytes", nl(),
          Bl, "reductions   : ", to_bin(Reductions), nl(),
          Bl, "stacktrace   : ", nl(), Pre, genlib_format:format_stacktrace(Stacktrace, [newlines]), nl()
      ].
  
  format_call({M, F, A}) ->
      [to_bin(M), $:, to_bin(F), $/, to_bin(A)].
  
  format_messages([]) ->
      "";
  format_messages(List) ->
      Sub = lists:sublist(List, 5),
      Pre = "        ",
      [nl(),
          [[Pre, genlib:print(M, 80)] || M <- Sub] |
          case List of
              Sub -> [];
              _   -> [Pre, "... and ", to_bin(length(List) - 5), " more"]
          end
      ].
  
  %%
  
  
negative.code:         false -> Default
      end.
  
  pad(S, N) ->
      genlib_string:pad_string(iolist_to_binary(S), N).
  
  padl(S, N) ->
      genlib_string:pad_left(iolist_to_binary(S), $\s, N).
  
  nl() ->
      io_lib:nl().
  