From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8169 invoked by alias); 23 Apr 2003 22:42:51 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 8156 invoked from network); 23 Apr 2003 22:42:50 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by sources.redhat.com with SMTP; 23 Apr 2003 22:42:50 -0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3p2/8.9.3) with ESMTP id SAA25213 for ; Wed, 23 Apr 2003 18:41:18 -0400 Received: from catdog ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id SAA00318 for ; Wed, 23 Apr 2003 18:42:49 -0400 Message-ID: <007801c309e9$adbed2e0$0202040a@catdog> From: "Kris Warkentin" To: References: <0b2c01c309c8$ebafebf0$0202040a@catdog> Subject: [patch-2] i386-nto (QNX Neutrino) support Date: Wed, 23 Apr 2003 23:32:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0075_01C309C8.269AE360" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-SW-Source: 2003-04/txt/msg00453.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0075_01C309C8.269AE360 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-length: 1453 Well that was easy. Daniels suggestion allows me to remove debug.h from this patch completely. cheers, Kris ChangeLog * configure.tgt: Add i386nto target * i386-nto-tdep.c: New file. i386 specific support for QNX Neutrino. * nto-tdep.c: New file. Neutrino target support routines. * nto-tdep.h: New file. Neutrino target header. * config/tm-qnxnto.h: New file. * config/i386/i386nto.mt: New file. * config/i386/tm-i386nto.h: New file. > In the interest of expediency, I removed the non-i386 things from debug.h > which I believe eliminates the portability issues. These can be re-examined > later when I'm doing the mips/powerpc ports. > > Most of this stuff has been gone over by Mark Kettenis fairly extensively (I > ran indent again Mark) and I hope that the debug.h issue was the last of > them. I've attached a diff of the config files as well as all the > individual files. I also included a tarball that can be extracted in the > gdb directory. > > Thanks > > Kris > > ChangeLog > > * configure.tgt: Add i386nto target > * i386-nto-tdep.c: New file. i386 specific support for QNX Neutrino. > * nto-tdep.c: New file. Neutrino target support routines. > * nto-tdep.h: New file. Neutrino target header. > * config/tm-qnxnto.h: New file. > * config/i386/i386nto.mt: New file. > * config/i386/tm-i386nto.h: New file. > * nto-share/debug.h: New file. Neutrino procfs interface. > ------=_NextPart_000_0075_01C309C8.269AE360 Content-Type: application/octet-stream; name="config.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="config.diff" Content-length: 460 Index: configure.tgt=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/configure.tgt,v=0A= retrieving revision 1.102=0A= diff -r1.102 configure.tgt=0A= 92a93=0A= > i[3456]86-*-nto*) gdb_target=3Di386nto;;=0A= 282a285=0A= > *-*-nto*) gdb_osabi=3DGDB_OSABI_QNXNTO ;;=0A= ------=_NextPart_000_0075_01C309C8.269AE360 Content-Type: application/x-compressed; name="nto.tgz" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="nto.tgz" Content-length: 10659 H4sIACwVpz4AA+xce3Pbtpbvv9anQN1pItlyLNmJkxvlMYojp57r2LqWskm2 yXAoCpJYUySXoPzobb/7/s4BQIJ6JOnstjs7U09jS4fAwQHO++Cw4eGTo704 T/bysUwfBN/9GT+td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iaxNC0YGjqnWqEANfS5Ba6CaSTxyQgva8b01KX9NQp D1ml4iVQv4CVqBxTLnq46fq8TQLDyWm73zkL6pXF4uOToNE0nQe6dxwWlc9F m4lNKBqoxuub4dqOXhx00HutWlRB/W+5Y0BQV4ZtY0AcVFs89tdB51W7G1yW FqrKO0WllcLSamFprbC0XljaKCxtFpa2Ckv3V02TDlSnTU/9t6EKa9UNeN/V MtKPzztuZc2trHmVdbey7lU23MqGV9l0K5teZcutbHmV+27lvlf5xK18kq+s l51K+vHZyJhwl7rHAPvse1/K90ha/oOet6cxQ3Yns2/7jjXyX7laK1v5rw4s kEqjURb8j3uhX7T492uAuEMcqmaQzKMIij3y1HdLcEQ8P+m0uwreSNmF4yD7 Qy4xRxmM4w/0P7avmH+VnSWmU/gg/zem4swtEZfo7KH73yEvmh148zMdwe9K 7vl3F+BbvmPN+a9WqlVf/2sRS5Dzfw+k/37GMpd/IEqZKGWilN2VUkZ33wlx 3LxS5hYGFfUno0aDd9CRJkDcpTl/0G4LleRkTPlvdQAAG+31QTYqHU6VCZ90 /5abYfoegFBmDtwo+QA+qswKz7nh/lzCs5CQkJCQkJCQkJCQkJCQkJCQkJCQ kJCQkJCQkJCQkJCQkJCQkJCQkJCQ0D3T/z8eMOgAoAAA ------=_NextPart_000_0075_01C309C8.269AE360 Content-Type: application/octet-stream; name="nto-tdep.h" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="nto-tdep.h" Content-length: 4264 /* nto-tdep.h - QNX Neutrino target header.=0A= =0A= Copyright 2003 Free Software Foundation, Inc.=0A= =0A= Contributed by QNX Software Systems Ltd.=0A= =0A= This file is part of GDB.=0A= =0A= This program is free software; you can redistribute it and/or modify=0A= it under the terms of the GNU General Public License as published by=0A= the Free Software Foundation; either version 2 of the License, or=0A= (at your option) any later version.=0A= =0A= This program is distributed in the hope that it will be useful,=0A= but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= GNU General Public License for more details.=0A= =0A= You should have received a copy of the GNU General Public License=0A= along with this program; if not, write to the Free Software=0A= Foundation, Inc., 59 Temple Place - Suite 330,=0A= Boston, MA 02111-1307, USA. */=0A= =0A= #ifndef _NTO_TDEP_H=0A= #define _NTO_TDEP_H=0A= =0A= #include "defs.h"=0A= #include "solist.h"=0A= =0A= /* Generic functions in nto-tdep.c. */=0A= =0A= extern void nto_init_solib_absolute_prefix PARAMS ((void));=0A= =0A= char **nto_parse_redirection=0A= PARAMS ((char *start_argv[], char **in, char **out, char **err));=0A= =0A= int proc_iterate_over_mappings PARAMS ((int (*func) (int, CORE_ADDR)));=0A= =0A= void nto_source_extra_gdbinit PARAMS ((char *));=0A= =0A= void nto_relocate_section_addresses=0A= PARAMS ((struct so_list *, struct section_table *));=0A= =0A= int nto_map_arch_to_cputype PARAMS ((const char *));=0A= =0A= int nto_find_and_open_solib PARAMS ((char *, unsigned, char **));=0A= =0A= /* Functions exported from all Neutrino targets (-nto-tdep.c). */= =0A= =0A= /* Given a register, return an id that represents the Neutrino=0A= regset it came from. If reg =3D=3D -1 update all regsets. */=0A= int nto_get_regset_id PARAMS ((int regno));=0A= =0A= /* Tell gdb about registers stored in data, based on regset. */=0A= void nto_cpu_supply_regset PARAMS ((int endian, int regset, void *data));= =0A= =0A= /* Get regset characteristics. Returns the length of the regset,=0A= or 0 if regset is unknown. */=0A= unsigned nto_get_regset_area PARAMS ((unsigned regset, char *subcmd));=0A= =0A= /* Given the first and last register number, figure out the size/len=0A= of the Neutrino register save area to ask for/tell about. Also set=0A= the register set that's being dealt with in *subcmd. Watch out for=0A= the range crossing a register set boundry. */=0A= unsigned nto_cpu_register_area=0A= PARAMS ((unsigned first_regno, unsigned last_regno, unsigned char *subcmd,= =0A= unsigned *off, unsigned *len));=0A= =0A= /* Build the Neutrino register set info into the 'data' buffer. */=0A= int nto_cpu_register_store=0A= PARAMS ((int endian, unsigned first_regno, unsigned last_regno, void *data)= );=0A= =0A= void nto_supply_gregset PARAMS ((char *regs));=0A= =0A= void nto_supply_fpregset PARAMS ((char *regs));=0A= =0A= /* Gives the fetch_link_map_offsets function exposure outside of=0A= solib-svr4.c so that we can override relocate_section_addresses(). */= =0A= struct link_map_offsets *nto_fetch_link_map_offsets PARAMS ((void));=0A= =0A= /* Globals. */=0A= =0A= /* For 'maintenance debug nto-debug' command. */=0A= extern int nto_internal_debugging;=0A= =0A= /* The CPUINFO flags from the remote. Currently used by=0A= i386 for fxsave but future proofing other hosts. */=0A= extern unsigned nto_cpuinfo_flags;=0A= =0A= /* True if successfully retrieved cpuinfo from remote. */=0A= extern int nto_cpuinfo_valid;=0A= =0A= /* Keep this consistant with neutrino syspage.h. */=0A= enum=0A= {=0A= CPUTYPE_X86,=0A= CPUTYPE_PPC,=0A= CPUTYPE_MIPS,=0A= CPUTYPE_SPARE,=0A= CPUTYPE_ARM,=0A= CPUTYPE_SH,=0A= CPUTYPE_UNKNOWN=0A= };=0A= =0A= enum=0A= {=0A= OSTYPE_QNX4,=0A= OSTYPE_NTO=0A= };=0A= =0A= /* These correspond to the DSMSG_* versions in dsmsgs.h. */=0A= enum=0A= {=0A= NTO_REG_GENERAL,=0A= NTO_REG_FLOAT,=0A= NTO_REG_SYSTEM,=0A= NTO_REG_ALT=0A= };=0A= =0A= typedef char qnx_reg64[8];=0A= =0A= typedef struct _debug_regs=0A= {=0A= qnx_reg64 padding[1024];=0A= } nto_regset_t;=0A= =0A= #endif=0A= ------=_NextPart_000_0075_01C309C8.269AE360 Content-Type: application/octet-stream; name="i386-nto-tdep.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="i386-nto-tdep.c" Content-length: 10751 /* i386-nto-tdep.c - i386 specific functionality for QNX Neutrino.=0A= =0A= Copyright 2003 Free Software Foundation, Inc.=0A= =0A= Contributed by QNX Software Systems Ltd.=0A= =0A= This file is part of GDB.=0A= =0A= This program is free software; you can redistribute it and/or modify=0A= it under the terms of the GNU General Public License as published by=0A= the Free Software Foundation; either version 2 of the License, or=0A= (at your option) any later version.=0A= =0A= This program is distributed in the hope that it will be useful,=0A= but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= GNU General Public License for more details.=0A= =0A= You should have received a copy of the GNU General Public License=0A= along with this program; if not, write to the Free Software=0A= Foundation, Inc., 59 Temple Place - Suite 330,=0A= Boston, MA 02111-1307, USA. */=0A= =0A= #include "gdb_string.h"=0A= #include "gdb_assert.h"=0A= #include "defs.h"=0A= #include "frame.h"=0A= #include "target.h"=0A= #include "regcache.h"=0A= #include "solib-svr4.h"=0A= #include "i386-tdep.h"=0A= #include "nto-tdep.h"=0A= #include "osabi.h"=0A= #include "i387-tdep.h"=0A= =0A= #ifndef X86_CPU_FXSR=0A= #define X86_CPU_FXSR (1L << 12)=0A= #endif=0A= =0A= enum QNX_REGS=0A= {=0A= QNX_REGS_GP =3D 0,=0A= QNX_REGS_FP =3D 1,=0A= QNX_REGS_END =3D 2=0A= };=0A= =0A= /* Why 13? Look in our debug.h header at the x86_cpu_registers structure= =0A= and you'll see an 'exx' junk register that is just filler. Don't ask=0A= me, ask the kernel guys. */=0A= #define NUM_GPREGS 13=0A= =0A= /* Map a GDB register number to an offset in the reg structure. */=0A= static int regmap[] =3D {=0A= (7 * 4), /* %eax */=0A= (6 * 4), /* %ecx */=0A= (5 * 4), /* %edx */=0A= (4 * 4), /* %ebx */=0A= (11 * 4), /* %esp */=0A= (2 * 4), /* %epb */=0A= (1 * 4), /* %esi */=0A= (0 * 4), /* %edi */=0A= (8 * 4), /* %eip */=0A= (10 * 4), /* %eflags */=0A= (9 * 4), /* %cs */=0A= (12 * 4), /* %ss */=0A= (-1 * 4) /* filler */=0A= };=0A= =0A= /* Perform mapping of gdb registers onto Neutrino registers.=0A= Actually works in reverse too which is why we make sure to=0A= return -1 if we're out of range. */=0A= int=0A= gdb_to_os (int regno)=0A= {=0A= return (regno >=3D 0 && regno < NUM_GPREGS) ? regmap[regno] >> 2 : -1;=0A= }=0A= =0A= void=0A= nto_supply_gregset (char *gpregs)=0A= {=0A= unsigned regno;=0A= =0A= for (regno =3D 0; regno < NUM_GPREGS - 1; regno++)=0A= {=0A= supply_register (regno, gpregs + regmap[regno]);=0A= }=0A= }=0A= =0A= int=0A= nto_get_regset_id (int regno)=0A= {=0A= if (regno =3D=3D -1)=0A= return QNX_REGS_END;=0A= else if (regno < FP0_REGNUM)=0A= return QNX_REGS_GP;=0A= else if (regno < FPC_REGNUM)=0A= return QNX_REGS_FP;=0A= =0A= return -1; /* Error. */=0A= }=0A= =0A= void=0A= nto_cpu_supply_regset (int endian, int regset, void *data)=0A= {=0A= endian =3D endian; /* For i386, we don't care about endian. */=0A= =0A= switch (regset)=0A= {=0A= case QNX_REGS_GP: /* QNX has different ordering of GP regs than GDB. = */=0A= nto_supply_gregset (data);=0A= break;=0A= case QNX_REGS_FP:=0A= nto_supply_fpregset (data);=0A= break;=0A= }=0A= }=0A= =0A= unsigned=0A= nto_get_regset_area (unsigned regset, char *subcmd)=0A= {=0A= unsigned length =3D 0;=0A= switch (regset)=0A= {=0A= case QNX_REGS_GP:=0A= *subcmd =3D NTO_REG_GENERAL;=0A= length =3D NUM_GPREGS * sizeof (unsigned);=0A= break;=0A= case QNX_REGS_FP:=0A= *subcmd =3D NTO_REG_FLOAT;=0A= /* FIXME: Should we calculate based on fxsave/fsave? */=0A= length =3D 512;=0A= break;=0A= default:=0A= length =3D 0;=0A= }=0A= return length;=0A= }=0A= =0A= unsigned=0A= nto_cpu_register_area (unsigned first_regno, unsigned last_regno,=0A= unsigned char *subcmd, unsigned *off, unsigned *len)=0A= {=0A= int regno =3D -1;=0A= =0A= if (first_regno < FP0_REGNUM)=0A= {=0A= if (last_regno >=3D FP0_REGNUM)=0A= last_regno =3D FP0_REGNUM - 1;=0A= *subcmd =3D NTO_REG_GENERAL;=0A= regno =3D gdb_to_os (first_regno);=0A= *off =3D regno * sizeof (unsigned);=0A= if (regno =3D=3D -1)=0A= *len =3D 0;=0A= else=0A= *len =3D (last_regno - first_regno + 1) * sizeof (unsigned);=0A= }=0A= else if (first_regno =3D=3D FP_REGNUM)=0A= {=0A= /* Frame Pointer Psuedo-register. */=0A= *off =3D SP_REGNUM * sizeof (unsigned);=0A= *len =3D sizeof (unsigned);=0A= return FP_REGNUM;=0A= }=0A= else if (first_regno >=3D FP0_REGNUM && first_regno < FPC_REGNUM)=0A= {=0A= unsigned off_adjust, regsize;=0A= =0A= if (nto_cpuinfo_valid && nto_cpuinfo_flags | X86_CPU_FXSR)=0A= {=0A= off_adjust =3D 32;=0A= regsize =3D 16;=0A= }=0A= else=0A= {=0A= off_adjust =3D 28;=0A= regsize =3D 10;=0A= }=0A= =0A= if (last_regno >=3D FPC_REGNUM)=0A= last_regno =3D FPC_REGNUM - 1;=0A= *subcmd =3D NTO_REG_FLOAT;=0A= *off =3D (first_regno - FP0_REGNUM) * regsize + off_adjust;=0A= *len =3D (last_regno - first_regno + 1) * 10;=0A= /* Why 10? GDB only stores 10 bytes per FP register so if we're=0A= sending a register back to the target, we only want pdebug to writ= e=0A= 10 bytes so as not to clobber the reserved 6 bytes in the fxsave= =0A= structure. The astute reader will note that this will fail if we= =0A= try to send a range of fpregs rather than 1 at a time but, as far= =0A= as I know, there is no way to send more than one fpreg at a time= =0A= anyway. If this turns out to be wrong, we may need to put more co= de=0A= in pdebug to deal with this - perhaps by masking off part of the= =0A= register when it writes it in. Put assertion to this effect so=0A= that we'll catch it here rather than get mysterious failures. */= =0A= gdb_assert (last_regno =3D=3D first_regno);=0A= }=0A= else=0A= {=0A= *len =3D 0;=0A= return last_regno;=0A= }=0A= return last_regno;=0A= }=0A= =0A= int=0A= nto_cpu_register_store (int endian, unsigned first_regno,=0A= unsigned last_regno, void *data)=0A= {=0A= /* Mostly (always?) you're only storing one at a time. */=0A= if (first_regno =3D=3D last_regno)=0A= {=0A= regcache_collect (first_regno, data);=0A= return 1;=0A= }=0A= /* Floating point is the same for gdb and target. */=0A= if (first_regno >=3D FP0_REGNUM)=0A= {=0A= for (; first_regno <=3D last_regno; first_regno++)=0A= {=0A= regcache_collect (first_regno, data);=0A= (char *) data +=3D REGISTER_RAW_SIZE (first_regno);=0A= }=0A= return 1;=0A= }=0A= /* GP registers are mapped differently for NTO than GDB. */=0A= for (; first_regno <=3D last_regno; first_regno++)=0A= {=0A= int regnum =3D gdb_to_os (first_regno);=0A= if (regnum =3D=3D -1)=0A= continue;=0A= regcache_collect (first_regno,=0A= (char *) data + sizeof (unsigned) * regnum);=0A= }=0A= return 1;=0A= }=0A= =0A= void=0A= nto_supply_fpregset (char *fpregs)=0A= {=0A= if (nto_cpuinfo_valid && nto_cpuinfo_flags | X86_CPU_FXSR)=0A= i387_supply_fxsave (fpregs);=0A= else=0A= i387_supply_fsave (fpregs);=0A= }=0A= =0A= /* Fetch (and possibly build) an appropriate link_map_offsets=0A= structure for native x86 targets using the struct offsets=0A= defined in link.h (but without actual reference to that file).=0A= =0A= This makes it possible to access x86 shared libraries from a GDB=0A= that was not built on an x86 host (for cross debugging). */=0A= static struct link_map_offsets *=0A= i386_nto_svr4_fetch_link_map_offsets (void)=0A= {=0A= static struct link_map_offsets lmo;=0A= static struct link_map_offsets *lmp =3D NULL;=0A= =0A= if (lmp =3D=3D NULL)=0A= {=0A= lmp =3D &lmo;=0A= =0A= lmo.r_debug_size =3D 8; /* The actual size is 20 bytes, but=0A= only 8 bytes are used. */=0A= lmo.r_map_offset =3D 4;=0A= lmo.r_map_size =3D 4;=0A= =0A= lmo.link_map_size =3D 20; /* The actual size is 552 bytes, but=0A= only 20 bytes are used. */=0A= lmo.l_addr_offset =3D 0;=0A= lmo.l_addr_size =3D 4;=0A= =0A= lmo.l_name_offset =3D 4;=0A= lmo.l_name_size =3D 4;=0A= =0A= lmo.l_next_offset =3D 12;=0A= lmo.l_next_size =3D 4;=0A= =0A= lmo.l_prev_offset =3D 16;=0A= lmo.l_prev_size =3D 4;=0A= }=0A= =0A= return lmp;=0A= }=0A= =0A= struct link_map_offsets *=0A= nto_fetch_link_map_offsets (void)=0A= {=0A= return i386_nto_svr4_fetch_link_map_offsets ();=0A= }=0A= =0A= static int=0A= i386_nto_pc_in_sigtramp (CORE_ADDR pc, char *name)=0A= {=0A= return name && strcmp ("__signalstub", name) =3D=3D 0;=0A= }=0A= =0A= #define SIGCONTEXT_OFFSET 136=0A= static CORE_ADDR=0A= i386_nto_sigcontext_addr (struct frame_info *frame)=0A= {=0A= if (get_next_frame (frame))=0A= return get_frame_base (get_next_frame (frame)) + SIGCONTEXT_OFFSET;=0A= =0A= return read_register (SP_REGNUM) + SIGCONTEXT_OFFSET;=0A= }=0A= =0A= static void=0A= i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)=0A= {=0A= struct gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch);=0A= =0A= /* NTO uses ELF. */=0A= i386_elf_init_abi (info, gdbarch);=0A= =0A= /* Neutrino rewinds to look more normal. */=0A= set_gdbarch_decr_pc_after_break (gdbarch, 0);=0A= =0A= /* NTO has shared libraries. */=0A= set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);=0A= set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);= =0A= =0A= set_gdbarch_pc_in_sigtramp (gdbarch, i386_nto_pc_in_sigtramp);=0A= tdep->sigcontext_addr =3D i386_nto_sigcontext_addr;=0A= tdep->sc_pc_offset =3D 56;=0A= tdep->sc_sp_offset =3D 68;=0A= =0A= /* Setjmp()'s return PC saved in EDX (5). */=0A= tdep->jb_pc_offset =3D 20; /* 5x32 bit ints in. */=0A= =0A= set_solib_svr4_fetch_link_map_offsets (gdbarch,=0A= i386_nto_svr4_fetch_link_map_offsets);=0A= =0A= /* Our loader handles solib relocations slightly differently than svr4. = */=0A= TARGET_SO_RELOCATE_SECTION_ADDRESSES =3D nto_relocate_section_addresses;= =0A= =0A= /* Supply a nice function to find our solibs. */=0A= TARGET_SO_FIND_AND_OPEN_SOLIB =3D nto_find_and_open_solib;=0A= }=0A= =0A= void=0A= _initialize_i386nto_tdep (void)=0A= {=0A= gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_QNXNTO,=0A= i386nto_init_abi);=0A= }=0A= ------=_NextPart_000_0075_01C309C8.269AE360 Content-Type: application/octet-stream; name="nto-tdep.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="nto-tdep.c" Content-length: 10855 /* nto-tdep.c - general QNX Neutrino target functionality.=0A= =0A= Copyright 2003 Free Software Foundation, Inc.=0A= =0A= Contributed by QNX Software Systems Ltd.=0A= =0A= This file is part of GDB.=0A= =0A= This program is free software; you can redistribute it and/or modify=0A= it under the terms of the GNU General Public License as published by=0A= the Free Software Foundation; either version 2 of the License, or=0A= (at your option) any later version.=0A= =0A= This program is distributed in the hope that it will be useful,=0A= but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= GNU General Public License for more details.=0A= =0A= You should have received a copy of the GNU General Public License=0A= along with this program; if not, write to the Free Software=0A= Foundation, Inc., 59 Temple Place - Suite 330,=0A= Boston, MA 02111-1307, USA. */=0A= =0A= #include =0A= #include "gdb_string.h"=0A= #include "nto-tdep.h"=0A= #include "top.h"=0A= #include "cli/cli-decode.h"=0A= #include "cli/cli-cmds.h"=0A= #include "inferior.h"=0A= #include "gdbarch.h"=0A= #include "bfd.h"=0A= #include "elf-bfd.h"=0A= #include "solib-svr4.h"=0A= #include "gdbcore.h"=0A= =0A= #ifdef __CYGWIN__=0A= #include =0A= #endif=0A= =0A= #ifdef __CYGWIN__=0A= static char default_nto_target[] =3D "C:\\QNXsdk\\target\\qnx6";=0A= #elif defined(__sun__) || defined(linux)=0A= static char default_nto_target[] =3D "/opt/QNXsdk/target/qnx6";=0A= #else=0A= static char default_nto_target[] =3D "";=0A= #endif=0A= =0A= /* Maintenance debugging flag. */=0A= int nto_internal_debugging;=0A= =0A= /* Filled in cpu info structure and flag to indicate its validity.=20=0A= This is initialized in procfs_attach or nto_start_remote depending on=0A= our host/target. It would only be invalid if we were talking to an=0A= older pdebug which didn't support the cpuinfo message. */=0A= unsigned nto_cpuinfo_flags;=0A= int nto_cpuinfo_valid;=0A= =0A= static char *=0A= nto_target (void)=0A= {=0A= char *p =3D getenv ("QNX_TARGET");=0A= =0A= #ifdef __CYGWIN__=0A= static char buf[PATH_MAX];=0A= if (p)=0A= cygwin_conv_to_posix_path (p, buf);=0A= else=0A= cygwin_conv_to_posix_path (default_nto_target, buf);=0A= return buf;=0A= #else=0A= return p ? p : default_nto_target;=0A= #endif=0A= }=0A= =0A= /* Take a string such as i386, rs6000, etc. and map it onto CPUTYPE_X86,=0A= CPUTYPE_PPC, etc. as defined in nto-share/dsmsgs.h. */=0A= int=0A= nto_map_arch_to_cputype (const char *arch)=0A= {=0A= if (!strcmp (arch, "i386") || !strcmp (arch, "x86"))=0A= return CPUTYPE_X86;=0A= if (!strcmp (arch, "rs6000") || !strcmp (arch, "ppc"))=0A= return CPUTYPE_PPC;=0A= if (!strcmp (arch, "mips"))=0A= return CPUTYPE_MIPS;=0A= if (!strcmp (arch, "arm"))=0A= return CPUTYPE_ARM;=0A= if (!strcmp (arch, "sh"))=0A= return CPUTYPE_SH;=0A= return CPUTYPE_UNKNOWN;=0A= }=0A= =0A= int=0A= nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathnam= e)=0A= {=0A= char *buf, arch_path[PATH_MAX], *nto_root, *endian;=0A= const char *arch;=0A= char *path_fmt =3D "%s/lib:%s/usr/lib:%s/usr/photon/lib\=0A= :%s/usr/photon/dll:%s/lib/dll";=0A= =0A= nto_root =3D nto_target ();=0A= if (strcmp (TARGET_ARCHITECTURE->arch_name, "i386") =3D=3D 0)=0A= {=0A= arch =3D "x86";=0A= endian =3D "";=0A= }=0A= else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") =3D=3D 0)=0A= {=0A= arch =3D "ppc";=0A= endian =3D "be";=0A= }=0A= else=0A= {=0A= arch =3D TARGET_ARCHITECTURE->arch_name;=0A= endian =3D TARGET_BYTE_ORDER =3D=3D BFD_ENDIAN_BIG ? "be" : "le";=0A= }=0A= =0A= sprintf (arch_path, "%s/%s%s", nto_root, arch, endian);=0A= =0A= buf =3D alloca (strlen (path_fmt) + strlen (arch_path) * 5 + 1);=0A= sprintf (buf, path_fmt, arch_path, arch_path, arch_path, arch_path,=0A= arch_path);=0A= =0A= return openp (buf, 1, solib, o_flags, 0, temp_pathname);=0A= }=0A= =0A= void=0A= nto_init_solib_absolute_prefix (void)=0A= {=0A= char buf[PATH_MAX * 2], arch_path[PATH_MAX];=0A= char *nto_root, *endian;=0A= const char *arch;=0A= =0A= nto_root =3D nto_target ();=0A= if (strcmp (TARGET_ARCHITECTURE->arch_name, "i386") =3D=3D 0)=0A= {=0A= arch =3D "x86";=0A= endian =3D "";=0A= }=0A= else if (strcmp (TARGET_ARCHITECTURE->arch_name, "rs6000") =3D=3D 0)=0A= {=0A= arch =3D "ppc";=0A= endian =3D "be";=0A= }=0A= else=0A= {=0A= arch =3D TARGET_ARCHITECTURE->arch_name;=0A= endian =3D TARGET_BYTE_ORDER =3D=3D BFD_ENDIAN_BIG ? "be" : "le";=0A= }=0A= =0A= sprintf (arch_path, "%s/%s%s", nto_root, arch, endian);=0A= =0A= sprintf (buf, "set solib-absolute-prefix %s", arch_path);=0A= execute_command (buf, 0);=0A= }=0A= =0A= char **=0A= nto_parse_redirection (char *pargv[], char **pin, char **pout, char **perr)= =0A= {=0A= char **argv;=0A= char *in, *out, *err, *p;=0A= int argc, i, n;=0A= =0A= for (n =3D 0; pargv[n]; n++);=0A= if (n =3D=3D 0)=0A= return NULL;=0A= in =3D "";=0A= out =3D "";=0A= err =3D "";=0A= =0A= argv =3D xcalloc (n + 1, sizeof argv[0]);=0A= argc =3D n;=0A= for (i =3D 0, n =3D 0; n < argc; n++)=0A= {=0A= p =3D pargv[n];=0A= if (*p =3D=3D '>')=0A= {=0A= p++;=0A= if (*p)=0A= out =3D p;=0A= else=0A= out =3D pargv[++n];=0A= }=0A= else if (*p =3D=3D '<')=0A= {=0A= p++;=0A= if (*p)=0A= in =3D p;=0A= else=0A= in =3D pargv[++n];=0A= }=0A= else if (*p++ =3D=3D '2' && *p++ =3D=3D '>')=0A= {=0A= if (*p =3D=3D '&' && *(p + 1) =3D=3D '1')=0A= err =3D out;=0A= else if (*p)=0A= err =3D p;=0A= else=0A= err =3D pargv[++n];=0A= }=0A= else=0A= argv[i++] =3D pargv[n];=0A= }=0A= *pin =3D in;=0A= *pout =3D out;=0A= *perr =3D err;=0A= return argv;=0A= }=0A= =0A= void=0A= nto_source_extra_gdbinit (char *file)=0A= {=0A= char *homedir, *homeinit;=0A= struct stat statbuf;=0A= =0A= homedir =3D getenv ("HOME");=0A= =0A= if (homedir && !inhibit_gdbinit)=0A= {=0A= homeinit =3D (char *) alloca (strlen (homedir) + strlen (file) + 10);= =0A= sprintf (homeinit, "%s/%s", homedir, file);=0A= if (stat (homeinit, &statbuf) =3D=3D 0)=0A= catch_command_errors (source_command, homeinit, 0, RETURN_MASK_ALL);=0A= }=0A= }=0A= =0A= /* The struct lm_info, LM_ADDR, and nto_truncate_ptr are copied from=0A= solib-svr4.c to support nto_relocate_section_addresses=0A= which is different from the svr4 version. */=0A= =0A= struct lm_info=0A= {=0A= /* Pointer to copy of link map from inferior. The type is char *=0A= rather than void *, so that we may use byte offsets to find the=0A= various fields without the need for a cast. */=0A= char *lm;=0A= };=0A= =0A= static CORE_ADDR=0A= LM_ADDR (struct so_list *so)=0A= {=0A= struct link_map_offsets *lmo =3D nto_fetch_link_map_offsets ();=0A= =0A= return (CORE_ADDR) extract_signed_integer (so->lm_info->lm +=0A= lmo->l_addr_offset,=0A= lmo->l_addr_size);=0A= }=0A= =0A= static CORE_ADDR=0A= nto_truncate_ptr (CORE_ADDR addr)=0A= {=0A= if (TARGET_PTR_BIT =3D=3D sizeof (CORE_ADDR) * 8)=0A= /* We don't need to truncate anything, and the bit twiddling below=0A= will fail due to overflow problems. */=0A= return addr;=0A= else=0A= return addr & (((CORE_ADDR) 1 << TARGET_PTR_BIT) - 1);=0A= }=0A= =0A= Elf_Internal_Phdr *=0A= find_load_phdr (bfd *abfd)=0A= {=0A= Elf_Internal_Phdr *phdr;=0A= unsigned int i;=0A= =0A= if (!elf_tdata (abfd))=0A= return NULL;=0A= =0A= phdr =3D elf_tdata (abfd)->phdr;=0A= for (i =3D 0; i < elf_elfheader (abfd)->e_phnum; i++, phdr++)=0A= {=0A= if (phdr->p_type =3D=3D PT_LOAD && (phdr->p_flags & PF_X))=0A= return phdr;=0A= }=0A= return NULL;=0A= }=0A= =0A= void=0A= nto_relocate_section_addresses (struct so_list *so, struct section_table *s= ec)=0A= {=0A= /* Neutrino treats the l_addr base address field in link.h as different t= han=0A= the base address in the System V ABI and so the offset needs to be=0A= calculated and applied to relocations. */=0A= Elf_Internal_Phdr *phdr =3D find_load_phdr (sec->bfd);=0A= unsigned vaddr =3D phdr ? phdr->p_vaddr : 0;=0A= =0A= sec->addr =3D nto_truncate_ptr (sec->addr + LM_ADDR (so) - vaddr);=0A= sec->endaddr =3D nto_truncate_ptr (sec->endaddr + LM_ADDR (so) - vaddr);= =0A= }=0A= =0A= static void=0A= fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,=0A= int which, CORE_ADDR reg_addr)=0A= {=0A= nto_regset_t regset;=0A= =0A= nto_init_solib_absolute_prefix ();=0A= =0A= if (which =3D=3D 0)=0A= {=0A= memcpy ((char *) ®set, core_reg_sect,=0A= min (core_reg_size, sizeof (regset)));=0A= nto_supply_gregset ((char *) ®set);=0A= }=0A= else if (which =3D=3D 2)=0A= {=0A= memcpy ((char *) ®set, core_reg_sect,=0A= min (core_reg_size, sizeof (regset)));=0A= nto_supply_fpregset ((char *) ®set);=0A= }=0A= }=0A= =0A= /* Register that we are able to handle ELF file formats using standard=0A= procfs "regset" structures. */=0A= =0A= static struct core_fns regset_core_fns =3D {=0A= bfd_target_elf_flavour, /* core_flavour */=0A= default_check_format, /* check_format */=0A= default_core_sniffer, /* core_sniffer */=0A= fetch_core_registers, /* core_read_registers */=0A= NULL /* next */=0A= };=0A= =0A= void=0A= _initialize_nto_tdep ()=0A= {=0A= add_show_from_set (add_set_cmd ("nto-debug", class_maintenance, var_zinte= ger, (char *) &nto_internal_debugging, "Set QNX NTO internal debugging.\n\= =0A= When non-zero, nto specific debug info is\n\=0A= displayed. Different information is displayed\n\=0A= for different positive values.", &setdebuglist),=0A= &showdebuglist);=0A= =0A= /* We use SIG45 for pulses, or something, so nostop, noprint=0A= and pass them. */=0A= signal_stop_update (target_signal_from_name ("SIG45"), 0);=0A= signal_print_update (target_signal_from_name ("SIG45"), 0);=0A= signal_pass_update (target_signal_from_name ("SIG45"), 1);=0A= =0A= /* By default we don't want to stop on these two, but we do want to pass.= */=0A= #if defined(SIGSELECT)=0A= signal_stop_update (SIGSELECT, 0);=0A= signal_print_update (SIGSELECT, 0);=0A= signal_pass_update (SIGSELECT, 1);=0A= #endif=0A= =0A= #if defined(SIGPHOTON)=0A= signal_stop_update (SIGPHOTON, 0);=0A= signal_print_update (SIGPHOTON, 0);=0A= signal_pass_update (SIGPHOTON, 1);=0A= #endif=0A= =0A= /* Register core file support. */=0A= add_core_fns (®set_core_fns);=0A= }=0A= ------=_NextPart_000_0075_01C309C8.269AE360 Content-Type: application/octet-stream; name="tm-qnxnto.h" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="tm-qnxnto.h" Content-length: 2059 /* Target machine sub-description for QNX Neutrino version 6.=0A= This is included by other tm-*.h files to specify nto specific=0A= stuff.=20=0A= =0A= Copyright 2003 Free Software Foundation, Inc.=0A= =0A= This code was donated by QNX Software Systems Ltd.=0A= =0A= This file is part of GDB.=0A= =0A= This program is free software; you can redistribute it and/or modify=0A= it under the terms of the GNU General Public License as published by=0A= the Free Software Foundation; either version 2 of the License, or=0A= (at your option) any later version.=0A= =0A= This program is distributed in the hope that it will be useful,=0A= but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= GNU General Public License for more details.=0A= =0A= You should have received a copy of the GNU General Public License=0A= along with this program; if not, write to the Free Software=0A= Foundation, Inc., 59 Temple Place - Suite 330,=0A= Boston, MA 02111-1307, USA. */=0A= =0A= #ifndef _TM_QNXNTO_H=0A= #define _TM_QNXNTO_H=0A= =0A= #include "tm-sysv4.h"=0A= =0A= /* Setup the valid realtime signal range. */=0A= #define REALTIME_LO 41=0A= #define REALTIME_HI 56=0A= =0A= /* Set up the undefined useable signals. */=0A= #define RAW_SIGNAL_LO 32=0A= #define RAW_SIGNAL_HI (REALTIME_LO - 1)=0A= =0A= #define TARGET_SIGNAL_RAW_VALUES \=0A= TARGET_SIGNAL_RAW0, \=0A= TARGET_SIGNAL_RAW1, \=0A= TARGET_SIGNAL_RAW2, \=0A= TARGET_SIGNAL_RAW3, \=0A= TARGET_SIGNAL_RAW4, \=0A= TARGET_SIGNAL_RAW5, \=0A= TARGET_SIGNAL_RAW6, \=0A= TARGET_SIGNAL_RAW7, \=0A= TARGET_SIGNAL_RAW8=0A= =0A= #define TARGET_SIGNAL_RAW_TABLE \=0A= {"SIGNAL32", "Signal 32"}, \=0A= {"SIGNAL33", "Signal 33"}, \=0A= {"SIGNAL34", "Signal 34"}, \=0A= {"SIGNAL35", "Signal 35"}, \=0A= {"SIGNAL36", "Signal 36"}, \=0A= {"SIGNAL37", "Signal 37"}, \=0A= {"SIGNAL38", "Signal 38"}, \=0A= {"SIGNAL39", "Signal 39"}, \=0A= {"SIGNAL40", "Signal 40"}=0A= =0A= #endif /* _TM_QNXNTO_H */=0A= ------=_NextPart_000_0075_01C309C8.269AE360 Content-Type: application/octet-stream; name="tm-i386nto.h" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="tm-i386nto.h" Content-length: 1242 /* QNX Neutrino target header.=0A= =20=0A= Copyright 2003 Free Software Foundation, Inc.=0A= =0A= This code was donated by QNX Software Systems Ltd.=0A= =0A= This file is part of GDB.=0A= =0A= This program is free software; you can redistribute it and/or modify=0A= it under the terms of the GNU General Public License as published by=0A= the Free Software Foundation; either version 2 of the License, or=0A= (at your option) any later version.=0A= =0A= This program is distributed in the hope that it will be useful,=0A= but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= GNU General Public License for more details.=0A= =0A= You should have received a copy of the GNU General Public License=0A= along with this program; if not, write to the Free Software=0A= Foundation, Inc., 59 Temple Place - Suite 330,=0A= Boston, MA 02111-1307, USA. */=0A= =0A= #ifndef TM_I386NTO_H=0A= #define TM_I386NTO_H 1=0A= =0A= /* Pick up most of what we need from the generic i386 target include file. = */=0A= #include "i386/tm-i386.h"=0A= #include "tm-qnxnto.h"=0A= =0A= #include "solib.h"=0A= =0A= #endif /* TM_I386NTO_H */=0A= ------=_NextPart_000_0075_01C309C8.269AE360 Content-Type: application/octet-stream; name="i386nto.mt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="i386nto.mt" Content-length: 172 # Target: Intel 386 running qnx6.=0A= TDEPFILES=3D i386-tdep.o i387-tdep.o corelow.o solib.o solib-svr4.o \=0A= i386-nto-tdep.o nto-tdep.o=0A= TM_FILE=3D tm-i386nto.h=0A= ------=_NextPart_000_0075_01C309C8.269AE360--