* arch-utils.c (gdbarch_info_init): Set osabi to
[deliverable/binutils-gdb.git] / gdb / alpha-osf1-tdep.c
CommitLineData
36a6271d 1/* Target-dependent code for OSF/1 on Alpha.
4be87837 2 Copyright 2002, 2003 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
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"
5868c862 23#include "gdbcore.h"
36a6271d 24#include "value.h"
4be87837 25#include "osabi.h"
36a6271d
JT
26
27#include "alpha-tdep.h"
28
29/* Under OSF/1, the __sigtramp routine is frameless and has a frame
30 size of zero, but we are able to backtrace through it. */
31static CORE_ADDR
32alpha_osf1_skip_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc)
33{
34 char *name;
35
36 find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
37 if (PC_IN_SIGTRAMP (pc, name))
38 return frame->frame;
39 return 0;
40}
41
6c72f9f9
JT
42static int
43alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
44{
45 return (func_name != NULL && STREQ ("__sigtramp", func_name));
46}
47
5868c862
JT
48static CORE_ADDR
49alpha_osf1_sigcontext_addr (struct frame_info *frame)
50{
51 return (read_memory_integer (frame->next ? frame->next->frame
52 : frame->frame, 8));
53}
54
36a6271d
JT
55static void
56alpha_osf1_init_abi (struct gdbarch_info info,
57 struct gdbarch *gdbarch)
58{
59 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
60
6c72f9f9 61 set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp);
c8edd8b4
JB
62 /* The next/step support via procfs on OSF1 is broken when running
63 on multi-processor machines. We need to use software single stepping
64 instead. */
65 set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
6c72f9f9 66
36a6271d 67 tdep->skip_sigtramp_frame = alpha_osf1_skip_sigtramp_frame;
5868c862 68 tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
accc6d1f
JT
69
70 tdep->jb_pc = 2;
71 tdep->jb_elt_size = 8;
36a6271d
JT
72}
73
74void
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}
This page took 0.072927 seconds and 4 git commands to generate.