1 |
douglas |
2 |
/* 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: ports/devel/gdb6/files/kvm-fbsd-alpha.h,v 1.1 2004/06/20 22:22:02 obrien Exp $"); |
23 |
|
|
|
24 |
|
|
#include "alpha/tm-alpha.h" |
25 |
|
|
#include "alpha-tdep.h" |
26 |
|
|
|
27 |
|
|
#ifndef S0_REGNUM |
28 |
|
|
#define S0_REGNUM (ALPHA_T7_REGNUM+1) |
29 |
|
|
#endif |
30 |
|
|
|
31 |
|
|
static void |
32 |
|
|
fetch_kcore_registers (struct pcb *pcbp) |
33 |
|
|
{ |
34 |
|
|
|
35 |
|
|
/* First clear out any garbage. */ |
36 |
|
|
memset (deprecated_registers, '\0', DEPRECATED_REGISTER_BYTES); |
37 |
|
|
|
38 |
|
|
/* SP */ |
39 |
|
|
*(long *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (SP_REGNUM)] = |
40 |
|
|
pcbp->pcb_hw.apcb_ksp; |
41 |
|
|
|
42 |
|
|
/* S0 through S6 */ |
43 |
|
|
memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (S0_REGNUM)], |
44 |
|
|
&pcbp->pcb_context[0], 7 * sizeof (long)); |
45 |
|
|
|
46 |
|
|
/* PC */ |
47 |
|
|
*(long *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)] = |
48 |
|
|
pcbp->pcb_context[7]; |
49 |
|
|
|
50 |
|
|
deprecated_registers_fetched (); |
51 |
|
|
} |
52 |
|
|
|
53 |
|
|
#if __FreeBSD_version >= 500032 |
54 |
|
|
CORE_ADDR |
55 |
|
|
fbsd_kern_frame_saved_pc (struct frame_info *fi) |
56 |
|
|
{ |
57 |
|
|
struct minimal_symbol *sym; |
58 |
|
|
CORE_ADDR this_saved_pc; |
59 |
|
|
|
60 |
|
|
this_saved_pc = DEPRECATED_FRAME_SAVED_PC(fi); |
61 |
|
|
|
62 |
|
|
sym = lookup_minimal_symbol_by_pc (this_saved_pc); |
63 |
|
|
|
64 |
|
|
if (sym != NULL && |
65 |
|
|
(strcmp (DEPRECATED_SYMBOL_NAME (sym), "XentArith") == 0 || |
66 |
|
|
strcmp (DEPRECATED_SYMBOL_NAME (sym), "XentIF") == 0 || |
67 |
|
|
strcmp (DEPRECATED_SYMBOL_NAME (sym), "XentInt") == 0 || |
68 |
|
|
strcmp (DEPRECATED_SYMBOL_NAME (sym), "XentMM") == 0 || |
69 |
|
|
strcmp (DEPRECATED_SYMBOL_NAME (sym), "XentSys") == 0 || |
70 |
|
|
strcmp (DEPRECATED_SYMBOL_NAME (sym), "XentUna") == 0 || |
71 |
|
|
strcmp (DEPRECATED_SYMBOL_NAME (sym), "XentRestart") == 0)) |
72 |
|
|
{ |
73 |
|
|
return (read_memory_integer (get_frame_base (fi) + 32 * 8, 8)); |
74 |
|
|
} |
75 |
|
|
else |
76 |
|
|
{ |
77 |
|
|
return (this_saved_pc); |
78 |
|
|
} |
79 |
|
|
} |
80 |
|
|
#endif |