diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-30 18:30:29 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-10-30 18:30:29 +0100 |
commit | 474ed06c3939391cbfd7b70bf4960403ae166762 (patch) | |
tree | 919267e0c24c7e1d08cbb9389694e571f330d6cf | |
parent | 493b9cae808093ff5d89b5fb794e3991859e7df6 (diff) | |
download | busybox-w32-474ed06c3939391cbfd7b70bf4960403ae166762.tar.gz busybox-w32-474ed06c3939391cbfd7b70bf4960403ae166762.tar.bz2 busybox-w32-474ed06c3939391cbfd7b70bf4960403ae166762.zip |
ash: fix bit-rotten debug infrastructure
DEBUG = 2 output was a bit messed up
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/ash.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/shell/ash.c b/shell/ash.c index 0c8480587..d617168b9 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -844,13 +844,8 @@ trace_vprintf(const char *fmt, va_list va) | |||
844 | { | 844 | { |
845 | if (debug != 1) | 845 | if (debug != 1) |
846 | return; | 846 | return; |
847 | if (DEBUG_TIME) | ||
848 | fprintf(tracefile, "%u ", (int) time(NULL)); | ||
849 | if (DEBUG_PID) | ||
850 | fprintf(tracefile, "[%u] ", (int) getpid()); | ||
851 | if (DEBUG_SIG) | ||
852 | fprintf(tracefile, "pending s:%d i:%d(supp:%d) ", pending_sig, pending_int, suppress_int); | ||
853 | vfprintf(tracefile, fmt, va); | 847 | vfprintf(tracefile, fmt, va); |
848 | fprintf(tracefile, "\n"); | ||
854 | } | 849 | } |
855 | 850 | ||
856 | static void | 851 | static void |
@@ -1243,11 +1238,10 @@ ash_vmsg_and_raise(int cond, const char *msg, va_list ap) | |||
1243 | { | 1238 | { |
1244 | #if DEBUG | 1239 | #if DEBUG |
1245 | if (msg) { | 1240 | if (msg) { |
1246 | TRACE(("ash_vmsg_and_raise(%d, \"", cond)); | 1241 | TRACE(("ash_vmsg_and_raise(%d):", cond)); |
1247 | TRACEV((msg, ap)); | 1242 | TRACEV((msg, ap)); |
1248 | TRACE(("\") pid=%d\n", getpid())); | ||
1249 | } else | 1243 | } else |
1250 | TRACE(("ash_vmsg_and_raise(%d, NULL) pid=%d\n", cond, getpid())); | 1244 | TRACE(("ash_vmsg_and_raise(%d):NULL\n", cond)); |
1251 | if (msg) | 1245 | if (msg) |
1252 | #endif | 1246 | #endif |
1253 | ash_vmsg(msg, ap); | 1247 | ash_vmsg(msg, ap); |
@@ -13422,16 +13416,15 @@ int ash_main(int argc UNUSED_PARAM, char **argv) | |||
13422 | goto state4; | 13416 | goto state4; |
13423 | } | 13417 | } |
13424 | exception_handler = &jmploc; | 13418 | exception_handler = &jmploc; |
13425 | #if DEBUG | ||
13426 | opentrace(); | ||
13427 | TRACE(("Shell args: ")); | ||
13428 | trace_puts_args(argv); | ||
13429 | #endif | ||
13430 | rootpid = getpid(); | 13419 | rootpid = getpid(); |
13431 | 13420 | ||
13432 | init(); | 13421 | init(); |
13433 | setstackmark(&smark); | 13422 | setstackmark(&smark); |
13434 | procargs(argv); | 13423 | procargs(argv); |
13424 | #if DEBUG | ||
13425 | TRACE(("Shell args: ")); | ||
13426 | trace_puts_args(argv); | ||
13427 | #endif | ||
13435 | 13428 | ||
13436 | if (argv[0] && argv[0][0] == '-') | 13429 | if (argv[0] && argv[0][0] == '-') |
13437 | isloginsh = 1; | 13430 | isloginsh = 1; |