config/global/ct-behave.in
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Sat Oct 06 23:48:07 2012 +0200 (2012-10-06)
changeset 3083 3a7b2eee9dcd
parent 2484 d1a8c2ae7946
child 3163 06938bc1c6e7
permissions -rw-r--r--
scripts: add option to start an interactive debug shell

Add an option that, when a command fails:
- starts an interactive shell with the failed command's environment
- attempts re-execution of the failed command, continues, or aborts
at user's whim.

Before starting the debug-shell, the backtrace is printed.
When exiting for an abort, the standard error message is printed.

Based on an idea and a patch from: Johannes Stezenbach <js@sig21.net>
http://sourceware.org/ml/crossgcc/2012-09/msg00144.html

Signed-off-by: Johannes Stezenbach <js@sig21.net>
[yann.morin.1998@free.fr: integrate in the fault handler]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: Johannes Stezenbach <js@sig21.net>
Patchwork-Id: 191571
Patchwork-Id: 191668
     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 config DEBUG_INTERACTIVE
    91     bool
    92     prompt "Interactive shell on failed commands"
    93     help
    94       If you say 'y' here, then an interactive shell will be spawned for
    95       each failed command.
    96       
    97       This shell will have the same environment that the failed command
    98       was run with, and the working directory will be set to the directory
    99       the failed command was run in.
   100       
   101       After you fix the issue, you can exit the interactive shell with any
   102       of these exit codes:
   103         1  the issue was fixed, continue the build with the next command
   104         2  the issue was fixed, re-run the failed command
   105         3  abort the build
   106       
   107       Note: '2' is only possible for commands run via CT_DoExecLog, though.
   108 
   109 endif