gdb/nto-tdep.h - gdb

Data types defined

Macros defined

Source code

  1. /* nto-tdep.h - QNX Neutrino target header.

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

  3.    Contributed by QNX Software Systems Ltd.

  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 _NTO_TDEP_H
  16. #define _NTO_TDEP_H

  17. #include "solist.h"
  18. #include "osabi.h"
  19. #include "regset.h"
  20. #include "gdbthread.h"

  21. /* Target operations defined for Neutrino targets (<target>-nto-tdep.c).  */

  22. struct nto_target_ops
  23. {
  24. /* The CPUINFO flags from the remote.  Currently used by
  25.    i386 for fxsave but future proofing other hosts.
  26.    This is initialized in procfs_attach or nto_start_remote
  27.    depending on our host/target.  It would only be invalid
  28.    if we were talking to an older pdebug which didn't support
  29.    the cpuinfo message.  */
  30.   unsigned cpuinfo_flags;

  31. /* True if successfully retrieved cpuinfo from remote.  */
  32.   int cpuinfo_valid;

  33. /* Given a register, return an id that represents the Neutrino
  34.    regset it came from.  If reg == -1 update all regsets.  */
  35.   int (*regset_id) (int);

  36.   void (*supply_gregset) (struct regcache *, char *);

  37.   void (*supply_fpregset) (struct regcache *, char *);

  38.   void (*supply_altregset) (struct regcache *, char *);

  39. /* Given a regset, tell gdb about registers stored in data.  */
  40.   void (*supply_regset) (struct regcache *, int, char *);

  41. /* Given a register and regset, calculate the offset into the regset
  42.    and stuff it into the last argument.  If regno is -1, calculate the
  43.    size of the entire regset.  Returns length of data, -1 if unknown
  44.    regset, 0 if unknown register.  */
  45.   int (*register_area) (struct gdbarch *, int, int, unsigned *);

  46. /* Build the Neutrino register set info into the data buffer.
  47.    Return -1 if unknown regset, 0 otherwise.  */
  48.   int (*regset_fill) (const struct regcache *, int, char *);

  49. /* Gives the fetch_link_map_offsets function exposure outside of
  50.    solib-svr4.c so that we can override relocate_section_addresses().  */
  51.   struct link_map_offsets *(*fetch_link_map_offsets) (void);

  52. /* Used by nto_elf_osabi_sniffer to determine if we're connected to an
  53.    Neutrino target.  */
  54.   enum gdb_osabi (*is_nto_target) (bfd *abfd);
  55. };

  56. extern struct nto_target_ops current_nto_target;

  57. #define nto_cpuinfo_flags (current_nto_target.cpuinfo_flags)

  58. #define nto_cpuinfo_valid (current_nto_target.cpuinfo_valid)

  59. #define nto_regset_id (current_nto_target.regset_id)

  60. #define nto_supply_gregset (current_nto_target.supply_gregset)

  61. #define nto_supply_fpregset (current_nto_target.supply_fpregset)

  62. #define nto_supply_altregset (current_nto_target.supply_altregset)

  63. #define nto_supply_regset (current_nto_target.supply_regset)

  64. #define nto_register_area (current_nto_target.register_area)

  65. #define nto_regset_fill (current_nto_target.regset_fill)

  66. #define nto_fetch_link_map_offsets \
  67. (current_nto_target.fetch_link_map_offsets)

  68. #define nto_is_nto_target (current_nto_target.is_nto_target)

  69. /* Keep this consistant with neutrino syspage.h.  */
  70. enum
  71. {
  72.   CPUTYPE_X86,
  73.   CPUTYPE_PPC,
  74.   CPUTYPE_MIPS,
  75.   CPUTYPE_SPARE,
  76.   CPUTYPE_ARM,
  77.   CPUTYPE_SH,
  78.   CPUTYPE_UNKNOWN
  79. };

  80. enum
  81. {
  82.   OSTYPE_QNX4,
  83.   OSTYPE_NTO
  84. };

  85. /* These correspond to the DSMSG_* versions in dsmsgs.h.  */
  86. enum
  87. {
  88.   NTO_REG_GENERAL,
  89.   NTO_REG_FLOAT,
  90.   NTO_REG_SYSTEM,
  91.   NTO_REG_ALT,
  92.   NTO_REG_END
  93. };

  94. typedef char qnx_reg64[8];

  95. typedef struct _debug_regs
  96. {
  97.   qnx_reg64 padding[1024];
  98. } nto_regset_t;

  99. struct private_thread_info
  100. {
  101.   short tid;
  102.   unsigned char state;
  103.   unsigned char flags;
  104.   char name[1];
  105. };

  106. /* Generic functions in nto-tdep.c.  */

  107. void nto_init_solib_absolute_prefix (void);

  108. char **nto_parse_redirection (char *start_argv[], const char **in,
  109.                               const char **out, const char **err);

  110. void nto_relocate_section_addresses (struct so_list *,
  111.                                      struct target_section *);

  112. int nto_map_arch_to_cputype (const char *);

  113. int nto_find_and_open_solib (char *, unsigned, char **);

  114. enum gdb_osabi nto_elf_osabi_sniffer (bfd *abfd);

  115. void nto_initialize_signals (void);

  116. /* Dummy function for initializing nto_target_ops on targets which do
  117.    not define a particular regset.  */
  118. void nto_dummy_supply_regset (struct regcache *regcache, char *regs);

  119. int nto_in_dynsym_resolve_code (CORE_ADDR pc);

  120. char *nto_extra_thread_info (struct target_ops *self, struct thread_info *);

  121. #endif