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