config/global/ct-behave.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 2227 5158aa602e58
child 3083 3a7b2eee9dcd
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 # Options specific to crosstool-NG overall behavior
     2 
     3 comment "crosstool-NG behavior"
     4 
     5 config OBSOLETE
     6     bool
     7     prompt "Use obsolete features"
     8     help
     9       If you set this to Y, you will be able to select obsolete features.
    10       
    11       Such obsolete features are the use of old kernel headers, old gcc
    12       versions, etc... for which maintaining support in crosstool-NG
    13       would be very costly.
    14       
    15       It does not however mean that the specific feature or version has been
    16       marked obsolete by the upstream team.
    17 
    18 config EXPERIMENTAL
    19     bool
    20     prompt "Try features marked as EXPERIMENTAL"
    21     help
    22       If you set this to Y, then you will be able to try very experimental
    23       features.
    24       
    25       Experimental features can be one of:
    26         - working, in which case you should tell me it is!
    27         - buggy, in which case you could try patching and send me the result
    28         - unfinished, in which case you could try hacking it and send me the result
    29         - non-existant, in which case you could also try hacking it in and send me
    30           the result
    31 
    32 config DEBUG_CT
    33     bool
    34     prompt "Debug crosstool-NG"
    35     depends on ! BACKEND
    36     help
    37       Say 'y' here to get some options regarding debugging crosstool-NG.
    38 
    39 if DEBUG_CT
    40 
    41 config DEBUG_PAUSE_STEPS
    42     bool
    43     prompt "Pause between every steps"
    44     help
    45       Say 'y' if you intend to attend the build, and want to investigate
    46       the result of each steps before running the next one.
    47 
    48 config DEBUG_CT_SAVE_STEPS
    49     bool
    50     prompt "Save intermediate steps"
    51     help
    52       If you say 'y' here, then you will be able to restart crosstool-NG at
    53       any step.
    54       
    55       It is not currently possible to restart at any of the debug facilities.
    56       They are treated as a whole.
    57       
    58       To get the full list os steps, run: ct-ng list-steps
    59 
    60 config DEBUG_CT_SAVE_STEPS_GZIP
    61     bool
    62     prompt "gzip saved states"
    63     default y
    64     depends on DEBUG_CT_SAVE_STEPS
    65     help
    66       If you are tight on space, then you can ask to gzip the saved states
    67       tarballs. On the other hand, this takes some longer time...
    68       
    69       To lose as less time as possible, the gzip process is done with a low
    70       compression ratio (-3), which gives roughly 70% gain in size. Going
    71       further doesn't gain much, and takes far more time (believe me, I've
    72       got figures here! :-) ).
    73 
    74 config NO_OVERIDE_LC_MESSAGES
    75     bool
    76     prompt "Do *not* overide LC_MESSAGES (EXPERIMENTAL)"
    77     depends on EXPERIMENTAL
    78     help
    79       By default, crosstool-NG sets and exports LC_ALL=C so that the
    80       build.log file contains english messages, that can be read by
    81       people most likely to help interpret the logs. If you say N here,
    82       and your locale is not an english language, then dissecting your
    83       log file will be difficult for most people but you.
    84       
    85       If you say Y here, then your current locale settings will be used
    86       to print messages, instead of plain english.
    87       
    88       Say N, please.
    89 
    90 endif