Commit | Line | Data |
---|---|---|
eb8bc282 AC |
1 | /* Per-frame user registers, for GDB, the GNU debugger. |
2 | ||
6aba47ca | 3 | Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc. |
eb8bc282 AC |
4 | |
5 | Contributed by Red Hat. | |
6 | ||
7 | This file is part of GDB. | |
8 | ||
9 | This program is free software; you can redistribute it and/or modify | |
10 | it under the terms of the GNU General Public License as published by | |
11 | the Free Software Foundation; either version 2 of the License, or | |
12 | (at your option) any later version. | |
13 | ||
14 | This program is distributed in the hope that it will be useful, | |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | GNU General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU General Public License | |
20 | along with this program; if not, write to the Free Software | |
197e01b6 EZ |
21 | Foundation, Inc., 51 Franklin Street, Fifth Floor, |
22 | Boston, MA 02110-1301, USA. */ | |
eb8bc282 AC |
23 | |
24 | #ifndef USER_REGS_H | |
25 | #define USER_REGS_H | |
26 | ||
27 | /* Implement both builtin, and architecture specific, per-frame user | |
28 | visible registers. | |
29 | ||
30 | Builtin registers apply to all architectures, where as architecture | |
31 | specific registers are present when the architecture is selected. | |
32 | ||
33 | These registers are assigned register numbers outside the | |
f57d151a UW |
34 | architecture's register range |
35 | [0 .. gdbarch_num_regs + gdbarch_num_pseudo_regs]. | |
eb8bc282 AC |
36 | Their values should be constructed using per-frame information. */ |
37 | ||
38 | /* TODO: cagney/2003-06-27: Need to think more about how these | |
39 | registers are added, read, and modified. At present they are kind | |
40 | of assumed to be read-only. Should it, for instance, return a | |
41 | register descriptor that contains all the relvent access methods. */ | |
42 | ||
43 | struct frame_info; | |
e6e5e94c | 44 | struct gdbarch; |
eb8bc282 AC |
45 | |
46 | /* Given an architecture, map a user visible register name onto its | |
47 | index. */ | |
48 | ||
49 | extern int user_reg_map_name_to_regnum (struct gdbarch *gdbarch, | |
50 | const char *str, int len); | |
51 | ||
52 | extern const char *user_reg_map_regnum_to_name (struct gdbarch *gdbarch, | |
53 | int regnum); | |
54 | ||
55 | /* Return the value of the frame register in the specified frame. | |
56 | ||
57 | Note; These methods return a "struct value" instead of the raw | |
58 | bytes as, at the time the register is being added, the type needed | |
59 | to describe the register has not bee initialized. */ | |
60 | ||
123dc839 DJ |
61 | typedef struct value *(user_reg_read_ftype) (struct frame_info *frame, |
62 | const void *baton); | |
eb8bc282 AC |
63 | extern struct value *value_of_user_reg (int regnum, struct frame_info *frame); |
64 | ||
65 | /* Add a builtin register (present in all architectures). */ | |
66 | extern void user_reg_add_builtin (const char *name, | |
123dc839 | 67 | user_reg_read_ftype *read, const void *baton); |
eb8bc282 AC |
68 | |
69 | /* Add a per-architecture frame register. */ | |
70 | extern void user_reg_add (struct gdbarch *gdbarch, const char *name, | |
123dc839 | 71 | user_reg_read_ftype *read, const void *baton); |
eb8bc282 AC |
72 | |
73 | #endif |