1 /* Per-frame user registers, for GDB, the GNU debugger.
3 Copyright (C) 2002, 2003, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc.
6 Contributed by Red Hat.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
26 /* Implement both builtin, and architecture specific, per-frame user
29 Builtin registers apply to all architectures, where as architecture
30 specific registers are present when the architecture is selected.
32 These registers are assigned register numbers outside the
33 architecture's register range
34 [0 .. gdbarch_num_regs + gdbarch_num_pseudo_regs].
35 Their values should be constructed using per-frame information. */
37 /* TODO: cagney/2003-06-27: Need to think more about how these
38 registers are added, read, and modified. At present they are kind
39 of assumed to be read-only. Should it, for instance, return a
40 register descriptor that contains all the relvent access methods. */
45 /* Given an architecture, map a user visible register name onto its
48 extern int user_reg_map_name_to_regnum (struct gdbarch *gdbarch,
49 const char *str, int len);
51 extern const char *user_reg_map_regnum_to_name (struct gdbarch *gdbarch,
54 /* Return the value of the frame register in the specified frame.
56 Note; These methods return a "struct value" instead of the raw
57 bytes as, at the time the register is being added, the type needed
58 to describe the register has not bee initialized. */
60 typedef struct value *(user_reg_read_ftype) (struct frame_info *frame,
62 extern struct value *value_of_user_reg (int regnum, struct frame_info *frame);
64 /* Add a builtin register (present in all architectures). */
65 extern void user_reg_add_builtin (const char *name,
66 user_reg_read_ftype *read, const void *baton);
68 /* Add a per-architecture frame register. */
69 extern void user_reg_add (struct gdbarch *gdbarch, const char *name,
70 user_reg_read_ftype *read, const void *baton);