anchor.diff:  -spec gc_set_bpqueue(gc_state(), [bp_msg()]) -> gc_state().
   gc_set_bpqueue(State, Val) ->   setelement(?BP_QUEUE, State, Val).
   -spec gc_bpstepped(gc_state()) -> boolean().
  -gc_bpstepped(State) ->          element(?BP_STEPPED, State).
  +gc_bpstepped(State) -> element(?BP_STEPPED, State).
   -spec gc_set_bpstepped(gc_state(), boolean()) -> gc_state().
   gc_set_bpstepped(State, Val) -> setelement(?BP_STEPPED, State, Val).
   -spec gc_bpstepper(gc_state()) -> pid() | 'unknown'.
   gc_bpstepper(State) ->          element(?BP_STEPPER, State).
   -spec gc_set_bpstepper(gc_state(), pid() | 'unknown') -> gc_state().
   gc_set_bpstepper(State, Val) -> setelement(?BP_STEPPER, State, Val).
  -%% users state
  --spec gc_ustate(gc_state()) -> user_state().
  -gc_ustate(State) ->             element(?USTATE, State).
  --spec gc_set_ustate(gc_state(), user_state()) -> gc_state().
  -gc_set_ustate(State, Val) ->    setelement(?USTATE, State, Val).
   
   -spec gc_bp_hold_back(gc_state(), bp_msg()) -> gc_state().
   gc_bp_hold_back(State, Msg) ->
  
positive.code:                           erlang:element(3, T) =:= [Msg, UState] andalso
                            Reason =:= function_clause andalso
                            Level =:= error ->
                          {'$gc_unknown_event',
                           on_unknown_event(Msg, T1State)};
                      _ ->
                          {'$gc_exception',
                           on_exception(Msg, Level, Reason, Stacktrace, T1State)}
                  end
          end,
      case T2State of
  
