]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/alpha/vms-unwind.h
alpha.c (alpha_links): Add 'target' field.
[thirdparty/gcc.git] / gcc / config / alpha / vms-unwind.h
CommitLineData
8662eb14 1/* DWARF2 EH unwinding support for Alpha VMS.
2f83c7d6 2 Copyright (C) 2004, 2007 Free Software Foundation, Inc.
8662eb14
AM
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
2f83c7d6 8the Free Software Foundation; either version 3, or (at your option)
8662eb14
AM
9any later version.
10
11GCC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
2f83c7d6
NC
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
8662eb14
AM
19
20#include <pdscdef.h>
21
22#define MD_FALLBACK_FRAME_STATE_FOR alpha_fallback_frame_state
23
24static _Unwind_Reason_Code
25alpha_fallback_frame_state (struct _Unwind_Context *context,
26 _Unwind_FrameState *fs)
27{
28 PDSCDEF *pv = *((PDSCDEF **) context->reg [29]);
29
30 if (pv && ((long) pv & 0x7) == 0) /* low bits 0 means address */
31 pv = *(PDSCDEF **) pv;
32
33 if (pv && ((pv->pdsc$w_flags & 0xf) == PDSC$K_KIND_FP_STACK))
34 {
35 int i, j;
36
6673f90b
NF
37 fs->regs.cfa_offset = pv->pdsc$l_size;
38 fs->regs.cfa_reg = pv->pdsc$w_flags & PDSC$M_BASE_REG_IS_FP ? 29 : 30;
8662eb14 39 fs->retaddr_column = 26;
6673f90b 40 fs->regs.cfa_how = CFA_REG_OFFSET;
8662eb14
AM
41 fs->regs.reg[27].loc.offset = -pv->pdsc$l_size;
42 fs->regs.reg[27].how = REG_SAVED_OFFSET;
43 fs->regs.reg[26].loc.offset
44 = -(pv->pdsc$l_size - pv->pdsc$w_rsa_offset);
45 fs->regs.reg[26].how = REG_SAVED_OFFSET;
46
47 for (i = 0, j = 0; i < 32; i++)
48 if (1<<i & pv->pdsc$l_ireg_mask)
49 {
50 fs->regs.reg[i].loc.offset
51 = -(pv->pdsc$l_size - pv->pdsc$w_rsa_offset - 8 * ++j);
52 fs->regs.reg[i].how = REG_SAVED_OFFSET;
53 }
54
55 return _URC_NO_REASON;
56 }
57 else if (pv && ((pv->pdsc$w_flags & 0xf) == PDSC$K_KIND_FP_REGISTER))
58 {
6673f90b
NF
59 fs->regs.cfa_offset = pv->pdsc$l_size;
60 fs->regs.cfa_reg = pv->pdsc$w_flags & PDSC$M_BASE_REG_IS_FP ? 29 : 30;
8662eb14 61 fs->retaddr_column = 26;
6673f90b 62 fs->regs.cfa_how = CFA_REG_OFFSET;
8662eb14
AM
63 fs->regs.reg[26].loc.reg = pv->pdsc$b_save_ra;
64 fs->regs.reg[26].how = REG_SAVED_REG;
65 fs->regs.reg[29].loc.reg = pv->pdsc$b_save_fp;
66 fs->regs.reg[29].how = REG_SAVED_REG;
67
68 return _URC_NO_REASON;
69 }
70 return _URC_END_OF_STACK;
71}