1/* Register support routines for the remote server for GDB.
2   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
3
4   This file is part of GDB.
5   It has been modified to integrate it in valgrind
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., 51 Franklin Street, Fifth Floor,
20   Boston, MA 02110-1301, USA.  */
21
22#ifndef REGCACHE_H
23#define REGCACHE_H
24
25struct inferior_list_entry;
26
27/* Create a new register cache for INFERIOR.  */
28
29void *new_register_cache (void);
30
31/* Release all memory associated with the register cache for INFERIOR.  */
32
33void free_register_cache (void *regcache);
34
35/* Invalidate cached registers for one or all threads.  */
36
37void regcache_invalidate_one (struct inferior_list_entry *);
38void regcache_invalidate (void);
39
40/* Convert all registers to a string in the currently specified remote
41   format.  */
42
43void registers_to_string (char *buf);
44
45/* Convert a string to register values and fill our register cache.  */
46
47void registers_from_string (char *buf);
48
49/* Return the size in bytes of a string-encoded register packet.  */
50
51int registers_length (void);
52
53/* Return a pointer to the description of register ``n''.  */
54
55struct reg *find_register_by_number (int n);
56
57int register_size (int n);
58
59int find_regno (const char *name);
60
61extern const char **gdbserver_expedite_regs;
62
63/* *mod set to True if *buf provides a new value. */
64void supply_register (int n, const void *buf, Bool *mod);
65
66/* Reads register data from buf (hex string in target byte order)
67   and stores it in the register cache.
68   *mod set to True if *buf provides a new value. */
69void supply_register_from_string (int n, const char *buf, Bool *mod);
70
71/* *mod set to True if *buf provides a new value. */
72void supply_register_by_name (const char *name, const void *buf, Bool *mod);
73
74void collect_register (int n, void *buf);
75
76void collect_register_as_string (int n, char *buf);
77
78void collect_register_by_name (const char *name, void *buf);
79
80#endif /* REGCACHE_H */
81