Rename inferior_list_entry uses from "head" to "entry" for consistency.
[deliverable/binutils-gdb.git] / gdb / gdbserver / regcache.h
CommitLineData
0a30fbc4 1/* Register support routines for the remote server for GDB.
ecd75fc8 2 Copyright (C) 2001-2014 Free Software Foundation, Inc.
0a30fbc4
DJ
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
a9762ec7 8 the Free Software Foundation; either version 3 of the License, or
0a30fbc4
DJ
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
a9762ec7 17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
0a30fbc4
DJ
18
19#ifndef REGCACHE_H
20#define REGCACHE_H
21
442ea881 22struct thread_info;
3aee8918 23struct target_desc;
442ea881 24
1c79eb8a
PA
25/* The register exists, it has a value, but we don't know what it is.
26 Used when inspecting traceframes. */
27#define REG_UNAVAILABLE 0
28
29/* We know the register's value (and we have it cached). */
30#define REG_VALID 1
31
442ea881
PA
32/* The data for the register cache. Note that we have one per
33 inferior; this is primarily for simplicity, as the performance
34 benefit is minimal. */
35
36struct regcache
37{
3aee8918
PA
38 /* The regcache's target description. */
39 const struct target_desc *tdesc;
40
1c79eb8a
PA
41 /* Whether the REGISTERS buffer's contents are valid. If false, we
42 haven't fetched the registers from the target yet. Not that this
43 register cache is _not_ pass-through, unlike GDB's. Note that
44 "valid" here is unrelated to whether the registers are available
45 in a traceframe. For that, check REGISTER_STATUS below. */
442ea881 46 int registers_valid;
219f2f23 47 int registers_owned;
442ea881 48 unsigned char *registers;
1c79eb8a
PA
49#ifndef IN_PROCESS_AGENT
50 /* One of REG_UNAVAILBLE or REG_VALID. */
51 unsigned char *register_status;
52#endif
442ea881 53};
d06f167a 54
219f2f23 55struct regcache *init_register_cache (struct regcache *regcache,
3aee8918 56 const struct target_desc *tdesc,
219f2f23
PA
57 unsigned char *regbuf);
58
59void regcache_cpy (struct regcache *dst, struct regcache *src);
60
c04a1aa8
DJ
61/* Create a new register cache for INFERIOR. */
62
3aee8918 63struct regcache *new_register_cache (const struct target_desc *tdesc);
442ea881
PA
64
65struct regcache *get_thread_regcache (struct thread_info *thread, int fetch);
c04a1aa8
DJ
66
67/* Release all memory associated with the register cache for INFERIOR. */
68
442ea881 69void free_register_cache (struct regcache *regcache);
0d62e5e8 70
3aee8918
PA
71/* Invalidate cached registers for one thread. */
72
73void regcache_invalidate_thread (struct thread_info *);
74
75/* Invalidate cached registers for all threads of the current
76 process. */
0d62e5e8 77
0d62e5e8 78void regcache_invalidate (void);
c04a1aa8 79
3aee8918
PA
80/* Invalidate and release the register cache of all threads of the
81 current process. */
82
83void regcache_release (void);
84
0a30fbc4
DJ
85/* Convert all registers to a string in the currently specified remote
86 format. */
87
442ea881 88void registers_to_string (struct regcache *regcache, char *buf);
0a30fbc4
DJ
89
90/* Convert a string to register values and fill our register cache. */
91
442ea881 92void registers_from_string (struct regcache *regcache, char *buf);
0a30fbc4 93
219f2f23
PA
94CORE_ADDR regcache_read_pc (struct regcache *regcache);
95
96void regcache_write_pc (struct regcache *regcache, CORE_ADDR pc);
97
0a30fbc4
DJ
98/* Return a pointer to the description of register ``n''. */
99
3aee8918 100struct reg *find_register_by_number (const struct target_desc *tdesc, int n);
0a30fbc4 101
3aee8918 102int register_cache_size (const struct target_desc *tdesc);
219f2f23 103
3aee8918 104int register_size (const struct target_desc *tdesc, int n);
0a30fbc4 105
3aee8918 106int find_regno (const struct target_desc *tdesc, const char *name);
0a30fbc4 107
442ea881 108void supply_register (struct regcache *regcache, int n, const void *buf);
0729219d 109
1c79eb8a
PA
110void supply_register_zeroed (struct regcache *regcache, int n);
111
442ea881
PA
112void supply_register_by_name (struct regcache *regcache,
113 const char *name, const void *buf);
0729219d 114
219f2f23
PA
115void supply_regblock (struct regcache *regcache, const void *buf);
116
442ea881 117void collect_register (struct regcache *regcache, int n, void *buf);
0729219d 118
442ea881 119void collect_register_as_string (struct regcache *regcache, int n, char *buf);
0d62e5e8 120
493e2a69
MS
121void collect_register_by_name (struct regcache *regcache,
122 const char *name, void *buf);
0729219d 123
0a30fbc4 124#endif /* REGCACHE_H */
This page took 0.90211 seconds and 4 git commands to generate.