config/debug/strace.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Dec 13 23:32:39 2011 +0100 (2011-12-13)
branch1.13
changeset 2847 c0bf2319af08
parent 2006 f15068f8ae3b
child 2733 3362c64f4b6c
permissions -rw-r--r--
scripts: fix dumping execution backtrace

Dumping the backtrace has been broken since changeset #652e56d6d35a:
scripts: execute each steps in a subshell

We can spawn sub-sub-shells in some cases.

The way the fault handler works is to dump the backtrace, but to avoid
printing it once for every sub-shell (which could get quite confusing),
it simply exits when it detects that it is being run in a sub-shell,
leaving to the top-level shell the work to dump the backtrace.

Because each step is executed in its own sub-shell, the variable arrays
that contain the step name, the source file and line number, are lost
when exiting the per-step sub-shell.

Hence, the backtrace is currently limited to printing only the top-level
main procedure of the shell.

Fix this thus:
- when dumping the bckatraces for the steps & the functions, remember
it was dumped, and only dump it if it was not already dumped
- at the top-level shell, print the hints

Also, rename the top-level step label.

Reported-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 4193d6e6a17430a177fa88c287879c2c35e319f3)
     1 # strace
     2 
     3 ## depends on ! BACKEND
     4 
     5 choice
     6     bool
     7     prompt "strace version"
     8 # Don't remove next line
     9 # CT_INSERT_VERSION_BELOW
    10 
    11 config STRACE_V_4_5_20
    12     bool
    13     prompt "4.5.20 (EXPERIMENTAL)"
    14     depends on EXPERIMENTAL
    15 
    16 config STRACE_V_4_5_19
    17     bool
    18     prompt "4.5.19"
    19 
    20 config STRACE_V_4_5_18
    21     bool
    22     prompt "4.5.18"
    23 
    24 config STRACE_V_4_5_17
    25     bool
    26     prompt "4.5.17 (OBSOLETE)"
    27     depends on OBSOLETE
    28 
    29 config STRACE_V_4_5_16
    30     bool
    31     prompt "4.5.16 (OBSOLETE)"
    32     depends on OBSOLETE
    33 
    34 config STRACE_V_4_5_15
    35     bool
    36     prompt "4.5.15 (OBSOLETE)"
    37     depends on OBSOLETE
    38 
    39 endchoice
    40 
    41 config STRACE_VERSION
    42     string
    43 # Don't remove next line
    44 # CT_INSERT_VERSION_STRING_BELOW
    45     default "4.5.20" if STRACE_V_4_5_20
    46     default "4.5.19" if STRACE_V_4_5_19
    47     default "4.5.18" if STRACE_V_4_5_18
    48     default "4.5.17" if STRACE_V_4_5_17
    49     default "4.5.16" if STRACE_V_4_5_16
    50     default "4.5.15" if STRACE_V_4_5_15