{
    "content": [
        {
            "type": "text",
            "text": "# GROFF_TRACE (man)\n\n## NAME\n\ngrofftrace - groff macro package trace.tmac\n\n## SYNOPSIS\n\ngroff -m trace [option ...] [input-file ...]\n\n## DESCRIPTION\n\nThe trace macro package of groff(1) can be a valuable tool for debugging documents written in\nthe roff formatting language.  A call stack trace is protocolled on standard error, this  is,\na  diagnostic message is emitted on entering and exiting of a macro call.  This greatly eases\nto track down an error in some macro.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n- **EXAMPLES** (3 subsections)\n- **PROBLEMS**\n- **FILES**\n- **ENVIRONMENT**\n- **AUTHORS**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "GROFF_TRACE",
        "section": "",
        "mode": "man",
        "summary": "grofftrace - groff macro package trace.tmac",
        "synopsis": "groff -m trace [option ...] [input-file ...]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-m",
                "long": null,
                "arg": null,
                "description": "tained by including the macro file within the document by the groff macro call .mso trace.tmac. Only macros that are defined after this line are traced. If the command-line option -r trace-full=1 is given (or if this register is set in the docu‐ ment), number and string register assignments together with some other requests are traced also. If some other macro package should be traced as well it must be specified after -m trace on the command line. The macro file trace.tmac is unusual because it does not contain any macros to be called by a user. Instead, the existing macro definition and appending facilities are modified such that they display diagnostic messages."
            }
        ],
        "examples": [
            "In the following examples, a roff fragment is fed into groff via standard input.  As  we  are",
            "only  interested in the diagnostic messages (standard error) on the terminal, the normal for‐",
            "matted output (standard output) is redirected to the nirvana device /dev/null.  The resulting",
            "diagnostic messages are displayed directly below the corresponding example.",
            "Example:",
            "sh# echo '.",
            "> .de testmacro",
            "> ..",
            "> .testmacro",
            "> .testmacro some dummy arguments",
            "> ' | groff -m trace > /dev/null",
            "* .de testmacro",
            "* de trace enter: .testmacro",
            "* trace exit: .testmacro",
            "* de trace enter: .testmacro \"some\" \"dummy\" \"arguments\"",
            "* trace exit: .testmacro \"some\" \"dummy\" \"arguments\"",
            "The  entry  and  the exit of each macro call is displayed on the terminal (standard output) —",
            "together with the arguments (if any).",
            "Example:",
            "sh# echo '.",
            "> .de child",
            "> ..",
            "> .de parent",
            "> .child",
            "> ..",
            "> .parent",
            "> ' | groff -m trace > /dev/null",
            "* .de child",
            "* .de parent",
            "* de trace enter: .parent",
            "* de trace enter: .child",
            "* trace exit: .child",
            "* trace exit: .parent",
            "This shows that macro calls can be nested.  This powerful feature can help to tack down quite",
            "complex call stacks.",
            "Example:",
            "sh# echo '.",
            "> .de before",
            "> ..",
            "> .mso trace.tmac",
            "> .de after",
            "> ..",
            "> .before",
            "> .after",
            "> .before",
            "> ' | groff > /dev/null",
            "* de trace enter: .after",
            "* trace exit: .after",
            "Here, the tracing is activated within the document, not by a command-line option.  As tracing",
            "was not active when macro before was defined, no call of this macro is  protocolled;  on  the",
            "other hand, the macro after is fully protocolled."
        ],
        "see_also": [
            {
                "name": "groff",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/groff/1/json"
            },
            {
                "name": "troff",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/troff/1/json"
            },
            {
                "name": "groffer",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/groffer/1/json"
            },
            {
                "name": "grofftmac",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/grofftmac/5/json"
            },
            {
                "name": "groff",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/groff/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": [
                    {
                        "name": "-m",
                        "lines": 14,
                        "flag": "-m"
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 5,
                "subsections": [
                    {
                        "name": "Command line option",
                        "lines": 18
                    },
                    {
                        "name": "Nested macro calls",
                        "lines": 21
                    },
                    {
                        "name": "Activating with .mso",
                        "lines": 20
                    }
                ]
            },
            {
                "name": "PROBLEMS",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 21,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "grofftrace - groff macro package trace.tmac\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "groff -m trace [option ...] [input-file ...]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The trace macro package of groff(1) can be a valuable tool for debugging documents written in\nthe roff formatting language.  A call stack trace is protocolled on standard error, this  is,\na  diagnostic message is emitted on entering and exiting of a macro call.  This greatly eases\nto track down an error in some macro.\n\nThis tracing process is activated by  specifying  the  groff  or  troff  command-line  option",
                "subsections": [
                    {
                        "name": "-m",
                        "content": "tained  by  including  the  macro  file  within  the  document  by  the  groff   macro   call\n.mso trace.tmac.  Only macros that are defined after this line are traced.\n\nIf  the command-line option -r trace-full=1 is given (or if this register is set in the docu‐\nment), number and string register assignments together with some other  requests  are  traced\nalso.\n\nIf  some  other macro package should be traced as well it must be specified after -m trace on\nthe command line.\n\nThe macro file trace.tmac is unusual because it does not contain any macros to be called by a\nuser.  Instead, the existing macro definition and appending facilities are modified such that\nthey display diagnostic messages.\n",
                        "flag": "-m"
                    }
                ]
            },
            "EXAMPLES": {
                "content": "In the following examples, a roff fragment is fed into groff via standard input.  As  we  are\nonly  interested in the diagnostic messages (standard error) on the terminal, the normal for‐\nmatted output (standard output) is redirected to the nirvana device /dev/null.  The resulting\ndiagnostic messages are displayed directly below the corresponding example.\n",
                "subsections": [
                    {
                        "name": "Command line option",
                        "content": "Example:\n\nsh# echo '.\n> .de testmacro\n> ..\n> .testmacro\n> .testmacro some dummy arguments\n> ' | groff -m trace > /dev/null\n\n* .de testmacro\n* de trace enter: .testmacro\n* trace exit: .testmacro\n* de trace enter: .testmacro \"some\" \"dummy\" \"arguments\"\n* trace exit: .testmacro \"some\" \"dummy\" \"arguments\"\n\nThe  entry  and  the exit of each macro call is displayed on the terminal (standard output) —\ntogether with the arguments (if any).\n"
                    },
                    {
                        "name": "Nested macro calls",
                        "content": "Example:\n\nsh# echo '.\n> .de child\n> ..\n> .de parent\n> .child\n> ..\n> .parent\n> ' | groff -m trace > /dev/null\n\n* .de child\n* .de parent\n* de trace enter: .parent\n* de trace enter: .child\n* trace exit: .child\n* trace exit: .parent\n\nThis shows that macro calls can be nested.  This powerful feature can help to tack down quite\ncomplex call stacks.\n"
                    },
                    {
                        "name": "Activating with .mso",
                        "content": "Example:\n\nsh# echo '.\n> .de before\n> ..\n> .mso trace.tmac\n> .de after\n> ..\n> .before\n> .after\n> .before\n> ' | groff > /dev/null\n\n* de trace enter: .after\n* trace exit: .after\n\nHere, the tracing is activated within the document, not by a command-line option.  As tracing\nwas not active when macro before was defined, no call of this macro is  protocolled;  on  the\nother hand, the macro after is fully protocolled.\n"
                    }
                ]
            },
            "PROBLEMS": {
                "content": "Because  trace.tmac wraps the .de request (and its cousins), macro arguments are expanded one\nlevel more.  This causes problems if an argument contains four backslashes or more to prevent\ntoo early expansion of the backslash.  For example, this macro call\n\n.foo \\\\\\\\n[bar]\n\nnormally  passes  ‘\\\\n[bar]’  to  macro  ‘.foo’, but with the redefined .de request it passes\n‘\\n[bar]’ instead.\n\nThe solution to this problem is to use groff's \\E escape which is an escape character not in‐\nterpreted in copy mode, for example\n\n.foo \\En[bar]\n",
                "subsections": []
            },
            "FILES": {
                "content": "The  trace  macros  are  kept  in  the  file  trace.tmac  located  in the tmac directory; see\ngrofftmac(5) for details.\n",
                "subsections": []
            },
            "ENVIRONMENT": {
                "content": "GROFFTMACPATH\nA colon-separated list of additional tmac directories in which  to  search  for  macro\nfiles; see grofftmac(5) for details.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "The  trace  macro  packages  was  written by James Clark.  This document was written by Bernd\nWarken ⟨groff-bernd.warken-72@web.de⟩.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Groff: The GNU Implementation of troff, by Trent A. Fisher and Werner Lemberg, is the primary\ngroff manual.  You can browse it interactively with “info groff”.\n\ngroff(1)\nAn overview of the groff system.\n\ntroff(1)\nFor details on option -m.\n\ngroffer(1)\nA viewer program for all kinds of roff documents.\n\ngrofftmac(5)\nA general description of groff macro packages.\n\ngroff(7)\nA short reference for the groff formatting language.\n\n\n\ngroff 1.22.4                                23 March 2022                             GROFFTRACE(7)",
                "subsections": []
            }
        }
    }
}