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