4 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
6 Copyright (C) 2002, 2006 - 2008 Free Software Foundation, Inc.
7 written by Bernd Warken.
9 Permission is granted to copy, distribute and/or modify this document
10 under the terms of the GNU Free Documentation License, Version 1.1 or
11 any later version published by the Free Software Foundation; with the
12 Invariant Sections being this .ig-section and AUTHOR, with no
13 Front-Cover Texts, and with no Back-Cover Texts.
15 You should have received a copy of the Free Documentation License
16 as part of the file COPYING; also located in the main directory of the
17 source package of this program.
20 .do nr __compat \n[.C]
22 .ds Ellipsis .\|.\|.\&\"
25 .TH @U_ROFF@_TRACE @MAN7EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
29 @L_ROFF@_trace \- @T_ROFF@ macro package trace.tmac
34 .SY "@L_ROFF@ \-m trace"
46 macro package can be a valuable tool for debugging documents written
47 in the roff formatting language.
48 A call stack trace is protocolled on standard error, this is, a
49 diagnostic message is emitted on entering and exiting of a macro call.
50 This greatly eases to track down an error in some macro.
53 This tracing process is activated by specifying the groff or troff
56 A finer control can be obtained by including the macro file within the
58 .BR .mso\ trace.tmac .
59 Only macros that are defined after this line are traced.
62 If command line option
64 is given (or if this register is set in the document), number and string
65 register assignments together with some other requests are traced also.
68 If some other macro package should be traced as well it must be specified
76 is unusual because it does not contain any macros to be called by a
78 Instead, the existing macro definition and appending facilities are
79 modified such that they display diagnostic messages.
84 In the following examples, a roff fragment is fed into @L_ROFF@ via
86 As we are only interested in the diagnostic messages (standard error)
87 on the terminal, the normal formatted output (standard output) is
88 redirected to the nirvana device
90 The resulting diagnostic messages are displayed directly below the
91 corresponding example.
94 .SS "Command line option"
105 > .test_macro some dummy arguments
106 > ' | @L_ROFF@ -m trace >/dev/null
109 *** de trace enter: .test_macro
110 *** trace exit: .test_macro
111 *** de trace enter: .test_macro "some" "dummy" "arguments"
112 *** trace exit: .test_macro "some" "dummy" "arguments"
117 The entry and the exit of each macro call is displayed on the terminal
118 (standard output) \[em] together with the arguments (if any).
121 .SS "Nested macro calls"
135 > ' | @L_ROFF@ -m trace >/dev/null
139 *** de trace enter: .parent
140 *** de trace enter: .child
141 *** trace exit: .child
142 *** trace exit: .parent
147 This shows that macro calls can be nested.
148 This powerful feature can help to tack down quite complex call stacks.
151 .SS "Activating with .mso"
167 > ' | @L_ROFF@ >/dev/null
169 *** de trace enter: .after
170 *** trace exit: .after
175 Here, the tracing is activated within the document, not by a command
177 As tracing was not active when macro
179 was defined, no call of this macro is protocolled; on the other hand,
182 is fully protocolled.
191 request (and its cousins), macro arguments are expanded one level more.
192 This causes problems if an argument contains four backslashes or more
193 to prevent too early expansion of the backslash. For example, this
198 \&.foo \e\e\e\en[bar]
202 normally passes `\e\en[bar]' to macro `.foo', but with the redefined
204 request it passes `\en[bar]' instead.
207 The solution to this problem is to use @L_ROFF@'s
209 escape which is an escape character not interpreted in copy mode, for
222 macros are kept in the file
225 .IR "tmac directory" ;
227 .BR @L_ROFF@-tmac (@MAN5EXT@)
234 .B $@U_ROFF@_TMAC_PATH
235 A colon-separated list of additional tmac directories in which to
236 search for macro files; see
237 .BR @L_ROFF@-tmac (@MAN5EXT@)
243 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
245 Copyright (C) 2002, 2006 - 2008 Free Software Foundation, Inc.
247 This document was written by Bernd Warken.
249 This document is distributed under the terms of the FDL (GNU Free
250 Documentation License) version 1.1 or later.
252 You should have received a copy of the FDL on your system, it is also
253 available on-line at the
254 .UR http://\:www.gnu.org/\:copyleft/\:fdl.html
262 .BR @L_ROFF@ (@MAN1EXT@)
263 An overview of the @T_ROFF@ system.
266 .BR @L_TROFF@ (@MAN1EXT@)
267 For details on option
271 .BR @L_ROFF@-tmac (@MAN5EXT@)
272 A general description of @T_ROFF@ macro packages.
275 .BR @L_ROFF@ (@MAN7EXT@)
276 A short reference for the @T_ROFF@ formatting language.