FreeBSD regtest: update getrlimit for FreeBSD 14.2
[valgrind.git] / coregrind / m_gdbserver / regcache.h
blob881dcc37b17227c9224567dca66edbd721078193
1 /* Register support routines for the remote server for GDB.
2 Copyright (C) 2001, 2002, 2012 Free Software Foundation, Inc.
4 This file is part of GDB.
5 It has been modified to integrate it in valgrind
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.
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.
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. */
22 #ifndef REGCACHE_H
23 #define REGCACHE_H
25 /* Defines support routines to get/set registers for the valgrind
26 remote GDB server.
27 This file used to provide a real register cache, where the register
28 values were written to by GDB without directly reaching the valgrind VEX
29 state. In the real GDB gdbserver, this cache was used to avoid a ptrace
30 system call each time a register has to be re-read. In valgrind, registers
31 are directly accessible by the embedded gdbserver. So, read/write registers
32 operations by GDB are directly executed from/to the valgrind VEX registers. */
35 struct inferior_list_entry;
37 /* Create a new register cache for INFERIOR. */
39 void *new_register_cache (void);
41 /* Release all memory associated with the register cache for INFERIOR. */
43 void free_register_cache (void *regcache);
45 /* Convert all registers to a string in the currently specified remote
46 format. */
48 void registers_to_string (char *buf);
50 /* Convert a string to register values and fill our register cache. */
52 void registers_from_string (const char *buf);
54 /* Return the size in bytes of a string-encoded register packet. */
56 int registers_length (void);
58 /* Return a pointer to the description of register ``n''. */
60 struct reg *find_register_by_number (int n);
62 int register_size (int n);
64 int find_regno (const char *name);
66 extern const char **gdbserver_expedite_regs;
68 /* Sets the value of register N to buf content. */
69 void supply_register (int n, const void *buf);
71 /* Reads register data from buf (hex string in target byte order)
72 and stores it in the register cache. */
73 void supply_register_from_string (int n, const char *buf);
75 /* Sets the value of register identified by NAME to buf content. */
76 void supply_register_by_name (const char *name, const void *buf);
78 void collect_register (int n, void *buf);
80 void collect_register_as_string (int n, char *buf);
82 void collect_register_by_name (const char *name, void *buf);
84 #endif /* REGCACHE_H */