anchor.diff:      ttb:stop([format]).
   
   debug_app(Mod) ->
  -    ttb:tracer(all,[{file,"webtool_app.trc"},{handler,{fun out/4,true}}]),
  -    ttb:p(all,[call,timestamp]),
  +    {ok, _} = ttb:tracer(all,[{file,"webtool_app.trc"},{handler,{fun out/4,true}}]),
  +    {ok, _} = ttb:p(all,[call,timestamp]),
       MS = [{'_',[],[{return_trace},{message,{caller}}]}],
  -    ttb:tp(Mod,MS),
  +    {ok, _} = ttb:tp(Mod,MS),
       ok.
      
   out(_,{trace_ts,Pid,call,MFA={M,F,A},{W,_,_},TS},_,S) 
  
positive.code:     script_start([App,DefaultBrowser]);
  script_start([App,Browser]) ->
      io:format("Starting webtool...\n"),
      start(),
      AvailableApps = get_applications(),
      {OSType,_} = os:type(),
      case lists:keysearch(App,1,AvailableApps) of
  
negative.code: %% Function = {FunctionName,Arity} | FunctionName |
  %%            {Module, FunctionName, Arity} | {Module,FunctionName}
  debug(F) -> 
      {ok, _} = ttb:tracer(all,[{file,"webtool.trc"}]), % tracing all nodes
      {ok, _} = ttb:p(all,[call,timestamp]),
      MS = [{'_',[],[{return_trace},{message,{caller}}]}],
      _ = tp(F,MS),
      {ok, _} = ttb:ctp(?MODULE,stop_debug), % don't want tracing of the stop_debug func
      ok.
  tp(local,MS) -> % all functions
      ttb:tpl(?MODULE,MS);
  tp(global,MS) -> % all exported functions
      ttb:tp(?MODULE,MS);
  tp([{M,F,A}|T],MS) -> % Other module
      {ok, _} = ttb:tpl(M,F,A,MS),
      tp(T,MS);
  tp([{M,F}|T],MS) when is_atom(F) -> % Other module
      {ok, _} = ttb:tpl(M,F,MS),
      tp(T,MS);
  tp([{F,A}|T],MS) -> % function/arity
      {ok, _} = ttb:tpl(?MODULE,F,A,MS),
      tp(T,MS);
  tp([F|T],MS) -> % function
      {ok, _} = ttb:tpl(?MODULE,F,MS),
      tp(T,MS);
  tp([],_MS) ->
      ok.
  