]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/gdbserver/regcache.h
Remove redundant WIFSTOPPED check
[thirdparty/binutils-gdb.git] / gdb / gdbserver / regcache.h
CommitLineData
0a30fbc4 1/* Register support routines for the remote server for GDB.
618f726f 2 Copyright (C) 2001-2016 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
361c8ade
GB
22#include "common-regcache.h"
23
442ea881 24struct thread_info;
3aee8918 25struct target_desc;
442ea881
PA
26
27/* The data for the register cache. Note that we have one per
28 inferior; this is primarily for simplicity, as the performance
29 benefit is minimal. */
30
31struct regcache
32{
3aee8918
PA
33 /* The regcache's target description. */
34 const struct target_desc *tdesc;
35
1c79eb8a
PA
36 /* Whether the REGISTERS buffer's contents are valid. If false, we
37 haven't fetched the registers from the target yet. Not that this
38 register cache is _not_ pass-through, unlike GDB's. Note that
39 "valid" here is unrelated to whether the registers are available
40 in a traceframe. For that, check REGISTER_STATUS below. */
442ea881 41 int registers_valid;
219f2f23 42 int registers_owned;
442ea881 43 unsigned char *registers;
1c79eb8a
PA
44#ifndef IN_PROCESS_AGENT
45 /* One of REG_UNAVAILBLE or REG_VALID. */
46 unsigned char *register_status;
47#endif
442ea881 48};
d06f167a 49
219f2f23 50struct regcache *init_register_cache (struct regcache *regcache,
3aee8918 51 const struct target_desc *tdesc,
219f2f23
PA
52 unsigned char *regbuf);
53
54void regcache_cpy (struct regcache *dst, struct regcache *src);
55
c04a1aa8
DJ
56/* Create a new register cache for INFERIOR. */
57
3aee8918 58struct regcache *new_register_cache (const struct target_desc *tdesc);
442ea881
PA
59
60struct regcache *get_thread_regcache (struct thread_info *thread, int fetch);
c04a1aa8
DJ
61
62/* Release all memory associated with the register cache for INFERIOR. */
63
442ea881 64void free_register_cache (struct regcache *regcache);
0d62e5e8 65
3aee8918
PA
66/* Invalidate cached registers for one thread. */
67
68void regcache_invalidate_thread (struct thread_info *);
69
80d82c19
JB
70/* Invalidate cached registers for all threads of the given process. */
71
72void regcache_invalidate_pid (int pid);
73
3aee8918
PA
74/* Invalidate cached registers for all threads of the current
75 process. */
0d62e5e8 76
0d62e5e8 77void regcache_invalidate (void);
c04a1aa8 78
3aee8918
PA
79/* Invalidate and release the register cache of all threads of the
80 current process. */
81
82void regcache_release (void);
83
0a30fbc4
DJ
84/* Convert all registers to a string in the currently specified remote
85 format. */
86
442ea881 87void registers_to_string (struct regcache *regcache, char *buf);
0a30fbc4
DJ
88
89/* Convert a string to register values and fill our register cache. */
90
442ea881 91void registers_from_string (struct regcache *regcache, char *buf);
0a30fbc4 92
361c8ade 93/* For regcache_read_pc see common/common-regcache.h. */
219f2f23
PA
94
95void regcache_write_pc (struct regcache *regcache, CORE_ADDR pc);
96
0a30fbc4
DJ
97/* Return a pointer to the description of register ``n''. */
98
3aee8918 99struct reg *find_register_by_number (const struct target_desc *tdesc, int n);
0a30fbc4 100
3aee8918 101int register_cache_size (const struct target_desc *tdesc);
219f2f23 102
3aee8918 103int register_size (const struct target_desc *tdesc, int n);
0a30fbc4 104
3aee8918 105int find_regno (const struct target_desc *tdesc, const char *name);
0a30fbc4 106
442ea881 107void supply_register (struct regcache *regcache, int n, const void *buf);
0729219d 108
1c79eb8a
PA
109void supply_register_zeroed (struct regcache *regcache, int n);
110
442ea881
PA
111void supply_register_by_name (struct regcache *regcache,
112 const char *name, const void *buf);
0729219d 113
219f2f23
PA
114void supply_regblock (struct regcache *regcache, const void *buf);
115
442ea881 116void collect_register (struct regcache *regcache, int n, void *buf);
0729219d 117
442ea881 118void collect_register_as_string (struct regcache *regcache, int n, char *buf);
0d62e5e8 119
493e2a69
MS
120void collect_register_by_name (struct regcache *regcache,
121 const char *name, void *buf);
0729219d 122
0a30fbc4 123#endif /* REGCACHE_H */