]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/user-regs.h
* reloc.c: Add BFD_RELOC_RX_OP_NEG.
[thirdparty/binutils-gdb.git] / gdb / user-regs.h
CommitLineData
eb8bc282
AC
1/* Per-frame user registers, for GDB, the GNU debugger.
2
7b6bb8da 3 Copyright (C) 2002, 2003, 2007, 2008, 2009, 2010, 2011
4c38e0a4 4 Free Software Foundation, Inc.
eb8bc282
AC
5
6 Contributed by Red Hat.
7
8 This file is part of GDB.
9
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
a9762ec7 12 the Free Software Foundation; either version 3 of the License, or
eb8bc282
AC
13 (at your option) any later version.
14
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.
19
20 You should have received a copy of the GNU General Public License
a9762ec7 21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
eb8bc282
AC
22
23#ifndef USER_REGS_H
24#define USER_REGS_H
25
26/* Implement both builtin, and architecture specific, per-frame user
27 visible registers.
28
29 Builtin registers apply to all architectures, where as architecture
30 specific registers are present when the architecture is selected.
31
32 These registers are assigned register numbers outside the
f57d151a
UW
33 architecture's register range
34 [0 .. gdbarch_num_regs + gdbarch_num_pseudo_regs].
eb8bc282
AC
35 Their values should be constructed using per-frame information. */
36
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. */
41
42struct frame_info;
e6e5e94c 43struct gdbarch;
eb8bc282
AC
44
45/* Given an architecture, map a user visible register name onto its
46 index. */
47
48extern int user_reg_map_name_to_regnum (struct gdbarch *gdbarch,
49 const char *str, int len);
50
51extern const char *user_reg_map_regnum_to_name (struct gdbarch *gdbarch,
52 int regnum);
53
54/* Return the value of the frame register in the specified frame.
55
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. */
59
123dc839
DJ
60typedef struct value *(user_reg_read_ftype) (struct frame_info *frame,
61 const void *baton);
eb8bc282
AC
62extern struct value *value_of_user_reg (int regnum, struct frame_info *frame);
63
64/* Add a builtin register (present in all architectures). */
65extern void user_reg_add_builtin (const char *name,
123dc839 66 user_reg_read_ftype *read, const void *baton);
eb8bc282
AC
67
68/* Add a per-architecture frame register. */
69extern void user_reg_add (struct gdbarch *gdbarch, const char *name,
123dc839 70 user_reg_read_ftype *read, const void *baton);
eb8bc282
AC
71
72#endif