]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/nto-tdep.h
[gdb/symtab] Make gold index workaround more precise
[thirdparty/binutils-gdb.git] / gdb / nto-tdep.h
index 4c51697f757ee75bbb8bf8204a0cf1c40546e6d3..889553709cb25f81ece9e693d70d57f285604e2e 100644 (file)
@@ -1,6 +1,6 @@
 /* nto-tdep.h - QNX Neutrino target header.
 
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003-2020 Free Software Foundation, Inc.
 
    Contributed by QNX Software Systems Ltd.
 
@@ -8,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef _NTO_TDEP_H
-#define _NTO_TDEP_H
+#ifndef NTO_TDEP_H
+#define NTO_TDEP_H
 
-#include "defs.h"
 #include "solist.h"
 #include "osabi.h"
 #include "regset.h"
+#include "gdbthread.h"
 
 /* Target operations defined for Neutrino targets (<target>-nto-tdep.c).  */
 
 struct nto_target_ops
 {
-/* For 'maintenance debug nto-debug' command.  */
-  int internal_debugging;
-
 /* The CPUINFO flags from the remote.  Currently used by
    i386 for fxsave but future proofing other hosts.
    This is initialized in procfs_attach or nto_start_remote
@@ -51,24 +46,24 @@ struct nto_target_ops
    regset it came from.  If reg == -1 update all regsets.  */
   int (*regset_id) (int);
 
-  void (*supply_gregset) (char *);
+  void (*supply_gregset) (struct regcache *, char *);
 
-  void (*supply_fpregset) (char *);
+  void (*supply_fpregset) (struct regcache *, char *);
 
-  void (*supply_altregset) (char *);
+  void (*supply_altregset) (struct regcache *, char *);
 
 /* Given a regset, tell gdb about registers stored in data.  */
-  void (*supply_regset) (int, char *);
+  void (*supply_regset) (struct regcache *, int, char *);
 
 /* Given a register and regset, calculate the offset into the regset
    and stuff it into the last argument.  If regno is -1, calculate the
    size of the entire regset.  Returns length of data, -1 if unknown
    regset, 0 if unknown register.  */
-  int (*register_area) (int, int, unsigned *);
+  int (*register_area) (struct gdbarch *, int, int, unsigned *);
 
-/* Build the Neutrino register set info into the data buffer.  
+/* Build the Neutrino register set info into the data buffer.
    Return -1 if unknown regset, 0 otherwise.  */
-  int (*regset_fill) (int, char *);
+  int (*regset_fill) (const struct regcache *, int, char *);
 
 /* Gives the fetch_link_map_offsets function exposure outside of
    solib-svr4.c so that we can override relocate_section_addresses().  */
@@ -81,8 +76,6 @@ struct nto_target_ops
 
 extern struct nto_target_ops current_nto_target;
 
-#define nto_internal_debugging (current_nto_target.internal_debugging)
-
 #define nto_cpuinfo_flags (current_nto_target.cpuinfo_flags)
 
 #define nto_cpuinfo_valid (current_nto_target.cpuinfo_valid)
@@ -124,7 +117,7 @@ enum
   OSTYPE_NTO
 };
 
-/* These correspond to the DSMSG_* versions in dsmsgs.h. */
+/* These correspond to the DSMSG_* versions in dsmsgs.h.  */
 enum
 {
   NTO_REG_GENERAL,
@@ -141,41 +134,61 @@ typedef struct _debug_regs
   qnx_reg64 padding[1024];
 } nto_regset_t;
 
-/* Generic functions in nto-tdep.c.  */
+struct nto_thread_info : public private_thread_info
+{
+  short tid = 0;
+  unsigned char state = 0;
+  unsigned char flags = 0;
+  std::string name;
+};
 
-void nto_init_solib_absolute_prefix (void);
+static inline nto_thread_info *
+get_nto_thread_info (thread_info *thread)
+{
+  return static_cast<nto_thread_info *> (thread->priv.get ());
+}
 
-void nto_set_target(struct nto_target_ops *);
+/* Per-inferior data, common for both procfs and remote.  */
+struct nto_inferior_data
+{
+  /* Last stopped flags result from wait function */
+  unsigned int stopped_flags = 0;
 
-char **nto_parse_redirection (char *start_argv[], char **in,
-                             char **out, char **err);
+  /* Last known stopped PC */
+  CORE_ADDR stopped_pc = 0;
+};
 
-int proc_iterate_over_mappings (int (*func) (int, CORE_ADDR));
+/* Generic functions in nto-tdep.c.  */
+
+void nto_init_solib_absolute_prefix (void);
+
+char **nto_parse_redirection (char *start_argv[], const char **in,
+                             const char **out, const char **err);
 
 void nto_relocate_section_addresses (struct so_list *,
-                                    struct section_table *);
+                                    struct target_section *);
 
 int nto_map_arch_to_cputype (const char *);
 
-int nto_find_and_open_solib (char *, unsigned, char **);
+int nto_find_and_open_solib (const char *, unsigned,
+                            gdb::unique_xmalloc_ptr<char> *);
 
 enum gdb_osabi nto_elf_osabi_sniffer (bfd *abfd);
 
 void nto_initialize_signals (void);
 
-void nto_generic_supply_gpregset (const struct regset *, struct regcache *,
-                                 int, const void *, size_t);
-
-void nto_generic_supply_fpregset (const struct regset *, struct regcache *,
-                                 int, const void *, size_t);
-
-void nto_generic_supply_altregset (const struct regset *, struct regcache *,
-                                  int, const void *, size_t);
-
 /* Dummy function for initializing nto_target_ops on targets which do
    not define a particular regset.  */
-void nto_dummy_supply_regset (char *regs);
+void nto_dummy_supply_regset (struct regcache *regcache, char *regs);
 
 int nto_in_dynsym_resolve_code (CORE_ADDR pc);
 
-#endif
+const char *nto_extra_thread_info (struct target_ops *self, struct thread_info *);
+
+LONGEST nto_read_auxv_from_initial_stack (CORE_ADDR inital_stack,
+                                         gdb_byte *readbuf,
+                                         LONGEST len, size_t sizeof_auxv_t);
+
+struct nto_inferior_data *nto_inferior_data (struct inferior *inf);
+
+#endif /* NTO_TDEP_H */