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