• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
27 struct inferior_list_entry;
28 
29 /* Create a new register cache for INFERIOR.  */
30 
31 void *new_register_cache (void);
32 
33 /* Release all memory associated with the register cache for INFERIOR.  */
34 
35 void free_register_cache (void *regcache);
36 
37 /* Invalidate cached registers for one or all threads.  */
38 
39 void regcache_invalidate_one (struct inferior_list_entry *);
40 void regcache_invalidate (void);
41 
42 /* Convert all registers to a string in the currently specified remote
43    format.  */
44 
45 void registers_to_string (char *buf);
46 
47 /* Convert a string to register values and fill our register cache.  */
48 
49 void registers_from_string (const char *buf);
50 
51 /* Return the size in bytes of a string-encoded register packet.  */
52 
53 int registers_length (void);
54 
55 /* Return a pointer to the description of register ``n''.  */
56 
57 struct reg *find_register_by_number (int n);
58 
59 int register_size (int n);
60 
61 int find_regno (const char *name);
62 
63 extern const char **gdbserver_expedite_regs;
64 
65 /* *mod set to True if *buf provides a new value. */
66 void 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. */
71 void supply_register_from_string (int n, const char *buf, Bool *mod);
72 
73 /* *mod set to True if *buf provides a new value. */
74 void supply_register_by_name (const char *name, const void *buf, Bool *mod);
75 
76 void collect_register (int n, void *buf);
77 
78 void collect_register_as_string (int n, char *buf);
79 
80 void collect_register_by_name (const char *name, void *buf);
81 
82 #endif /* REGCACHE_H */
83