• Anders Lindgren's avatar
    Enhance NSTRACE (trace output for NextStep). · ae16894d
    Anders Lindgren authored
    Trace can be disabled for groups of functions. By default, event
    functions and functions that generate lots of output are disabled.
    
    Trace output of Objective-C functions now use the "[ClassName
    parameter:]" form.
    
    * src/nsterm.h (NSTRACE_ALL_GROUPS, NSTRACE_GROUP_EVENTS)
    (NSTRACE_GROUP_UPDATES, NSTRACE_GROUP_FRINGE, NSTRACE_GROUP_COLOR)
    (NSTRACE_GROUP_GLYPHS, NSTRACE_GROUP_FOCUS): New macros,
    controlling in which function groups trace should be active.
    (NSTRACE_WHEN): Support for silencing a function, this also
    silencing all called functions.
    (NSTRACE_UNSILENCE): New macro, used to re-enable trace.
    (NSTRACE_FMT_FSTYPE, NSTRACE_ARG_FSTYPE): New macros, used to
    print the full screen state in NSTRACE functions.
    
    * src/nsterm.m (nstrace_depth, nstrace_num): Made volatile as they
    can be accessed from multiple threads.
    (nstrace_enabled_global): New variable, when FALSE, trace is
    silenced.
    (nstrace_restore_global_trace_state): New function, used to
    restore `nstrace_enabled_global' at end of block.
    ([EmacsView setFrame:], [EmacsWindow setFrame:display:])
    ([EmacsWindow setFrame:display:animation:])
    ([EmacsWindow setFrameTopLeftPoint:]): New functions, print trace
    and call corresponding super function.
    (Many functions): Add or enhance trace output.
    
    * src/nsimage.m (ns_image_from_file): Enhanced trace output.
    
    * src/nsfns.m (x_set_tool_bar_lines): Add trace output.
    
    * src/nsmenu.m ([EmacsToolbar setVisible:]): New function, print trace
    and call corresponding super function.
    ae16894d
nsterm.m 249 KB