* linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
[deliverable/binutils-gdb.git] / gdb / alpha-osf1-tdep.c
1 /* Target-dependent code for OSF/1 on Alpha.
2 Copyright 2002, 2003 Free Software Foundation, Inc.
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
8 the Free Software Foundation; either version 2 of the License, or
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
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 #include "defs.h"
22 #include "frame.h"
23 #include "gdbcore.h"
24 #include "value.h"
25 #include "osabi.h"
26 #include "gdb_string.h"
27 #include "objfiles.h"
28
29 #include "alpha-tdep.h"
30
31 static int
32 alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
33 {
34 return (func_name != NULL && strcmp ("__sigtramp", func_name) == 0);
35 }
36
37 static CORE_ADDR
38 alpha_osf1_sigcontext_addr (struct frame_info *frame)
39 {
40 struct frame_info *next_frame = get_next_frame (frame);
41
42 if (next_frame != NULL)
43 return (read_memory_integer (get_frame_base (next_frame), 8));
44 else
45 return (read_memory_integer (get_frame_base (frame), 8));
46 }
47
48 /* This is the definition of CALL_DUMMY_ADDRESS. It's a heuristic that is used
49 to find a convenient place in the text segment to stick a breakpoint to
50 detect the completion of a target function call (ala call_function_by_hand).
51 */
52
53 static CORE_ADDR
54 alpha_call_dummy_address (void)
55 {
56 CORE_ADDR entry;
57 struct minimal_symbol *sym;
58
59 entry = entry_point_address ();
60
61 if (entry != 0)
62 return entry;
63
64 sym = lookup_minimal_symbol ("_Prelude", NULL, symfile_objfile);
65
66 if (!sym || MSYMBOL_TYPE (sym) != mst_text)
67 return 0;
68 else
69 return SYMBOL_VALUE_ADDRESS (sym) + 4;
70 }
71
72 static void
73 alpha_osf1_init_abi (struct gdbarch_info info,
74 struct gdbarch *gdbarch)
75 {
76 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
77
78 /* Hook into the MDEBUG frame unwinder. */
79 alpha_mdebug_init_abi (info, gdbarch);
80
81 set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp);
82 /* The next/step support via procfs on OSF1 is broken when running
83 on multi-processor machines. We need to use software single stepping
84 instead. */
85 set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
86
87 /* Alpha OSF/1 inhibits execution of code on the stack. But there is
88 no need for a dummy on the Alpha. PUSH_ARGUMENTS takes care of all
89 argument handling and bp_call_dummy takes care of stopping the dummy. */
90 set_gdbarch_call_dummy_address (gdbarch, alpha_call_dummy_address);
91
92 tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
93
94 tdep->jb_pc = 2;
95 tdep->jb_elt_size = 8;
96 }
97
98 void
99 _initialize_alpha_osf1_tdep (void)
100 {
101 gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OSF1,
102 alpha_osf1_init_abi);
103 }
This page took 0.03308 seconds and 4 git commands to generate.