]> Git Repo - binutils.git/blob - gdb/alpha-osf1-tdep.c
* as.c (perform_an_assembly_pass): If using cgen, call gas_cgen_begin.
[binutils.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
28 #include "alpha-tdep.h"
29
30 /* Under OSF/1, the __sigtramp routine is frameless and has a frame
31    size of zero, but we are able to backtrace through it.  */
32 static CORE_ADDR
33 alpha_osf1_skip_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc)
34 {
35   char *name;
36
37   find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
38   if (PC_IN_SIGTRAMP (pc, name))
39     return frame->frame;
40   return 0;
41 }
42
43 static int
44 alpha_osf1_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
45 {
46   return (func_name != NULL && strcmp ("__sigtramp", func_name) == 0);
47 }
48
49 static CORE_ADDR
50 alpha_osf1_sigcontext_addr (struct frame_info *frame)
51 {
52   return (read_memory_integer (frame->next ? frame->next->frame
53                                            : frame->frame, 8));
54 }
55
56 static void
57 alpha_osf1_init_abi (struct gdbarch_info info,
58                      struct gdbarch *gdbarch)
59 {
60   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
61
62   set_gdbarch_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp);
63   /* The next/step support via procfs on OSF1 is broken when running
64      on multi-processor machines. We need to use software single stepping
65      instead.  */
66   set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
67
68   tdep->skip_sigtramp_frame = alpha_osf1_skip_sigtramp_frame;
69   tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
70
71   tdep->jb_pc = 2;
72   tdep->jb_elt_size = 8;
73 }
74
75 void
76 _initialize_alpha_osf1_tdep (void)
77 {
78   gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OSF1,
79                           alpha_osf1_init_abi);
80 }
This page took 0.026243 seconds and 4 git commands to generate.