gdb/
[binutils-gdb.git] / gdb / gdbserver / regcache.h
1 /* Register support routines for the remote server for GDB.
2 Copyright (C) 2001, 2002, 2007, 2008, 2009, 2010
3 Free Software Foundation, Inc.
4
5 This file is part of GDB.
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 3 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, see <http://www.gnu.org/licenses/>. */
19
20 #ifndef REGCACHE_H
21 #define REGCACHE_H
22
23 struct inferior_list_entry;
24
25 /* Create a new register cache for INFERIOR. */
26
27 void *new_register_cache (void);
28
29 /* Release all memory associated with the register cache for INFERIOR. */
30
31 void free_register_cache (void *regcache);
32
33 /* Invalidate cached registers for one or all threads. */
34
35 void regcache_invalidate_one (struct inferior_list_entry *);
36 void regcache_invalidate (void);
37
38 /* Convert all registers to a string in the currently specified remote
39 format. */
40
41 void registers_to_string (char *buf);
42
43 /* Convert a string to register values and fill our register cache. */
44
45 void registers_from_string (char *buf);
46
47 /* Return a pointer to the description of register ``n''. */
48
49 struct reg *find_register_by_number (int n);
50
51 int register_size (int n);
52
53 int find_regno (const char *name);
54
55 /* The following two variables are set by auto-generated
56 code in the init_registers_... routines. */
57 extern const char **gdbserver_expedite_regs;
58 extern const char *gdbserver_xmltarget;
59
60 void supply_register (int n, const void *buf);
61
62 void supply_register_by_name (const char *name, const void *buf);
63
64 void collect_register (int n, void *buf);
65
66 void collect_register_as_string (int n, char *buf);
67
68 void collect_register_by_name (const char *name, void *buf);
69
70 #endif /* REGCACHE_H */