Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh DEBUG mode build changes - add extra trace output.



details:   https://anonhg.NetBSD.org/src/rev/5f33bb69bdc0
branches:  trunk
changeset: 448798:5f33bb69bdc0
user:      kre <kre%NetBSD.org@localhost>
date:      Sat Feb 09 09:17:59 2019 +0000

description:
DEBUG mode build changes - add extra trace output.

NFC for any normal shell build.

diffstat:

 bin/sh/eval.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (67 lines):

diff -r 85be01098235 -r 5f33bb69bdc0 bin/sh/eval.c
--- a/bin/sh/eval.c     Sat Feb 09 09:15:22 2019 +0000
+++ b/bin/sh/eval.c     Sat Feb 09 09:17:59 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eval.c,v 1.173 2019/02/09 09:15:22 kre Exp $   */
+/*     $NetBSD: eval.c,v 1.174 2019/02/09 09:17:59 kre Exp $   */
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c     8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.173 2019/02/09 09:15:22 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.174 2019/02/09 09:17:59 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -976,6 +976,7 @@
                 */
                cmdentry.cmdtype = CMDBUILTIN;
                cmdentry.u.bltin = bltincmd;
+               VTRACE(DBG_CMDS, ("No command name, assume \"comamnd\"\n"));
        } else {
                static const char PATH[] = "PATH=";
 
@@ -991,6 +992,8 @@
                        int argsused, use_syspath;
 
                        find_command(argv[0], &cmdentry, cmd_flags, path);
+                       VTRACE(DBG_CMDS, ("Command %s type %d\n", argv[0],
+                           cmdentry.cmdtype));
 #if 0
                        /*
                         * This short circuits all of the processing that
@@ -1010,10 +1013,13 @@
                        if (cmdentry.cmdtype != CMDBUILTIN ||
                            cmdentry.u.bltin != bltincmd)
                                break;
+                       VTRACE(DBG_CMDS, ("Command \"command\"\n"));
                        cmd_flags |= DO_NOFUNC;
                        argsused = parse_command_args(argc, argv, &use_syspath);
                        if (argsused == 0) {
                                /* use 'type' builtin to display info */
+                               VTRACE(DBG_CMDS,
+                                   ("Command \"command\" -> \"type\"\n"));
                                cmdentry.u.bltin = typecmd;
                                break;
                        }
@@ -1118,6 +1124,9 @@
                        default:
                                VFORK_UNDO();
                                                /* restore from vfork(2) */
+                               CTRACE(DBG_PROCS|DBG_CMDS,
+                                   ("parent after vfork - vforked=%d\n",
+                                     vforked));
                                handler = savehandler;
                                poplocalvars();
                                localvars = savelocalvars;
@@ -1146,6 +1155,7 @@
 #endif
                        if (forkshell(jp, cmd, mode) != 0)
                                goto parent;    /* at end of routine */
+                       CTRACE(DBG_PROCS|DBG_CMDS, ("Child sets EV_EXIT\n"));
                        flags |= EV_EXIT;
                        FORCEINTON;
 #ifdef DO_SHAREDVFORK



Home | Main Index | Thread Index | Old Index