From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15098 invoked by alias); 4 May 2004 23:47:25 -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 15082 invoked from network); 4 May 2004 23:47:21 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.77.109) by sources.redhat.com with SMTP; 4 May 2004 23:47:21 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i44NlKtU000274; Wed, 5 May 2004 01:47:20 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i44NlKJ1000598; Wed, 5 May 2004 01:47:20 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i44NlJGN000595; Wed, 5 May 2004 01:47:19 +0200 (CEST) Date: Tue, 04 May 2004 23:47:00 -0000 Message-Id: <200405042347.i44NlJGN000595@elgar.kettenis.dyndns.org> From: Mark Kettenis To: thorpej@wasabisystems.com CC: gdb-patches@sources.redhat.com In-reply-to: (message from Jason Thorpe on Mon, 3 May 2004 14:48:49 -0700) Subject: Re: [PATCH/RFA] Modernize NetBSD/m68k References: <200405011729.i41HTd8w000681@elgar.kettenis.dyndns.org> X-SW-Source: 2004-05/txt/msg00124.txt.bz2 From: Jason Thorpe Date: Mon, 3 May 2004 14:48:49 -0700 On May 1, 2004, at 10:29 AM, Mark Kettenis wrote: > Do you have any objections if I check this in, and make some further > imporvements towards properly supporting signal trampolines? That sounds fine. Thanks for working on this (sigh, I sure wish I had more [any] time to work on this myself...) No problem. I'll try to improve NetBSD support when I can... Anyway, some recent changes I made to the generic m68k waranted a small change. The attached is what I actually checked in. Mark Index: ChangeLog from Mark Kettenis * m68knbsd-nat.c: Remove file. * m68knbsd-tdep.c: Remove file. * Makefile.in: (m68knbsd-nat.o, m68knbsd-tdep.o): Remove dependencies. * configure.host: Add m68k-*-netbsdelf*. * configure.tgt (m68k-*-netbsd*): Set gdb_target to nbsd. * config/m68k/nbsdaout.mh (NATDEPFILES): Add m68kbsd-nat.o, solib.o and solib-sunos.o. Remove m68knbsd-nat.o, corelow.o. (XM_FILE): Remove. * config/m68k/nbsdelf.mh: New file. * config/m68k/nbsd.mt: New file. * config/m68k/nbsdaout.mt: Remove file. * config/m68k/tm-nbsd.h: Don't include , and "m68k/tm-m68k.h". Include "solib.h". (BPT_VECTOR, STACK_END_ADDR): Remove defines. (DEPRECATED_SIGTRAMP_START, DEPRECATED_SIGTRAMP_END): Likewise. (use_struct_convention): Remove prototype. (USE_STRUCT_CONVENTION): Remove define. * config/m68k/xm-nbsd.h: Remove file. Index: configure.host =================================================================== RCS file: /cvs/src/src/gdb/configure.host,v retrieving revision 1.77 diff -u -p -r1.77 configure.host --- configure.host 30 Apr 2004 23:28:51 -0000 1.77 +++ configure.host 4 May 2004 23:46:29 -0000 @@ -84,6 +84,7 @@ ia64-*-aix*) gdb_host=aix ;; ia64-*-linux*) gdb_host=linux ;; m68*-*-linux*) gdb_host=linux ;; +m68*-*-netbsdelf*) gdb_host=nbsdelf ;; m68*-*-netbsd*) gdb_host=nbsdaout ;; m68*-*-openbsd*) gdb_host=obsd ;; Index: configure.tgt =================================================================== RCS file: /cvs/src/src/gdb/configure.tgt,v retrieving revision 1.141 diff -u -p -r1.141 configure.tgt --- configure.tgt 30 Apr 2004 23:28:51 -0000 1.141 +++ configure.tgt 4 May 2004 23:46:29 -0000 @@ -113,7 +113,7 @@ m68*-*-elf*) gdb_target=monitor ;; m68*-*-linux*) gdb_target=linux build_gdbserver=yes ;; -m68*-*-netbsd*) gdb_target=nbsdaout ;; +m68*-*-netbsd*) gdb_target=nbsd ;; m68*-*-openbsd*) gdb_target=obsd ;; m68*-*-os68k*) gdb_target=os68k ;; m68*-*-uclinux*) gdb_target=monitor ;; Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.559 diff -u -p -r1.559 Makefile.in --- Makefile.in 3 May 2004 22:12:29 -0000 1.559 +++ Makefile.in 4 May 2004 23:46:30 -0000 @@ -2018,9 +2018,6 @@ m68kbsd-nat.o: m68kbsd-nat.c $(defs_h) $ m68kbsd-tdep.o: m68kbsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \ $(regcache_h) $(regset_h) $(gdb_assert_h) $(gdb_string_h) \ $(m68k_tdep_h) $(solib_svr4_h) -m68knbsd-nat.o: m68knbsd-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(regcache_h) -m68knbsd-tdep.o: m68knbsd-tdep.c $(defs_h) $(gdbtypes_h) $(regcache_h) m68k-stub.o: m68k-stub.c m68k-tdep.o: m68k-tdep.c $(defs_h) $(dwarf2_frame_h) $(frame_h) \ $(frame_base_h) $(frame_unwind_h) $(floatformat_h) $(symtab_h)\ Index: m68knbsd-nat.c =================================================================== RCS file: m68knbsd-nat.c diff -N m68knbsd-nat.c --- m68knbsd-nat.c 21 Apr 2004 17:47:10 -0000 1.11 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,103 +0,0 @@ -/* Native-dependent code for Motorola m68k's running NetBSD, for GDB. - Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001 - Free Software Foundation, Inc. - - This file is part of GDB. - - 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 - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include "defs.h" -#include -#include -#include -#include -#include "inferior.h" -#include "gdbcore.h" -#include "regcache.h" - -void -fetch_inferior_registers (int regno) -{ - struct reg inferior_registers; - struct fpreg inferior_fp_registers; - - ptrace (PT_GETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers, 0); - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (0)], &inferior_registers, - sizeof (inferior_registers)); - - ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof (inferior_fp_registers)); - - deprecated_registers_fetched (); -} - -void -store_inferior_registers (int regno) -{ - struct reg inferior_registers; - struct fpreg inferior_fp_registers; - - memcpy (&inferior_registers, &deprecated_registers[DEPRECATED_REGISTER_BYTE (0)], - sizeof (inferior_registers)); - ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_registers, 0); - - memcpy (&inferior_fp_registers, &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - sizeof (inferior_fp_registers)); - ptrace (PT_SETFPREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0); -} - -struct md_core -{ - struct reg intreg; - struct fpreg freg; -}; - -static void -fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which, - CORE_ADDR ignore) -{ - struct md_core *core_reg = (struct md_core *) core_reg_sect; - - /* Integer registers */ - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (0)], - &core_reg->intreg, sizeof (struct reg)); - /* Floating point registers */ - memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], - &core_reg->freg, sizeof (struct fpreg)); -} - -/* Register that we are able to handle m68knbsd core file formats. - FIXME: is this really bfd_target_unknown_flavour? */ - -static struct core_fns m68knbsd_core_fns = -{ - bfd_target_unknown_flavour, /* core_flavour */ - default_check_format, /* check_format */ - default_core_sniffer, /* core_sniffer */ - fetch_core_registers, /* core_read_registers */ - NULL /* next */ -}; - -void -_initialize_m68knbsd_nat (void) -{ - deprecated_add_core_fns (&m68knbsd_core_fns); -} Index: m68knbsd-tdep.c =================================================================== RCS file: m68knbsd-tdep.c diff -N m68knbsd-tdep.c --- m68knbsd-tdep.c 1 Mar 2001 01:39:21 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,33 +0,0 @@ -/* Target-dependent code for NetBSD/i386, for GDB. - Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001 - Free Software Foundation, Inc. - - This file is part of GDB. - - 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 - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#include "defs.h" -#include "gdbtypes.h" -#include "regcache.h" - -int -m68knbsd_use_struct_convention (int gcc_p, struct type *type) -{ - return !(TYPE_LENGTH (type) == 1 - || TYPE_LENGTH (type) == 2 - || TYPE_LENGTH (type) == 4 - || TYPE_LENGTH (type) == 8); -} Index: config/m68k/nbsd.mt =================================================================== RCS file: config/m68k/nbsd.mt diff -N config/m68k/nbsd.mt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ config/m68k/nbsd.mt 4 May 2004 23:46:30 -0000 @@ -0,0 +1,3 @@ +# Target: NetBSD/m68k +TDEPFILES= m68k-tdep.o m68kbsd-tdep.o corelow.o solib.o solib-svr4.o +TM_FILE= tm-nbsd.h Index: config/m68k/nbsdaout.mh =================================================================== RCS file: /cvs/src/src/gdb/config/m68k/nbsdaout.mh,v retrieving revision 1.1 diff -u -p -r1.1 nbsdaout.mh --- config/m68k/nbsdaout.mh 22 May 2002 03:59:54 -0000 1.1 +++ config/m68k/nbsdaout.mh 4 May 2004 23:46:30 -0000 @@ -1,5 +1,4 @@ -# Host: Motorola m68k running NetBSD -NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o m68knbsd-nat.o \ +# Host: NetBSD/m68k a.out +NATDEPFILES= m68kbsd-nat.o fork-child.o infptrace.o inftarg.o \ solib.o solib-sunos.o -XM_FILE= xm-nbsd.h NAT_FILE= nm-nbsdaout.h Index: config/m68k/nbsdaout.mt =================================================================== RCS file: config/m68k/nbsdaout.mt diff -N config/m68k/nbsdaout.mt --- config/m68k/nbsdaout.mt 22 May 2002 03:59:54 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -# Target: Motorola m68k running NetBSD -TDEPFILES= m68k-tdep.o m68knbsd-tdep.o -TM_FILE= tm-nbsd.h Index: config/m68k/nbsdelf.mh =================================================================== RCS file: config/m68k/nbsdelf.mh diff -N config/m68k/nbsdelf.mh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ config/m68k/nbsdelf.mh 4 May 2004 23:46:30 -0000 @@ -0,0 +1,3 @@ +# Host: NetBSD/m68k ELF +NATDEPFILES= m68kbsd-nat.o fork-child.o infptrace.o inftarg.o +NAT_FILE= nm-nbsd.h Index: config/m68k/tm-nbsd.h =================================================================== RCS file: /cvs/src/src/gdb/config/m68k/tm-nbsd.h,v retrieving revision 1.8 diff -u -p -r1.8 tm-nbsd.h --- config/m68k/tm-nbsd.h 1 May 2004 13:14:20 -0000 1.8 +++ config/m68k/tm-nbsd.h 4 May 2004 23:46:30 -0000 @@ -1,4 +1,4 @@ -/* Macro definitions for m68k running under NetBSD. +/* Target-dependent definitions for NetBSD/m68k. Copyright 1994, 1996, 2001, 2004 Free Software Foundation, Inc. @@ -22,28 +22,6 @@ #ifndef TM_NBSD_H #define TM_NBSD_H -#include -#include +#include "solib.h" -/* Define BPT_VECTOR if it is different than the default. - This is the vector number used by traps to indicate a breakpoint. */ -#define BPT_VECTOR 0xf - -/* Address of end of stack space. */ -#define STACK_END_ADDR USRSTACK - -/* For NetBSD, sigtramp is 32 bytes before STACK_END_ADDR. */ -#define DEPRECATED_IN_SIGTRAMP(PC,FUNC_NAME) \ -((PC) >= (STACK_END_ADDR - 32) && (PC) < (STACK_END_ADDR)) - -#include "m68k/tm-m68k.h" - -/* Return non-zero if we are in a shared library trampoline code stub. */ -#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \ - (name && !strcmp(name, "_DYNAMIC")) - -extern use_struct_convention_fn m68knbsd_use_struct_convention; -#define USE_STRUCT_CONVENTION(gcc_p, type) \ - m68knbsd_use_struct_convention(gcc_p, type) - -#endif /* TM_NBSD_H */ +#endif /* tm-nbsd.h */ Index: config/m68k/xm-nbsd.h =================================================================== RCS file: config/m68k/xm-nbsd.h diff -N config/m68k/xm-nbsd.h --- config/m68k/xm-nbsd.h 5 Jun 2002 19:18:23 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,22 +0,0 @@ -/* Parameters for execution on a Motorola m68k running NetBSD, for GDB. - Copyright 1996 Free Software Foundation, Inc. - - This file is part of GDB. - - 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 - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* Get generic NetBSD host definitions. */ -#include "config/xm-nbsd.h"