2011-05-26 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / alpha-osf1-tdep.c
CommitLineData
36a6271d 1/* Target-dependent code for OSF/1 on Alpha.
7b6bb8da 2 Copyright (C) 2002, 2003, 2007, 2008, 2009, 2010, 2011
4c38e0a4 3 Free Software Foundation, Inc.
36a6271d
JT
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
a9762ec7 9 the Free Software Foundation; either version 3 of the License, or
36a6271d
JT
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
a9762ec7 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
36a6271d
JT
19
20#include "defs.h"
21#include "frame.h"
5868c862 22#include "gdbcore.h"
36a6271d 23#include "value.h"
4be87837 24#include "osabi.h"
4c2e2391 25#include "gdb_string.h"
9798ab0d 26#include "objfiles.h"
36a6271d
JT
27
28#include "alpha-tdep.h"
29
6c72f9f9 30static int
e17a4113
UW
31alpha_osf1_pc_in_sigtramp (struct gdbarch *gdbarch,
32 CORE_ADDR pc, char *func_name)
6c72f9f9 33{
bde58177 34 return (func_name != NULL && strcmp ("__sigtramp", func_name) == 0);
6c72f9f9
JT
35}
36
5868c862 37static CORE_ADDR
6834c9bb 38alpha_osf1_sigcontext_addr (struct frame_info *this_frame)
5868c862 39{
e17a4113
UW
40 struct gdbarch *gdbarch = get_frame_arch (this_frame);
41 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
6834c9bb
JB
42 struct frame_info *next_frame = get_next_frame (this_frame);
43 struct frame_id next_id = null_frame_id;
44
45 if (next_frame != NULL)
46 next_id = get_frame_id (next_frame);
37bb6d9f 47
e17a4113 48 return (read_memory_integer (next_id.stack_addr, 8, byte_order));
5868c862
JT
49}
50
36a6271d
JT
51static void
52alpha_osf1_init_abi (struct gdbarch_info info,
53 struct gdbarch *gdbarch)
54{
55 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
56
0bd79c5c
JB
57 /* Hook into the MDEBUG frame unwinder. */
58 alpha_mdebug_init_abi (info, gdbarch);
59
c8edd8b4 60 /* The next/step support via procfs on OSF1 is broken when running
0963b4bd
MS
61 on multi-processor machines. We need to use software single
62 stepping instead. */
c8edd8b4 63 set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
6c72f9f9 64
5868c862 65 tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
f2524b93 66 tdep->pc_in_sigtramp = alpha_osf1_pc_in_sigtramp;
accc6d1f
JT
67
68 tdep->jb_pc = 2;
69 tdep->jb_elt_size = 8;
36a6271d
JT
70}
71
63807e1d
PA
72/* Provide a prototype to silence -Wmissing-prototypes. */
73extern initialize_file_ftype _initialize_alpha_osf1_tdep;
74
36a6271d
JT
75void
76_initialize_alpha_osf1_tdep (void)
77{
05816f70
MK
78 gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OSF1,
79 alpha_osf1_init_abi);
36a6271d 80}
This page took 0.545651 seconds and 4 git commands to generate.