1 /* nto-tdep.h - QNX Neutrino target header.
3 Copyright 2003 Free Software Foundation, Inc.
5 Contributed by QNX Software Systems Ltd.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
30 /* Generic functions in nto-tdep.c. */
32 extern void nto_init_solib_absolute_prefix (void);
34 char **nto_parse_redirection (char *start_argv[], char **in,
35 char **out, char **err);
37 int proc_iterate_over_mappings (int (*func) (int, CORE_ADDR));
39 void nto_relocate_section_addresses (struct so_list *, struct section_table *);
41 int nto_map_arch_to_cputype (const char *);
43 int nto_find_and_open_solib (char *, unsigned, char **);
45 /* Dummy function for initializing nto_target_ops on targets which do
46 not define a particular regset. */
47 void nto_dummy_supply_regset (char *regs);
49 /* Target operations defined for Neutrino targets (<target>-nto-tdep.c). */
53 int nto_internal_debugging;
54 unsigned nto_cpuinfo_flags;
55 int nto_cpuinfo_valid;
57 int (*nto_regset_id) (int);
58 void (*nto_supply_gregset) (char *);
59 void (*nto_supply_fpregset) (char *);
60 void (*nto_supply_altregset) (char *);
61 void (*nto_supply_regset) (int, char *);
62 int (*nto_register_area) (int, int, unsigned *);
63 int (*nto_regset_fill) (int, char *);
64 struct link_map_offsets *(*nto_fetch_link_map_offsets) (void);
67 extern struct nto_target_ops current_nto_target;
69 /* For 'maintenance debug nto-debug' command. */
70 #define nto_internal_debugging \
71 (current_nto_target.nto_internal_debugging)
73 /* The CPUINFO flags from the remote. Currently used by
74 i386 for fxsave but future proofing other hosts.
75 This is initialized in procfs_attach or nto_start_remote
76 depending on our host/target. It would only be invalid
77 if we were talking to an older pdebug which didn't support
78 the cpuinfo message. */
79 #define nto_cpuinfo_flags \
80 (current_nto_target.nto_cpuinfo_flags)
82 /* True if successfully retrieved cpuinfo from remote. */
83 #define nto_cpuinfo_valid \
84 (current_nto_target.nto_cpuinfo_valid)
86 /* Given a register, return an id that represents the Neutrino
87 regset it came from. If reg == -1 update all regsets. */
88 #define nto_regset_id(reg) \
89 (*current_nto_target.nto_regset_id) (reg)
91 #define nto_supply_gregset(regs) \
92 (*current_nto_target.nto_supply_gregset) (regs)
94 #define nto_supply_fpregset(regs) \
95 (*current_nto_target.nto_supply_fpregset) (regs)
97 #define nto_supply_altregset(regs) \
98 (*current_nto_target.nto_supply_altregset) (regs)
100 /* Given a regset, tell gdb about registers stored in data. */
101 #define nto_supply_regset(regset, data) \
102 (*current_nto_target.nto_supply_regset) (regset, data)
104 /* Given a register and regset, calculate the offset into the regset
105 and stuff it into the last argument. If regno is -1, calculate the
106 size of the entire regset. Returns length of data, -1 if unknown
107 regset, 0 if unknown register. */
108 #define nto_register_area(reg, regset, off) \
109 (*current_nto_target.nto_register_area) (reg, regset, off)
111 /* Build the Neutrino register set info into the data buffer.
112 Return -1 if unknown regset, 0 otherwise. */
113 #define nto_regset_fill(regset, data) \
114 (*current_nto_target.nto_regset_fill) (regset, data)
116 /* Gives the fetch_link_map_offsets function exposure outside of
117 solib-svr4.c so that we can override relocate_section_addresses(). */
118 #define nto_fetch_link_map_offsets() \
119 (*current_nto_target.nto_fetch_link_map_offsets) ()
121 /* Keep this consistant with neutrino syspage.h. */
139 /* These correspond to the DSMSG_* versions in dsmsgs.h. */
149 typedef char qnx_reg64[8];
151 typedef struct _debug_regs
153 qnx_reg64 padding[1024];