add arm fix for gdb from #1468
[openwrt-10.03/.git] / toolchain / gdb / patches / 790-debian_dwarf2-cfi-warning.patch
1 Status: Unsuitable for upstream (at least, without a lot of arguing).
2
3 GCC does not specify the state of every last register in the CIE.  Since
4 GCC's focus is on correctness of runtime unwinding, any registers which
5 have to be unwound will be specified; but unmodified registers will not
6 be explicitly marked.  (How about modified, call-clobbered registers?
7 I'm not sure if they are marked as unavailable.)
8
9 GDB issues a noisy warning about this.  The warning is generally not useful,
10 and we can get it extremely frequently (any time we load a new CIE).
11
12 This patch disables the warning.  Alternately we could set the complaints
13 threshold to zero, or implement a default frame init-register method for
14 every architecture.  But someday the compiler will support using different
15 calling conventions for internal functions, so that's not much of a stopgap. 
16 ARM has a complex algorithm for handling this, involving scanning all CIEs -
17 benefit not completely clear outside of the ARM context of flexible register
18 sets.
19
20 Index: gdb-6.3/gdb/dwarf2-frame.c
21 ===================================================================
22 --- gdb-6.3.orig/gdb/dwarf2-frame.c     2004-11-15 11:54:57.000000000 -0500
23 +++ gdb-6.3/gdb/dwarf2-frame.c  2004-12-08 18:02:23.896409471 -0500
24 @@ -705,9 +705,12 @@ dwarf2_frame_cache (struct frame_info *n
25            table.  We need a way of iterating through all the valid
26            DWARF2 register numbers.  */
27         if (fs->regs.reg[column].how == DWARF2_FRAME_REG_UNSPECIFIED)
28 -         complaint (&symfile_complaints,
29 -                    "Incomplete CFI data; unspecified registers at 0x%s",
30 -                    paddr (fs->pc));
31 +         {
32 +           if (0)
33 +             complaint (&symfile_complaints,
34 +                        "Incomplete CFI data; unspecified registers at 0x%s",
35 +                        paddr (fs->pc));
36 +         }
37         else
38           cache->reg[regnum] = fs->regs.reg[column];
39        }