]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - gnu/usr.bin/binutils/gdb/kvm-fbsd-alpha.h
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / gnu / usr.bin / binutils / gdb / kvm-fbsd-alpha.h
1 /* Kernel core dump functions below target vector, for GDB on FreeBSD/Alpha.
2    Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995
3    Free Software Foundation, Inc.
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
9 the Free Software Foundation; either version 2 of the License, or
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
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21
22 __FBSDID("$FreeBSD$");
23
24 #include "alpha/tm-alpha.h"
25
26 #ifndef S0_REGNUM
27 #define S0_REGNUM (T7_REGNUM+1)
28 #endif
29
30 static void
31 fetch_kcore_registers (struct pcb *pcbp)
32 {
33
34   /* First clear out any garbage.  */
35   memset (registers, '\0', REGISTER_BYTES);
36
37   /* SP */
38   *(long *) &registers[REGISTER_BYTE (SP_REGNUM)] =
39     pcbp->pcb_hw.apcb_ksp;
40
41   /* S0 through S6 */
42   memcpy (&registers[REGISTER_BYTE (S0_REGNUM)],
43           &pcbp->pcb_context[0], 7 * sizeof (long));
44
45   /* PC */
46   *(long *) &registers[REGISTER_BYTE (PC_REGNUM)] =
47     pcbp->pcb_context[7];
48
49   registers_fetched ();
50 }
51
52 CORE_ADDR
53 fbsd_kern_frame_saved_pc (struct frame_info *fi)
54 {
55   struct minimal_symbol *sym;
56   CORE_ADDR this_saved_pc;
57
58   this_saved_pc = alpha_frame_saved_pc (fi);
59
60   sym = lookup_minimal_symbol_by_pc (this_saved_pc);
61
62   if (sym != NULL &&
63       (strcmp (SYMBOL_NAME (sym), "XentArith") == 0 ||
64        strcmp (SYMBOL_NAME (sym), "XentIF") == 0 ||
65        strcmp (SYMBOL_NAME (sym), "XentInt") == 0 ||
66        strcmp (SYMBOL_NAME (sym), "XentMM") == 0 ||
67        strcmp (SYMBOL_NAME (sym), "XentSys") == 0 ||
68        strcmp (SYMBOL_NAME (sym), "XentUna") == 0 ||
69        strcmp (SYMBOL_NAME (sym), "XentRestart") == 0))
70     {
71       return (read_memory_integer (fi->frame + 32 * 8, 8));
72     }
73   else
74     {
75       return (this_saved_pc);
76     }
77 }