config/debug/gdb.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 2692 8d989a8a320e
child 2803 8e6fc0fe3bc9
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)
yann@96
     1
# GDB menu
yann@96
     2
yann@2444
     3
## help gdb is the GNU debugger
yann@96
     4
yann@1849
     5
source "config/debug/gdb.in.cross"
yann@1849
     6
source "config/debug/gdb.in.native"
yann@1849
     7
source "config/debug/gdb.in.gdbserver"
yann@1269
     8
yann@2417
     9
if GDB_CROSS || GDB_NATIVE || GDB_GDBSERVER
yann@2417
    10
yann@2417
    11
comment "gdb version"
yann@2417
    12
yann@2417
    13
config DEBUG_GDB_SHOW_LINARO
yann@2417
    14
    bool
yann@2417
    15
    prompt "Show Linaro versions (EXPERIMENTAL)"
yann@2417
    16
    depends on EXPERIMENTAL
yann@2417
    17
    help
yann@2417
    18
      Linaro is maintaining some advanced/more stable/experimental versions
yann@2417
    19
      of gdb, especially for the ARM architecture.
yann@2417
    20
yann@2417
    21
      Those versions have not been blessed by the gdb community (nor have they
yann@2417
    22
      been cursed either!), but they look to be pretty much stable, and even
yann@2417
    23
      more stable than the upstream versions. YMMV...
yann@2417
    24
yann@2417
    25
      If you do not know what this Linaro stuff is, then simply say 'n' here,
yann@2417
    26
      and rest in peace. OTOH, if you know what you are doing, you will be
yann@2417
    27
      able to use and enjoy :-) the Linaro versions by saying 'y' here.
yann@2417
    28
yann@2417
    29
      Linaro: http://www.linaro.org/
yann@2417
    30
yann@96
    31
choice
yann@96
    32
    bool
yann@96
    33
    prompt "gdb version"
yann@1535
    34
# Don't remove next line
yann@1535
    35
# CT_INSERT_VERSION_BELOW
yann@1534
    36
benoit@2720
    37
config GDB_V_linaro_7_3_2011_10
benoit@2612
    38
    bool
benoit@2720
    39
    prompt "linaro-7.3-2011.10 (EXPERIMENTAL)"
benoit@2612
    40
    depends on DEBUG_GDB_SHOW_LINARO
benoit@2612
    41
    select GDB_7_0_or_later
benoit@2612
    42
yann@2654
    43
config GDB_V_7_3a
benoit@2612
    44
    bool
yann@2654
    45
    prompt "7.3a (EXPERIMENTAL)"
benoit@2612
    46
    depends on EXPERIMENTAL
benoit@2612
    47
    select GDB_7_0_or_later
benoit@2612
    48
benoit@2478
    49
config GDB_V_linaro_7_2_2011_05_0
yann@2303
    50
    bool
benoit@2478
    51
    prompt "linaro-7.2-2011.05-0 (EXPERIMENTAL)"
yann@2417
    52
    depends on DEBUG_GDB_SHOW_LINARO
yann@2303
    53
    select GDB_7_0_or_later
yann@2303
    54
yann@2654
    55
config GDB_V_7_2a
jon@2168
    56
    bool
yann@2654
    57
    prompt "7.2a (EXPERIMENTAL)"
jon@2168
    58
    depends on EXPERIMENTAL
jon@2168
    59
    select GDB_7_0_or_later
jon@2168
    60
yann@2654
    61
config GDB_V_7_1a
yann@1874
    62
    bool
yann@2654
    63
    prompt "7.1a (EXPERIMENTAL)"
yann@1874
    64
    depends on EXPERIMENTAL
yann@1874
    65
    select GDB_7_0_or_later
yann@1874
    66
yann@2654
    67
config GDB_V_7_0_1a
jocke@1705
    68
    bool
yann@2654
    69
    prompt "7.0.1a (EXPERIMENTAL)"
jocke@1705
    70
    depends on EXPERIMENTAL
yann@1852
    71
    select GDB_7_0_or_later
jocke@1705
    72
yann@2654
    73
config GDB_V_7_0a
yann@1612
    74
    bool
yann@2654
    75
    prompt "7.0a (EXPERIMENTAL)"
yann@1612
    76
    depends on EXPERIMENTAL
yann@1852
    77
    select GDB_7_0_or_later
yann@1612
    78
yann@2654
    79
config GDB_V_6_8a
yann@1534
    80
    bool
yann@2654
    81
    prompt "6.8a"
yann@1534
    82
yann@96
    83
endchoice
yann@96
    84
yann@1852
    85
config GDB_7_0_or_later
yann@1852
    86
    bool
benoit@2490
    87
    select GDB_HAS_PKGVERSION_BUGURL
yann@2575
    88
    select GDB_INSTALL_GDBINIT
benoit@2490
    89
benoit@2490
    90
config GDB_HAS_PKGVERSION_BUGURL
benoit@2490
    91
    bool
yann@1852
    92
yann@2575
    93
config GDB_INSTALL_GDBINIT
yann@2575
    94
    bool
yann@2575
    95
yann@96
    96
config GDB_VERSION
yann@96
    97
    string
yann@1535
    98
# Don't remove next line
yann@1535
    99
# CT_INSERT_VERSION_STRING_BELOW
benoit@2720
   100
    default "linaro-7.3-2011.10" if GDB_V_linaro_7_3_2011_10
yann@2654
   101
    default "7.3a" if GDB_V_7_3a
benoit@2478
   102
    default "linaro-7.2-2011.05-0" if GDB_V_linaro_7_2_2011_05_0
yann@2654
   103
    default "7.2a" if GDB_V_7_2a
yann@2654
   104
    default "7.1a" if GDB_V_7_1a
yann@2654
   105
    default "7.0.1a" if GDB_V_7_0_1a
yann@2654
   106
    default "7.0a" if GDB_V_7_0a
yann@2654
   107
    default "6.8a" if GDB_V_6_8a
yann@2417
   108
yann@2417
   109
endif