2010-01-21 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
[deliverable/binutils-gdb.git] / gdb / gdbserver / regcache.h
CommitLineData
0a30fbc4 1/* Register support routines for the remote server for GDB.
4c38e0a4
JB
2 Copyright (C) 2001, 2002, 2007, 2008, 2009, 2010
3 Free Software Foundation, Inc.
0a30fbc4
DJ
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
a9762ec7 9 the Free Software Foundation; either version 3 of the License, or
0a30fbc4
DJ
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
a9762ec7 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
0a30fbc4
DJ
19
20#ifndef REGCACHE_H
21#define REGCACHE_H
22
0d62e5e8 23struct inferior_list_entry;
442ea881
PA
24struct thread_info;
25
26/* The data for the register cache. Note that we have one per
27 inferior; this is primarily for simplicity, as the performance
28 benefit is minimal. */
29
30struct regcache
31{
32 int registers_valid;
33 unsigned char *registers;
34};
d06f167a 35
c04a1aa8
DJ
36/* Create a new register cache for INFERIOR. */
37
442ea881
PA
38struct regcache *new_register_cache (void);
39
40struct regcache *get_thread_regcache (struct thread_info *thread, int fetch);
c04a1aa8
DJ
41
42/* Release all memory associated with the register cache for INFERIOR. */
43
442ea881 44void free_register_cache (struct regcache *regcache);
0d62e5e8
DJ
45
46/* Invalidate cached registers for one or all threads. */
47
48void regcache_invalidate_one (struct inferior_list_entry *);
49void regcache_invalidate (void);
c04a1aa8 50
0a30fbc4
DJ
51/* Convert all registers to a string in the currently specified remote
52 format. */
53
442ea881 54void registers_to_string (struct regcache *regcache, char *buf);
0a30fbc4
DJ
55
56/* Convert a string to register values and fill our register cache. */
57
442ea881 58void registers_from_string (struct regcache *regcache, char *buf);
0a30fbc4 59
0a30fbc4
DJ
60/* Return a pointer to the description of register ``n''. */
61
62struct reg *find_register_by_number (int n);
63
0a30fbc4
DJ
64int register_size (int n);
65
66int find_regno (const char *name);
67
9b4b61c8
UW
68/* The following two variables are set by auto-generated
69 code in the init_registers_... routines. */
0a30fbc4 70extern const char **gdbserver_expedite_regs;
9b4b61c8 71extern const char *gdbserver_xmltarget;
0a30fbc4 72
442ea881 73void supply_register (struct regcache *regcache, int n, const void *buf);
0729219d 74
442ea881
PA
75void supply_register_by_name (struct regcache *regcache,
76 const char *name, const void *buf);
0729219d 77
442ea881 78void collect_register (struct regcache *regcache, int n, void *buf);
0729219d 79
442ea881 80void collect_register_as_string (struct regcache *regcache, int n, char *buf);
0d62e5e8 81
442ea881 82void collect_register_by_name (struct regcache *regcache, const char *name, void *buf);
0729219d 83
0a30fbc4 84#endif /* REGCACHE_H */
This page took 0.550563 seconds and 4 git commands to generate.