anchor.diff:      end.
   
   top_inspect_pid_interactive(TopPid, Pid) ->
  -    {ok, [Char]} = io:fread(">", "~c"),
  +    {ok, [Char]} = io:fread("> ", "~c"),
       Quit =
           case Char of
               "q" -> quit;
  +            "d" -> %% show dictionary
  +                comm:send_local(TopPid, {output_off}),
  +                comm:send_local(TopPid, {stop_sampling}),
  +                print_process_dictionary(Pid),
  +                io:get_chars("Hit return to continue> ", 1),
  +                comm:send_local(TopPid, {enable_sampling, Pid}),
  +                comm:send_local(TopPid, {sample_pid, Pid}),
  +                comm:send_local(TopPid, {enable_output, pid}),
  +                comm:send_local(TopPid, {output_pid, Pid}),
  +                ok;
               "e" ->
                   comm:send_local(TopPid, {output_off}),
                   Expr = io:parse_erl_exprs('expr>'),
  
positive.code:         false -> DefaultVal;
          X -> element(2, X)
      end.
  
negative.code: usage_inspect() ->
      io:format(
        "~n"
        " (q)uit, (e)val expr, (g)arb-coll. (d)ictionary"
        %% ", exclude (t)op itself" %% undocumented feature for top development
        "~n sort by: (c)pu usage~n").
  
  print_process_dictionary(Pid) ->
      Infos = try_process_info(
                Pid, [dictionary, registered_name]),
  
      io:format("Pid: ~p~n", [ Pid ]),
      io:format("Name: ~p",
                [process_info_get(Infos, registered_name, [])]),
      case gen_component:is_gen_component(Pid) of
          true -> io:format(" ~p", [readable_grp_and_pid_name(Pid)]);
          false -> ok
      end,
      io:format("~n"),
      io:format("Process Dictionary:~n"),
      io:format("~20s ~-60s~n", ["Key", "Value"]),
      [ io:format("~20s ~-60s~n",
                  [ lists:flatten(io_lib:format("~1210.0p", [element(1, X)])),
                    lists:flatten(io_lib:format("~111610.0p", [element(2, X)]))])
        || X <- process_info_get(Infos, dictionary, [])].
  
  
  -spec on(comm:message(), state()) -> state().
  
  on({enable_sampling, Val}, State) ->
      case is_pid(Val) of
          true ->
              dbg:stop_clear(),
              dbg:tracer(process, {fun top:trace_fwd/2, self()}),
              dbg:tpl('_', []),
              dbg:p(Val, [c, return_to]);
          false -> ok
      end,
      set_sampling(State, Val);
  
  on({enable_output, Val}, State)   -> set_output(State, Val);
  on({sort_by, Type}, State)        -> set_sort_by(State, Type);
  on({toggle_exclude_self}, State)  -> toggle_exclude_self(State);
  