4 Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
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 .ds Ellipsis .\|.\|.\&\"
22 .TH @U_ROFF@_TRACE @MAN7EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
26 @L_ROFF@_trace \- @T_ROFF@ macro package trace.tmac
31 .SY "@L_ROFF@ \-m trace"
43 macro package can be a valuable tool for debugging documents written
44 in the roff formatting language.
45 A call stack trace is protocolled on standard error, this is, a
46 diagnostic message is emitted on entering and exiting of a macro call.
47 This greatly eases to track down an error in some macro.
50 This tracing process is activated by specifying the groff or troff
53 A finer control can be obtained by including the macro file within the
55 .BR .mso\ trace.tmac .
56 Only macros that are defined after this line are traced.
59 If command line option
61 is given (or if this register is set in the document), number and string
62 register assignments together with some other requests are traced also.
65 If some other macro package should be traced as well it must be specified
73 is unusual because it does not contain any macros to be called by a
75 Instead, the existing macro definition and appending facilities are
76 modified such that they display diagnostic messages.
81 In the following examples, a roff fragment is fed into @L_ROFF@ via
83 As we are only interested in the diagnostic messages (standard error)
84 on the terminal, the normal formatted output (standard output) is
85 redirected to the nirvana device
87 The resulting diagnostic messages are displayed directly below the
88 corresponding example.
91 .SS "Command line option"
102 > .test_macro some dummy arguments
103 > ' | @L_ROFF@ -m trace >/dev/null
106 *** de trace enter: .test_macro
107 *** trace exit: .test_macro
108 *** de trace enter: .test_macro "some" "dummy" "arguments"
109 *** trace exit: .test_macro "some" "dummy" "arguments"
114 The entry and the exit of each macro call is displayed on the terminal
115 (standard output) \[em] together with the arguments (if any).
118 .SS "Nested macro calls"
132 > ' | @L_ROFF@ -m trace >/dev/null
136 *** de trace enter: .parent
137 *** de trace enter: .child
138 *** trace exit: .child
139 *** trace exit: .parent
144 This shows that macro calls can be nested.
145 This powerful feature can help to tack down quite complex call stacks.
148 .SS "Activating with .mso"
164 > ' | @L_ROFF@ >/dev/null
166 *** de trace enter: .after
167 *** trace exit: .after
172 Here, the tracing is activated within the document, not by a command
174 As tracing was not active when macro
176 was defined, no call of this macro is protocolled; on the other hand,
179 is fully protocolled.
188 request (and its cousins), macro arguments are expanded one level more.
189 This causes problems if an argument contains four backslashes or more
190 to prevent too early expansion of the backslash. For example, this
195 \&.foo \e\e\e\en[bar]
199 normally passes `\e\en[bar]' to macro `.foo', but with the redefined
201 request it passes `\en[bar]' instead.
204 The solution to this problem is to use @L_ROFF@'s
206 escape which is an escape character not interpreted in copy mode, for
219 macros are kept in the file
222 .IR "tmac directory" ;
224 .BR @L_ROFF@_tmac (@MAN5EXT@)
231 .B $@U_ROFF@_TMAC_PATH
232 A colon-separated list of additional tmac directories in which to
233 search for macro files; see
234 .BR @L_ROFF@_tmac (@MAN5EXT@)
240 Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
242 Copyright (C) 2002, 2006 - 2008 Free Software Foundation, Inc.
244 This document was written by Bernd Warken.
246 This document is distributed under the terms of the FDL (GNU Free
247 Documentation License) version 1.1 or later.
249 You should have received a copy of the FDL on your system, it is also
250 available on-line at the
251 .UR http://\:www.gnu.org/\:copyleft/\:fdl.html
259 .BR @L_ROFF@ (@MAN1EXT@)
260 An overview of the @T_ROFF@ system.
263 .BR @L_TROFF@ (@MAN1EXT@)
264 For details on option
268 .BR @L_ROFF@_tmac (@MAN5EXT@)
269 A general description of @T_ROFF@ macro packages.
272 .BR @L_ROFF@ (@MAN7EXT@)
273 A short reference for the @T_ROFF@ formatting language.