gdb/user-regs.h - gdb

Data types defined

Macros defined

Source code

  1. /* Per-frame user registers, for GDB, the GNU debugger.

  2.    Copyright (C) 2002-2015 Free Software Foundation, Inc.

  3.    Contributed by Red Hat.

  4.    This file is part of GDB.

  5.    This program is free software; you can redistribute it and/or modify
  6.    it under the terms of the GNU General Public License as published by
  7.    the Free Software Foundation; either version 3 of the License, or
  8.    (at your option) any later version.

  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.

  13.    You should have received a copy of the GNU General Public License
  14.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  15. #ifndef USER_REGS_H
  16. #define USER_REGS_H

  17. /* Implement both builtin, and architecture specific, per-frame user
  18.    visible registers.

  19.    Builtin registers apply to all architectures, where as architecture
  20.    specific registers are present when the architecture is selected.

  21.    These registers are assigned register numbers outside the
  22.    architecture's register range
  23.    [0 .. gdbarch_num_regs + gdbarch_num_pseudo_regs].
  24.    Their values should be constructed using per-frame information.  */

  25. /* TODO: cagney/2003-06-27: Need to think more about how these
  26.    registers are added, read, and modified.  At present they are kind
  27.    of assumed to be read-only.  Should it, for instance, return a
  28.    register descriptor that contains all the relvent access methods.  */

  29. struct frame_info;
  30. struct gdbarch;

  31. /* Given an architecture, map a user visible register name onto its
  32.    index.  */

  33. extern int user_reg_map_name_to_regnum (struct gdbarch *gdbarch,
  34.                                         const char *str, int len);

  35. extern const char *user_reg_map_regnum_to_name (struct gdbarch *gdbarch,
  36.                                                 int regnum);

  37. /* Return the value of the frame register in the specified frame.

  38.    Note; These methods return a "struct value" instead of the raw
  39.    bytes as, at the time the register is being added, the type needed
  40.    to describe the register has not bee initialized.  */

  41. typedef struct value *(user_reg_read_ftype) (struct frame_info *frame,
  42.                                              const void *baton);
  43. extern struct value *value_of_user_reg (int regnum, struct frame_info *frame);

  44. /* Add a builtin register (present in all architectures).  */
  45. extern void user_reg_add_builtin (const char *name,
  46.                                   user_reg_read_ftype *read,
  47.                                   const void *baton);

  48. /* Add a per-architecture frame register.  */
  49. extern void user_reg_add (struct gdbarch *gdbarch, const char *name,
  50.                           user_reg_read_ftype *read, const void *baton);

  51. #endif