GDB (xrefs)
Loading...
Searching...
No Matches
nto-tdep.h
Go to the documentation of this file.
1/* nto-tdep.h - QNX Neutrino target header.
2
3 Copyright (C) 2003-2023 Free Software Foundation, Inc.
4
5 Contributed by QNX Software Systems Ltd.
6
7 This file is part of GDB.
8
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 3 of the License, or
12 (at your option) any later version.
13
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.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21
22#ifndef NTO_TDEP_H
23#define NTO_TDEP_H
24
25#include "solist.h"
26#include "osabi.h"
27#include "regset.h"
28#include "gdbthread.h"
29#include "gdbsupport/gdb-checked-static-cast.h"
30
31/* Target operations defined for Neutrino targets (<target>-nto-tdep.c). */
32
34{
35/* The CPUINFO flags from the remote. Currently used by
36 i386 for fxsave but future proofing other hosts.
37 This is initialized in procfs_attach or nto_start_remote
38 depending on our host/target. It would only be invalid
39 if we were talking to an older pdebug which didn't support
40 the cpuinfo message. */
41 unsigned cpuinfo_flags;
42
43/* True if successfully retrieved cpuinfo from remote. */
45
46/* Given a register, return an id that represents the Neutrino
47 regset it came from. If reg == -1 update all regsets. */
48 int (*regset_id) (int);
49
50 void (*supply_gregset) (struct regcache *, char *);
51
52 void (*supply_fpregset) (struct regcache *, char *);
53
54 void (*supply_altregset) (struct regcache *, char *);
55
56/* Given a regset, tell gdb about registers stored in data. */
57 void (*supply_regset) (struct regcache *, int, char *);
58
59/* Given a register and regset, calculate the offset into the regset
60 and stuff it into the last argument. If regno is -1, calculate the
61 size of the entire regset. Returns length of data, -1 if unknown
62 regset, 0 if unknown register. */
63 int (*register_area) (struct gdbarch *, int, int, unsigned *);
64
65/* Build the Neutrino register set info into the data buffer.
66 Return -1 if unknown regset, 0 otherwise. */
67 int (*regset_fill) (const struct regcache *, int, char *);
68
69/* Gives the fetch_link_map_offsets function exposure outside of
70 solib-svr4.c so that we can override relocate_section_addresses(). */
71 struct link_map_offsets *(*fetch_link_map_offsets) (void);
72
73/* Used by nto_elf_osabi_sniffer to determine if we're connected to an
74 Neutrino target. */
75 enum gdb_osabi (*is_nto_target) (bfd *abfd);
76};
77
79
80#define nto_cpuinfo_flags (current_nto_target.cpuinfo_flags)
81
82#define nto_cpuinfo_valid (current_nto_target.cpuinfo_valid)
83
84#define nto_regset_id (current_nto_target.regset_id)
85
86#define nto_supply_gregset (current_nto_target.supply_gregset)
87
88#define nto_supply_fpregset (current_nto_target.supply_fpregset)
89
90#define nto_supply_altregset (current_nto_target.supply_altregset)
91
92#define nto_supply_regset (current_nto_target.supply_regset)
93
94#define nto_register_area (current_nto_target.register_area)
95
96#define nto_regset_fill (current_nto_target.regset_fill)
97
98#define nto_fetch_link_map_offsets \
99(current_nto_target.fetch_link_map_offsets)
100
101#define nto_is_nto_target (current_nto_target.is_nto_target)
102
103/* Keep this consistant with neutrino syspage.h. */
104enum
105{
114
115enum
116{
120
121/* These correspond to the DSMSG_* versions in dsmsgs.h. */
122enum
123{
130
131typedef char qnx_reg64[8];
132
137
139{
140 short tid = 0;
141 unsigned char state = 0;
142 unsigned char flags = 0;
143 std::string name;
144};
145
146static inline nto_thread_info *
148{
149 return gdb::checked_static_cast<nto_thread_info *> (thread->priv.get ());
150}
151
152/* Per-inferior data, common for both procfs and remote. */
154{
155 /* Last stopped flags result from wait function */
156 unsigned int stopped_flags = 0;
157
158 /* Last known stopped PC */
159 CORE_ADDR stopped_pc = 0;
160};
161
162/* Generic functions in nto-tdep.c. */
163
165
166char **nto_parse_redirection (char *start_argv[], const char **in,
167 const char **out, const char **err);
168
170 struct target_section *);
171
172int nto_map_arch_to_cputype (const char *);
173
174int nto_find_and_open_solib (const char *, unsigned,
175 gdb::unique_xmalloc_ptr<char> *);
176
177enum gdb_osabi nto_elf_osabi_sniffer (bfd *abfd);
178
179void nto_initialize_signals (void);
180
181/* Dummy function for initializing nto_target_ops on targets which do
182 not define a particular regset. */
183void nto_dummy_supply_regset (struct regcache *regcache, char *regs);
184
185int nto_in_dynsym_resolve_code (CORE_ADDR pc);
186
187const char *nto_extra_thread_info (struct target_ops *self, struct thread_info *);
188
189LONGEST nto_read_auxv_from_initial_stack (CORE_ADDR initial_stack,
190 gdb_byte *readbuf,
191 LONGEST len, size_t sizeof_auxv_t);
192
194
195#endif /* NTO_TDEP_H */
private_thread_info_up priv
Definition gdbthread.h:528
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t err
Definition gnu-nat.c:1789
@ OSTYPE_QNX4
Definition nto-tdep.h:117
@ OSTYPE_NTO
Definition nto-tdep.h:118
struct nto_inferior_data * nto_inferior_data(struct inferior *inf)
Definition nto-tdep.c:506
char ** nto_parse_redirection(char *start_argv[], const char **in, const char **out, const char **err)
Definition nto-tdep.c:192
@ CPUTYPE_X86
Definition nto-tdep.h:106
@ CPUTYPE_SH
Definition nto-tdep.h:111
@ CPUTYPE_SPARE
Definition nto-tdep.h:109
@ CPUTYPE_MIPS
Definition nto-tdep.h:108
@ CPUTYPE_ARM
Definition nto-tdep.h:110
@ CPUTYPE_PPC
Definition nto-tdep.h:107
@ CPUTYPE_UNKNOWN
Definition nto-tdep.h:112
void nto_dummy_supply_regset(struct regcache *regcache, char *regs)
Definition nto-tdep.c:306
LONGEST nto_read_auxv_from_initial_stack(CORE_ADDR initial_stack, gdb_byte *readbuf, LONGEST len, size_t sizeof_auxv_t)
Definition nto-tdep.c:421
int nto_find_and_open_solib(const char *, unsigned, gdb::unique_xmalloc_ptr< char > *)
Definition nto-tdep.c:93
void nto_init_solib_absolute_prefix(void)
Definition nto-tdep.c:157
struct _debug_regs nto_regset_t
char qnx_reg64[8]
Definition nto-tdep.h:131
const char * nto_extra_thread_info(struct target_ops *self, struct thread_info *)
Definition nto-tdep.c:384
int nto_in_dynsym_resolve_code(CORE_ADDR pc)
Definition nto-tdep.c:298
enum gdb_osabi nto_elf_osabi_sniffer(bfd *abfd)
Definition nto-tdep.c:347
@ NTO_REG_FLOAT
Definition nto-tdep.h:125
@ NTO_REG_SYSTEM
Definition nto-tdep.h:126
@ NTO_REG_ALT
Definition nto-tdep.h:127
@ NTO_REG_GENERAL
Definition nto-tdep.h:124
@ NTO_REG_END
Definition nto-tdep.h:128
static nto_thread_info * get_nto_thread_info(thread_info *thread)
Definition nto-tdep.h:147
struct nto_target_ops current_nto_target
Definition nto-tdep.c:52
void nto_relocate_section_addresses(struct so_list *, struct target_section *)
Definition nto-tdep.c:283
void nto_initialize_signals(void)
Definition nto-tdep.c:397
int nto_map_arch_to_cputype(const char *)
Definition nto-tdep.c:77
gdb_osabi
Definition osabi.h:25
qnx_reg64 padding[1024]
Definition nto-tdep.h:135
Definition gnu-nat.c:153
CORE_ADDR stopped_pc
Definition nto-tdep.h:159
unsigned int stopped_flags
Definition nto-tdep.h:156
enum gdb_osabi(* is_nto_target)(bfd *abfd)
Definition nto-tdep.h:75
int(* regset_id)(int)
Definition nto-tdep.h:48
void(* supply_gregset)(struct regcache *, char *)
Definition nto-tdep.h:50
void(* supply_altregset)(struct regcache *, char *)
Definition nto-tdep.h:54
int(* register_area)(struct gdbarch *, int, int, unsigned *)
Definition nto-tdep.h:63
int(* regset_fill)(const struct regcache *, int, char *)
Definition nto-tdep.h:67
void(* supply_fpregset)(struct regcache *, char *)
Definition nto-tdep.h:52
void(* supply_regset)(struct regcache *, int, char *)
Definition nto-tdep.h:57
unsigned cpuinfo_flags
Definition nto-tdep.h:41
int cpuinfo_valid
Definition nto-tdep.h:44
std::string name
Definition nto-tdep.h:143
unsigned char state
Definition nto-tdep.h:141
unsigned char flags
Definition nto-tdep.h:142