negative.code:                             erlang:throw('unknown gen_component command')
                      end
              end;
          {'$gc_unknown_event'} -> loop(UState, T1GCState);
          {'$gc_exception'} ->     loop(UState, T1GCState);
          unknown_event ->
              %% drop T2State, as it contains the error message
              on_unknown_event(Msg, UState, T1GCState),
              case gc_bpactive(T1GCState) andalso gc_bpstepped(T1GCState) of
                  false -> loop(UState, T1GCState);
                  true -> loop(UState, bp_step_done(Msg, T1GCState))
              end;
          NewUState ->
              case element(?BP_ACTIVE, T1GCState) andalso gc_bpstepped(T1GCState) of
                  false -> loop(NewUState, T1GCState);
                  true -> loop(NewUState, bp_step_done(Msg, T1GCState))
              end
      end.
  
  -spec on_traced_msg(comm:message(), user_state(), gc_state())
                     -> ok.
  on_traced_msg(GCMsg, UState, GCState)
    when is_tuple(GCMsg)
         andalso '$gen_component' =:= element(1, GCMsg) ->
      on_gc_msg(GCMsg, UState, GCState);
  on_traced_msg({ping, Pid}, UState, GCState) ->
      %% handle failure detector messages
      comm:send(Pid, {pong}, [{channel, prio}]),
      MsgTag = erlang:erase('$gen_component_trace_mpath_msg_tag'),
      trace_mpath:log_info(self(), {gc_on_done, MsgTag}),
      trace_mpath:stop(),
      loop(UState, GCState);
  on_traced_msg({send_to_group_member, Processname, Msg}, UState, GCState) ->
      %% forward a message to group member by its process name
      %% initiated via comm:send/3 with group_member
      Pid = pid_groups:get_my(Processname),
      case Pid of
          failed -> ok;
          _      -> comm:send_local(Pid, Msg)
      end,
      MsgTag = erlang:erase('$gen_component_trace_mpath_msg_tag'),
      trace_mpath:log_info(self(), {gc_on_done, MsgTag}),
      trace_mpath:stop(),
      loop(UState, GCState);
  on_traced_msg(Msg, UState, GCState) ->
      T1GCState = on_bp(Msg, UState, GCState),
      Module  = gc_mod(T1GCState),
      Handler = gc_hand(T1GCState),
      T2State =
          try Handler(Msg, UState)
          catch Level:Reason ->
                  Stacktrace = erlang:get_stacktrace(),
                  case Stacktrace of
                      %% erlang < R15 : {Module, Handler, [Msg, State]}
                      %% erlang >= R15: {Module, Handler, [Msg, State], _}
                      [T | _] when
                            erlang:element(1, T) =:= Module andalso
                            %% erlang:element(2, T) =:= Handler andalso
                            erlang:element(3, T) =:= [Msg, UState] andalso
                            Reason =:= function_clause andalso
                            Level =:= error ->
                          on_unknown_event(Msg, UState, T1GCState),
                          {'$gc_unknown_event'};
                      _ ->
                          on_exception(Msg, Level, Reason, Stacktrace,
                                       UState, T1GCState),
                          {'$gc_exception'}
                  end
          end,
      case T2State of
          kill ->
              log:log(info, "[ gen_component ] ~.0p killed (~.0p:~.0p/2):",
                      [self(), Module, Handler]),
              ok;
          {'$gen_component', [{post_op, Msg1}], NewUState} ->
              on_post_op(Msg1, NewUState, T1GCState);
          {'$gen_component', Commands, NewUState} ->
              %% This is not counted as a bp_step
              case lists:keyfind(on_handler, 1, Commands) of
                  {on_handler, NewHandler} ->
                      MsgTag = erlang:erase('$gen_component_trace_mpath_msg_tag'),
                      trace_mpath:log_info(self(), {gc_on_done, MsgTag}),
                      trace_mpath:stop(),
                      loop(NewUState, gc_set_hand(T1GCState, NewHandler));
                  false ->
                      case lists:keyfind(post_op, 1, Commands) of
                          {post_op, Msg1} ->
                              on_post_op(Msg1, NewUState, T1GCState);
                          false ->
                              %% let's fail since the Config list was either
                              %% empty or contained an invalid entry
                              log:log(warn, "[ gen_component ] unknown command(s): ~.0p",
                                      [Commands]),
                              erlang:throw('unknown gen_component command')
                      end
              end;
          {'$gc_unknown_event'} ->
              MsgTag = erlang:erase('$gen_component_trace_mpath_msg_tag'),
              trace_mpath:log_info(self(), {gc_on_done, MsgTag}),
              trace_mpath:stop(),
              loop(UState, T1GCState);
          {'$gc_exception'} ->
              MsgTag = erlang:erase('$gen_component_trace_mpath_msg_tag'),
              trace_mpath:log_info(self(), {gc_on_done, MsgTag}),
              trace_mpath:stop(),
              loop(UState, T1GCState);
          unknown_event ->
              %% drop T2State, as it contains the error message
              on_unknown_event(Msg, UState, T1GCState),
              MsgTag = erlang:erase('$gen_component_trace_mpath_msg_tag'),
              trace_mpath:log_info(self(), {gc_on_done, MsgTag}),
              trace_mpath:stop(),
              case gc_bpactive(T1GCState) andalso gc_bpstepped(T1GCState) of
                  false -> loop(UState, T1GCState);
                  true -> loop(UState, bp_step_done(Msg, T1GCState))
              end;
          NewUState ->
              MsgTag = erlang:erase('$gen_component_trace_mpath_msg_tag'),
              trace_mpath:log_info(self(), {gc_on_done, MsgTag}),
              trace_mpath:stop(),
              case gc_bpactive(T1GCState) andalso gc_bpstepped(T1GCState) of
                  false -> loop(NewUState, T1GCState);
                  true -> loop(NewUState, bp_step_done(Msg, T1GCState))
              end
      end.
  
  -spec on_unknown_event(comm:message(), user_state(), gc_state())
                        -> ok.
  on_unknown_event({web_debug_info, Requestor}, UState, GCState) ->
      comm:send_local(Requestor, {web_debug_info_reply,
                                  [{"generic info from gen_component:", ""},
                                   {"module", webhelpers:safe_html_string("~.0p", [gc_mod(GCState)])},
                                   {"handler", webhelpers:safe_html_string("~.0p", [gc_hand(GCState)])},
                                   {"state", webhelpers:safe_html_string("~.0p", [UState])}]});
  on_unknown_event(UnknownMessage, UState, GCState) ->
      log:log(error,
              "~n** Unknown message:~n ~.0p~n"
              "** Module:~n ~.0p~n"
  