2004-04-30 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gdb / hppa-tdep.h
CommitLineData
3ff7cf9e
JB
1/* Common target dependent code for GDB on HPPA systems.
2 Copyright 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#ifndef HPPA_TDEP_H
22#define HPPA_TDEP_H
23
7c46b9fb
RC
24enum { HPPA_INSTRUCTION_SIZE = 4 };
25
3ff7cf9e
JB
26/* Target-dependent structure in gdbarch. */
27struct gdbarch_tdep
28{
29 /* The number of bytes in an address. For now, this field is designed
30 to allow us to differentiate hppa32 from hppa64 targets. */
31 int bytes_per_address;
fdd72f95
RC
32
33 /* Is this an ELF target? This can be 64-bit HP-UX, or a 32/64-bit GNU/Linux
34 system. */
35 int is_elf;
3ff7cf9e
JB
36};
37
7c46b9fb
RC
38/*
39 * Unwind table and descriptor.
40 */
41
42struct unwind_table_entry
43 {
44 CORE_ADDR region_start;
45 CORE_ADDR region_end;
46
47 unsigned int Cannot_unwind:1; /* 0 */
48 unsigned int Millicode:1; /* 1 */
49 unsigned int Millicode_save_sr0:1; /* 2 */
50 unsigned int Region_description:2; /* 3..4 */
51 unsigned int reserved1:1; /* 5 */
52 unsigned int Entry_SR:1; /* 6 */
53 unsigned int Entry_FR:4; /* number saved *//* 7..10 */
54 unsigned int Entry_GR:5; /* number saved *//* 11..15 */
55 unsigned int Args_stored:1; /* 16 */
56 unsigned int Variable_Frame:1; /* 17 */
57 unsigned int Separate_Package_Body:1; /* 18 */
58 unsigned int Frame_Extension_Millicode:1; /* 19 */
59 unsigned int Stack_Overflow_Check:1; /* 20 */
60 unsigned int Two_Instruction_SP_Increment:1; /* 21 */
61 unsigned int Ada_Region:1; /* 22 */
62 unsigned int cxx_info:1; /* 23 */
63 unsigned int cxx_try_catch:1; /* 24 */
64 unsigned int sched_entry_seq:1; /* 25 */
65 unsigned int reserved2:1; /* 26 */
66 unsigned int Save_SP:1; /* 27 */
67 unsigned int Save_RP:1; /* 28 */
68 unsigned int Save_MRP_in_frame:1; /* 29 */
69 unsigned int extn_ptr_defined:1; /* 30 */
70 unsigned int Cleanup_defined:1; /* 31 */
71
72 unsigned int MPE_XL_interrupt_marker:1; /* 0 */
73 unsigned int HP_UX_interrupt_marker:1; /* 1 */
74 unsigned int Large_frame:1; /* 2 */
75 unsigned int Pseudo_SP_Set:1; /* 3 */
76 unsigned int reserved4:1; /* 4 */
77 unsigned int Total_frame_size:27; /* 5..31 */
78
79 /* This is *NOT* part of an actual unwind_descriptor in an object
80 file. It is *ONLY* part of the "internalized" descriptors that
81 we create from those in a file.
82 */
83 struct
84 {
85 unsigned int stub_type:4; /* 0..3 */
86 unsigned int padding:28; /* 4..31 */
87 }
88 stub_unwind;
89 };
90
91/* HP linkers also generate unwinds for various linker-generated stubs.
92 GDB reads in the stubs from the $UNWIND_END$ subspace, then
93 "converts" them into normal unwind entries using some of the reserved
94 fields to store the stub type. */
95
96/* The gaps represent linker stubs used in MPE and space for future
97 expansion. */
98enum unwind_stub_types
99 {
100 LONG_BRANCH = 1,
101 PARAMETER_RELOCATION = 2,
102 EXPORT = 10,
103 IMPORT = 11,
104 IMPORT_SHLIB = 12,
105 };
106
abc485a1
RC
107struct unwind_table_entry *find_unwind_entry (CORE_ADDR);
108
7c46b9fb
RC
109/* We use the objfile->obj_private pointer for two things:
110 * 1. An unwind table;
111 *
112 * 2. A pointer to any associated shared library object.
113 *
114 * #defines are used to help refer to these objects.
115 */
116
117/* Info about the unwind table associated with an object file.
118 * This is hung off of the "objfile->obj_private" pointer, and
119 * is allocated in the objfile's psymbol obstack. This allows
120 * us to have unique unwind info for each executable and shared
121 * library that we are debugging.
122 */
123struct hppa_unwind_info
124 {
125 struct unwind_table_entry *table; /* Pointer to unwind info */
126 struct unwind_table_entry *cache; /* Pointer to last entry we found */
127 int last; /* Index of last entry */
128 };
129
130struct hppa_objfile_private
131 {
132 struct hppa_unwind_info *unwind_info; /* a pointer */
133 struct so_list *so_info; /* a pointer */
134 CORE_ADDR dp;
135 };
136
137extern const struct objfile_data *hppa_objfile_priv_data;
138
abc485a1
RC
139int hppa_get_field (unsigned word, int from, int to);
140int hppa_extract_5_load (unsigned int);
141unsigned hppa_extract_5R_store (unsigned int);
142unsigned hppa_extract_5r_store (unsigned int);
143int hppa_extract_17 (unsigned int);
144int hppa_extract_21 (unsigned);
145int hppa_extract_14 (unsigned);
146int hppa_low_sign_extend (unsigned int, unsigned int);
147int hppa_sign_extend (unsigned int, unsigned int);
148
3ff7cf9e 149#endif /* HPPA_TDEP_H */
This page took 0.087549 seconds and 4 git commands to generate.