2011-05-26 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / tramp-frame.h
CommitLineData
4ea4748e 1/* Signal trampoline unwinder.
d2259dd3 2
7b6bb8da 3 Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011
4c38e0a4 4 Free Software Foundation, Inc.
d2259dd3
AC
5
6 This file is part of GDB.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
a9762ec7 10 the Free Software Foundation; either version 3 of the License, or
d2259dd3
AC
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
a9762ec7 19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
d2259dd3
AC
20
21#ifndef TRAMP_FRAME_H
22#define TRAMP_FRAME_H
23
2cd8546d
AC
24#include "frame.h" /* For "enum frame_type". */
25
d2259dd3
AC
26struct trad_frame;
27struct frame_info;
28struct trad_frame_cache;
29
30/* A trampoline consists of a small sequence of instructions placed at
31 an unspecified location in the inferior's address space. The only
32 identifying attribute of the trampoline's address is that it does
33 not fall inside an object file's section.
34
35 The only way to identify a trampoline is to perform a brute force
36 examination of the instructions at and around the PC.
37
938f5214 38 This module provides a convenient interface for performing that
d2259dd3
AC
39 operation. */
40
41/* A trampoline descriptor. */
42
1196bfda
AC
43/* Magic instruction that to mark the end of the signal trampoline
44 instruction sequence. */
45#define TRAMP_SENTINEL_INSN ((LONGEST) -1)
46
d2259dd3
AC
47struct tramp_frame
48{
2cd8546d
AC
49 /* The trampoline's type, some a signal trampolines, some are normal
50 call-frame trampolines (aka thunks). */
51 enum frame_type frame_type;
52 /* The trampoline's entire instruction sequence. It consists of a
53 bytes/mask pair. Search for this in the inferior at or around
54 the frame's PC. It is assumed that the PC is INSN_SIZE aligned,
55 and that each element of TRAMP contains one INSN_SIZE
56 instruction. It is also assumed that INSN[0] contains the first
57 instruction of the trampoline and hence the address of the
58 instruction matching INSN[0] is the trampoline's "func" address.
59 The instruction sequence is terminated by
1196bfda 60 TRAMP_SENTINEL_INSN. */
d2259dd3 61 int insn_size;
2cd8546d
AC
62 struct
63 {
64 ULONGEST bytes;
65 ULONGEST mask;
70f13f6b 66 } insn[48];
d2259dd3
AC
67 /* Initialize a trad-frame cache corresponding to the tramp-frame.
68 FUNC is the address of the instruction TRAMP[0] in memory. */
69 void (*init) (const struct tramp_frame *self,
25492ce3 70 struct frame_info *this_frame,
d2259dd3
AC
71 struct trad_frame_cache *this_cache,
72 CORE_ADDR func);
73};
74
fb2be677
AC
75void tramp_frame_prepend_unwinder (struct gdbarch *gdbarch,
76 const struct tramp_frame *tramp);
d2259dd3
AC
77
78#endif
This page took 0.667764 seconds and 4 git commands to generate.