/* nto-tdep.h - QNX Neutrino target header.
|
/* nto-tdep.h - QNX Neutrino target header.
|
|
|
Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
Copyright (C) 2003, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
|
|
Contributed by QNX Software Systems Ltd.
|
Contributed by QNX Software Systems Ltd.
|
|
|
This file is part of GDB.
|
This file is part of GDB.
|
|
|
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
the Free Software Foundation; either version 3 of the License, or
|
the Free Software Foundation; either version 3 of the License, or
|
(at your option) any later version.
|
(at your option) any later version.
|
|
|
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
GNU General Public License for more details.
|
GNU General Public License for more details.
|
|
|
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
#ifndef _NTO_TDEP_H
|
#ifndef _NTO_TDEP_H
|
#define _NTO_TDEP_H
|
#define _NTO_TDEP_H
|
|
|
#include "solist.h"
|
#include "solist.h"
|
#include "osabi.h"
|
#include "osabi.h"
|
#include "regset.h"
|
#include "regset.h"
|
#include "gdbthread.h"
|
#include "gdbthread.h"
|
|
|
/* Target operations defined for Neutrino targets (<target>-nto-tdep.c). */
|
/* Target operations defined for Neutrino targets (<target>-nto-tdep.c). */
|
|
|
struct nto_target_ops
|
struct nto_target_ops
|
{
|
{
|
/* For 'maintenance debug nto-debug' command. */
|
/* For 'maintenance debug nto-debug' command. */
|
int internal_debugging;
|
int internal_debugging;
|
|
|
/* The CPUINFO flags from the remote. Currently used by
|
/* The CPUINFO flags from the remote. Currently used by
|
i386 for fxsave but future proofing other hosts.
|
i386 for fxsave but future proofing other hosts.
|
This is initialized in procfs_attach or nto_start_remote
|
This is initialized in procfs_attach or nto_start_remote
|
depending on our host/target. It would only be invalid
|
depending on our host/target. It would only be invalid
|
if we were talking to an older pdebug which didn't support
|
if we were talking to an older pdebug which didn't support
|
the cpuinfo message. */
|
the cpuinfo message. */
|
unsigned cpuinfo_flags;
|
unsigned cpuinfo_flags;
|
|
|
/* True if successfully retrieved cpuinfo from remote. */
|
/* True if successfully retrieved cpuinfo from remote. */
|
int cpuinfo_valid;
|
int cpuinfo_valid;
|
|
|
/* Given a register, return an id that represents the Neutrino
|
/* Given a register, return an id that represents the Neutrino
|
regset it came from. If reg == -1 update all regsets. */
|
regset it came from. If reg == -1 update all regsets. */
|
int (*regset_id) (int);
|
int (*regset_id) (int);
|
|
|
void (*supply_gregset) (struct regcache *, char *);
|
void (*supply_gregset) (struct regcache *, char *);
|
|
|
void (*supply_fpregset) (struct regcache *, char *);
|
void (*supply_fpregset) (struct regcache *, char *);
|
|
|
void (*supply_altregset) (struct regcache *, char *);
|
void (*supply_altregset) (struct regcache *, char *);
|
|
|
/* Given a regset, tell gdb about registers stored in data. */
|
/* Given a regset, tell gdb about registers stored in data. */
|
void (*supply_regset) (struct regcache *, int, char *);
|
void (*supply_regset) (struct regcache *, int, char *);
|
|
|
/* Given a register and regset, calculate the offset into the regset
|
/* Given a register and regset, calculate the offset into the regset
|
and stuff it into the last argument. If regno is -1, calculate the
|
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
|
size of the entire regset. Returns length of data, -1 if unknown
|
regset, 0 if unknown register. */
|
regset, 0 if unknown register. */
|
int (*register_area) (struct gdbarch *, 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. */
|
Return -1 if unknown regset, 0 otherwise. */
|
int (*regset_fill) (const struct regcache *, int, char *);
|
int (*regset_fill) (const struct regcache *, int, char *);
|
|
|
/* Gives the fetch_link_map_offsets function exposure outside of
|
/* Gives the fetch_link_map_offsets function exposure outside of
|
solib-svr4.c so that we can override relocate_section_addresses(). */
|
solib-svr4.c so that we can override relocate_section_addresses(). */
|
struct link_map_offsets *(*fetch_link_map_offsets) (void);
|
struct link_map_offsets *(*fetch_link_map_offsets) (void);
|
|
|
/* Used by nto_elf_osabi_sniffer to determine if we're connected to an
|
/* Used by nto_elf_osabi_sniffer to determine if we're connected to an
|
Neutrino target. */
|
Neutrino target. */
|
enum gdb_osabi (*is_nto_target) (bfd *abfd);
|
enum gdb_osabi (*is_nto_target) (bfd *abfd);
|
};
|
};
|
|
|
extern struct nto_target_ops current_nto_target;
|
extern struct nto_target_ops current_nto_target;
|
|
|
#define nto_internal_debugging (current_nto_target.internal_debugging)
|
#define nto_internal_debugging (current_nto_target.internal_debugging)
|
|
|
#define nto_cpuinfo_flags (current_nto_target.cpuinfo_flags)
|
#define nto_cpuinfo_flags (current_nto_target.cpuinfo_flags)
|
|
|
#define nto_cpuinfo_valid (current_nto_target.cpuinfo_valid)
|
#define nto_cpuinfo_valid (current_nto_target.cpuinfo_valid)
|
|
|
#define nto_regset_id (current_nto_target.regset_id)
|
#define nto_regset_id (current_nto_target.regset_id)
|
|
|
#define nto_supply_gregset (current_nto_target.supply_gregset)
|
#define nto_supply_gregset (current_nto_target.supply_gregset)
|
|
|
#define nto_supply_fpregset (current_nto_target.supply_fpregset)
|
#define nto_supply_fpregset (current_nto_target.supply_fpregset)
|
|
|
#define nto_supply_altregset (current_nto_target.supply_altregset)
|
#define nto_supply_altregset (current_nto_target.supply_altregset)
|
|
|
#define nto_supply_regset (current_nto_target.supply_regset)
|
#define nto_supply_regset (current_nto_target.supply_regset)
|
|
|
#define nto_register_area (current_nto_target.register_area)
|
#define nto_register_area (current_nto_target.register_area)
|
|
|
#define nto_regset_fill (current_nto_target.regset_fill)
|
#define nto_regset_fill (current_nto_target.regset_fill)
|
|
|
#define nto_fetch_link_map_offsets \
|
#define nto_fetch_link_map_offsets \
|
(current_nto_target.fetch_link_map_offsets)
|
(current_nto_target.fetch_link_map_offsets)
|
|
|
#define nto_is_nto_target (current_nto_target.is_nto_target)
|
#define nto_is_nto_target (current_nto_target.is_nto_target)
|
|
|
/* Keep this consistant with neutrino syspage.h. */
|
/* Keep this consistant with neutrino syspage.h. */
|
enum
|
enum
|
{
|
{
|
CPUTYPE_X86,
|
CPUTYPE_X86,
|
CPUTYPE_PPC,
|
CPUTYPE_PPC,
|
CPUTYPE_MIPS,
|
CPUTYPE_MIPS,
|
CPUTYPE_SPARE,
|
CPUTYPE_SPARE,
|
CPUTYPE_ARM,
|
CPUTYPE_ARM,
|
CPUTYPE_SH,
|
CPUTYPE_SH,
|
CPUTYPE_UNKNOWN
|
CPUTYPE_UNKNOWN
|
};
|
};
|
|
|
enum
|
enum
|
{
|
{
|
OSTYPE_QNX4,
|
OSTYPE_QNX4,
|
OSTYPE_NTO
|
OSTYPE_NTO
|
};
|
};
|
|
|
/* These correspond to the DSMSG_* versions in dsmsgs.h. */
|
/* These correspond to the DSMSG_* versions in dsmsgs.h. */
|
enum
|
enum
|
{
|
{
|
NTO_REG_GENERAL,
|
NTO_REG_GENERAL,
|
NTO_REG_FLOAT,
|
NTO_REG_FLOAT,
|
NTO_REG_SYSTEM,
|
NTO_REG_SYSTEM,
|
NTO_REG_ALT,
|
NTO_REG_ALT,
|
NTO_REG_END
|
NTO_REG_END
|
};
|
};
|
|
|
typedef char qnx_reg64[8];
|
typedef char qnx_reg64[8];
|
|
|
typedef struct _debug_regs
|
typedef struct _debug_regs
|
{
|
{
|
qnx_reg64 padding[1024];
|
qnx_reg64 padding[1024];
|
} nto_regset_t;
|
} nto_regset_t;
|
|
|
struct private_thread_info
|
struct private_thread_info
|
{
|
{
|
short tid;
|
short tid;
|
unsigned char state;
|
unsigned char state;
|
unsigned char flags;
|
unsigned char flags;
|
char name[1];
|
char name[1];
|
};
|
};
|
|
|
/* Generic functions in nto-tdep.c. */
|
/* Generic functions in nto-tdep.c. */
|
|
|
void nto_init_solib_absolute_prefix (void);
|
void nto_init_solib_absolute_prefix (void);
|
|
|
char **nto_parse_redirection (char *start_argv[], const char **in,
|
char **nto_parse_redirection (char *start_argv[], const char **in,
|
const char **out, const char **err);
|
const char **out, const char **err);
|
|
|
void nto_relocate_section_addresses (struct so_list *,
|
void nto_relocate_section_addresses (struct so_list *,
|
struct target_section *);
|
struct target_section *);
|
|
|
int nto_map_arch_to_cputype (const char *);
|
int nto_map_arch_to_cputype (const char *);
|
|
|
int nto_find_and_open_solib (char *, unsigned, char **);
|
int nto_find_and_open_solib (char *, unsigned, char **);
|
|
|
enum gdb_osabi nto_elf_osabi_sniffer (bfd *abfd);
|
enum gdb_osabi nto_elf_osabi_sniffer (bfd *abfd);
|
|
|
void nto_initialize_signals (void);
|
void nto_initialize_signals (void);
|
|
|
/* Dummy function for initializing nto_target_ops on targets which do
|
/* Dummy function for initializing nto_target_ops on targets which do
|
not define a particular regset. */
|
not define a particular regset. */
|
void nto_dummy_supply_regset (struct regcache *regcache, char *regs);
|
void nto_dummy_supply_regset (struct regcache *regcache, char *regs);
|
|
|
int nto_in_dynsym_resolve_code (CORE_ADDR pc);
|
int nto_in_dynsym_resolve_code (CORE_ADDR pc);
|
|
|
char *nto_extra_thread_info (struct thread_info *);
|
char *nto_extra_thread_info (struct thread_info *);
|
|
|
#endif
|
#endif
|
|
|