scripts/build/arch/x86.sh
author "Yann E. MORIN" <yann.morin.1998@free.fr>
Sat Oct 06 23:48:07 2012 +0200 (2012-10-06)
changeset 3083 3a7b2eee9dcd
parent 1635 5d1936ad5ba8
child 3169 9d0b37f08a10
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
yann@383
     1
# Compute x86-specific values
yann@383
     2
yann@1635
     3
# This one really needs a little love! :-(
yann@383
     4
yann@964
     5
CT_DoArchTupleValues() {
yann@383
     6
yann@1635
     7
    # Override the architecture part of the tuple:
yann@1635
     8
    if [ "${CT_ARCH_64}" = "y" ]; then
yann@1635
     9
        CT_TARGET_ARCH=x86_64
yann@1635
    10
    else
yann@1635
    11
        arch="${CT_ARCH_ARCH}"
yann@1635
    12
        [ -z "${arch}" ] && arch="${CT_ARCH_TUNE}"
yann@1635
    13
        case "${arch}" in
yann@1635
    14
            "")                           CT_TARGET_ARCH=i386;;
yann@1635
    15
            i386|i486|i586|i686)          CT_TARGET_ARCH="${arch}";;
yann@1635
    16
            winchip*)                     CT_TARGET_ARCH=i486;;
yann@1635
    17
            pentium|pentium-mmx|c3*)      CT_TARGET_ARCH=i586;;
yann@1635
    18
            pentiumpro|pentium*|athlon*)  CT_TARGET_ARCH=i686;;
titus@2759
    19
            prescott)                     CT_TARGET_ARCH=i686;;
yann@1635
    20
            *)                            CT_TARGET_ARCH=i586;;
yann@1635
    21
        esac
yann@1635
    22
    fi
yann@383
    23
}