1 Status: Checked in to HEAD after 6.3.
3 2004-11-07 Daniel Jacobowitz <dan@debian.org>
5 * dwarf2-frame.c (struct dwarf2_frame_ops): Add signal_frame_p.
6 (dwarf2_frame_set_signal_frame_p, dwarf2_frame_signal_frame_p)
7 (dwarf2_signal_frame_unwind): New.
8 (dwarf2_frame_sniffer): Use dwarf2_frame_signal_frame_p.
9 * dwarf2-frame.h (dwarf2_frame_set_signal_frame_p): New prototype.
11 Index: src/gdb/dwarf2-frame.c
12 ===================================================================
13 RCS file: /big/fsf/rsync/src-cvs/src/gdb/dwarf2-frame.c,v
14 retrieving revision 1.41
15 diff -u -p -r1.41 dwarf2-frame.c
16 --- src/gdb/dwarf2-frame.c 4 Nov 2004 21:15:15 -0000 1.41
17 +++ src/gdb/dwarf2-frame.c 7 Nov 2004 17:41:58 -0000
18 @@ -471,6 +471,10 @@ struct dwarf2_frame_ops
20 /* Pre-initialize the register state REG for register REGNUM. */
21 void (*init_reg) (struct gdbarch *, int, struct dwarf2_frame_state_reg *);
23 + /* Check whether the frame preceding NEXT_FRAME will be a signal
25 + int (*signal_frame_p) (struct gdbarch *, struct frame_info *);
28 /* Default architecture-specific register state initialization
29 @@ -547,6 +551,33 @@ dwarf2_frame_init_reg (struct gdbarch *g
31 ops->init_reg (gdbarch, regnum, reg);
34 +/* Set the architecture-specific signal trampoline recognition
35 + function for GDBARCH to SIGNAL_FRAME_P. */
38 +dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch,
39 + int (*signal_frame_p) (struct gdbarch *,
40 + struct frame_info *))
42 + struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data);
44 + ops->signal_frame_p = signal_frame_p;
47 +/* Query the architecture-specific signal frame recognizer for
51 +dwarf2_frame_signal_frame_p (struct gdbarch *gdbarch,
52 + struct frame_info *next_frame)
54 + struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data);
56 + if (ops->signal_frame_p == NULL)
58 + return ops->signal_frame_p (gdbarch, next_frame);
62 struct dwarf2_frame_cache
63 @@ -841,6 +872,13 @@ static const struct frame_unwind dwarf2_
64 dwarf2_frame_prev_register
67 +static const struct frame_unwind dwarf2_signal_frame_unwind =
70 + dwarf2_frame_this_id,
71 + dwarf2_frame_prev_register
74 const struct frame_unwind *
75 dwarf2_frame_sniffer (struct frame_info *next_frame)
77 @@ -848,10 +886,18 @@ dwarf2_frame_sniffer (struct frame_info
78 function. frame_pc_unwind(), for a no-return next function, can
79 end up returning something past the end of this function's body. */
80 CORE_ADDR block_addr = frame_unwind_address_in_block (next_frame);
81 - if (dwarf2_frame_find_fde (&block_addr))
82 - return &dwarf2_frame_unwind;
83 + if (!dwarf2_frame_find_fde (&block_addr))
87 + /* On some targets, signal trampolines may have unwind information.
88 + We need to recognize them so that we set the frame type
91 + if (dwarf2_frame_signal_frame_p (get_frame_arch (next_frame),
93 + return &dwarf2_signal_frame_unwind;
95 + return &dwarf2_frame_unwind;
99 Index: src/gdb/dwarf2-frame.h
100 ===================================================================
101 RCS file: /big/fsf/rsync/src-cvs/src/gdb/dwarf2-frame.h,v
102 retrieving revision 1.6
103 diff -u -p -r1.6 dwarf2-frame.h
104 --- src/gdb/dwarf2-frame.h 28 Feb 2004 16:59:32 -0000 1.6
105 +++ src/gdb/dwarf2-frame.h 7 Nov 2004 17:40:41 -0000
106 @@ -79,6 +79,14 @@ extern void dwarf2_frame_set_init_reg (s
107 void (*init_reg) (struct gdbarch *, int,
108 struct dwarf2_frame_state_reg *));
110 +/* Set the architecture-specific signal trampoline recognition
111 + function for GDBARCH to SIGNAL_FRAME_P. */
114 + dwarf2_frame_set_signal_frame_p (struct gdbarch *gdbarch,
115 + int (*signal_frame_p) (struct gdbarch *,
116 + struct frame_info *));
118 /* Return the frame unwind methods for the function that contains PC,
119 or NULL if it can't be handled by DWARF CFI frame unwinder. */