diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-11 15:31:59 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-11 15:31:59 +0200 |
| commit | 883cea47518a171ab83f8e41def3aec92207519e (patch) | |
| tree | 3de35b80e52f0259ef2cc92db52308c34e943d46 /shell | |
| parent | 2e6d4ef695c4be0ff1963e24315bc5bec6c5313b (diff) | |
| download | busybox-w32-883cea47518a171ab83f8e41def3aec92207519e.tar.gz busybox-w32-883cea47518a171ab83f8e41def3aec92207519e.tar.bz2 busybox-w32-883cea47518a171ab83f8e41def3aec92207519e.zip | |
ash: fixes in debug printouts
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/ash.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/shell/ash.c b/shell/ash.c index 9b40ca3c6..027dc7c6f 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
| @@ -251,7 +251,7 @@ static void trace_vprintf(const char *fmt, va_list va); | |||
| 251 | # define close(fd) do { \ | 251 | # define close(fd) do { \ |
| 252 | int dfd = (fd); \ | 252 | int dfd = (fd); \ |
| 253 | if (close(dfd) < 0) \ | 253 | if (close(dfd) < 0) \ |
| 254 | bb_error_msg("bug on %d: closing %d(%x)", \ | 254 | bb_error_msg("bug on %d: closing %d(0x%x)", \ |
| 255 | __LINE__, dfd, dfd); \ | 255 | __LINE__, dfd, dfd); \ |
| 256 | } while (0) | 256 | } while (0) |
| 257 | #else | 257 | #else |
| @@ -997,7 +997,7 @@ static void | |||
| 997 | showtree(union node *n) | 997 | showtree(union node *n) |
| 998 | { | 998 | { |
| 999 | trace_puts("showtree called\n"); | 999 | trace_puts("showtree called\n"); |
| 1000 | shtree(n, 1, NULL, stdout); | 1000 | shtree(n, 1, NULL, stderr); |
| 1001 | } | 1001 | } |
| 1002 | 1002 | ||
| 1003 | #endif /* DEBUG */ | 1003 | #endif /* DEBUG */ |
| @@ -3987,7 +3987,7 @@ showjobs(FILE *out, int mode) | |||
| 3987 | { | 3987 | { |
| 3988 | struct job *jp; | 3988 | struct job *jp; |
| 3989 | 3989 | ||
| 3990 | TRACE(("showjobs(%x) called\n", mode)); | 3990 | TRACE(("showjobs(0x%x) called\n", mode)); |
| 3991 | 3991 | ||
| 3992 | /* Handle all finished jobs */ | 3992 | /* Handle all finished jobs */ |
| 3993 | while (dowait(DOWAIT_NONBLOCK, NULL) > 0) | 3993 | while (dowait(DOWAIT_NONBLOCK, NULL) > 0) |
| @@ -4048,7 +4048,7 @@ getstatus(struct job *job) | |||
| 4048 | } | 4048 | } |
| 4049 | retval += 128; | 4049 | retval += 128; |
| 4050 | } | 4050 | } |
| 4051 | TRACE(("getstatus: job %d, nproc %d, status %x, retval %x\n", | 4051 | TRACE(("getstatus: job %d, nproc %d, status 0x%x, retval 0x%x\n", |
| 4052 | jobno(job), job->nprocs, status, retval)); | 4052 | jobno(job), job->nprocs, status, retval)); |
| 4053 | return retval; | 4053 | return retval; |
| 4054 | } | 4054 | } |
| @@ -8496,7 +8496,7 @@ poplocalvars(void) | |||
| 8496 | while ((lvp = localvars) != NULL) { | 8496 | while ((lvp = localvars) != NULL) { |
| 8497 | localvars = lvp->next; | 8497 | localvars = lvp->next; |
| 8498 | vp = lvp->vp; | 8498 | vp = lvp->vp; |
| 8499 | TRACE(("poplocalvar %s", vp ? vp->text : "-")); | 8499 | TRACE(("poplocalvar %s\n", vp ? vp->text : "-")); |
| 8500 | if (vp == NULL) { /* $- saved */ | 8500 | if (vp == NULL) { /* $- saved */ |
| 8501 | memcpy(optlist, lvp->text, sizeof(optlist)); | 8501 | memcpy(optlist, lvp->text, sizeof(optlist)); |
| 8502 | free((char*)lvp->text); | 8502 | free((char*)lvp->text); |
| @@ -9348,7 +9348,7 @@ preadfd(void) | |||
| 9348 | * 2) If an EOF was pushed back (g_parsefile->left_in_line < -BIGNUM) | 9348 | * 2) If an EOF was pushed back (g_parsefile->left_in_line < -BIGNUM) |
| 9349 | * or we are reading from a string so we can't refill the buffer, | 9349 | * or we are reading from a string so we can't refill the buffer, |
| 9350 | * return EOF. | 9350 | * return EOF. |
| 9351 | * 3) If the is more stuff in this buffer, use it else call read to fill it. | 9351 | * 3) If there is more stuff in this buffer, use it else call read to fill it. |
| 9352 | * 4) Process input up to the next newline, deleting nul characters. | 9352 | * 4) Process input up to the next newline, deleting nul characters. |
| 9353 | */ | 9353 | */ |
| 9354 | //#define pgetc_debug(...) bb_error_msg(__VA_ARGS__) | 9354 | //#define pgetc_debug(...) bb_error_msg(__VA_ARGS__) |
| @@ -11843,8 +11843,9 @@ cmdloop(int top) | |||
| 11843 | #endif | 11843 | #endif |
| 11844 | } | 11844 | } |
| 11845 | n = parsecmd(inter); | 11845 | n = parsecmd(inter); |
| 11846 | #if DEBUG | 11846 | #if DEBUG > 2 |
| 11847 | showtree(n); | 11847 | if (debug && (n != NEOF)) |
| 11848 | showtree(n); | ||
| 11848 | #endif | 11849 | #endif |
| 11849 | if (n == NEOF) { | 11850 | if (n == NEOF) { |
| 11850 | if (!top || numeof >= 50) | 11851 | if (!top || numeof >= 50) |
