GDB (API)
/home/stan/gdb/src/gdb/user-regs.h
Go to the documentation of this file.
00001 /* Per-frame user registers, for GDB, the GNU debugger.
00002 
00003    Copyright (C) 2002-2013 Free Software Foundation, Inc.
00004 
00005    Contributed by Red Hat.
00006 
00007    This file is part of GDB.
00008 
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; either version 3 of the License, or
00012    (at your option) any later version.
00013 
00014    This program is distributed in the hope that it will be useful,
00015    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017    GNU General Public License for more details.
00018 
00019    You should have received a copy of the GNU General Public License
00020    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00021 
00022 #ifndef USER_REGS_H
00023 #define USER_REGS_H
00024 
00025 /* Implement both builtin, and architecture specific, per-frame user
00026    visible registers.
00027 
00028    Builtin registers apply to all architectures, where as architecture
00029    specific registers are present when the architecture is selected.
00030 
00031    These registers are assigned register numbers outside the
00032    architecture's register range
00033    [0 .. gdbarch_num_regs + gdbarch_num_pseudo_regs].
00034    Their values should be constructed using per-frame information.  */
00035 
00036 /* TODO: cagney/2003-06-27: Need to think more about how these
00037    registers are added, read, and modified.  At present they are kind
00038    of assumed to be read-only.  Should it, for instance, return a
00039    register descriptor that contains all the relvent access methods.  */
00040 
00041 struct frame_info;
00042 struct gdbarch;
00043 
00044 /* Given an architecture, map a user visible register name onto its
00045    index.  */
00046 
00047 extern int user_reg_map_name_to_regnum (struct gdbarch *gdbarch,
00048                                         const char *str, int len);
00049 
00050 extern const char *user_reg_map_regnum_to_name (struct gdbarch *gdbarch,
00051                                                 int regnum);
00052 
00053 /* Return the value of the frame register in the specified frame.
00054 
00055    Note; These methods return a "struct value" instead of the raw
00056    bytes as, at the time the register is being added, the type needed
00057    to describe the register has not bee initialized.  */
00058 
00059 typedef struct value *(user_reg_read_ftype) (struct frame_info *frame,
00060                                              const void *baton);
00061 extern struct value *value_of_user_reg (int regnum, struct frame_info *frame);
00062 
00063 /* Add a builtin register (present in all architectures).  */
00064 extern void user_reg_add_builtin (const char *name,
00065                                   user_reg_read_ftype *read,
00066                                   const void *baton);
00067 
00068 /* Add a per-architecture frame register.  */
00069 extern void user_reg_add (struct gdbarch *gdbarch, const char *name, 
00070                           user_reg_read_ftype *read, const void *baton);
00071 
00072 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines