diff -Naur gdb-5.2-PLUS_CG/gdb/Makefile.in gdb-5.2-PLUS_RDBG/gdb/Makefile.in --- gdb-5.2-PLUS_CG/gdb/Makefile.in Mon Jun 10 15:32:05 2002 +++ gdb-5.2-PLUS_RDBG/gdb/Makefile.in Wed Jun 12 11:14:47 2002 @@ -538,6 +538,7 @@ symmisc.c symtab.c linespec.c target.c thread.c top.c tracepoint.c \ typeprint.c utils.c valarith.c valops.c valprint.c values.c \ serial.c ser-unix.c mdebugread.c os9kread.c \ + remote-rte.c rtems.c thread_rte.c rtems/rteRemDebXdr.c \ tui/tui.c tui/tui.h tui/tuiCommand.c tui/tuiCommand.h \ tui/tuiData.c tui/tuiData.h tui/tuiDataWin.c tui/tuiDataWin.h \ tui/tuiDisassem.c tui/tuiDisassem.h tui/tuiGeneralWin.c \ @@ -663,7 +664,7 @@ c-lang.h ch-lang.h f-lang.h \ jv-lang.h \ m2-lang.h p-lang.h \ - complaints.h valprint.h \ + complaints.h valprint.h rtems/remdeb.h \ 29k-share/udi/udiids.h 29k-share/udi_soc nindy-share/b.out.h \ nindy-share/block_io.h nindy-share/coff.h \ nindy-share/env.h nindy-share/stop.h \ @@ -954,6 +955,7 @@ clean mostlyclean: $(CONFIG_CLEAN) @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(SUBDIRS)" subdir_do + cd rtems ; $(MAKE) clean rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp init.l-tmp version.c-tmp rm -f init.c version.c rm -f gdb$(EXEEXT) core make.log @@ -967,6 +969,7 @@ # always included in SUBDIRS. Remove the gdbserver files explictly. distclean: clean @$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(SUBDIRS)" subdir_do + cd rtems ; $(MAKE) distclean rm -f gdbserver/config.status gdbserver/config.log rm -f gdbserver/tm.h gdbserver/xm.h gdbserver/nm.h rm -f gdbserver/Makefile gdbserver/config.cache @@ -1213,7 +1216,11 @@ win32-nat.c \ xcoffread.c xcoffsolib.c \ xstormy16-tdep.c \ - z8k-tdep.c + z8k-tdep.c \ + remote-rte.c rtems.c thread_rte.c rtems/rteRemDebXdr.c \ + rtems/remdeb.h + + udip2soc.o: $(srcdir)/29k-share/udi/udip2soc.c $(udiheaders) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/29k-share/udi/udip2soc.c @@ -1292,6 +1299,18 @@ f-valprint.o: f-valprint.c $(defs_h) $(expression_h) $(gdbtypes_h) \ $(language_h) $(symtab_h) $(valprint_h) $(value_h) $(gdb_string_h) +rtems.o: rtems.c rtems/remdeb.h + +rtems/rteRemDebXdr.c : rtems/remdeb.x + cd rtems ; $(MAKE) + +rtems/remdeb.h : rtems/remdeb.x + cd rtems ; $(MAKE) + +rtems/rteRemDebXdr.o: rtems/rteRemDebXdr.c rtems/remdeb.h + $(CC) -c $(INTERNAL_CFLAGS) rtems/rteRemDebXdr.c + mv rteRemDebXdr.o rtems/rteRemDebXdr.o + ch-exp.o: ch-exp.c ch-lang.h $(defs_h) $(language_h) $(parser_defs_h) \ $(bfd_h) $(symfile_h) $(objfiles_h) $(value_h) @@ -1895,6 +1914,9 @@ $(inferior_h) $(target_h) $(terminal_h) $(remote_utils_h) \ $(gdb_string_h) $(regcache_h) +remote-rte.o: remote-rte.c rtems/remdeb.h $(wait_h) $(defs_h) $(gdbcmd_h) \ + $(inferior_h) symfile.h target.h + remote-e7000.o: remote-e7000.c $(defs_h) $(gdbcore_h) $(target_h) \ $(serial_h) $(gdb_string_h) $(regcache_h) @@ -2098,6 +2120,8 @@ thread.o: thread.c $(defs_h) $(gdbthread_h) $(gdbcmd_h) $(target_h) \ $(regcache_h) $(ui_out_h) $(gdb_h) + +thread_rte.o: thread_rte.c thread_rte.h completer.o: completer.c $(completer_h) $(gdbtypes_h) $(symtab_h) \ $(defs_h) $(gdbcmd_h) $(expression_h) $(readline_headers) diff -Naur gdb-5.2-PLUS_CG/gdb/command.h gdb-5.2-PLUS_RDBG/gdb/command.h --- gdb-5.2-PLUS_CG/gdb/command.h Mon Jun 10 15:32:05 2002 +++ gdb-5.2-PLUS_RDBG/gdb/command.h Wed Jun 12 11:15:01 2002 @@ -42,6 +42,9 @@ class_files, class_support, class_info, class_breakpoint, class_trace, class_alias, class_obscure, class_user, class_maintenance, class_pseudo, class_tui, class_xdb +#ifdef RTEMS + , class_threads +#endif }; /* Not a set/show command. Note that some commands which begin with diff -Naur gdb-5.2-PLUS_CG/gdb/config/i386/i386RTEMS.mt gdb-5.2-PLUS_RDBG/gdb/config/i386/i386RTEMS.mt --- gdb-5.2-PLUS_CG/gdb/config/i386/i386RTEMS.mt Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/config/i386/i386RTEMS.mt Wed Jun 12 11:15:34 2002 @@ -0,0 +1,45 @@ +#**************************************************************** +# +# Component = GDB configuration file +# Module = +# +# Synopsis = Configuration when target is Rtems +# running on a i386 +# +# +# Copyright(C) 2000 Canon Research Center France SA. +# +# Developped by : +# Eric Valette, mail to : valette@crf.canon.fr +# Emmanuel Raguet, mail to : raguet@crf.canon.fr +# +# $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ +# +#**************************************************************** +# Basic, host-specific, and target-specific definitions for GDB. +# Copyright (C) 1986, 1989, 1991, 1992, 1993, 1994, 1995 +# 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +# Target: Intel 386 running RTEMS +TDEPFILES= i386-tdep.o i387-tdep.o fork-child.o infptrace.o inftarg.o remote-rte.o rtems.o thread_rte.o rtems/rteRemDebXdr.o + +TM_FILE= tm-i386rte.h + +MT_CFLAGS= -DCOMPAQ386 -DGDB_BUG_FIX -DRPC_SUN -DNO_PORT_MAPPER -DFETCH_INFERIOR_REGISTERS -DTARGET_i386 -DRTEMS + diff -Naur gdb-5.2-PLUS_CG/gdb/config/i386/tm-i386.h gdb-5.2-PLUS_RDBG/gdb/config/i386/tm-i386.h --- gdb-5.2-PLUS_CG/gdb/config/i386/tm-i386.h Mon Jun 10 15:32:07 2002 +++ gdb-5.2-PLUS_RDBG/gdb/config/i386/tm-i386.h Wed Jun 12 11:15:32 2002 @@ -49,7 +49,10 @@ inferior, and when we finally get to the inferior code. This is 2 on most implementations. */ +#ifdef START_INFERIOR_TRAPS_EXPECTED +#undef START_INFERIOR_TRAPS_EXPECTED #define START_INFERIOR_TRAPS_EXPECTED 2 +#endif /* Offset from address of function to start of its code. Zero on most machines. */ diff -Naur gdb-5.2-PLUS_CG/gdb/config/i386/tm-i386rte.h gdb-5.2-PLUS_RDBG/gdb/config/i386/tm-i386rte.h --- gdb-5.2-PLUS_CG/gdb/config/i386/tm-i386rte.h Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/config/i386/tm-i386rte.h Wed Jun 12 11:15:34 2002 @@ -0,0 +1,144 @@ +/* + **************************************************************** + * + * Component = GDB - + * Module = tm-i386rte.h + * + * Synopsis = Target dependent definitions[derived from tm-i386v4.h] + * + * + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + **************************************************************** + */ + +/* Macro definitions for GDB on an Intel i386 running SVR4. + Copyright (C) 1991, 1994 Free Software Foundation, Inc. + Written by Fred Fish at Cygnus Support (fnf@cygnus.com) + +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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* Use the alternate method of determining valid frame chains. */ + +#define FRAME_CHAIN_VALID_ALTERNATE + +/* number of traps that happen between exec'ing the shell + * to run an inferior, and when we finally get to + * the inferior code. This is 2 on most implementations. + */ + + +#undef START_INFERIOR_TRAPS_EXPECTED +#define START_INFERIOR_TRAPS_EXPECTED 1 + +/* Pick up most of what we need from the generic i386 target include file. */ + +#include "i386/tm-i386v.h" + +/* Pick up more stuff from the generic SVR4 host include file. */ + +#include "tm-sysv4.h" + +/* The remote debug server used (rdb), resets the PC to break addr */ +#undef DECR_PC_AFTER_BREAK +#define DECR_PC_AFTER_BREAK 0 +/* We can't tell how many args there are + now that the C compiler delays popping them. */ + +#undef FRAME_NUM_ARGS +#define FRAME_NUM_ARGS(fi) (-1) + +/* Offsets (in target ints) into jmp_buf. Not defined in any system header + file, so we have to step through setjmp/longjmp with a debugger and figure + them out. Note that defines _JBLEN as 10, which is the default + if no specific machine is selected, even though we only use 6 slots. */ + +#define JB_ELEMENT_SIZE sizeof(int) /* jmp_buf[_JBLEN] is array of ints */ + +#define JB_EBX 0 +#define JB_ESI 1 +#define JB_EDI 2 +#define JB_EBP 3 +#define JB_ESP 4 +#define JB_EDX 5 + +#define JB_PC JB_EDX /* Setjmp()'s return PC saved in EDX */ + +/* Figure out where the longjmp will land. Slurp the args out of the stack. + We expect the first arg to be a pointer to the jmp_buf structure from which + we extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. + This routine returns true on success */ + +extern int +get_longjmp_target PARAMS ((CORE_ADDR *)); + +#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) + +/* The following redefines make backtracing through sigtramp work. + They manufacture a fake sigtramp frame and obtain the saved pc in sigtramp + from the ucontext structure which is pushed by the kernel on the + user stack. Unfortunately there are three variants of sigtramp handlers. */ + +#define I386V4_SIGTRAMP_SAVED_PC +#define IN_SIGTRAMP(pc, name) ((name) \ + && (STREQ ("_sigreturn", name) \ + || STREQ ("_sigacthandler", name) \ + || STREQ ("sigvechandler", name))) + +/* FRAME_CHAIN takes a frame's nominal address and produces the frame's + chain-pointer. + In the case of the i386, the frame's nominal address + is the address of a 4-byte word containing the calling frame's address. */ + +/* Read frame pointer if non null. + A null frame pointer means entry-point of a new thread */ +#undef FRAME_CHAIN +#define FRAME_CHAIN(thisframe) \ + ((thisframe)->signal_handler_caller \ + ? (thisframe)->frame \ + : (!inside_entry_file ((thisframe)->pc) && (thisframe)->frame \ + ? read_memory_integer ((thisframe)->frame, 4) \ + : 0)) + +/* A macro that tells us whether the function invocation represented + by FI does not have a frame on the stack associated with it. If it + does not, FRAMELESS is set to 1, else 0. */ +#undef FRAMELESS_FUNCTION_INVOCATION +#define FRAMELESS_FUNCTION_INVOCATION(FI) \ + (frameless_look_for_prologue(FI)) + +/* Saved Pc. Get it from ucontext if within sigtramp. */ + +#undef FRAME_SAVED_PC +#define FRAME_SAVED_PC(FRAME) \ + (((FRAME)->signal_handler_caller \ + ? i386v4_sigtramp_saved_pc (FRAME) \ + : read_memory_integer ((FRAME)->frame + 4, 4)) \ + ) +extern CORE_ADDR i386v4_sigtramp_saved_pc PARAMS ((struct frame_info *)); + +#undef target_pid_to_str + +#define target_pid_to_str(PID) rtems_pid_to_str (PID) + +extern char *rtems_pid_to_str PARAMS ((int pid)); diff -Naur gdb-5.2-PLUS_CG/gdb/config/powerpc/rtems.mt gdb-5.2-PLUS_RDBG/gdb/config/powerpc/rtems.mt --- gdb-5.2-PLUS_CG/gdb/config/powerpc/rtems.mt Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/config/powerpc/rtems.mt Wed Jun 12 11:16:04 2002 @@ -0,0 +1,46 @@ +#**************************************************************** +# +# Component = GDB configuration file +# Module = +# +# Synopsis = Configuration when target is Rtems +# running on a i386 +# +# Copyright(C) 2000 Canon Research Center France SA. +# +# Developped by : +# Eric Valette, mail to : valette@crf.canon.fr +# Emmanuel Raguet, mail to : raguet@crf.canon.fr +# +# $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ +# +# +# +#**************************************************************** +# Basic, host-specific, and target-specific definitions for GDB. +# Copyright (C) 1986, 1989, 1991, 1992, 1993, 1994, 1995 +# 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +# Target: PPC 750 running RTEMS +TDEPFILES= rs6000-tdep.o fork-child.o infptrace.o inftarg.o remote-rte.o rtems.o thread_rte.o rtems/rteRemDebXdr.o + +TM_FILE= tm-ppc-rtems.h + +MT_CFLAGS= -DGDB_BUG_FIX -DRPC_SUN -DNO_PORT_MAPPER -DFETCH_INFERIOR_REGISTERS -DRTEMS -DTARGET_powerpc + diff -Naur gdb-5.2-PLUS_CG/gdb/config/powerpc/tm-ppc-rtems.h gdb-5.2-PLUS_RDBG/gdb/config/powerpc/tm-ppc-rtems.h --- gdb-5.2-PLUS_CG/gdb/config/powerpc/tm-ppc-rtems.h Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/config/powerpc/tm-ppc-rtems.h Wed Jun 12 11:16:04 2002 @@ -0,0 +1,91 @@ +/* Macro definitions for Power PC running embedded ABI. + Copyright 1995, 1996, 1997 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. */ + +#ifndef TM_PPC_EABI_H +#define TM_PPC_EABI_H + +/* Use generic RS6000 definitions. */ +#include "rs6000/tm-rs6000.h" +#undef START_INFERIOR_TRAPS_EXPECTED +#define START_INFERIOR_TRAPS_EXPECTED 1 + +/* except we want to allow single stepping */ +#undef SOFTWARE_SINGLE_STEP_P +#define SOFTWARE_SINGLE_STEP_P 0 + +#undef DEFAULT_LR_SAVE +#define DEFAULT_LR_SAVE 4 /* eabi saves LR at 4 off of SP */ + +#define GDB_TARGET_POWERPC + +#undef PC_LOAD_SEGMENT +#undef PROCESS_LINENUMBER_HOOK + +#undef TEXT_SEGMENT_BASE +#define TEXT_SEGMENT_BASE 1 + +/* Say that we're using ELF, not XCOFF. */ +#define ELF_OBJECT_FORMAT 1 + +#define TARGET_BYTE_ORDER_SELECTABLE_P 1 + +/* return true if a given `pc' value is in `call dummy' function. */ +/* FIXME: This just checks for the end of the stack, which is broken + for things like stepping through gcc nested function stubs. */ +#undef PC_IN_CALL_DUMMY +#define PC_IN_CALL_DUMMY(STOP_PC, STOP_SP, STOP_FRAME_ADDR) \ + (STOP_SP < STOP_PC) + +/* generic dummy frame stuff */ + + + +/* target-specific dummy_frame stuff */ + +extern struct frame_info *rs6000_pop_frame PARAMS ((struct frame_info *frame)); + +extern CORE_ADDR ppc_push_return_address PARAMS ((CORE_ADDR, CORE_ADDR)); +extern CORE_ADDR rs6000_push_arguments PARAMS ((int nargs, + struct value **args, + CORE_ADDR sp, + int, + CORE_ADDR struct_addr)); + +#undef PUSH_DUMMY_FRAME +#define PUSH_DUMMY_FRAME generic_push_dummy_frame () + +#define PUSH_RETURN_ADDRESS(PC, SP) ppc_push_return_address (PC, SP) + +/* override the standard get_saved_register function with + one that takes account of generic CALL_DUMMY frames */ +#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) \ + generic_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval) + +#define USE_GENERIC_DUMMY_FRAMES 1 +#define CALL_DUMMY_BREAKPOINT_OFFSET (0) +#define CALL_DUMMY_LOCATION AT_ENTRY_POINT +#define CALL_DUMMY_ADDRESS() entry_point_address () +#undef CALL_DUMMY_START_OFFSET +#define CALL_DUMMY_START_OFFSET 0 + +/* The value of symbols of type N_SO and N_FUN maybe null when + it shouldn't be. */ +#define SOFUN_ADDRESS_MAYBE_MISSING + +#endif /* TM_PPC_EABI_H */ diff -Naur gdb-5.2-PLUS_CG/gdb/configure gdb-5.2-PLUS_RDBG/gdb/configure --- gdb-5.2-PLUS_CG/gdb/configure Mon Jun 10 15:32:05 2002 +++ gdb-5.2-PLUS_RDBG/gdb/configure Wed Jun 12 11:15:02 2002 @@ -79,7 +79,6 @@ program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -194,7 +193,6 @@ --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -365,11 +363,6 @@ -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -535,16 +528,12 @@ srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -585,7 +574,7 @@ echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:589: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:578: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -611,7 +600,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:615: checking for $ac_word" >&5 +echo "configure:604: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -641,7 +630,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:645: checking for $ac_word" >&5 +echo "configure:634: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -692,7 +681,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:696: checking for $ac_word" >&5 +echo "configure:685: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -724,7 +713,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:717: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -735,12 +724,12 @@ cat > conftest.$ac_ext << EOF -#line 739 "configure" +#line 728 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -766,12 +755,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:770: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:759: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:775: checking whether we are using GNU C" >&5 +echo "configure:764: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -780,7 +769,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -799,7 +788,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:803: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:792: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -831,7 +820,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:835: checking how to run the C preprocessor" >&5 +echo "configure:824: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -846,13 +835,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -863,13 +852,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -880,13 +869,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -911,9 +900,9 @@ echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:915: checking for AIX" >&5 +echo "configure:904: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:939: checking for POSIXized ISC" >&5 +echo "configure:928: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -959,7 +948,7 @@ echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 -echo "configure:963: checking for ${CC-cc} option to accept ANSI C" >&5 +echo "configure:952: checking for ${CC-cc} option to accept ANSI C" >&5 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -976,7 +965,7 @@ do CC="$ac_save_CC $ac_arg" cat > conftest.$ac_ext < #include @@ -1013,7 +1002,7 @@ ; return 0; } EOF -if { (eval echo configure:1017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_prog_cc_stdc="$ac_arg"; break else @@ -1084,7 +1073,7 @@ fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1088: checking host system type" >&5 +echo "configure:1077: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1105,7 +1094,7 @@ echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:1109: checking target system type" >&5 +echo "configure:1098: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -1123,7 +1112,7 @@ echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:1127: checking build system type" >&5 +echo "configure:1116: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -1148,7 +1137,7 @@ ALL_LINGUAS= echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1152: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1141: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1177,7 +1166,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1181: checking for $ac_word" >&5 +echo "configure:1170: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1205,12 +1194,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1209: checking for ANSI C header files" >&5 +echo "configure:1198: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1218,7 +1207,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1235,7 +1224,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1253,7 +1242,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1274,7 +1263,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1285,7 +1274,7 @@ exit (0); } EOF -if { (eval echo configure:1289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1309,12 +1298,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1313: checking for working const" >&5 +echo "configure:1302: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1384,21 +1373,21 @@ fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:1388: checking for inline" >&5 +echo "configure:1377: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -1424,12 +1413,12 @@ esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:1428: checking for off_t" >&5 +echo "configure:1417: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1457,12 +1446,12 @@ fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1461: checking for size_t" >&5 +echo "configure:1450: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1492,19 +1481,19 @@ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1496: checking for working alloca.h" >&5 +echo "configure:1485: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1525,12 +1514,12 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1529: checking for alloca" >&5 +echo "configure:1518: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1590,12 +1579,12 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1594: checking whether alloca needs Cray hooks" >&5 +echo "configure:1583: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:1624: checking for $ac_func" >&5 +echo "configure:1613: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1675,7 +1664,7 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1679: checking stack direction for C alloca" >&5 +echo "configure:1668: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1683,7 +1672,7 @@ ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -1727,17 +1716,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1731: checking for $ac_hdr" >&5 +echo "configure:1720: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1766,12 +1755,12 @@ for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1770: checking for $ac_func" >&5 +echo "configure:1759: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1819,7 +1808,7 @@ done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1823: checking for working mmap" >&5 +echo "configure:1812: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1827,7 +1816,7 @@ ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -1995,17 +1984,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1999: checking for $ac_hdr" >&5 +echo "configure:1988: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2035,12 +2024,12 @@ __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2039: checking for $ac_func" >&5 +echo "configure:2028: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2092,12 +2081,12 @@ for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2096: checking for $ac_func" >&5 +echo "configure:2085: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2154,19 +2143,19 @@ if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:2158: checking for LC_MESSAGES" >&5 +echo "configure:2147: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:2170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -2187,7 +2176,7 @@ fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2191: checking whether NLS is requested" >&5 +echo "configure:2180: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2207,7 +2196,7 @@ EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:2211: checking whether included gettext is requested" >&5 +echo "configure:2200: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -2226,17 +2215,17 @@ ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:2230: checking for libintl.h" >&5 +echo "configure:2219: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2253,19 +2242,19 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:2257: checking for gettext in libc" >&5 +echo "configure:2246: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -2281,7 +2270,7 @@ if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:2285: checking for bindtextdomain in -lintl" >&5 +echo "configure:2274: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2289,7 +2278,7 @@ ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2316,19 +2305,19 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:2320: checking for gettext in libintl" >&5 +echo "configure:2309: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libintl=yes else @@ -2356,7 +2345,7 @@ # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2360: checking for $ac_word" >&5 +echo "configure:2349: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2390,12 +2379,12 @@ for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2394: checking for $ac_func" >&5 +echo "configure:2383: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2445,7 +2434,7 @@ # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2449: checking for $ac_word" >&5 +echo "configure:2438: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2481,7 +2470,7 @@ # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2485: checking for $ac_word" >&5 +echo "configure:2474: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2513,7 +2502,7 @@ fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -2553,7 +2542,7 @@ # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2557: checking for $ac_word" >&5 +echo "configure:2546: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2587,7 +2576,7 @@ # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2591: checking for $ac_word" >&5 +echo "configure:2580: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2623,7 +2612,7 @@ # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2627: checking for $ac_word" >&5 +echo "configure:2616: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2713,7 +2702,7 @@ LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:2717: checking for catalogs to be installed" >&5 +echo "configure:2706: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -2741,17 +2730,17 @@ if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:2745: checking for linux/version.h" >&5 +echo "configure:2734: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2825,7 +2814,7 @@ CONFIG_INSTALL= CONFIG_UNINSTALL= -configdirs="doc testsuite" +configdirs="doc testsuite rtems" # Check whether --enable-multi-ice or --disable-multi-ice was given. if test "${enable_multi_ice+set}" = set; then @@ -2869,12 +2858,12 @@ fi -for ac_prog in mawk gawk nawk awk +for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2878: checking for $ac_word" >&5 +echo "configure:2867: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2915,7 +2904,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:2919: checking for a BSD compatible install" >&5 +echo "configure:2908: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2976,7 +2965,7 @@ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2980: checking for $ac_word" >&5 +echo "configure:2969: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3008,7 +2997,7 @@ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3012: checking for $ac_word" >&5 +echo "configure:3001: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3040,7 +3029,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3044: checking for $ac_word" >&5 +echo "configure:3033: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3075,7 +3064,7 @@ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3079: checking for $ac_word" >&5 +echo "configure:3068: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3107,7 +3096,7 @@ # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3111: checking for $ac_word" >&5 +echo "configure:3100: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3141,7 +3130,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3145: checking for $ac_word" >&5 +echo "configure:3134: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3175,7 +3164,7 @@ # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args. set dummy ${ac_tool_prefix}mig; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3179: checking for $ac_word" >&5 +echo "configure:3168: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3226,12 +3215,12 @@ echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3230: checking return type of signal handlers" >&5 +echo "configure:3219: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3248,7 +3237,7 @@ int i; ; return 0; } EOF -if { (eval echo configure:3252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -3268,12 +3257,12 @@ echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3272: checking for ANSI C header files" >&5 +echo "configure:3261: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3281,7 +3270,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3298,7 +3287,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3316,7 +3305,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3337,7 +3326,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3348,7 +3337,7 @@ exit (0); } EOF -if { (eval echo configure:3352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3392,17 +3381,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3396: checking for $ac_hdr" >&5 +echo "configure:3385: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3429,12 +3418,12 @@ done echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:3433: checking whether stat file-mode macros are broken" >&5 +echo "configure:3422: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3486,12 +3475,12 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3490: checking for working const" >&5 +echo "configure:3479: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3565,12 +3554,12 @@ realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3569: checking for $ac_func" >&5 +echo "configure:3558: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3620,19 +3609,19 @@ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:3624: checking for working alloca.h" >&5 +echo "configure:3613: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -3653,12 +3642,12 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3657: checking for alloca" >&5 +echo "configure:3646: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -3718,12 +3707,12 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3722: checking whether alloca needs Cray hooks" >&5 +echo "configure:3711: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:3752: checking for $ac_func" >&5 +echo "configure:3741: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3803,7 +3792,7 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3807: checking stack direction for C alloca" >&5 +echo "configure:3796: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3811,7 +3800,7 @@ ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3852,12 +3841,12 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3856: checking for pid_t" >&5 +echo "configure:3845: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3886,17 +3875,17 @@ ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:3890: checking for vfork.h" >&5 +echo "configure:3879: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3921,18 +3910,18 @@ fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:3925: checking for working vfork" >&5 +echo "configure:3914: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:3931: checking for vfork" >&5 +echo "configure:3920: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -3977,7 +3966,7 @@ ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -4072,7 +4061,7 @@ } } EOF -if { (eval echo configure:4076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -4096,7 +4085,7 @@ if test "$cross_compiling" = no; then echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:4100: checking whether setpgrp takes no argument" >&5 +echo "configure:4089: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4104,7 +4093,7 @@ { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -4149,12 +4138,12 @@ else echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:4153: checking whether setpgrp takes no argument" >&5 +echo "configure:4142: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4168,7 +4157,7 @@ ; return 0; } EOF -if { (eval echo configure:4172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_func_setpgrp_void=no else @@ -4192,12 +4181,12 @@ # Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do # since sigsetjmp might only be defined as a macro. echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:4196: checking for sigsetjmp" >&5 +echo "configure:4185: checking for sigsetjmp" >&5 if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4206,7 +4195,7 @@ sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1); ; return 0; } EOF -if { (eval echo configure:4210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4199: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_func_sigsetjmp=yes else @@ -4229,19 +4218,19 @@ # See if supports the %fs and %gs i386 segment registers. # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6 -echo "configure:4233: checking for r_fs in struct reg" >&5 +echo "configure:4222: checking for r_fs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct reg r; r.r_fs; ; return 0; } EOF -if { (eval echo configure:4245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_fs=yes else @@ -4261,19 +4250,19 @@ fi echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6 -echo "configure:4265: checking for r_gs in struct reg" >&5 +echo "configure:4254: checking for r_gs in struct reg" >&5 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct reg r; r.r_gs; ; return 0; } EOF -if { (eval echo configure:4277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_struct_reg_r_gs=yes else @@ -4295,19 +4284,19 @@ # See if provides the PTRACE_GETREGS request. echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6 -echo "configure:4299: checking for PTRACE_GETREGS" >&5 +echo "configure:4288: checking for PTRACE_GETREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETREGS; ; return 0; } EOF -if { (eval echo configure:4311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getregs=yes else @@ -4329,19 +4318,19 @@ # See if provides the PTRACE_GETFPXREGS request. echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6 -echo "configure:4333: checking for PTRACE_GETFPXREGS" >&5 +echo "configure:4322: checking for PTRACE_GETFPXREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { PTRACE_GETFPXREGS; ; return 0; } EOF -if { (eval echo configure:4345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_ptrace_getfpxregs=yes else @@ -4363,12 +4352,12 @@ # See if provides the PT_GETDBREGS request. echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6 -echo "configure:4367: checking for PT_GETDBREGS" >&5 +echo "configure:4356: checking for PT_GETDBREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4376,7 +4365,7 @@ PT_GETDBREGS; ; return 0; } EOF -if { (eval echo configure:4380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getdbregs=yes else @@ -4398,12 +4387,12 @@ # See if provides the PT_GETXMMREGS request. echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6 -echo "configure:4402: checking for PT_GETXMMREGS" >&5 +echo "configure:4391: checking for PT_GETXMMREGS" >&5 if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4411,7 +4400,7 @@ PT_GETXMMREGS; ; return 0; } EOF -if { (eval echo configure:4415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_pt_getxmmregs=yes else @@ -4433,7 +4422,7 @@ echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6 -echo "configure:4437: checking for socketpair in -lsocket" >&5 +echo "configure:4426: checking for socketpair in -lsocket" >&5 ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4441,7 +4430,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4482,12 +4471,12 @@ for ac_func in socketpair do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4486: checking for $ac_func" >&5 +echo "configure:4475: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4537,12 +4526,12 @@ echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4541: checking whether malloc must be declared" >&5 +echo "configure:4530: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4563,7 +4552,7 @@ char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:4567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -4584,12 +4573,12 @@ fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:4588: checking whether realloc must be declared" >&5 +echo "configure:4577: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4610,7 +4599,7 @@ char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:4614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -4631,12 +4620,12 @@ fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4635: checking whether free must be declared" >&5 +echo "configure:4624: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4657,7 +4646,7 @@ char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4678,12 +4667,12 @@ fi echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6 -echo "configure:4682: checking whether strerror must be declared" >&5 +echo "configure:4671: checking whether strerror must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4704,7 +4693,7 @@ char *(*pfn) = (char *(*)) strerror ; return 0; } EOF -if { (eval echo configure:4708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strerror=no else @@ -4725,12 +4714,12 @@ fi echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6 -echo "configure:4729: checking whether strdup must be declared" >&5 +echo "configure:4718: checking whether strdup must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4751,7 +4740,7 @@ char *(*pfn) = (char *(*)) strdup ; return 0; } EOF -if { (eval echo configure:4755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strdup=no else @@ -4772,12 +4761,12 @@ fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4776: checking whether strstr must be declared" >&5 +echo "configure:4765: checking whether strstr must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4798,7 +4787,7 @@ char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4819,12 +4808,12 @@ fi echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6 -echo "configure:4823: checking whether canonicalize_file_name must be declared" >&5 +echo "configure:4812: checking whether canonicalize_file_name must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4845,7 +4834,7 @@ char *(*pfn) = (char *(*)) canonicalize_file_name ; return 0; } EOF -if { (eval echo configure:4849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_canonicalize_file_name=no else @@ -4872,9 +4861,9 @@ # could be expunged. --jsm 1999-03-22 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6 -echo "configure:4876: checking for HPUX save_state structure" >&5 +echo "configure:4865: checking for HPUX save_state structure" >&5 cat > conftest.$ac_ext < EOF @@ -4889,7 +4878,7 @@ rm -f conftest* cat > conftest.$ac_ext < EOF @@ -4959,12 +4948,12 @@ if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4963: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:4952: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -4995,12 +4984,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:4999: checking for prrun_t in sys/procfs.h" >&5 +echo "configure:4988: checking for prrun_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prrun_t=yes else @@ -5031,12 +5020,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6 echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5035: checking for gregset_t in sys/procfs.h" >&5 +echo "configure:5024: checking for gregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_gregset_t=yes else @@ -5067,12 +5056,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6 echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5071: checking for fpregset_t in sys/procfs.h" >&5 +echo "configure:5060: checking for fpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_fpregset_t=yes else @@ -5103,12 +5092,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6 echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5107: checking for prgregset_t in sys/procfs.h" >&5 +echo "configure:5096: checking for prgregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset_t=yes else @@ -5139,12 +5128,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6 echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5143: checking for prfpregset_t in sys/procfs.h" >&5 +echo "configure:5132: checking for prfpregset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset_t=yes else @@ -5175,12 +5164,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6 echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5179: checking for prgregset32_t in sys/procfs.h" >&5 +echo "configure:5168: checking for prgregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5182: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prgregset32_t=yes else @@ -5211,12 +5200,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6 echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5215: checking for prfpregset32_t in sys/procfs.h" >&5 +echo "configure:5204: checking for prfpregset32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5218: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prfpregset32_t=yes else @@ -5247,12 +5236,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6 echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5251: checking for lwpid_t in sys/procfs.h" >&5 +echo "configure:5240: checking for lwpid_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpid_t=yes else @@ -5283,12 +5272,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6 echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5287: checking for psaddr_t in sys/procfs.h" >&5 +echo "configure:5276: checking for psaddr_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psaddr_t=yes else @@ -5319,12 +5308,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6 echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5323: checking for prsysent_t in sys/procfs.h" >&5 +echo "configure:5312: checking for prsysent_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5326: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prsysent_t=yes else @@ -5355,12 +5344,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6 echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5359: checking for pr_sigset_t in sys/procfs.h" >&5 +echo "configure:5348: checking for pr_sigset_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigset_t=yes else @@ -5391,12 +5380,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6 echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5395: checking for pr_sigaction64_t in sys/procfs.h" >&5 +echo "configure:5384: checking for pr_sigaction64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes else @@ -5427,12 +5416,12 @@ echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6 echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5431: checking for pr_siginfo64_t in sys/procfs.h" >&5 +echo "configure:5420: checking for pr_siginfo64_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes else @@ -5468,7 +5457,7 @@ if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6 -echo "configure:5472: checking whether prfpregset_t type is broken" >&5 +echo "configure:5461: checking whether prfpregset_t type is broken" >&5 if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5476,7 +5465,7 @@ gdb_cv_prfpregset_t_broken=yes else cat > conftest.$ac_ext < int main () @@ -5486,7 +5475,7 @@ return 0; } EOF -if { (eval echo configure:5490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_prfpregset_t_broken=no else @@ -5511,12 +5500,12 @@ echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5515: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 +echo "configure:5504: checking for PIOCSET ioctl entry in sys/procfs.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5529,7 +5518,7 @@ ; return 0; } EOF -if { (eval echo configure:5533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_procfs_piocset=yes else @@ -5553,19 +5542,19 @@ if test ${host} = ${target} ; then echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:5557: checking for member l_addr in struct link_map" >&5 +echo "configure:5546: checking for member l_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct link_map lm; (void) lm.l_addr; ; return 0; } EOF -if { (eval echo configure:5569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_l_members=yes else @@ -5587,12 +5576,12 @@ echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6 -echo "configure:5591: checking for member lm_addr in struct link_map" >&5 +echo "configure:5580: checking for member lm_addr in struct link_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5600,7 +5589,7 @@ struct link_map lm; (void) lm.lm_addr; ; return 0; } EOF -if { (eval echo configure:5604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map_with_lm_members=yes else @@ -5622,12 +5611,12 @@ echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6 -echo "configure:5626: checking for member som_addr in struct so_map" >&5 +echo "configure:5615: checking for member som_addr in struct so_map" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifdef HAVE_NLIST_H @@ -5638,7 +5627,7 @@ struct so_map lm; (void) lm.som_addr; ; return 0; } EOF -if { (eval echo configure:5642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_so_map_with_som_members=yes else @@ -5660,12 +5649,12 @@ echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6 -echo "configure:5664: checking for struct link_map32 in sys/link.h" >&5 +echo "configure:5653: checking for struct link_map32 in sys/link.h" >&5 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5673,7 +5662,7 @@ struct link_map32 l; ; return 0; } EOF -if { (eval echo configure:5677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_struct_link_map32=yes else @@ -5695,7 +5684,7 @@ fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5699: checking for main in -lm" >&5 +echo "configure:5688: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5703,14 +5692,14 @@ ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5739,7 +5728,7 @@ echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6 -echo "configure:5743: checking for wctype in -lc" >&5 +echo "configure:5732: checking for wctype in -lc" >&5 ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5747,7 +5736,7 @@ ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5777,7 +5766,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6 -echo "configure:5781: checking for wctype in -lw" >&5 +echo "configure:5770: checking for wctype in -lw" >&5 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5785,7 +5774,7 @@ ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5828,12 +5817,12 @@ echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6 -echo "configure:5832: checking for long long support in compiler" >&5 +echo "configure:5821: checking for long long support in compiler" >&5 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_c_long_long=yes else @@ -5865,7 +5854,7 @@ echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6 -echo "configure:5869: checking for long long support in printf" >&5 +echo "configure:5858: checking for long long support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5873,7 +5862,7 @@ gdb_cv_printf_has_long_long=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_long=yes else @@ -5911,19 +5900,19 @@ echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6 -echo "configure:5915: checking for long double support in compiler" >&5 +echo "configure:5904: checking for long double support in compiler" >&5 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_long_double=yes else @@ -5945,7 +5934,7 @@ echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6 -echo "configure:5949: checking for long double support in printf" >&5 +echo "configure:5938: checking for long double support in printf" >&5 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5953,7 +5942,7 @@ gdb_cv_printf_has_long_double=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_printf_has_long_double=yes else @@ -5987,7 +5976,7 @@ echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6 -echo "configure:5991: checking for long double support in scanf" >&5 +echo "configure:5980: checking for long double support in scanf" >&5 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5995,7 +5984,7 @@ gdb_cv_scanf_has_long_double=no else cat > conftest.$ac_ext < 3.14159 && f < 3.14160); } EOF -if { (eval echo configure:6009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then gdb_cv_scanf_has_long_double=yes else @@ -6031,17 +6020,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6035: checking for $ac_hdr" >&5 +echo "configure:6024: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6070,12 +6059,12 @@ for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6074: checking for $ac_func" >&5 +echo "configure:6063: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6123,7 +6112,7 @@ done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6127: checking for working mmap" >&5 +echo "configure:6116: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6131,7 +6120,7 @@ ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -6297,7 +6286,7 @@ case ${host_os} in aix*) echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6 -echo "configure:6301: checking for -bbigtoc option" >&5 +echo "configure:6290: checking for -bbigtoc option" >&5 if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6311,14 +6300,14 @@ LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -6341,7 +6330,7 @@ case ${host_os} in hpux*) echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6 -echo "configure:6345: checking for HPUX/OSF thread support" >&5 +echo "configure:6334: checking for HPUX/OSF thread support" >&5 if test -f /usr/include/dce/cma_config.h ; then if test "$GCC" = "yes" ; then echo "$ac_t""yes" 1>&6 @@ -6360,7 +6349,7 @@ ;; solaris*) echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6 -echo "configure:6364: checking for Solaris thread debugging library" >&5 +echo "configure:6353: checking for Solaris thread debugging library" >&5 if test -f /usr/lib/libthread_db.so.1 ; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -6370,7 +6359,7 @@ CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o" CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:6374: checking for dlopen in -ldl" >&5 +echo "configure:6363: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6378,7 +6367,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6421,17 +6410,17 @@ # all symbols visible in the dynamic symbol table. hold_ldflags=$LDFLAGS echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:6425: checking for the ld -export-dynamic flag" >&5 +echo "configure:6414: checking for the ld -export-dynamic flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -6450,13 +6439,13 @@ # Sun randomly tweaked the prototypes in # at one point. echo $ac_n "checking if is old""... $ac_c" 1>&6 -echo "configure:6454: checking if is old" >&5 +echo "configure:6443: checking if is old" >&5 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -6467,7 +6456,7 @@ ; return 0; } EOF -if { (eval echo configure:6471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_proc_service_is_old=no else @@ -6686,7 +6675,7 @@ if test "x${build_warnings}" != x -a "x$GCC" = xyes then echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6 -echo "configure:6690: checking compiler warning flags" >&5 +echo "configure:6679: checking compiler warning flags" >&5 # Separate out the -Werror flag as some files just cannot be # compiled with it enabled. for w in ${build_warnings}; do @@ -6696,14 +6685,14 @@ saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $w" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* WARN_CFLAGS="${WARN_CFLAGS} $w" else @@ -6763,12 +6752,12 @@ if test $want_included_regex = false; then echo $ac_n "checking for GNU regex""... $ac_c" 1>&6 -echo "configure:6767: checking for GNU regex" >&5 +echo "configure:6756: checking for GNU regex" >&5 if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6780,7 +6769,7 @@ ; return 0; } EOF -if { (eval echo configure:6784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gdb_cv_have_gnu_regex=yes else @@ -6809,12 +6798,12 @@ # In the Cygwin environment, we need some additional flags. echo $ac_n "checking for cygwin""... $ac_c" 1>&6 -echo "configure:6813: checking for cygwin" >&5 +echo "configure:6802: checking for cygwin" >&5 if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6856: checking for tgetent in -lncurses" >&5 +echo "configure:6845: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6860,7 +6849,7 @@ ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6890,7 +6879,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6 -echo "configure:6894: checking for tgetent in -lHcurses" >&5 +echo "configure:6883: checking for tgetent in -lHcurses" >&5 ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6898,7 +6887,7 @@ ac_save_LIBS="$LIBS" LIBS="-lHcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6928,7 +6917,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6 -echo "configure:6932: checking for tgetent in -ltermlib" >&5 +echo "configure:6921: checking for tgetent in -ltermlib" >&5 ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6936,7 +6925,7 @@ ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6966,7 +6955,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:6970: checking for tgetent in -ltermcap" >&5 +echo "configure:6959: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6974,7 +6963,7 @@ ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7004,7 +6993,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:7008: checking for tgetent in -lcurses" >&5 +echo "configure:6997: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7012,7 +7001,7 @@ ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7042,7 +7031,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6 -echo "configure:7046: checking for tgetent in -lterminfo" >&5 +echo "configure:7035: checking for tgetent in -lterminfo" >&5 ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7050,7 +7039,7 @@ ac_save_LIBS="$LIBS" LIBS="-lterminfo $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7226,7 +7215,7 @@ fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:7230: checking for Tcl configuration" >&5 +echo "configure:7219: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7334,7 +7323,7 @@ fi echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6 -echo "configure:7338: checking for Tk configuration" >&5 +echo "configure:7327: checking for Tk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7443,7 +7432,7 @@ no_tcl=true echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6 -echo "configure:7447: checking for Tcl private headers. dir=${configdir}" >&5 +echo "configure:7436: checking for Tcl private headers. dir=${configdir}" >&5 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" @@ -7509,17 +7498,17 @@ if test x"${ac_cv_c_tclh}" = x ; then ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6 -echo "configure:7513: checking for tclInt.h" >&5 +echo "configure:7502: checking for tclInt.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7579,7 +7568,7 @@ # no_tk=true echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6 -echo "configure:7583: checking for Tk private headers" >&5 +echo "configure:7572: checking for Tk private headers" >&5 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" @@ -7645,17 +7634,17 @@ if test x"${ac_cv_c_tkh}" = x ; then ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tk.h""... $ac_c" 1>&6 -echo "configure:7649: checking for tk.h" >&5 +echo "configure:7638: checking for tk.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -7701,7 +7690,7 @@ echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7705: checking for Itcl private headers. srcdir=${srcdir}" >&5 +echo "configure:7694: checking for Itcl private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itclh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do if test -f $i/generic/itcl.h ; then @@ -7724,7 +7713,7 @@ echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7728: checking for Itk private headers. srcdir=${srcdir}" >&5 +echo "configure:7717: checking for Itk private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_itkh}" = x ; then for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do if test -f $i/generic/itk.h ; then @@ -7747,7 +7736,7 @@ echo $ac_n "checking for Tix private headers. srcdir=${srcdir}""... $ac_c" 1>&6 -echo "configure:7751: checking for Tix private headers. srcdir=${srcdir}" >&5 +echo "configure:7740: checking for Tix private headers. srcdir=${srcdir}" >&5 if test x"${ac_cv_c_tixh}" = x ; then for i in ${srcdir}/../tix ${srcdir}/../../tix ${srcdir}/../../../tix ; do if test -f $i/generic/tix.h ; then @@ -7799,7 +7788,7 @@ fi echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6 -echo "configure:7803: checking for Itcl configuration" >&5 +echo "configure:7792: checking for Itcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7902,7 +7891,7 @@ fi echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6 -echo "configure:7906: checking for Itk configuration" >&5 +echo "configure:7895: checking for Itk configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8005,7 +7994,7 @@ fi echo $ac_n "checking for Tix configuration""... $ac_c" 1>&6 -echo "configure:8009: checking for Tix configuration" >&5 +echo "configure:7998: checking for Tix configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tixconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8148,7 +8137,7 @@ # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:8152: checking for X" >&5 +echo "configure:8141: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -8210,12 +8199,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8284,14 +8273,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -8584,7 +8573,7 @@ # ``gdbserver'' can only be built in a native configuration. if test x"${target}" = x"${host}"; then echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6 -echo "configure:8588: checking whether gdbserver is supported on this host" >&5 +echo "configure:8577: checking whether gdbserver is supported on this host" >&5 if test x"${build_gdbserver}" = xyes ; then configdirs="${configdirs} gdbserver" SUBDIRS="${SUBDIRS} gdbserver" @@ -8646,7 +8635,7 @@ echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:8650: checking whether ln -s works" >&5 +echo "configure:8639: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8670,12 +8659,12 @@ echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:8674: checking for Cygwin environment" >&5 +echo "configure:8663: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -8703,19 +8692,19 @@ CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:8707: checking for mingw32 environment" >&5 +echo "configure:8696: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -8734,7 +8723,7 @@ echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:8738: checking for executable suffix" >&5 +echo "configure:8727: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8744,10 +8733,10 @@ rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:8748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:8737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done diff -Naur gdb-5.2-PLUS_CG/gdb/configure.in gdb-5.2-PLUS_RDBG/gdb/configure.in --- gdb-5.2-PLUS_CG/gdb/configure.in Mon Jun 10 15:32:05 2002 +++ gdb-5.2-PLUS_RDBG/gdb/configure.in Wed Jun 12 11:15:02 2002 @@ -51,7 +51,7 @@ CONFIG_INSTALL= CONFIG_UNINSTALL= -configdirs="doc testsuite" +configdirs="doc testsuite rtems" AC_ARG_ENABLE(multi-ice, [ --enable-multi-ice Build the multi-ice-gdb-server], diff -Naur gdb-5.2-PLUS_CG/gdb/configure.tgt gdb-5.2-PLUS_RDBG/gdb/configure.tgt --- gdb-5.2-PLUS_CG/gdb/configure.tgt Mon Jun 10 15:32:05 2002 +++ gdb-5.2-PLUS_RDBG/gdb/configure.tgt Wed Jun 12 11:15:02 2002 @@ -95,6 +95,7 @@ i[3456]86-*-coff*) gdb_target=embed ;; i[3456]86-*-elf*) gdb_target=embed ;; i[3456]86-*-rtems*) gdb_target=embed ;; +i[3456]86-*-RTEMS*) gdb_target=i386RTEMS ;; i[3456]86-*-aix*) gdb_target=i386aix ;; i[3456]86-*-bsd*) gdb_target=i386bsd ;; i[3456]86-*-freebsd*) gdb_target=fbsd ;; @@ -232,6 +233,7 @@ powerpc-*-netbsd*) gdb_target=nbsd ;; powerpc-*-aix*) gdb_target=aix ;; +powerpc-*-RTEMS*) gdb_target=rtems ;; powerpc-*-eabi* | powerpc-*-sysv* | powerpc-*-elf* | powerpc-*-rtems* ) if test -f ../sim/ppc/Makefile; then gdb_target=ppc-sim diff -Naur gdb-5.2-PLUS_CG/gdb/inflow.c gdb-5.2-PLUS_RDBG/gdb/inflow.c --- gdb-5.2-PLUS_CG/gdb/inflow.c Mon Jun 10 15:32:05 2002 +++ gdb-5.2-PLUS_RDBG/gdb/inflow.c Wed Jun 12 11:15:10 2002 @@ -104,7 +104,12 @@ /* The name of the tty (from the `tty' command) that we gave to the inferior when it was last started. */ -static char *inferior_thisrun_terminal; +#if defined(RPC_SUN) +char* +#else +static char* +#endif +inferior_thisrun_terminal; /* Nonzero if our terminal settings are in effect. Zero if the inferior's settings are in effect. Ignored if !gdb_has_a_terminal diff -Naur gdb-5.2-PLUS_CG/gdb/infptrace.c gdb-5.2-PLUS_RDBG/gdb/infptrace.c --- gdb-5.2-PLUS_CG/gdb/infptrace.c Mon Jun 10 15:32:05 2002 +++ gdb-5.2-PLUS_RDBG/gdb/infptrace.c Wed Jun 12 11:15:10 2002 @@ -117,6 +117,7 @@ /* This function simply calls ptrace with the given arguments. It exists so that all calls to ptrace are isolated in this machine-dependent file. */ +#if !defined(RTEMS) int call_ptrace (int request, int pid, PTRACE_ARG3_TYPE addr, int data) { @@ -187,7 +188,12 @@ #endif return pt_status; } +#endif +#ifdef RTEMS +#define DEBUG_PTRACE +extern int call_ptrace(); +#endif #if defined (DEBUG_PTRACE) || defined (FIVE_ARG_PTRACE) /* For the rest of the file, use an extra level of indirection */ @@ -278,6 +284,11 @@ #endif /* CHILD_RESUME */ +#if defined(RTEMS) && !defined(USE_PROC_FS) +#define PTRACE_ATTACH 10 +#define PTRACE_DETACH 11 +#endif + #ifdef ATTACH_DETACH /* Start debugging the process whose number is PID. */ int @@ -400,6 +411,11 @@ void fetch_inferior_registers (int regno) { +#if defined(RTEMS) && !defined(USE_PROC_FS) + extern void rtems_fetch_inferior_registers(); + rtems_fetch_inferior_registers (-1); +#else + if (regno >= 0) { fetch_register (regno); @@ -411,6 +427,7 @@ fetch_register (regno); } } +#endif } /* Store one register. */ @@ -465,6 +482,12 @@ void store_inferior_registers (int regno) { +#if defined(RTEMS) && !defined(USE_PROC_FS) + extern void rtems_store_inferior_registers(); + + rtems_store_inferior_registers (-1); +#else + if (regno >= 0) { store_register (regno); @@ -476,6 +499,7 @@ store_register (regno); } } +#endif } #endif /* !defined (FETCH_INFERIOR_REGISTERS). */ diff -Naur gdb-5.2-PLUS_CG/gdb/infrun.c gdb-5.2-PLUS_RDBG/gdb/infrun.c --- gdb-5.2-PLUS_CG/gdb/infrun.c Mon Jun 10 15:32:05 2002 +++ gdb-5.2-PLUS_RDBG/gdb/infrun.c Wed Jun 12 11:15:10 2002 @@ -1455,9 +1455,14 @@ ecs->new_thread_event = (! ptid_equal (ecs->ptid, inferior_ptid) && ! in_thread_list (ecs->ptid)); +#ifdef RTEMS + if (!ptid_equal(ecs->ptid, minus_one_ptid) + && ecs->new_thread_event) +#else if (ecs->ws.kind != TARGET_WAITKIND_EXITED && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED && ecs->new_thread_event) +#endif { add_thread (ecs->ptid); @@ -2358,6 +2363,13 @@ remove_breakpoints (); } breakpoints_inserted = 0; +#ifdef GDB_BUG_FIX + if (step_resume_breakpoint) + { + delete_breakpoint (step_resume_breakpoint); + step_resume_breakpoint = NULL; + } +#endif ecs->another_trap = 1; /* Still need to check other stuff, at least the case where we are stepping and step out of the right range. */ diff -Naur gdb-5.2-PLUS_CG/gdb/printcmd.c gdb-5.2-PLUS_RDBG/gdb/printcmd.c --- gdb-5.2-PLUS_CG/gdb/printcmd.c Mon Jun 10 15:32:05 2002 +++ gdb-5.2-PLUS_RDBG/gdb/printcmd.c Wed Jun 12 11:15:15 2002 @@ -162,7 +162,12 @@ static void inspect_command (char *, int); -static void print_command (char *, int); +#ifdef RTEMS +void +#else +static void +#endif +print_command (char *, int); static void print_command_1 (char *, int, int); @@ -982,7 +987,11 @@ } /* ARGSUSED */ -static void +#ifdef RTEMS +void +#else +static void +#endif print_command (char *exp, int from_tty) { print_command_1 (exp, 0, 1); diff -Naur gdb-5.2-PLUS_CG/gdb/remote-rte.c gdb-5.2-PLUS_RDBG/gdb/remote-rte.c --- gdb-5.2-PLUS_CG/gdb/remote-rte.c Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/remote-rte.c Wed Jun 12 11:17:56 2002 @@ -0,0 +1,2071 @@ +/* + ************************************************************************** + * + * Component = GDB + * Module = gdb/remote-rte.c + * + * Synopsis = contains remote debugging code for gdb. + * + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + ************************************************************************** + */ + +/* remote debugging over Sun's RPC, for GDB. + Copyright (C) 1990-1991 Free Software Foundation, Inc. + Contributed by Wind River Systems and Cygnus Support. + +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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + + /* Tracing options to be uncommented (or defined in Makefile): + TRACE_PTRACE - trace all ptrace (2) calls (args and result). + This flag must also be set in infptrace.c + DEBUG_REGS - trace get/set registers + DEBUG_WAIT - trace remote wait (2) + DEBUG_EXEC - trace exec (2) creating debuggee. */ + +#define TRACE_PTRACE +#define DEBUG_REGS +/* #define DEBUG_WAIT xxx */ +/* #define DEBUG_EXEC xxx */ + +#include +#include "defs.h" +#include "frame.h" +#include "inferior.h" +#include "wait.h" +#include "target.h" +#include "gdbcore.h" +#include "command.h" +#include "symtab.h" +#include "complaints.h" /* for struct complaint */ +#include "gdbcmd.h" +#include "bfd.h" +#include "netdb.h" /* MAXHOSTNAMELEN and something else */ +#include /* MAXHOSTNAMELEN */ +#include +#include +#include +#include + +#ifdef __linux__ +#include +#include +#include +#define HAVE_POSIX_SIGNALS +#define FREE(ptr, len) free(ptr) +#else +#include +#include +#define FREE(ptr, len) free(ptr) +#define HAVE_POSIX_SIGNALS +#endif + +#include +#include + +#if defined(__SunOS_5_5) && defined(__STDC__) +#undef __STDC__ +#include +#define __STDC__ 1 +#else +#include +#endif + +#ifdef UW_SV +#include +#undef HAVE_BSD_SIGNALS +#define HAVE_POSIX_SIGNALS +#define FREE(ptr, len) free(ptr) +#endif + +#define free bogon_free /* Sun claims "int free ()" not void */ +#include +#undef free +#include /* UTek's doesn't #incl this */ + +/* get rid of value.h if possible */ +#include +#include + +#define INITIAL_THREAD 32000 +int original_pid = 0; + +#include "thread_rte.h" /* thread.h includes osRemDeb.h */ +#include "rtems/servcmd.h" +# define PM_BUG + +#define SWAP_TARGET_AND_HOST(buffer,len) \ + do \ + { \ + if (TARGET_BYTE_ORDER != HOST_BYTE_ORDER) \ + { \ + char tmp; \ + char *p = (char *)(buffer); \ + char *q = ((char *)(buffer)) + len - 1; \ + for (; p < q; p++, q--) \ + { \ + tmp = *q; \ + *q = *p; \ + *p = tmp; \ + } \ + } \ + } \ + while (0) + +/* Port where GDB receives back messages from rdb server */ +struct sockaddr_in backPort; +int backSock; + +#if !defined (PT_KILL) +#define PT_KILL 8 +#define PT_STEP 9 +#define PT_CONTINUE 7 +#define PT_READ_U 3 +#define PT_WRITE_U 6 +#define PT_READ_I 1 +#define PT_READ_D 2 +#define PT_WRITE_I 4 +#define PT_WRITE_D 5 +#endif /* No PT_KILL. */ + + +/* + These macros, except SIGNALS_BLOCK_MASK, + were lifted from readline/rldefs.h ! + + Define some macros for dealing with assorted signalling disciplines. + + These macros provide a way to use signal blocking and disabling + without smothering your code in a pile of #ifdef's. + + SIGNALS_UNBLOCK; Stop blocking all signals. + + { + SIGNALS_DECLARE_SAVED (name); Declare a variable to save the + signal blocking state. + ... + SIGNALS_BLOCK (SIGSTOP, name); Block a signal, and save the previous + state for restoration later. + ... + SIGNALS_BLOCK_MASK (name); Block signals described by the named + mask. + ... + SIGNALS_RESTORE (name); Restore previous signals. + } + +*/ + +#ifdef HAVE_POSIX_SIGNALS + +#define SIGNALS_UNBLOCK \ + do { sigset_t set; \ + sigemptyset (&set); \ + sigprocmask (SIG_SETMASK, &set, (sigset_t *)NULL); \ + } while (0) + +#define SIGNALS_DECLARE_SAVED(name) sigset_t name + +#define SIGNALS_BLOCK(SIG, saved) \ + do { sigset_t set; \ + sigemptyset (&set); \ + sigaddset (&set, SIG); \ + sigprocmask (SIG_BLOCK, &set, &saved); \ + } while (0) + +#define SIGNALS_BLOCK_MASK(name) \ + sigprocmask (SIG_BLOCK, &name, (sigset_t *)NULL) + +#define SIGNALS_RESTORE(saved) \ + sigprocmask (SIG_SETMASK, &saved, (sigset_t *)NULL) + + +#else /* HAVE_POSIX_SIGNALS */ +#ifdef HAVE_BSD_SIGNALS + /* BSD signals */ + +#define SIGNALS_UNBLOCK sigsetmask (0) +#define SIGNALS_DECLARE_SAVED(name) int name +#define SIGNALS_BLOCK(SIG, saved) saved = sigblock (sigmask (SIG)) +#define SIGNALS_BLOCK_MASK(name) sigblock (name) +#define SIGNALS_RESTORE(saved) sigsetmask (saved) + + +#else /* HAVE_BSD_SIGNALS */ + /* None of the Above */ + +#define SIGNALS_UNBLOCK /* nothing */ +#define SIGNALS_DECLARE_SAVED(name) int name +#define SIGNALS_BLOCK(SIG, saved) /* nothing */ +#define SIGNALS_BLOCK_MASK(name) /* nothing */ +#define SIGNALS_RESTORE(saved) /* nothing */ + + +#endif /* HAVE_BSD_SIGNALS */ +#endif /* HAVE_POSIX_SIGNALS */ + + + /* Pointer to current ptrace function: + - call_ptrace for local debugging. + - remote_ptrace for remote debugging (Sun RPC to RGDB). */ +extern int call_ptrace (); +int (*current_ptrace_function) () = call_ptrace; +/* quit_flag, immediate_quit, quit are needed to manage DEL */ +extern int quit_flag, immediate_quit; +extern void quit(); +rpc_type cur_rpc_type = BADRPCTYPE; /* valid type = SUNRPC*/ +static int catch_sig_int(); +static int restore_sig_int(); +static int rpc_call_gen(); + +static char debugHost[MAXHOSTNAMELEN+1]; +int real_quit = 0; +int target_has_fp =0; +struct target_ops remote_run_ops; +struct target_ops saved_target; +extern struct target_ops dummy_target; +extern char* inferior_thisrun_terminal; +#ifndef MODIF42VERS45 +#define sections to_sections +#define sections_end to_sections_end +#endif +char rootpath_to_sub[MAXPATHLEN]={'\0'}; +char newrootpath[MAXPATHLEN]={'\0'}; + +char *stored_exec_file = (char*) 0; +int actor_debugging = 0; +enum daemontype { + RDBG = 1, + NEXT +}; +typedef enum daemontype daemontype; +daemontype remote_daemon_type = NEXT; +int userActor = 1; + +/* new ptrace service (PTRACE_(S/G)ETTHREADREGS) have + * been defined in mix3.2 r4.0. Now PTRACE_(S/G)ETREGS always + * apply on the current thread as in sunOS. + */ +int target_can_always_use_gdb_tty = 0; +int remote_sys_can_debug_thread = 0; +int remote_debug_in_progress = 0; + +/* + * generic function used for child manipulation + * we can re-use for host-target debugging. + */ +int pending_execs = +#if defined(START_INFERIOR_TRAPS_EXPECTED) + START_INFERIOR_TRAPS_EXPECTED; +#else + 2; +#endif + +#ifndef PT_ATTACH +#define PT_ATTACH PTRACE_ATTACH +#endif +#ifndef PT_DETACH +#define PT_DETACH PTRACE_DETACH +#endif + +int +isSystemDebug() +{ + return (remote_daemon_type == RDBG) ? 1 : 0; +} + +int +close_connexion () +{ + enum clnt_stat status; + close_in closeIn; + closeIn.control = CLOSE_DETACH; + status = rpc_call_gen (CLOSE_CONNEX, xdr_close_in, &closeIn, xdr_void, 0); + return 1; +} + +static const char rpcerr[] = "network target debugging: rpc error"; +CLIENT *pClient; /* client used in net debugging */ +static int ptraceSock = RPC_ANYSOCK; +static struct timeval rpcTimeout = { 300, 0 }; +static struct timeval closeConnexTimeout = { 1, 0 }; + +static int +sun_rpc_connect(hostname, remdebtype) +char *hostname; +int remdebtype; +{ + open_out openOut; + open_in openIn; + struct sockaddr_in destAddr; + struct hostent *destHost; + enum clnt_stat rpc_status; + struct timeval wait; + char* user = "GDB"; + switch (remdebtype) { + case RDBG: + break; + default : + error("use setdaemon rdbg command\n"); + break; + } + + /* get the internet address for the given host */ + + if ((destHost = (struct hostent *) gethostbyname (hostname)) == NULL) + error ("Invalid hostname. Couldn't find remote host address."); + + bzero (&destAddr, sizeof (destAddr)); + + destAddr.sin_addr.s_addr = * ((u_long *) (destHost->h_addr)); + destAddr.sin_family = AF_INET; + + destAddr.sin_port = htons(RTEMS_PORT); + + ptraceSock = RPC_ANYSOCK; + + /* Create a tcp client transport on which to issue + calls to the remote server. */ + + wait.tv_sec = 1; + wait.tv_usec = 0; + pClient = clntudp_create (&destAddr, REMOTEDEB, REMOTEVERS, wait, + &ptraceSock); + if (pClient == NULL) + { + clnt_pcreateerror ("\trpc_connect"); + error ("Couldn't connect to remote target."); + return 0; + } + + memcpy(openIn.back_port, &backPort, sizeof(backPort)); + openIn.debug_type = DEBTYP_KERNEL; + + openIn.flags = DEBUGGER_IS_GDB; + bzero(openIn.destination, 16); + openIn.user_name = user; + + rpc_status = rpc_call_gen(OPEN_CONNEX, xdr_open_in, &openIn, xdr_open_out, + &openOut); + if (rpc_status != RPC_SUCCESS || openOut.port == -1) { + return 0; + } + + return 1; + +} + +void +setsubstitutepath (arg1, fromtty) + char *arg1; + int fromtty; +{ + char *first; + char *second; + int offset; + char *loc_args; + char *null = " "; + + bzero(rootpath_to_sub, sizeof(rootpath_to_sub)); + bzero(newrootpath, sizeof(newrootpath)); + + loc_args = strtok(arg1, "\0"); + if (loc_args == NULL) { + printf("Error. Syntax is : setsubstitutepath [new-path]\n"); + } else { + first = strstr(arg1, " "); + if (first == NULL) { + strcpy(rootpath_to_sub, arg1); + strcpy(newrootpath, "/"); + } else { + offset = first - arg1; + strncpy(rootpath_to_sub, arg1, offset); + second = arg1 + offset; + while (*second == *null) *second++; + strcpy(newrootpath, second); + if (strlen(newrootpath) == 0) strcpy(newrootpath, "/"); + } + } +} + +void +setrpcmode (args, fromtty) + char *args; + int fromtty; +{ + char *loc_args; + + loc_args = strtok (args, " \t"); + if (loc_args) { + if (!strcmp(args, "sun")) { + cur_rpc_type = SUNRPC; + } + return; + } + printf("Error. Syntax is : setrpcmode sun\n"); + return; +} + +void +setdaemontype (args, fromtty) + char *args; + int fromtty; +{ + char *loc_args; + + loc_args = strtok (args, " \t"); + if (loc_args) { + if (!strcmp(args, "rdbg")) { + remote_daemon_type = RDBG; + return; + } + } + printf("Error. Syntax is : setdaemontype rdbg\n"); +} + +static int +rpc_connect_gen(hostname, remdebtype) +char *hostname; +daemontype remdebtype; +{ + int resu = 0; + switch(cur_rpc_type) { + case SUNRPC : { + resu = sun_rpc_connect(hostname, remdebtype); + break; + } + default : { + printf("\tUnknown rpc protocol\n"); + printf("\tuse setrpcmode sun to specify rpc type\n"); + } + } + return resu; +} + +static void +sun_rpc_disconnect() +{ + if (pClient) { + close_connexion(); + } + pClient = 0; + close(backSock); + memset(&backPort, 0, sizeof(backPort)); +} + +static void +rpc_disconnect_gen() +{ + switch(cur_rpc_type) { + case SUNRPC : { + sun_rpc_disconnect(); + break; + } + default : { + printf("unknown rpc type\n"); + } + } +} + +/* These defs should come from "rkdb/include/servrpc.h" */ +#define BACK_MSG_WARM 1 +#define BACK_MSG_WAIT 2 +#define BACK_MSG_KILL 6 + +#define BACK_MSG_INVALID 255 + +struct UDP_MSG current_back_msg= {255, 0, 0, 0, 0}; +SIGNALS_DECLARE_SAVED(signalMask); + +static fd_set backfd; + +int recvBackMsg() +{ + + struct UDP_MSG msg; + int ret; + int len = sizeof(backPort); + wait_out waitOut; + wait_in remote_pid; + + ret = recvfrom(backSock, &msg, sizeof(current_back_msg), 0, + (struct sockaddr*) &backPort, &len); + if (ret < 0) { + return -1; + /* error return */ + } + + if (current_back_msg.msg_num == msg.msg_num) { + return -1; + } else { + current_back_msg.msg_num = msg.msg_num; + } + + switch(msg.type) { + + /* Server warm test: we must respond by doing a dummy wait */ + case BACK_MSG_WARM: { + remote_pid.pid = 0; + rpc_call_gen (WAIT_INFO, xdr_wait_in, &remote_pid, + xdr_wait_out, &waitOut); + return -1; + } + + /* Managed by remote_wait */ + case BACK_MSG_KILL: { + current_back_msg.type = BACK_MSG_KILL; + return 0; + } + + /* Managed by remote_wait */ + case BACK_MSG_WAIT: { + current_back_msg.type = BACK_MSG_WAIT; + return 0; + } + + default: { + return -1; + } + } +} + + +void sigIoHdl(sig) + int sig; +{ + int ret; + struct timeval wait; + + wait.tv_sec = 0; + wait.tv_usec = 0; + FD_ZERO(&backfd); + FD_SET(backSock, &backfd); + ret = select(backSock+1, &backfd, NULL, NULL, &wait); + + if (ret > 0) { + recvBackMsg(); + } + + signal(SIGIO, sigIoHdl); +} + +int +createBackPort() +{ + int ret, pgid, len; + + backSock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if (backSock < 0) { + printf("createBackPort error (%d)\n", errno); + return 0; + } + backPort.sin_family = AF_INET; + backPort.sin_addr.s_addr = INADDR_ANY; + backPort.sin_port = 0; + + if (bind(backSock, (struct sockaddr*) &backPort, sizeof(backPort))<0) { + printf("Error binding back port %d\n", errno); + return 0; + } + + len = sizeof(backPort); + if (getsockname(backSock, (struct sockaddr*) &backPort, &len) == -1) { + printf("createBackPort: bad name for socket %d\n", errno); + return 0; + } + + /* + * Target expects sin_family to be in net format. + * Notice that this field is initialized by getsockname. + */ + backPort.sin_family = htons(backPort.sin_family); + + pgid = 1; + ret = ioctl(backSock, FIOASYNC, &pgid); +#if defined(__linux__) || defined(UX_SV) || defined(SCO_SV) + pgid = getpgrp(); +#else + pgid = getpgrp(0); +#endif + ret = ioctl(backSock, SIOCSPGRP, &pgid); + FD_ZERO(&backfd); + FD_SET(backSock, &backfd); + current_back_msg.type = BACK_MSG_INVALID; + + signal(SIGIO, sigIoHdl); + + if (ret < 0) { + return 0; + } + return 1; +} + + +/* Establish an RPC connection with the target system. + Calls error () if unable to establish connection. */ + +static int +rpc_connect (args) + char *args; +{ + char *loc_args; + char targetname[MAXHOSTNAMELEN+1]; + int resu = 0; + static char errorMsg[] = "syntax is: \"target rtems machine\""; + + loc_args = strtok (args, " \t"); + if (!loc_args) { + error(errorMsg); + return 0; + } + + actor_debugging = 1; + + strcpy(targetname, loc_args); + /* check wheter we want to debug actors or processes */ + + loc_args = strtok (NULL, " \t"); + if (loc_args) + error(errorMsg); + + strcpy(debugHost,targetname); + createBackPort(targetname); + resu = rpc_connect_gen(targetname, remote_daemon_type); + return resu; +} + +/* Make an RPC call to the target. + Returns RPC status. */ + +static enum clnt_stat +sun_rpc_call (procNum, inProc, in, outProc, out) + enum ptracereq procNum; + xdrproc_t inProc; + char *in; + xdrproc_t outProc; + char *out; +{ + + enum clnt_stat status = RPC_CANTSEND; + + SIGNALS_DECLARE_SAVED(sigMask); + + CLIENT *receiver; /* provison for remote signal handling */ + struct timeval wait_delay; + + if (pClient != NULL) { + +make_rpc : + switch(procNum) { + + case CLOSE_CONNEX : { + wait_delay = closeConnexTimeout; + receiver = pClient; + break; + } + + default : { + wait_delay = rpcTimeout; + receiver = pClient; + break; + } + } + + + SIGNALS_BLOCK(SIGIO, sigMask); + + status = clnt_call (receiver, procNum, inProc, in, outProc, + out, wait_delay); + + SIGNALS_RESTORE(sigMask); + + if (status != RPC_SUCCESS) { + if (procNum != CLOSE_CONNEX) { + if (status == RPC_TIMEDOUT) { + if (procNum == WAIT_INFO) { + /* wait is the only blocking call. That why it needs + * a special test here (e.g the remote program loops!!! + */ + if (query("RPC CALL TIMED OUT. Do you want to restart ?")) { + goto make_rpc ; + } + else { + if (query("Do you want to go to gdb command level\ + (else the current call\nwill exist with -1 as return value) ? ")) { + error("remote wait fails due to time-out\n"); + } + clnt_perrno(status); + return -1; + } + } + } + } + clnt_perrno(status); + return -1; + } + } + else { + perror ("rpc_call: pClient = NULL. Did you do a \"target rtems\" ?"); + status = -1; + } + + return status; +} + +static int +rpc_call_gen(procNum, inProc, in, outProc, out) + enum ptracereq procNum; + xdrproc_t inProc; + char *in; + xdrproc_t outProc; + char *out; +{ + int resu = -1; + switch(cur_rpc_type) { + case SUNRPC : { + resu = sun_rpc_call(procNum, inProc, in, outProc, out); + break; + } + default : { + printf("unknown rpc type\n"); + } + } + return resu; +} + +/* remote function implemented on top of RPC */ + +void +remote_read_registers () +{ + + struct xdr_regs inferior_registers; +#ifdef FP_SUPPORT + struct xdr_fp_status inferior_fp_registers; +#endif + int threadid=100000; + + registers_fetched (); + errno = 0; + + threadid=GET_CURRENT_THREAD_ID (); + remote_ptrace (RPT_GETTHREADREGS, original_pid, &inferior_registers, + inferior_pid); + + if (errno) + error("Unable to get register values for current thread %d\n", errno); + +#ifdef FP_SUPPORT + remote_ptrace (RPT_GETFPREGS, original_pid, &inferior_fp_registers, + threadid); +#endif + put_registers_in_gdb_order (&inferior_registers); +#ifdef FP_SUPPORT + put_fp_registers_in_gdb_order (&inferior_fp_registers); +#endif + +} + + +/* Store our register values back into the inferior. + If REGNO is -1, do this for all registers. + Otherwise, REGNO specifies which register (so we can save time). */ + +void +remote_write_registers (regno) + int regno; +{ + + struct xdr_regs inferior_registers; +#ifdef FP_SUPPORT + struct xdr_fp_status inferior_fp_registers; +#endif + + int threadid = 100000; + + put_registers_in_frame_order (&inferior_registers); +#if FP_SUPPORT + put_fp_registers_in_frame_order (&inferior_fp_registers); +#endif + errno = 0; + + threadid=GET_CURRENT_THREAD_ID (); + + remote_ptrace (RPT_SETTHREADREGS, original_pid, &inferior_registers, + inferior_pid); + if (errno) + error("Unable to set remote registers for current thread\n"); + +#if FP_SUPPORT + remote_ptrace (RPT_SETFPREGS, original_pid, &inferior_fp_registers, + threadid); +#endif + put_registers_in_gdb_order (&inferior_registers); +} + + +static char** parse_args (); +static char *skip_white_space (); +static char *find_white_space (); +extern int breakpoints_failed, breakpoints_inserted; + + +/* Start an inferior process and sets inferior_pid to its pid. + EXEC_FILE is the file to run. + ALLARGS is a string containing the arguments to the program. + ENV is the environment vector to pass. + Returns process id. Errors reported with error (). */ + +#ifndef SHELL_FILE +#define SHELL_FILE "/bin/sh" +#endif + +void +resetExecPath(path) + char *path; +{ + char tmppath[MAXPATHLEN]; + char *ep; + + if (newrootpath[0] == '\0') + return; + if (strncmp(rootpath_to_sub, path, + strlen(rootpath_to_sub)) != 0) { + printf("something wrong in path substitution\n"); + return ; + } + strcpy(tmppath, newrootpath); + + ep = tmppath + strlen(tmppath) -1; + if (*ep != '/') { + strcat(tmppath, "/"); + } + + strcat(tmppath, path + strlen(rootpath_to_sub) +1); + strcpy(path, tmppath); +} + +/* Fill ARGSTRUCT in argc/argv form with the arguments from the + argument string ARGSTRING. */ +static char** +parse_args (arg_string) + register char *arg_string; +{ + register int arg_count = 0; /* number of arguments */ + register int arg_index = 0; + register char *p0; + char** res; + + /* first count how many arguments there are */ + + p0 = arg_string; + while (*p0 != '\0') + { + if (*(p0 = skip_white_space (p0)) == '\0') + break; + p0 = find_white_space (p0); + arg_count++; + } + res = (char **) malloc ((arg_count + 1) * sizeof (char *)); + + /* now copy argument strings into arg_struct. */ + + while (*(arg_string = skip_white_space (arg_string))) + { + p0 = find_white_space (arg_string); + res[arg_index++] = savestring (arg_string, p0 - arg_string); + arg_string = p0; + } + + res[arg_count] = NULL; + return res; +} + +/* Advance a string pointer across whitespace and return a pointer + to the first non-white character. */ + +static char * +skip_white_space (p) + register char *p; +{ + while (*p == ' ' || *p == '\t') + p++; + return p; +} + +/* Search for the first unquoted whitespace character in a string. + Returns a pointer to the character, or to the null terminator + if no whitespace is found. */ + +static char * +find_white_space (p) + register char *p; +{ + register int c; + + while ((c = *p) != ' ' && c != '\t' && c) + { + if (c == '\'' || c == '"') + { + while (*++p != c && *p) + { + if (*p == '\\') + p++; + } + if (!*p) + break; + } + p++; + } + return p; +} + +static int memory_breakpoint_size = sizeof(unsigned char); +int +remote_insert_breakpoint(addr, contents_cache) + CORE_ADDR addr; + char *contents_cache; +{ + int val; + xdr_break breakReq; + + val = remote_xfer_memory(addr, contents_cache, memory_breakpoint_size, 0); + if (val == 0) return 0; + + memset(&breakReq, 0, sizeof(xdr_break)); + breakReq.type = BRKT_INSTR; + breakReq.thread_spec = 0; + breakReq.handle = 0; + breakReq.ee_loc = addr; + + /* return value is the handle for this bkpt in RDBG */ + val = remote_ptrace(RPT_SETBREAK, original_pid, &breakReq, 0); + + if (val < 0) return -1; + return 0; +} + +int +remote_remove_breakpoint(addr, contents_cache) + CORE_ADDR addr; + char *contents_cache; +{ + int val; + + val = remote_ptrace(RPT_CLRBREAK, original_pid, addr, 0); + + if (val < 0) return val; + return 0; +} + +/* Copy LEN bytes to or from remote inferior's memory starting at MEMADDR + to debugger memory starting at MYADDR. WRITE is true if writing to the + inferior. + Result is the number of bytes written or read (zero if error). */ + +void patch_target(); +void restore_target(); + +int +remote_xfer_memory (memaddr, myaddr, len, write, target) + CORE_ADDR memaddr; + char *myaddr; + int len; + int write; + struct target_ops *target; /* ignored */ +{ + + extern struct target_ops exec_ops; + int ret; + struct target_ops *tmpTarget = &exec_ops; + int execRestored = 0; + + register int i; + /* Round starting address down to longword boundary. */ + register CORE_ADDR addr = memaddr & - sizeof (int); + /* Round ending address up; get number of longwords that makes. */ + register int count + = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int); + /* Allocate buffer of that many longwords. */ + register int *buffer = (int *) alloca (count * sizeof (int)); + /* first access real length */ + int reallen = memaddr - addr; + +#ifdef DEBUG_XFER + { + printf("myaddr = %x, memaddr = %x, addr = %x, len = %d, count = %d, memaddr & (sizeof (int) - 1) = %x\n", + myaddr, memaddr, addr, len, count, (memaddr & (sizeof (int) - 1))); + } +#endif + if (!target_has_execution) { + + if ( (tmpTarget->sections == NULL) && ( tmpTarget->sections_end == NULL)) { + restore_target(tmpTarget); + execRestored = 1; + } + ret = xfer_memory(memaddr, myaddr, len, write, tmpTarget); + if (execRestored) { + patch_target (tmpTarget); + restore_bfd(); + } + return ret; + } + + if (write) + { +#ifdef DEBUG_XFER + { + unsigned char *ptc = (unsigned char *) myaddr; + int i; + + printf("content of buffer to be writen to the target:\n"); + for (i = 0; i < len; i++) + { + printf(" addr = %x contains %x\n", ptc, (unsigned int) *ptc); + ptc++; + } + } +#endif + /* Fill start and end extra bytes of buffer with existing memory data. */ + + if (addr != memaddr || len < (int)sizeof (int)) { + /* Need part of initial word -- fetch it. */ + buffer[0] = remote_ptrace (PT_READ_I, original_pid, (int *)addr, 0); + SWAP_TARGET_AND_HOST(buffer, sizeof(int)); + } + + if (count > 1) /* FIXME, avoid if even boundary */ + { + buffer[count - 1] + = remote_ptrace (PT_READ_I, original_pid, + (int *)(addr + (count - 1) * sizeof (int)), 0); + SWAP_TARGET_AND_HOST(&buffer[count -1], sizeof(int)); + + } + + /* Copy data to be written over corresponding part of buffer */ + bcopy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len); + /* Write the entire buffer. */ + + for (i = 0; i < count; i++, addr += sizeof (int), reallen += sizeof (int)) + { + errno = 0; +#ifndef PM_BUG + remote_ptrace (PT_WRITE_D, original_pid, (int *)addr, buffer[i]); + if (errno) + { + /* Using the appropriate one (I or D) is necessary for + Gould NP1, at least. */ + errno = 0; +#endif + SWAP_TARGET_AND_HOST(&buffer[i], sizeof(int)); + remote_ptrace (PT_WRITE_I, original_pid, (int *)addr, buffer[i]); +#ifndef PM_BUG + } +#endif + if (errno) + return reallen; + } + } + else + { + /* Read all the longwords */ + for (i = 0; i < count; i++, addr += sizeof (int), reallen += sizeof (int)) + { + errno = 0; + buffer[i] = remote_ptrace (PT_READ_I, original_pid, (int *)addr, 0); + SWAP_TARGET_AND_HOST(&buffer[i], sizeof(int)); + if (errno) + break; + QUIT; + } + if (reallen < len) + len = reallen; +#ifdef DEBUG_XFER + { + unsigned char *ptc = (unsigned char*) buffer; + int i; + + printf("content of buffer got from the target:\n"); + for (i = 0; i < len; i++) + { + printf(" addr = %x contains %x\n", ptc, (unsigned int) *ptc); + ptc++; + } + } +#endif + /* Copy appropriate bytes out of the buffer. */ + bcopy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len); + } + return len; +} + + +void +remote_run_files_info () +{ + if (target_has_execution) + { + printf ("\tRunning process %s", local_hex_string (original_pid)); + printf (".\n"); + } + else + { + printf ("No process debugged so far\n"); + } +} + + +/* Resume execution of the inferior process. + If STEP is nonzero, single-step it. + If SIGNAL is nonzero, give it that signal. */ + +void +remote_resume (pid, step, signal) + int pid; + int step; + enum target_signal signal; +{ + errno = 0; + +/* An address of (int *)1 tells ptrace to continue from where it was. + (If GDB wanted it to start some other way, we have already written + a new PC value to the child.) */ + + if (step) + { + remote_ptrace (RPT_SINGLESTEP, original_pid, (int *)1, + target_signal_to_host(signal)); + } + else + { + + remote_ptrace (RPT_CONT, original_pid, (int *)1, + target_signal_to_host(signal)); + } + + if (errno) + perror_with_name ("ptrace"); +} + + +void +remote_mourn_inferior () +{ + close_connexion(); + unpush_target (&remote_run_ops); + generic_mourn_inferior (); +} + +/* Emulate ptrace using RPC calls to the target system. + * Returns nonzero (-1) if RPC status to target is bad, 0 otherwise. + */ + +int /* this function must be exported for thread.c module */ +remote_ptrace (request, pid, addr, data) + enum ptracereq request; + int pid; + caddr_t addr; + int data; +{ + + ptrace_in ptraceIn; + ptrace_out ptraceOut; + enum clnt_stat status; + + bzero ((char *) &ptraceIn, sizeof (ptraceIn)); + bzero ((char *) &ptraceOut, sizeof (ptraceOut)); + + ptraceIn.pid = pid; + ptraceIn.data = data; + ptraceIn.addr.req = request; + switch (request) { + case RPT_SETREGS : + case RPT_SETTHREADREGS : + bcopy (addr, (caddr_t) &(ptraceIn.addr.ptrace_addr_data_in_u.regs), + sizeof (xdr_regs)); + break; +#if defined TARGET_m68k && defined FP_SUPPORT + case RPT_SETFPREGS : + bcopy (addr, (caddr_t) &(ptraceIn.addr.ptrace_addr_data_in_u.fpregs), + sizeof (xdr_fp_status)); + break; +#endif /* TARGET_m68k */ + case RPT_SETTHREADNAME : + ptraceIn.addr.ptrace_addr_data_in_u.name = addr; + break; + case RPT_SETBREAK: + bcopy(addr, + (caddr_t)&(ptraceIn.addr.ptrace_addr_data_in_u.breakp), + sizeof (xdr_break)); + break; + default : + ptraceIn.addr.ptrace_addr_data_in_u.address = (u_int) addr; + break; + } + + status = rpc_call_gen (PTRACE, xdr_ptrace_in, &ptraceIn, xdr_ptrace_out, + &ptraceOut); + + if (status != RPC_SUCCESS) { + return -1; + } + + switch (ptraceOut.addr.req) { + + case RPT_GETREGS : + case RPT_GETTHREADREGS : + bcopy ((caddr_t) &(ptraceOut.addr.ptrace_addr_data_out_u.regs), addr, + sizeof (xdr_regs)); + break; +#if defined TARGET_m68k && defined FP_SUPPORT + case RPT_GETFPREGS : + bcopy ((caddr_t) &(ptraceOut.addr.ptrace_addr_data_out_u.fpregs), addr, + sizeof (xdr_fp_status)); + break; +#endif /* TARGET_m68k */ + case RPT_GETTHREADNAME : + strcpy (addr, ptraceOut.addr.ptrace_addr_data_out_u.name); + break; + case RPT_THREADLIST : + bcopy ((caddr_t) (ptraceOut.addr.ptrace_addr_data_out_u.threads.threads), + addr, + ptraceOut.addr.ptrace_addr_data_out_u.threads.nbThread * sizeof (KernThread) + ); + break; + + } + +#ifdef TRACE_PTRACE + trace_ptrace (request, pid, addr, data, ptraceOut.result); +#endif + + errno = ptraceOut.errNo; + return ptraceOut.result; + +} + +struct complaint cant_contact_target = +{"Lost contact with RTEMS target", 0, 0}; + +/* Check to see if the target has a floating point coprocessor. + Returns 1 if target has floating point processor, 0 otherwise. + Calls error () if rpc fails. */ +int +rpc_check_for_fp() +{ + return 0; +} + +int +addressing_mode() +{ + printf("You can't do that without a system core dump.\n"); + return; +} + + +/* Sleep for the specified number of milliseconds + * (assumed to be less than 1000). + * If select () is interrupted, returns immediately; + * takes an error exit if select () fails for some other reason. + */ + +static void +sleep_ms (ms) + long ms; +{ + struct timeval select_timeout; + int status; + + select_timeout.tv_sec = 0; + select_timeout.tv_usec = ms * 1000; + + status = select (0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &select_timeout); + + if (status < 0 && errno != EINTR) + perror_with_name ("select"); +} + +/* Wait for control to return from inferior to debugger. + If inferior gets a signal, we may decide to start it up again + instead of returning. That is why there is a loop in this function. + When this function actually returns it means the inferior + should be left stopped and GDB should read more commands. */ + +static int +remote_wait (pid, ourstatus) + int pid; + struct target_waitstatus *ourstatus; +{ + wait_out waitOut; + enum clnt_stat rpc_status; + wait_in remote_pid; + int ret; + int currThdId = -1; + int rslt; + + SIGNALS_BLOCK(SIGIO, signalMask); + +make_select: + if (current_back_msg.type == BACK_MSG_INVALID) { + FD_ZERO(&backfd); + FD_SET(backSock, &backfd); + + ret = select(backSock+1, &backfd, NULL, NULL, NULL); + + switch (ret) { +#if 0 + // No time out on select, ctrl-c allow interuption ! + case 0: /* timed out */ + if (query("RPC CALL TIMED OUT. Do you want to restart ?")) { + goto make_select; + } else { + if (query("Do you want to go to gdb command level ?")) { + error("remote wait fails due to time-out\n"); + } + clnt_perrno(rpc_status); + SIGNALS_BLOCK_MASK(signalMask); + return -1; + } +#endif + case -1: + SIGNALS_RESTORE(signalMask); + + terminal_ours (); + if (query ("Interrupted: Disconnect from target_system ?")) + { + if (target_has_execution) { + /* stop the process and remove breakpoints */ + remote_ptrace (RPT_ATTACH, original_pid, 0, 0); + remove_breakpoints(); + if (attach_flag) target_detach(0, 0); + else target_kill (); + } + target_mourn_inferior (); + error ("Use the target command\n"); + } else { + target_terminal_inferior (); + goto make_select; + } + + default: + rslt = recvBackMsg(); + if (rslt < 0) goto make_select; + break; + } + } + + current_back_msg.type = BACK_MSG_INVALID; + SIGNALS_RESTORE(signalMask); + remote_pid.pid = original_pid; + rpc_status = rpc_call_gen (WAIT_INFO, xdr_wait_in, &remote_pid, + xdr_wait_out, &waitOut); + + if (rpc_status != RPC_SUCCESS) { + return -1; + } + if (waitOut.wait_return < 0) { + /* Wait on the target side signals an errors + Pass information to upper (generic) layer. */ +#ifdef DEBUG_WAIT + printf ("REMOTE_WAIT: error in wait: %d\n", res.wait_return); +#endif + } + else { + if (WIFEXITED (waitOut.status) || !(WIFSTOPPED (waitOut.status))) { +#ifdef DEBUG_WAIT + if (WIFEXITED (waitOut.status)) { + printf ("REMOTE_WAIT: debuggee made exit (%d)\n", + WEXITSTATUS (waitOut.status)); + } + else { + printf ("REMOTE_WAIT: debuggee terminated with signal %d\n", + WTERMSIG (waitOut.status)); + } +#endif + } + else { + update_thread_chain(); + currThdId = GET_CURRENT_THREAD_ID (); + if (inferior_pid == INITIAL_THREAD) { + inferior_pid = currThdId; + } + } + } + +inform_upper: + errno = waitOut.errNo; + + store_waitstatus (ourstatus, waitOut.status); + + registers_changed(); + return currThdId; +} + + + +static int +symbol_stub (arg) + char *arg; +{ + symbol_file_command (arg, 0); + return 1; +} + +static int +add_symbol_stub (arg) + char *arg; +{ +#if 0 + struct ldfile *pLoadFile = (struct ldfile *)arg; + + printf ("\t%s: ", pLoadFile->name); + symbol_file_add (pLoadFile->name, 0, pLoadFile->txt_addr, 0); +#endif + printf ("ok\n"); + return 1; +} +/* Target command for target systems. + + Take the name of a remote target machine + and connects to it to initialize remote network + debugging. */ + +int +rpc_attach (pid) + int pid; +{ + clear_thread_chain (); + errno = 0; + remote_ptrace (RPT_ATTACH, pid, 0, 0); + if (errno) + perror_with_name ("remote ptrace ATTACH"); + attach_flag = 1; + return pid; +} + +/* Stop debugging the process whose number is PID + and continue it with signal number SIGNAL. + SIGNAL = 0 means just continue it. */ + +void +rpc_detach (signal) + int signal; +{ + errno = 0; + + remote_ptrace (RPT_DETACH, original_pid, 1, signal); + if (errno) + perror_with_name ("ptrace"); + attach_flag = 0; +} + +/* Attach to process PID, then initialize for debugging it + and wait for the trace-trap that results from attaching. */ + +void +remote_attach (args, from_tty) + char *args; + int from_tty; +{ + char *exec_file; + int pid; + + dont_repeat (); + + if (!args) + error_no_arg ("process-id to attach"); + + pid = atoi (args); + + if (target_has_execution) + { + if (query ("A program is being debugged already. Kill it? ")) + target_kill (); + else + error ("Inferior not killed."); + } + + exec_file = (char *) get_exec_file (1); + + if (from_tty) + { + printf ("Attaching program: %s pid %d\n", exec_file, pid); + fflush (stdout); + } + + rpc_attach (pid); + init_thread_list(); + original_pid = pid; + inferior_pid = INITIAL_THREAD; + mark_breakpoints_out (); + target_terminal_init (); + target_has_execution = 1; + target_has_stack = 1; + target_has_registers = 1; + target_has_all_memory= 1; + +} + + + +/* + * remote_detach () + * takes a program previously attached to and detaches it. + * The program resumes execution and will no longer stop + * on signals, etc. We better not have left any breakpoints + * in the program or it'll die when it hits one. For this + * to work, it may be necessary for the process to have been + * previously attached. It *might* work if the program was + * started via the normal ptrace (PTRACE_TRACEME). + */ + +static void +remote_detach (args, from_tty) + char *args; + int from_tty; +{ + int siggnal = 0; + + if (from_tty) + { + char *exec_file = get_exec_file (0); + if (exec_file == 0) + exec_file = ""; + printf ("Detaching program: %s pid %d\n", exec_file, original_pid); + fflush (stdout); + } + if (args) + siggnal = atoi (args); + + rpc_detach (siggnal); + original_pid = 0; + inferior_pid = 0; + remote_mourn_inferior(); +} + +int +remote_kill_inferior_force() +{ + signal_in in; + signal_out out; + enum clnt_stat status; + + in.pid = original_pid; + in.sig = SIGKILL; + + memset(&out, 0, sizeof(out)); + + status = rpc_call_gen (SEND_SIGNAL, xdr_signal_in, &in, xdr_signal_out, + &out); + + if (status != RPC_SUCCESS) return -1; + if ( out.errNo != 0) return -1; + return 0; +} + +void +remote_kill_inferior_fast () +{ + int resu; + struct target_waitstatus mystatus; + if (original_pid == 0) + return; + resu = remote_ptrace (RPT_KILL, original_pid, 0, 0); + if (resu == -1) { + + /* this may appens when a remote process loops. + * Something special must be done here because + * the remote thread involved in debug can be + * sleeping in wait system calls. Therefore we + * must call another thread to do the work. + * If this threads do the work correctly, the + * remote_wait system call should return indicating + * that inferior dies. + */ + if (remote_kill_inferior_force() == -1) { + original_pid = 0; + inferior_pid = 0; + /* avoid entering wait : it would be timed out */ + return; + } + } + remote_wait (-1, &mystatus); + original_pid = 0; + inferior_pid = 0; +} + + +void +remote_kill_inferior (args, from_tty) + char *args; + int from_tty; +{ + remote_kill_inferior_fast (); + target_mourn_inferior (); +} + + +bfd *saved_bdf; + +restore_bfd() +{ + extern bfd *exec_bfd; + if (saved_bdf) exec_bfd = saved_bdf; +} + +clear_bfd() +{ + extern bfd *exec_bfd; + + saved_bdf = exec_bfd; + exec_bfd = 0; +} + + +void +patch_target(target) + struct target_ops *target; +{ + extern struct target_ops exec_ops; + extern bfd *exec_bfd; + + if (!STREQ (target->to_shortname, "exec")) + return; + remote_run_ops.sections = target->sections; + remote_run_ops.sections_end = target->sections_end; + target->sections = NULL; + target->sections_end = NULL; + + exec_ops.sections = NULL; + exec_ops.sections_end = NULL; + + clear_bfd(); +} + + +void +restore_target(target) +struct target_ops *target; +{ + extern struct target_ops exec_ops; + extern bfd *exec_bfd; + + if (!STREQ (target->to_shortname, "exec")) + return; + + target->sections = remote_run_ops.sections; + target->sections_end = remote_run_ops.sections_end ; + + exec_ops.sections = remote_run_ops.sections; + exec_ops.sections_end = remote_run_ops.sections_end ; + + restore_bfd(); +} + + + +/* TDB implemented */ +void +remote_convert_from_virtual () +{ + printf ("remote_convert_from_virtual called\n"); +} + + +void +remote_load_command () +{ + printf ("remote_load_command called\n"); +} + + +int +remote_lookup_symbol () +{ + printf ("remote_lookup_command called\n"); +} + + +struct value* +remote_call_function_by_hand () +{ + printf ("Remote_all_function_by_hand called\n"); +} + + +extern void host_convert_to_virtual(); + +void what_to_do_on_sigint(signo) +int signo; +{ + quit_flag = 1; + +#ifdef USG + /* Restore the signal handler. */ + signal (signo, what_to_do_on_sigint); +#endif + + if (immediate_quit) + quit (); + +} + + +static void (*what_was_done_on_sigint) (); + +static catch_sig_int() { + what_was_done_on_sigint = signal(SIGINT, what_to_do_on_sigint); +} + +static restore_sig_int() { + signal(SIGINT, what_was_done_on_sigint); +} + + +static void remote_patch_globals() +{ + /* Use from now on remote_ptrace () instead of ptrace (). */ + current_ptrace_function = remote_ptrace; + /* + * Determine the number of wait(2)'s to be issued by the debugger + * after having started the debuggee. + * Explanation: When a program is executed from GDB its main + * thread is started in single step mode. This means that the + * debuggee is stopped after its exec(2) before the first instruction + * of its code is executed and the wait(2) call invoked by the + * debugger returns, so that GDB can get control of the debuggee. + * Depending on the way the debuggee is started, there can be + * several intermediate exec(2)'s involved before the actual code to be + * debugged is running. E.g. in UNIX, debuggees are started via + * the sytem(3) facility, which implies two exec(2) calls, + * + * gdb -exec(2)-> sh -exec(2)-> debuggee's code + * + * In the above scenario the debugger has to wait for the + * second exec(2) (i.e. continue the debuggee after its first exec(2)) + * before doing it's regular work (e.g. localize the breakpoint). + * Note: Because of an idiosyncracy in UNIX, the debugger actually + * is nofified 2 times of the debuggee's stop after an + * exec(2) in single step mode. So the number of wait(2) + * calls to be issues has to be multiplied by two. This + * explains the setting: + * pending_execs = 4 + * below. + * + * In the ClassiX OS we don't use an intermediate exec(2) and + * don't have to take into account the above idiosyncracy. + * + * Note: The name pending_execs is chosen by GNU, so we don't + * change it to facilitate upgrades to future releases. + * Note however it could be missleading because it + * corresponds not always to reality. + */ + + if (actor_debugging) { + remote_sys_can_debug_thread = 1; + pending_execs = START_INFERIOR_TRAPS_EXPECTED; + } + else { +#if defined(MIX_V4_MULTI_THREAD) + /* MiX40 and MiX32 can debug threads */ + remote_sys_can_debug_thread = 1; + pending_execs = START_INFERIOR_TRAPS_EXPECTED; +#else + /* FIXME: set pending_execs && remote_sys_can_debug_thread + when supporting a new target */ + ; +#endif + } + remote_debug_in_progress = 1; + catch_sig_int(); +} + +static void remote_restore_globals() +{ + extern int pending_execs; + /* Use from ptrace (). */ + current_ptrace_function = call_ptrace; + /* change the number of trap expected when starting the child */ +#if defined(START_INFERIOR_TRAPS_EXPECTED) + pending_execs = START_INFERIOR_TRAPS_EXPECTED; +#else + pending_execs = 2; +#endif + remote_debug_in_progress = 0; + remote_sys_can_debug_thread = 0; + restore_sig_int(); +} + +static void +remote_open (args, from_tty) + char *args; + int from_tty; +{ + extern int close (); + char *bootFile; + extern char *source_path; + int i; + + if (STREQ (current_target.to_shortname, "rtems")) { + printf_filtered ("rtems target already selected\n"); + if (query("Do you want to re-open a connexion?")) { + pop_target(); + } + else + return; + } + + if (!args) + error_no_arg (""); + + target_preopen (from_tty); + + printf ("Attaching remote machine across net...\n"); + fflush (stdout); + + /* Allow the user to kill the connect attempt by typing ^C. + Wait until the call to target_has_fp () completes before + disallowing an immediate quit, since even if rpc_connect () + is successful, the remote debug server might be hung. */ + + immediate_quit++; + + if (rpc_connect (args)) + { + target_has_fp = rpc_check_for_fp (); + printf_filtered ("Connected to %s.\n", args); + immediate_quit--; + /* must to it so that close of current target + introduced by the push_target, will have + no effect */ + patch_target(¤t_target); + memcpy(&saved_target, ¤t_target, sizeof(struct target_ops)); + push_target (&remote_run_ops); + restore_bfd(); + remote_patch_globals(); + + printf_filtered ("Now the \"run\" command will start a remote process.\n"); + } + else + { + immediate_quit--; + error ("maybe you could try ping to see if machine is active"); + } +} + +/* Clean up before losing control. */ + +void +remote_close (quitting) + int quitting; +{ + if (target_has_execution) + { + inferior_pid = 0; + original_pid = 0; + target_has_execution = 0; + target_has_stack = 0; + target_has_registers = 0; + target_has_all_memory= 0; + } + + rpc_disconnect_gen(); + + { + printf("Warning: the next command will be done localy! If you want to\n"); + printf("restart another remote program, reuse the target command\n"); + + if (STREQ(saved_target.to_shortname, "exec")) + clear_bfd(); + + if (!STREQ(saved_target.to_shortname, "None")) + push_target (&saved_target); + restore_target(&saved_target); + + } + remote_restore_globals(); +} + +#ifdef TARGET_none_none +static void child_prepare_to_store(){} +static void wait_unix_start(){} +static trace_ptrace(){} +static int pending_execs; +#endif + +void +remote_prepare_to_store () +{ +#ifdef CHILD_PREPARE_TO_STORE + CHILD_PREPARE_TO_STORE (); +#endif +} + +/* Target ops structure for accessing child processes over the net */ + +struct target_ops remote_run_ops = { + "rtems ", "Rtems remote debugging", + "Remote RTEMS debugging.\n\ +Syntax: target rtems ", + remote_open, remote_close, + remote_attach, 0, 0, + remote_detach, 0, + remote_resume, remote_wait, 0, + remote_read_registers, remote_write_registers, + remote_prepare_to_store, + remote_xfer_memory, remote_run_files_info, + remote_insert_breakpoint, remote_remove_breakpoint, + 0, 0, 0, 0, 0, /* terminal stuff */ + remote_kill_inferior, + remote_load_command, + 0, /* lookup_symbol */ + 0, /* create_inferior */ + 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0, + remote_mourn_inferior, + 0, /* to_can_run */ + 0, /* to_notice_signals */ + 0, /* to_thread_alive */ + 0, /* to_stop */ + 0,0,0,0,0,0,0,0,0, + process_stratum, /* to_stratum */ + 0, /* to_next */ + 0, /* to_has_all_memory */ + 1, /* to_has_memory */ + 0, /* to_has_stack */ + 0, /* to_has_registers */ + 0, /* to_has_execution */ + 0, + 0, /* to_sections */ + 0, /* to_sections_end */ + 0, 0, 0, 0, + OPS_MAGIC /* Always the last thing */ + +}; +/* ==> Remember when reading at end of file, there are two "ops" structs here. */ + + + +int +getargsnb (args) + char **args; +{ + int i = 0; + + while (args[i] != (char*) 0) { +#ifdef DEBUG_EXEC + printf_filtered("args[%d] = %s\n",i,args[i]); +#endif + ++i; + } + return i; +} + +#if MY_DEBUG +void +checkEnv (envp) + char **envp; +{ + int i = 0; + + while (envp[i] != (char*) 0) + { + printf ("envp[%d] = %x \t%s\n", i, (unsigned int) envp[i], envp[i]); + i++; + } +} + +void +rpc_deb (args, fromtty) + char *args; + int fromtty; +{ + if (fromtty) + printf ("args = %s\n", args); + switch (args[0]) { + + case 'p' : /* Set memory or register */ + remote_ptrace (1, 2, 3, 4); + break; + case 'e' : /* test exec routine */ + { + extern char **environ; + + char tab[10][20]; + char * ptstring[10]; + int i; + + strcpy (tab[0], "myfile"); + strcpy (tab[1], "myarg1"); + strcpy (tab[2], "myarg2"); + strcpy (tab[3], "myarg3"); + strcpy (tab[4], "myarg4"); + strcpy (tab[5], "myarg5"); + strcpy (tab[6], "myarg6"); + strcpy (tab[7], "myarg7"); + for (i = 0; i<8; i++) + ptstring[i] = tab[i]; + ptstring[8] = (char *) 0; + checkEnv (environ); + remote_exec (ptstring[0], ptstring, environ); + } + } +} +#endif + +void +_initialize_rte () +{ + if (actor_debugging == 0) { + target_can_always_use_gdb_tty = 1; + }else target_can_always_use_gdb_tty = 1; + + /* huge hack to be sure gdb is linked with memory + * allocator that all come from gnu malloc library. + * If you remove the next line, t_alloc(3N) will + * use calloc(3C) that comes from /usr/lib/libc.a + * but t_free(3N) will use the free(3C) that is + * from gdb-4.5/mmalloc/... + */ + (void) calloc(1,1); + add_target (&remote_run_ops); +#if MY_DEBUG + add_com ("rpcdeb", class_obscure, rpc_deb, + "Command for debugging remote stuff"); +#endif + + add_com ("setrpcmode", class_obscure, setrpcmode, + "Select the protocol stack used to communicate with the target.\n\ +Allowed RPC modes is:\n\ + \"sun\" when using the IP protocol stack\n."); + + add_com ("setsubstitutepath", class_obscure, setsubstitutepath, + "Command for telling gdb the path name to set\n"); + + add_com ("setdaemontype", class_obscure, setdaemontype, + "Which kind of remote debugger will GDB talk to?\n\ +Allowed values is \"rdbg\""); + +} + diff -Naur gdb-5.2-PLUS_CG/gdb/rtems/Makefile.in gdb-5.2-PLUS_RDBG/gdb/rtems/Makefile.in --- gdb-5.2-PLUS_CG/gdb/rtems/Makefile.in Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/rtems/Makefile.in Wed Jun 12 11:17:57 2002 @@ -0,0 +1,62 @@ +# Copyright(C) 2000 Canon Research Center France SA. +# +# Developped by : +# Eric Valette, mail to : valette@crf.canon.fr +# Emmanuel Raguet, mail to : raguet@crf.canon.fr +# +# $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ +# +# This file is distributed under the GPL license +# +# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000. +# 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. + +target_cpu = @target_cpu@ +srcdir = @srcdir@ + +TARGETS = remdeb.h rteRemDebXdr.c + +RPCGEN = /usr/bin/rpcgen + +all: $(TARGETS) + +cpu_dep_files: remdeb_f.x + +remdeb_f.x: + cp -f @srcdir@/$(target_cpu)/remdeb_f.x . + +remdeb.h: @srcdir@/remdeb.x cpu_dep_files + cp -f @srcdir@/remdeb.x . + $(RPCGEN) -h remdeb.x -o $@ + +rteRemDebXdr.c: @srcdir@/remdeb.x cpu_dep_files + $(RPCGEN) -c remdeb.x -o $@ + +clean: + rm -f *~ *.o core $(TARGETS) *.bak remdeb_f.x remdeb.x + +distclean: clean + rm -f config.log config.cache + rm -f Makefile + + + + + + diff -Naur gdb-5.2-PLUS_CG/gdb/rtems/configure gdb-5.2-PLUS_RDBG/gdb/rtems/configure --- gdb-5.2-PLUS_CG/gdb/rtems/configure Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/rtems/configure Wed Jun 12 11:17:57 2002 @@ -0,0 +1,973 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=remdeb.x + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Do some error checking and defaulting for the host and target type. +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD NONOPT +# +# The rules are: +# 1. You are not allowed to specify --host, --target, and nonopt at the +# same time. +# 2. Host defaults to nonopt. +# 3. If nonopt is not specified, then host defaults to the current host, +# as determined by config.guess. +# 4. Target and build default to nonopt. +# 5. If nonopt is not specified, then target and build default to host. + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +case $host---$target---$nonopt in +NONE---*---* | *---NONE---* | *---*---NONE) ;; +*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +esac + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:573: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:594: checking target system type" >&5 + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$target" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:612: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:647: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@target@%$target%g +s%@target_alias@%$target_alias%g +s%@target_cpu@%$target_cpu%g +s%@target_vendor@%$target_vendor%g +s%@target_os@%$target_os%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff -Naur gdb-5.2-PLUS_CG/gdb/rtems/configure.in gdb-5.2-PLUS_RDBG/gdb/rtems/configure.in --- gdb-5.2-PLUS_CG/gdb/rtems/configure.in Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/rtems/configure.in Wed Jun 12 11:17:57 2002 @@ -0,0 +1,15 @@ +dnl Process this file file with autoconf to produce a configure script. +dnl This file is a shell script fragment that supplies the information +dnl necessary to tailor a template configure script into the configure +dnl script appropriate for this directory. For more information, check +dnl any existing configure script. + +AC_PREREQ(2.5) +AC_INIT(remdeb.x) + +AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..) +AC_CANONICAL_SYSTEM + +AC_PROG_INSTALL + +AC_OUTPUT(Makefile) diff -Naur gdb-5.2-PLUS_CG/gdb/rtems/i386/remdeb_f.x gdb-5.2-PLUS_RDBG/gdb/rtems/i386/remdeb_f.x --- gdb-5.2-PLUS_CG/gdb/rtems/i386/remdeb_f.x Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/rtems/i386/remdeb_f.x Wed Jun 12 11:17:57 2002 @@ -0,0 +1,66 @@ +/* + ************************************************************************** + * + * Component = rdblib + * + * Synopsis = remdeb_f.x + * + * + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + ************************************************************************** + */ + +struct xdr_regs +{ + unsigned int tabreg[19]; +}; + +#ifdef RPC_HDR + +%/* now define register macros to apply to xdr_reg struct */ +% +%#define GS 0 +%#define FS 1 +%#define ES 2 +%#define DS 3 +%#define EDI 4 +%#define ESI 5 +%#define EBP 6 +%#define ESP 7 +%#define EBX 8 +%#define EDX 9 +%#define ECX 10 +%#define EAX 11 +%#define TRAPNO 12 +%#define ERR 13 +%#define EIP 14 +%#define CS 15 +%#define EFL 16 +%#define UESP 17 +%#define SS 18 +% +%#define REG_PC tabreg[EIP] /* PC (eip) register offset */ +%#define REG_SP tabreg[UESP] /* SP (uesp) register offset */ +%#define REG_FP tabreg[EBP] /* FP (ebp) register offset */ + +%/* now define the BREAKPOINT mask technique to a long word */ +%#define SET_BREAK(l) ((l&0xFFFFFF00) | 0xCC) +%#define IS_BREAK(l) (((l) & 0xFF) == 0xCC) +%#define ORG_BREAK(c,p) (((c) & 0xFFFFFF00) | ((p) & 0xFF)) +%#define IS_STEP(regs) (regs.tabreg[TRAPNO] == 1) /* was step and not break */ +%#define BREAK_ADJ 1 /* must subtract one from address after bp */ +%#define BREAK_SIZE 1 /* Breakpoint occupies one byte */ + +%#define TARGET_PROC_TYPE 0 + +#endif + + + diff -Naur gdb-5.2-PLUS_CG/gdb/rtems/m68k/remdeb_f.x gdb-5.2-PLUS_RDBG/gdb/rtems/m68k/remdeb_f.x --- gdb-5.2-PLUS_CG/gdb/rtems/m68k/remdeb_f.x Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/rtems/m68k/remdeb_f.x Wed Jun 12 11:17:57 2002 @@ -0,0 +1,69 @@ +/* + ************************************************************************** + * + * Component = rdblib + * + * Synopsis = remdeb_f.x + * + * + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + ************************************************************************** + */ +/* Basic, host-specific, and target-specific definitions for GDB. + Copyright (C) 1986, 1989, 1991, 1992, 1993, 1994, 1995 + 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +struct xdr_regs { + int r_dreg[8]; /* data registers */ + int r_areg[8]; /* address registers */ + int r_sr; /* status register (actually a short) */ + int r_pc; /* program counter */ +}; + +#ifdef RPC_HDR + +%/* now define register macros to apply to xdr_reg struct */ +% + +%#define r_r0 r_dreg[0] /* r0 for portability */ +%#define r_sp r_areg[7] /* user stack pointer */ +%#define r_ps r_sr + +%#define REG_PC r_pc /* PC register offset */ +%#define REG_SP r_areg[7] /* SP register offset */ +%#define REG_FP r_areg[6] /* FP register offset */ + +%/* now define the BREAKPOINT mask technique to a long word */ +%#define SET_BREAK(l) ((l&0x0000FFFF) | 0x4E4F0000) /* TRAP 15 */ +%#define IS_BREAK(l) (((l) & 0xFFFF0000) == 0x4E4F0000) +%#define ORG_BREAK(c,p) (((c) & 0x0000FFFF) | ((p) & 0xFFFF0000)) +%#define IS_STEP(regs) ((regs.r_sr & 0x8000) == 0x8000) +%#define BREAK_ADJ 0 +%#define BREAK_SIZE 2 + +%#define TARGET_PROC_TYPE 2 + +#endif diff -Naur gdb-5.2-PLUS_CG/gdb/rtems/powerpc/remdeb_f.x gdb-5.2-PLUS_RDBG/gdb/rtems/powerpc/remdeb_f.x --- gdb-5.2-PLUS_CG/gdb/rtems/powerpc/remdeb_f.x Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/rtems/powerpc/remdeb_f.x Wed Jun 12 11:17:57 2002 @@ -0,0 +1,81 @@ +/* + ************************************************************************** + * + * Component = rdblib + * Synopsis = remdeb_f.x + * + * + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + */ + +struct xdr_regs +{ + unsigned int tabreg[40]; +}; + +#ifdef RPC_HDR + +%/* now define register macros to apply to xdr_regs struct */ +% +%#define R_PC 0 +%#define R_MSR 1 +%#define R_EXCEPNB 2 +%#define R_R0 3 +%#define R_R1 (R_R0 + 1) +%#define R_R2 (R_R0 + 2) +%#define R_R3 (R_R0 + 3) +%#define R_R4 (R_R0 + 4) +%#define R_R5 (R_R0 + 5) +%#define R_R6 (R_R0 + 6) +%#define R_R7 (R_R0 + 7) +%#define R_R8 (R_R0 + 8) +%#define R_R9 (R_R0 + 9) +%#define R_R10 (R_R0 + 10) +%#define R_R11 (R_R0 + 11) +%#define R_R12 (R_R0 + 12) +%#define R_R13 (R_R0 + 13) +%#define R_R14 (R_R0 + 14) +%#define R_R15 (R_R0 + 15) +%#define R_R16 (R_R0 + 16) +%#define R_R17 (R_R0 + 17) +%#define R_R18 (R_R0 + 18) +%#define R_R19 (R_R0 + 19) +%#define R_R20 (R_R0 + 20) +%#define R_R21 (R_R0 + 21) +%#define R_R22 (R_R0 + 22) +%#define R_R23 (R_R0 + 23) +%#define R_R24 (R_R0 + 24) +%#define R_R25 (R_R0 + 25) +%#define R_R26 (R_R0 + 26) +%#define R_R27 (R_R0 + 27) +%#define R_R28 (R_R0 + 28) +%#define R_R29 (R_R0 + 29) +%#define R_R30 (R_R0 + 30) +%#define R_R31 (R_R0 + 31) +%#define R_CR 35 +%#define R_CTR 36 +%#define R_XER 37 +%#define R_LR 38 +%#define R_MQ 39 +% +% +%#define REG_PC tabreg[R_PC] /* PC register offset */ +%#define REG_SP tabreg[R_R1] /* SP register offset */ +%#define REG_FP tabreg[R_R1] /* SP register offset (no FP on PPC) */ +%#define BREAK_SIZE 4 /* Breakpoint occupies 4 bytes */ +%#define BREAK_ADJ 0 /* Nothing to subtract from address after bp */ +%#define IS_BREAK(l) ((l) == 0x7d8d6808) +%#define SET_BREAK(l) (0x7d8d6808) +%#define ORG_BREAK(c,p) (p) +%#define IS_STEP(regs) (regs.tabreg[R_EXCEPNB] == 0xd) /* Was step and not break */ +%#define TARGET_PROC_TYPE 3 + +#endif + diff -Naur gdb-5.2-PLUS_CG/gdb/rtems/remdeb.x gdb-5.2-PLUS_RDBG/gdb/rtems/remdeb.x --- gdb-5.2-PLUS_CG/gdb/rtems/remdeb.x Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/rtems/remdeb.x Wed Jun 12 11:17:57 2002 @@ -0,0 +1,553 @@ +/* + ********************************************************************** + * + * Component: RDBG servers + * Module: remdeb.x + * + * Synopsis: XDR definitions for remote debug server RPC calls. + * XDR definitions for RPCGEN to build remote debug server. + * + * + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + ********************************************************************** + */ + +#ifdef RPC_SVC +%/*HEADER_START*/ +#endif + +%#define RTEMS_PORT 2071 +%#define RTEMS_BACK_PORT 2073 + +#ifdef RPC_HDR +%#ifndef REMDEB_H +%#define RPCGENSRVNAME(a) a +#endif + +enum rpc_type { + SUNRPC = 0, + BADRPCTYPE = 25 +}; + + +const NET_SAFE = 1400; /* this is safe for UDP messages */ + +struct UDP_MSG +{ /* format of UDP messages (should be in .h) */ + unsigned char type; /* type of message (BMSG_xx) */ + unsigned char msg_num; /* ringed number for resend detect */ + unsigned short spec; /* specific information for type */ + long pid; /* process this affects */ + unsigned long context; /* specific information to request */ +}; + + /* First we support the overhead structures and types needed for RPC + requests. Then, we have all RPC routines input/output args. */ + +%/* +% * Sun request values for the remote ptrace system call +% */ +% +enum ptracereq +{ /* these match PTRACE_xxx numbers */ + RPT_TRACEME = 0, /* 0, by tracee to begin tracing */ + RPT_CHILDDONE = 0, /* 0, tracee is done with his half */ + RPT_PEEKTEXT, /* 1, read word from text segment */ + RPT_PEEKDATA, /* 2, read word from data segment */ + RPT_PEEKUSER, /* 3, read word from user struct */ + RPT_POKETEXT, /* 4, write word into text segment */ + RPT_POKEDATA, /* 5, write word into data segment */ + RPT_POKEUSER, /* 6, write word into user struct */ + RPT_CONT, /* 7, continue process */ + RPT_KILL, /* 8, terminate process */ + RPT_SINGLESTEP, /* 9, single step process */ + RPT_ATTACH, /* 10, attach to an existing process (returns 2 if not primary)*/ + RPT_DETACH, /* 11, detach from a process */ + RPT_GETREGS, /* 12, get all registers */ + RPT_SETREGS, /* 13, set all registers */ + RPT_GETFPREGS, /* 14, get all floating point regs */ + RPT_SETFPREGS, /* 15, set all floating point regs */ + RPT_READDATA, /* 16, read data segment */ + RPT_WRITEDATA, /* 17, write data segment */ + RPT_READTEXT, /* 18, read text segment */ + RPT_WRITETEXT, /* 19, write text segment */ + RPT_GETFPAREGS, /* 20, get all fpa regs */ + RPT_SETFPAREGS, /* 21, set all fpa regs */ + RPT_22, /* 22, filler */ + RPT_23, /* 23, filler */ + RPT_SYSCALL, /* 24, trap next sys call */ + RPT_DUMPCORE, /* 25, dump process core */ + RPT_26, /* 26, filler */ + RPT_27, /* 27, filler */ + RPT_28, /* 28, filler */ + RPT_GETUCODE, /* 29, get u.u_code */ + /* Begin specific ptrace options */ + RPT_GETTARGETTHREAD = 50, /* get PM target thread identifier */ + RPT_SETTARGETTHREAD = 51, /* set PM target thread identifier */ + RPT_THREADSUSPEND = 52, /* suspend a thread */ + RPT_THREADRESUME = 53, /* resume a thread */ + RPT_THREADLIST = 54, /* get list of process's threads */ + RPT_GETTHREADNAME = 55, /* get the name of the thread */ + RPT_SETTHREADNAME = 56, /* set the name of the thread */ + RPT_SETTHREADREGS = 57, /* set all registers for a specific thread*/ + RPT_GETTHREADREGS = 58, /* get all registers for a specific thread*/ + /* Begin extended ptrace options for remote debug server */ + RPT_STEPRANGE = 75, /* step while in range (addr=start, data=len) */ + RPT_CONTTO = 76, /* cont from PC to temp break in addr */ + RPT_SETBREAK = 77, /* set a breakpoint (addr=break) */ + RPT_CLRBREAK = 78, /* clear a breakpoint (data=handle or 0 for all) */ + RPT_GETBREAK = 79, /* get breakpoint (data=handle, addr=buffer to + fill). Returns next break. If data=0, + returns number of breaks. */ + RPT_GETNAME = 80, /* get name of process (data 0=name, 1=path + as started, 2=fullpath). Return in addr + as mem) */ + RPT_STOP = 81, /* (C-actors) Stop the C-actor */ + RPT_PGETREGS = 82, /* portable version */ + RPT_PSETREGS = 83, /* portable version */ + RPT_PSETTHREADREGS = 84, /* portable version */ + RPT_PGETTHREADREGS = 85 /* portable version */ +}; + +#include "remdeb_f.x" + +const MAXDEBUGGEE= 150; +const NAMEMAX = 17; + +% /* +% * Memory data for read/write text or data. The size is in data. The target +% * addr is in the addr field. +% * Be careful before modifying because this value goes into internal +% * pipes and is allocated on stack too. Pipes and/or the stack could +% * become too small if this value gets incremented. +% */ + +const MEM_DATA_MAX = 256; + +#ifndef RPC_XDR + +struct xdr_mem { + u_long addr; + u_int dataNb; + unsigned char data[MEM_DATA_MAX]; +}; + +#else +/* manually define best XDR function for this */ +%bool_t xdr_xdr_mem(xdrs, objp) +% XDR *xdrs; +% struct xdr_mem *objp; +%{ +% if (!xdr_u_long(xdrs, &objp->addr)) { +% return (FALSE); +% } +% if (!xdr_u_int(xdrs, &objp->dataNb)) { +% return(FALSE); +% } +% return (xdr_opaque(xdrs, objp->data, objp->dataNb)); +%} + +#endif + +/* Breakpoint structure maps to same structure on host. Do not change one + without changing the other. */ + +enum break_type +{ /* types of breakpoints */ + BRKT_NONE, /* unused entry */ + BRKT_INSTR, /* general instruction break */ + BRKT_READ, /* read break */ + BRKT_WRITE, /* write breakpoint */ + BRKT_ACCESS, /* read-or-write break */ + BRKT_EXEC, /* execution HW breakpoint */ + BRKT_OS_CALL, /* break on OS call, addr is call number */ + BRKT_OS_SWITCH, /* dispatch breakpoint */ + BRKT_STEPEMUL /* emulate hardware single-step */ +}; +const MAX_THRD_BRK = 4; /* enough for 128 threads per process */ +struct xdr_break +{ /* one per process local breakpoint */ + u_char type; /* BRKT_xxx type of break */ + u_char thread_spec; /* 0=all, else count of threads it affects */ + u_short handle; /* handle of breakpoint returned */ + u_long ee_loc; /* address of start */ + u_long ee_type; /* type/method of address */ + u_short length; /* length of break if range, else 0 */ + u_char pass_count; /* pass count to initialize to (0=none) */ + u_char curr_pass; /* pass count current value */ + u_long thread_list[MAX_THRD_BRK]; /* bit map for thread list */ +}; /* 20 bytes+4 per thread_list (4x4=16) = 36 */ + +const UTHREAD_MAX = 64; + +const THREADNAMEMAX = 16; +typedef string thread_name ; + +struct KernThread { + unsigned int threadLi; +}; + +#ifndef RPC_XDR + +#ifdef RPC_HDR +%typedef KernThread *ptThreadList; +#endif + +struct thread_list { + unsigned int nbThread; + ptThreadList threads; +}; + +#else /* RPC_XDR */ + +/* must write this function by hand */ + +%bool_t xdr_thread_list(xdrs, objp) +% XDR *xdrs; +% struct thread_list *objp; +%{ +% return (xdr_array(xdrs, (char**)&objp->threads, &objp->nbThread, +% UTHREAD_MAX, sizeof(KernThread), xdr_KernThread)); +%} + +#endif /* not RPC_XDR */ + + +union ptrace_addr_data_in switch (ptracereq req) { + /* + * due to rpcgen poor features, we cannot put RPC_SETREGS + * AND RPC_SETTHREADREGS in the case list. So we use a hack (FIX rpcgen). + */ +#ifndef RPC_HDR + case RPT_SETTHREADREGS : + xdr_regs regs; +#endif + case RPT_SETREGS: + + xdr_regs regs; + +#ifndef RPC_HDR + case RPT_PSETTHREADREGS: + u_int pregs<>; +#endif + case RPT_PSETREGS: + u_int pregs<>; + +#ifdef LATER + case RPT_SETFPREGS: + xdr_fp_status fpregs; +#endif + case RPT_SETTHREADNAME: + thread_name name; +#ifndef RPC_HDR + case RPT_WRITETEXT: + xdr_mem mem; +#endif + case RPT_WRITEDATA: + xdr_mem mem; + case RPT_SETBREAK: + xdr_break breakp; + default: + u_int address; +}; + +union ptrace_addr_data_out switch (ptracereq req) { + case RPT_GETREGS: + xdr_regs regs; +#ifndef RPC_HDR + case RPT_GETTHREADREGS: + xdr_regs regs; +#endif + + case RPT_PGETREGS: + u_int pregs<>; + +#ifndef RPC_HDR + case RPT_PGETTHREADREGS: + u_int pregs<>; +#endif + +#ifdef LATER + case RPT_GETFPREGS: + xdr_fp_status fpregs; +#endif + case RPT_THREADLIST: + thread_list threads; + case RPT_GETTHREADNAME: + thread_name name; +#ifndef RPC_HDR + case RPT_READTEXT: + xdr_mem mem; + case RPT_GETNAME: + xdr_mem mem; +#endif + case RPT_READDATA: + xdr_mem mem; + case RPT_GETBREAK: + xdr_break breakp; + default: + u_int addr; +}; + +typedef opaque CHAR_DATA ; /* variable sized data */ + +const XRY_MAX_INST_BUFF = 128; +const XRY_MAX_INSTANCES = 16; +%#ifndef XRY_MAX_CMD_STR +const XRY_MAX_CMD_STR = 320; /* XRY_MAX_INST_BUFF+(XRY_MAX_INSTANCES*12) */ +%#endif /* REMDEB_H */ + + +struct xry_inst +{ + unsigned char flags; /* value2 interp, etc. INFL_xxx */ + unsigned char type; /* base type of data (str, val, etc) INST_xxx */ + unsigned char sub_type; /* specific type (task, res, etc). This is + set and defined by the user defined instance + processor and not the auto-processor */ + unsigned char res_type; + u_long value; /* pointer to value or value itself */ + u_long value2; /* second value (optional - based on flags) */ +}; + +struct instance +{ + struct xry_inst instances[XRY_MAX_INSTANCES]; + unsigned char buffer[XRY_MAX_INST_BUFF]; +}; + +union instance_union switch (bool instances) +{ + case TRUE: + instance inst; + case FALSE: + string buffer ; +}; + +typedef string one_arg ; + +const XRY_MAX_OBJ_NAME = 32; /* objname in some commands */ + +% /* now open_connex() routine which establishes a connection to server */ + +enum debug_type +{ /* type of connection requested */ + DEBTYP_PROCESS = 0, /* process connection */ + DEBTYP_C_ACTOR = 1, /* C-Actor connection */ + DEBTYP_KERNEL = 2, /* kernel debug connection */ + DEBTYP_OTHER = 3 /* other subsystem */ +}; + +%#define DEBUGGER_IS_GDB 0x2 /* */ + +struct open_in +{ /* input args to open a connection */ + u_char back_port[16]; /* opaque NET address format */ + u_short debug_type; /* type of process DEBTYP_xxx */ + u_short flags; /* connection information OPNFLG_xxx */ + u_char destination[16];/* opaque address if to router */ + one_arg user_name; /* name of user on host */ +}; + +struct open_out +{ /* return from open_connex */ + u_long port; /* connection number to server or -1 if error */ + u_int pad[4]; /* Planned to be KnIpcDest. Never used */ + u_int fp; /* True if floating point processor. If error, + set to errno for open error. */ + u_char cmd_table_num; /* command table used */ + u_char cmd_table_vers; /* version of command table */ + u_short server_vers; /* version number of server itself */ +}; + +% /* now close_connex() routine which detaches from server */ + +enum close_control +{ /* choice of how to handle owned processes */ + CLOSE_IGNORE = 0, /* ignore all controlled pids on close */ + CLOSE_KILL = 1, /* kill all controlled pids on close */ + CLOSE_DETACH = 2 /* detach free running all controlled pids */ +}; + +struct close_in +{ /* arg to close connection */ + close_control control; /* shutdown of owned processes control */ +}; + +% /* now send_signal() routine which sends signals to processes like kill(2) */ + +struct signal_in +{ /* input to send_signal */ + int pid; /* process/actor to send signal to */ + int sig; /* signal to send (from /usr/include/signal.h) */ +}; + +struct signal_out +{ /* return from send_signal */ + int kill_return; /* return code from kill(2) call */ + int errNo; /* error code if failed */ +}; + + +% /* now wait_info() routine which returns results of polling the wait status +% of a process/actor. It may return 0 if running, else pid or -1 */ + +enum stop_code +{ /* stop code information */ + STOP_ERROR = 0, /* error, errno set */ + STOP_NONE = 1, /* not stopped */ + STOP_UNKNOWN = 2, /* unknown stop reason */ + STOP_BREAK = 3, /* stopped on breakpoint */ + STOP_STEP = 4, /* stopped on step */ + STOP_SIGNAL = 5, /* stopped on signal receieve */ + STOP_TERM_EXIT = 6, /* terminated normally */ + STOP_TERM_SIG = 7, /* terminated by signal */ + STOP_DETACHED = 8, /* detached from server */ + STOP_KILLED = 9, /* killed by ptrace KILL */ + STOP_SPAWN_FAILED = 10 /* spawn failed in exec part, handle=errno */ +}; + +struct wait_in +{ /* input arg to wait is process */ + int pid; /* process/actor id */ +}; + +struct wait_out +{ /* result of wait_info call */ + int wait_return; /* -1=error,0=running,pid=stopped */ + int errNo; /* error code if error */ + int status; /* wait(2) status if stopped */ + stop_code reason; /* reason in more abstracted terms */ + int handle; /* handle of break if stopped on break, + or signal number or exit code */ + u_long PC; /* program counter if stopped */ + u_long SP; /* stack pointer if stopped */ + u_long FP; /* frame pointer if stopped */ + u_long thread; /* thread that stopped if applies (else -1) */ +}; + +% /* now ptrace() routine. This matches the Sun UNIX ptrace as well as +% some additions */ + +const PTRFLG_FORCE = 1; /* when set and process running, forces process + to stop, make the request, then start again. + This is used for breakpoints and the like */ +const PTRFLG_NON_OWNER = 2; /* do request even if not primary owner (will + notify all owners including caller if owns) */ +const PTRFLG_FREE = 4; /* free pid_list after KILL/DETACH */ + +const PTRDET_UNOWN = 0x100; /* data value in RPT_DETACH just disconnects + caller as an owner of process. */ + +struct ptrace_in +{ /* input args matches ptrace but for XDR */ + int pid; /* process to act on */ + ptrace_addr_data_in addr; /* mappings for addr and addr2 */ + u_int data; /* simple data arg of ptrace */ + u_int flags; /* mask of PTRFLG_xxx flags. */ +}; + +struct ptrace_out +{ /* return information from ptrace */ + ptrace_addr_data_out addr; /* return through addr/addr2 */ + int result; /* result of ptrace call (return value) */ + int errNo; /* error code if error */ +}; + + /* Data for GET_GLOBAL_SYMBOLS */ +struct one_symbol { /* Must match common/src/lib/ctx/ctx.h */ + string symbolName<>; + long symbolValue; +}; + +typedef one_symbol all_symbols<>; + +struct get_global_symbols_out { + all_symbols symbols; +}; + + /* Data for GET_TEXT_DATA */ +struct get_text_data_in { + int pid; /* process/actor id if non-zero */ + string actorName<16>; /* actor name for system mode */ +}; + +struct get_text_data_out { + int result; + int errNo; + u_long textStart; + u_long textSize; + u_long dataStart; + u_long dataSize; +}; + + /* Data for GET_SIGNAL_NAMES */ +struct one_signal { + u_int number; + string name<>; +}; + +typedef one_signal all_signals<>; + +struct get_signal_names_out { + all_signals signals; +}; + +% /* now define the actual calls we support */ + +program REMOTEDEB { + version REMOTEVERS { + + /* open a connection to server or router */ + open_out + OPEN_CONNEX(open_in) = 1; + + /* send a signal to a process */ + signal_out + SEND_SIGNAL(signal_in) = 2; + + /* all routines below require a connection first */ + + /* close the connection to the server */ + void + CLOSE_CONNEX(close_in) = 10; + + /* process ptrace request */ + ptrace_out + PTRACE(ptrace_in) = 11; + + /* poll for status of process */ + wait_out + WAIT_INFO(wait_in) = 13; + + get_signal_names_out + GET_SIGNAL_NAMES(void) = 17; + + } = 2; /* now version 2 */ +} = 0x20000fff; + +#ifdef RPC_HDR +%#define REMDEB_H +%#endif +#endif + +#ifdef RPC_SVC + +%const char* names [] = { +% "NULLPROC", "OPEN_CONNEX", "SEND_SIGNAL", "name3", +% "name4", "name5", "name6", "name7", +% "name8", "name9", "CLOSE_CONNEX", "PTRACE", +% "name12", "WAIT_INFO", "name14", "name15", +% "name16", "GET_SIGNAL_NAMES", "name18" +%}; +% + +%/*HEADER_END*/ +#endif diff -Naur gdb-5.2-PLUS_CG/gdb/rtems/servcmd.h gdb-5.2-PLUS_RDBG/gdb/rtems/servcmd.h --- gdb-5.2-PLUS_CG/gdb/rtems/servcmd.h Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/rtems/servcmd.h Wed Jun 12 11:17:57 2002 @@ -0,0 +1,158 @@ +/* + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + */ +/* Basic, host-specific, and target-specific definitions for GDB. + Copyright (C) 1986, 1989, 1991, 1992, 1993, 1994, 1995 + 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef _SERV_CMD +#define _SERV_CMD + +/************************************************************************/ +/* DEFINE THE COMMAND TABLE TYPES */ +/************************************************************************/ + +#define CTABLE_MIX_PROC 1 /* commands for MiX processes */ +#define CVERS_MIX_PROC 0x10 /* version 1.0 */ +#define CTABLE_C_ACTOR 2 /* commands for regular C-actors */ +#define CVERS_C_ACTOR 0x10 /* version 1.0 */ +#define CTABLE_KERN 3 /* commands for system debug */ +#define CVERS_KERN 0x11 /* version 1.1 */ +/* next user defined table starts at 10 */ + +/************************************************************************/ +/* DEFINE THE LIST INDEXES */ +/************************************************************************/ + +#define LIST_PID 16 /* dynamic list of processes/tasks/actors */ +#define LIST_PID_DEB 17 /* list of processes under debug now */ +#define LIST_PID_THREAD 18 /* list of threads for specific process */ +#define LIST_CONN 19 /* dynamic list of connections */ + +/************************************************************************/ +/* DEFINE THE COMMAND NUMBERS */ +/************************************************************************/ + +#define STAT_SIGNAL 1 +#define STAT_ACTOR 20 +#define STAT_PORTS 21 +#define STAT_REGIONS 22 +#define STAT_THREADS 23 +#define STAT_ACTORS 24 /* RKDB */ +#define STAT_SCHED 25 /* RKDB */ +#define STAT_ALLTHREADS 26 +#define STAT_MEMCHECK 27 /* Display used memory blocks */ +#define STAT_PANIC 28 /* Display data about current panic */ +#define STAT_PORT 29 /* Show port by number */ +#define STAT_THREAD 30 /* Show thread by number */ + +#define SS_CATCH 1 +#define SS_IGNORE 2 +#define SS_FIRE 3 +#define SS_PASS 4 +#define SS_STOP 5 +#define SS_START 6 +#define SS_KILL 7 +#define SS_DETACH 8 +#define SS_SUSPEND 9 /* suspend a thread */ +#define SS_RESUME 10 /* resume a thread */ +#define SS_REBOOT 11 /* reboot machine - RKDB */ +#define SS_PANICEXIT 13 /* set panic handler exit code - RKDB */ + +/************************************************************************/ +/* DEFINE THE DISPATCHED ROUTINES */ +/************************************************************************/ + +#define STAT_SIG_CMD 1 /* show signal state */ +#define SS_SIG_CMD 2 /* signal control */ +#define SS_KILL_DET_CMD 3 /* kill and detach */ +#define STAT_ACTOR_CMD 4 /* show actor information */ +#define STAT_PORTS_CMD 5 /* show actor ports */ +#define STAT_REGIONS_CMD 6 /* show actor regions */ +#define STAT_THREADS_CMD 7 /* show actor threads */ +#define SS_SUSPEND_CMD 8 /* suspend a thread */ +#define SS_RESUME_CMD 9 /* resume a thread */ +#define SS_REBOOT_CMD 10 /* reboot machine - RKDB */ +#define STAT_ACTORS_CMD 12 /* show all actors - RKDB */ +#define STAT_SCHED_CMD 13 /* show scheduler information - RKDB */ +#define STAT_ALLTHREADS_CMD 14 /* Display all threads, with actors - RKDB */ +#define STAT_MEMCHECK_CMD 15 /* Display used memory blocks */ +#define STAT_PANIC_CMD 16 /* Display data about current panic - RKDB */ +#define SS_PANICEXIT_CMD 17 /* Set panic handler exit code - RKDB */ +#define STAT_PORT_CMD 18 /* Show port by number */ +#define STAT_THREAD_CMD 19 /* Show thread by number */ + +/************************************************************************/ +/* DEFINE THE QUALIFIER MASKS */ +/************************************************************************/ + + /* qualifiers used by signal managing/affecting commands */ +#define QSIG_CATCH 0x1 /* used for stat command only */ +#define QSIG_IGNORE 0x2 +#define QSIG_PASS 0x4 +#define QSIG_FIRE 0x8 +#define QSIG_MASK 0x10 + +#define QSIG_HUP 0x00000001 /* used for ss commands only */ +#define QSIG_INT 0x00000002 +#define QSIG_QUIT 0x00000004 +#define QSIG_ILL 0x00000008 +#define QSIG_TRAP 0x00000010 +#define QSIG_IOT 0x00000020 +#define QSIG_EMT 0x00000040 +#define QSIG_FPE 0x00000080 +#define QSIG_KILL 0x00000100 +#define QSIG_BUS 0x00000200 +#define QSIG_SEGV 0x00000400 +#define QSIG_SYS 0x00000800 +#define QSIG_PIPE 0x00001000 +#define QSIG_ALRM 0x00002000 +#define QSIG_TERM 0x00004000 +#define QSIG_USR1 0x00008000 +#define QSIG_USR2 0x00010000 +#define QSIG_CLD 0x00020000 +#define QSIG_PWR 0x00040000 +#define QSIG_WINCH 0x00080000 +#define QSIG_URG 0x00100000 +#define QSIG_POLL 0x00200000 +#define QSIG_STOP 0x00400000 +#define QSIG_TSTP 0x00800000 +#define QSIG_CONT 0x01000000 +#define QSIG_TTIN 0x02000000 +#define QSIG_TTOU 0x04000000 +#define QSIG_VTALRM 0x08000000 +#define QSIG_PROF 0x10000000 +#define QSIG_XCPU 0x20000000 +#define QSIG_XFSZ 0x40000000 + +#define QKILL_ALL 1 /* kill/detach */ +#define QKILL_FORCE 2 + +#define QSUSP_ALL 1 /* suspend/resume */ +#define QSUSP_ALLBUT 2 + +#endif /* _SERV_CMD */ + diff -Naur gdb-5.2-PLUS_CG/gdb/rtems/sparc/remdeb_f.x gdb-5.2-PLUS_RDBG/gdb/rtems/sparc/remdeb_f.x --- gdb-5.2-PLUS_CG/gdb/rtems/sparc/remdeb_f.x Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/rtems/sparc/remdeb_f.x Wed Jun 12 11:17:57 2002 @@ -0,0 +1,106 @@ +/* + ************************************************************************** + * + * Component = rdblib + * + * Synopsis = remdeb_f.x + * + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + */ +/* Basic, host-specific, and target-specific definitions for GDB. + Copyright (C) 1986, 1989, 1991, 1992, 1993, 1994, 1995 + 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +% /* +% * NOTE: this corresponds to the 35 registers defined in KnThreadCtx +% * defined for sparc. +% */ +struct xdr_regs +{ + unsigned int tabreg[35]; +}; + +#ifdef RPC_HDR + +%/* now define register macros to apply to xdr_reg struct */ +% +%#define PSR 0 +%#define PC1 1 +%#define nPC 2 +%#define Y 3 + +%#define G1 4 +%#define G2 5 +%#define G3 6 +%#define G4 7 +%#define G5 8 +%#define G6 9 +%#define G7 10 + +%#define O0 11 +%#define O1 12 +%#define O2 13 +%#define O3 14 +%#define O4 15 +%#define O5 16 +%#define O6 17 +%#define O7 18 + +%#define L0 19 +%#define L1 20 +%#define L2 21 +%#define L3 22 +%#define L4 23 +%#define L5 24 +%#define L6 25 +%#define L7 26 + +%#define I0 27 +%#define I1 28 +%#define I2 29 +%#define I3 30 +%#define I4 31 +%#define I5 32 +%#define I6 33 +%#define I7 34 +% +%#define REG_PC tabreg[PC1] /* PC (pc) register offset */ +%#define REG_NPC tabreg[nPC] /* PC (npc) register offset */ +%#define REG_SP tabreg[O6] /* SP (o6) register offset */ +%#define REG_FP tabreg[I6] /* FP (i6) register offset */ + +%#define ST_DEBUGGER_TRAP 0x14 +%#define FIRST_DEBUG_TRAP ST_DEBUGGER_TRAP +%#define LAST_DEBUG_TRAP ST_DEBUGGER_TRAP +%#define SET_BREAK(l) (0x91d02000|ST_DEBUGGER_TRAP) +%#define ORG_BREAK(c, p) (p) +%#define IS_BREAK(l) ( (((l) & 0xff) >= FIRST_DEBUG_TRAP) && (((l) & 0xff) <= LAST_DEBUG_TRAP)) +%#define IS_STEP(regs) (0) +%#define BREAK_ADJ 0 /* must subtract one from address after bp */ +%#define BREAK_SIZE 4 /* Breakpoint occupies four byte */ +#endif + diff -Naur gdb-5.2-PLUS_CG/gdb/rtems/sparc-v9/remdeb_f.x gdb-5.2-PLUS_RDBG/gdb/rtems/sparc-v9/remdeb_f.x --- gdb-5.2-PLUS_CG/gdb/rtems/sparc-v9/remdeb_f.x Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/rtems/sparc-v9/remdeb_f.x Wed Jun 12 11:17:57 2002 @@ -0,0 +1,106 @@ +/* + ************************************************************************** + * + * Component = rdblib + * + * Synopsis = remdeb_f.x + * + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + */ +/* Basic, host-specific, and target-specific definitions for GDB. + Copyright (C) 1986, 1989, 1991, 1992, 1993, 1994, 1995 + 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +% /* +% * NOTE: this corresponds to the 35 registers defined in KnThreadCtx +% * defined for sparc. +% */ +struct xdr_regs +{ + unsigned int tabreg[35]; +}; + +#ifdef RPC_HDR + +%/* now define register macros to apply to xdr_reg struct */ +% +%#define PSR 0 +%#define PC1 1 +%#define nPC 2 +%#define Y 3 + +%#define G1 4 +%#define G2 5 +%#define G3 6 +%#define G4 7 +%#define G5 8 +%#define G6 9 +%#define G7 10 + +%#define O0 11 +%#define O1 12 +%#define O2 13 +%#define O3 14 +%#define O4 15 +%#define O5 16 +%#define O6 17 +%#define O7 18 + +%#define L0 19 +%#define L1 20 +%#define L2 21 +%#define L3 22 +%#define L4 23 +%#define L5 24 +%#define L6 25 +%#define L7 26 + +%#define I0 27 +%#define I1 28 +%#define I2 29 +%#define I3 30 +%#define I4 31 +%#define I5 32 +%#define I6 33 +%#define I7 34 +% +%#define REG_PC tabreg[PC1] /* PC (pc) register offset */ +%#define REG_NPC tabreg[nPC] /* PC (npc) register offset */ +%#define REG_SP tabreg[O6] /* SP (o6) register offset */ +%#define REG_FP tabreg[I6] /* FP (i6) register offset */ + +%#define ST_DEBUGGER_TRAP 0x12 +%#define FIRST_DEBUG_TRAP ST_DEBUGGER_TRAP +%#define LAST_DEBUG_TRAP ST_DEBUGGER_TRAP +%#define SET_BREAK(l) (0x91d02000|ST_DEBUGGER_TRAP) +%#define ORG_BREAK(c, p) (p) +%#define IS_BREAK(l) ( (((l) & 0xff) >= FIRST_DEBUG_TRAP) && (((l) & 0xff) <= LAST_DEBUG_TRAP)) +%#define IS_STEP(regs) (0) +%#define BREAK_ADJ 0 /* must subtract one from address after bp */ +%#define BREAK_SIZE 4 /* Breakpoint occupies four byte */ +#endif + diff -Naur gdb-5.2-PLUS_CG/gdb/rtems.c gdb-5.2-PLUS_RDBG/gdb/rtems.c --- gdb-5.2-PLUS_CG/gdb/rtems.c Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/rtems.c Wed Jun 12 11:17:58 2002 @@ -0,0 +1,716 @@ +/* + **************************************************************** + * + * Component = GDB + * Module = os.c + * + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + **************************************************************** + */ + +/* This file is part of GDB. + +GDB 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 1, or (at your option) +any later version. + +GDB 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 GDB; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +#ifdef RTEMS + +#include +#include +#include +#include + +#include "defs.h" /* Definition of CORE_ADDR. */ +#include "tm.h" +#include "frame.h" +#include "inferior.h" +#define free bogon_free +#include "gdbthread.h" +#undef free +#include "thread_rte.h" /* thread.h includes osRemDeb.h */ + +#include /* htonl */ +#include + +extern int original_pid; + +extern ULONGEST read_register (); +extern unsigned int register_addr (); +extern void error (); +extern void supply_register (); +extern void perror_with_name (); + +#define NAME_MAX 255 +static char site_name[NAME_MAX + 1]; +static int site_number; + +int trace_ptrace_flag = 0; +#define str(A) "A" +#define assert(A) if ((A) == 0) \ +printf("%s:%d assert %s failed",__FILE__, __LINE__, str(A)) + +void +toggle_trace_ptrace () +{ + if (trace_ptrace_flag == 0) { + trace_ptrace_flag = 1; + printf_filtered("trace_ptrace enabled\n"); + } + else { + trace_ptrace_flag = 0; + printf_filtered("trace_ptrace disabled\n"); + } +} + +#define SWAP_TARGET_AND_HOST(buffer,len) + +#warning "HACK ALERT!!! FIX SWAP_TARGET_AND_HOST!!" +#if 0 + +#define SWAP_TARGET_AND_HOST(buffer,len) \ + do \ + { \ + if (TARGET_BYTE_ORDER != HOST_BYTE_ORDER) \ + { \ + char tmp; \ + char *p = (char *)(buffer); \ + char *q = ((char *)(buffer)) + len - 1; \ + for (; p < q; p++, q--) \ + { \ + tmp = *q; \ + *q = *p; \ + *p = tmp; \ + } \ + } \ + } \ + while (0) +#endif + + void +trace_regs(addr) + caddr_t addr; +{ +#if defined TARGET_i386 + + unsigned long* ptReg = (unsigned long*) addr; + + printf_filtered ("\tgs\t=\t%x\n", *ptReg++); + printf_filtered ("\tfs\t=\t%x\n", *ptReg++); + printf_filtered ("\tes\t=\t%x\n", *ptReg++); + printf_filtered ("\tds\t=\t%x\n", *ptReg++); + printf_filtered ("\tedi\t=\t%x\n", *ptReg++); + printf_filtered ("\tesi\t=\t%x\n", *ptReg++); + printf_filtered ("\tebp\t=\t%x\n", *ptReg++); + printf_filtered ("\tesp0\t=\t%x\n", *ptReg++); + printf_filtered ("\tebx\t=\t%x\n", *ptReg++); + printf_filtered ("\tedx\t=\t%x\n", *ptReg++); + printf_filtered ("\tecx\t=\t%x\n", *ptReg++); + printf_filtered ("\teax\t=\t%x\n", *ptReg++); + printf_filtered ("\ttrapno\t=\t%x\n", *ptReg++); + printf_filtered ("\terr\t=\t%x\n", *ptReg++); + printf_filtered ("\teip\t=\t%x\n", *ptReg++); + printf_filtered ("\tcs\t=\t%x\n", *ptReg++); + printf_filtered ("\teflags\t=\t%x\n", *ptReg++); + printf_filtered ("\tesp3\t=\t%x\n", *ptReg++); + printf_filtered ("\tss3\t=\t%x\n", *ptReg++); +#define trace_regs_done +#endif +#if defined TARGET_m68k + + unsigned long* ptReg = (unsigned long*) addr; + + printf_filtered ("\tR0\t=\t%x\n", *ptReg++); + printf_filtered ("\tR1\t=\t%x\n", *ptReg++); + printf_filtered ("\tR2\t=\t%x\n", *ptReg++); + printf_filtered ("\tR3\t=\t%x\n", *ptReg++); + printf_filtered ("\tR4\t=\t%x\n", *ptReg++); + printf_filtered ("\tR5\t=\t%x\n", *ptReg++); + printf_filtered ("\tR6\t=\t%x\n", *ptReg++); + printf_filtered ("\tR7\t=\t%x\n", *ptReg++); + printf_filtered ("\tAR0\t=\t%x\n", *ptReg++); + printf_filtered ("\tAR1\t=\t%x\n", *ptReg++); + printf_filtered ("\tAR2\t=\t%x\n", *ptReg++); + printf_filtered ("\tAR3\t=\t%x\n", *ptReg++); + printf_filtered ("\tAR4\t=\t%x\n", *ptReg++); + printf_filtered ("\tAR5\t=\t%x\n", *ptReg++); + printf_filtered ("\tAR6\t=\t%x\n", *ptReg++); + printf_filtered ("\tAR7 (USP/SSP)\t=\t%x\n", *ptReg++); + printf_filtered ("\tSR\t=\t%x\n", *ptReg++); + printf_filtered ("\tPC\t=\t%x\n", *ptReg++); +#define trace_regs_done +#endif /* TARGET_m68k */ + +#if defined TARGET_sparc + + unsigned long* ptReg = (unsigned long*) addr; + + printf_filtered( "%s %x", "psr=", *ptReg++ ); + printf_filtered( " %s %x", "pc=", *ptReg++ ); + printf_filtered( " %s %x", "npc=", *ptReg++ ); + printf_filtered( " %s %x", "y=", *ptReg++ ); + printf_filtered( "\n" ); + + printf_filtered( "%s ", "g1-g7" ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( "\n" ); + + printf_filtered( "%s", "o0-o7" ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( "\n" ); + + printf_filtered( "%s", "l0-l7" ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( "\n" ); + + printf_filtered( "%s", "i0-i7" ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( " %08x", *ptReg++ ); + printf_filtered( "\n" ); +#define trace_regs_done +#endif /* TARGET_sparc */ + +#if defined TARGET_powerpc + + unsigned long* ptReg = (unsigned long*) addr; + + printf_filtered( "%s ", "r0-r31" ); + { + int i; + for (i = 0; i < 32; i++) { + printf_filtered( " %08x", *ptReg++ ); + } + } + + printf_filtered( "CR %08x", *ptReg++ ); + printf_filtered( "LR %08x", *ptReg++ ); + printf_filtered( "PC %08x", *ptReg++ ); + printf_filtered( "MSR %08x", *ptReg++ ); + printf_filtered( "CTR %08x", *ptReg++ ); + printf_filtered( "XER %08x", *ptReg++ ); + printf_filtered( "MQ %08x", *ptReg++ ); + printf_filtered( "\n" ); +#define trace_regs_done +#endif /* TARGET_powerpc */ + +#ifndef trace_regs_done + printf_filtered("Only know the register structure of i386, m68k, powerpc and sparc\n"); +#else +#undef trace_regs_done +#endif +} + +void +trace_ptrace (request, pid, addr, data, resu) + int request, resu; + int pid, data; + caddr_t addr; +{ + char requestInasc[30]; + + if (trace_ptrace_flag == 0) + return; + + switch(request) { + + case RPT_TRACEME: strcpy(requestInasc, "TRACEME"); break; + case RPT_PEEKTEXT: strcpy(requestInasc, "PEEKTEXT"); break; + case RPT_PEEKDATA: strcpy(requestInasc, "PEEKDATA"); break; + case RPT_PEEKUSER: strcpy(requestInasc, "PEEKUSER"); break; + case RPT_POKETEXT: strcpy(requestInasc, "POKETEXT"); break; + case RPT_POKEDATA: strcpy(requestInasc, "POKEDATA"); break; + case RPT_POKEUSER: strcpy(requestInasc, "POKEUSER"); break; + case RPT_CONT: strcpy(requestInasc, "CONT"); break; + case RPT_KILL: strcpy(requestInasc, "KILL"); break; + case RPT_SINGLESTEP: strcpy(requestInasc, "SINGLESTEP"); break; + case RPT_ATTACH: strcpy(requestInasc, "ATTACH"); break; + case RPT_DETACH: strcpy(requestInasc, "DETACH"); break; + case RPT_GETREGS: strcpy(requestInasc, "GETREGS"); break; + case RPT_SETREGS: strcpy(requestInasc, "SETREGS"); break; +#ifdef FP_SUPPORT + case RPT_GETFPREGS: strcpy(requestInasc, "GETFPREGS"); break; + case RPT_SETFPREGS: strcpy(requestInasc, "SETFPREGS"); break; + case RPT_READDATA: strcpy(requestInasc, "READDATA"); break; + case RPT_WRITEDATA: strcpy(requestInasc, "WRITEDATA"); break; + case RPT_READTEXT: strcpy(requestInasc, "READTEXT"); break; + case RPT_WRITETEXT: strcpy(requestInasc, "WRITETEXT"); break; + case RPT_GETFPAREGS: strcpy(requestInasc, "GETFPAREGS"); break; + case RPT_SETFPAREGS: strcpy(requestInasc, "SETFPAREGS"); break; +#endif + case RPT_GETTARGETTHREAD:strcpy(requestInasc, "GETTARGETTHREAD");break; + case RPT_SETTARGETTHREAD:strcpy(requestInasc, "SETTARGETTHREAD");break; + case RPT_THREADSUSPEND: strcpy(requestInasc, "THREADSUSPEND"); break; + case RPT_THREADRESUME: strcpy(requestInasc, "THREADRESUME"); break; + case RPT_THREADLIST: strcpy(requestInasc, "THREADLIST"); break; + case RPT_GETTHREADNAME: strcpy(requestInasc, "GETTHREADNAME"); break; + case RPT_SETTHREADNAME: strcpy(requestInasc, "SETTHREADNAME"); break; + case RPT_SETTHREADREGS: strcpy(requestInasc, "SETTHREADREGS"); break; + case RPT_GETTHREADREGS: strcpy(requestInasc, "GETTHREADREGS"); break; + case RPT_STEPRANGE: strcpy(requestInasc, "STEPRANGE"); break; + case RPT_CONTTO: strcpy(requestInasc, "CONTTO"); break; + case RPT_SETBREAK: strcpy(requestInasc, "SETBREAK"); break; + case RPT_CLRBREAK: strcpy(requestInasc, "CLRBREAK"); break; + case RPT_GETBREAK: strcpy(requestInasc, "GETBREAK"); break; + case RPT_GETNAME: strcpy(requestInasc, "GETNAME"); break; + case RPT_STOP: strcpy(requestInasc, "STOP"); break; + default: sprintf(requestInasc, "unknown: %d", request); break; + + } + + if ((request == RPT_SETBREAK) || + (request == RPT_GETBREAK)) + printf("PTR: req=%-15s pid=%d addr=%8x data=%8x resu=%8x\n", + requestInasc, pid & 0xffff, ((xdr_break*)addr)->ee_loc, data, resu); + else + printf_filtered("PTR: req=%-15s pid=%d addr=%8x data=%8x resu=%8x\n", + requestInasc, pid & 0xffff, addr, data, resu); + + if ((request == RPT_GETREGS) || + (request == RPT_GETTHREADREGS) || + (request == RPT_SETREGS) || + (request == RPT_SETTHREADREGS)) + trace_regs(addr); +} + + +/* This function simply calls ptrace with the given arguments. + It exists so that all calls to ptrace are isolated in this + machine-dependent file. */ +int +call_ptrace (request, pid, addr, data) + int request, pid, addr, data; +{ + int res; + + res = ptrace (request, pid, addr, data); + trace_ptrace(request, pid, addr, data, res); + return res; +} + + +#if defined TARGET_m68k + +void +put_registers_in_gdb_order (regs) + xdr_regs *regs; +{ + extern char registers[]; + int i; + + for (i = 0; i < NUM_REGS; i++) { + ((int*)registers)[i] = ntohl(((int*)regs)[i]); + } + regs->r_ps = ntohl(regs->r_ps); + supply_register (PS_REGNUM, (char*) ®s->r_ps); + regs->r_pc = ntohl(regs->r_pc); + supply_register (PC_REGNUM, (char*) ®s->r_pc); +} + + +void +put_registers_in_frame_order (regs) + xdr_regs *regs; +{ + extern char registers[]; + int i; + + for (i = 0; i < NUM_REGS; i++) { + ((int*)regs)[i] = htonl(((int*)registers)[i]); + } + regs->r_ps = ntohl(read_register (PS_REGNUM)); + regs->r_pc = ntohl(read_register (PC_REGNUM)); +} + +#ifdef FP_SUPPORT + +void +put_fp_registers_in_gdb_order (regs) + xdr_fp_status *regs; +{ + extern char registers[]; + + bcopy (regs, ®isters[REGISTER_BYTE (FP0_REGNUM)], + sizeof regs->fps_regs); + bcopy (regs->fps_control, + ®isters[REGISTER_BYTE (FPC_REGNUM)], + sizeof (xdr_fp_status) - sizeof (regs->fps_regs)); +} + + +void +put_fp_registers_in_frame_order (regs) + xdr_fp_status *regs; +{ + extern char registers[]; + + bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)], regs, + sizeof regs->fps_regs); + bcopy (®isters[REGISTER_BYTE (FPC_REGNUM)], + regs->fps_control, + sizeof (xdr_fp_status) - sizeof (regs->fps_regs)); +} + +#endif /* FP_SUPPORT */ +#endif + +#if defined TARGET_i386 + +/* + * The global variable REGISTERS (findvar.c) must contain 16 register values + * in the following order: + * + * EAX, ECX, EDX, EBX, UESP, EBP, ESI, EDI, EIP, EFL, CS, SS, DS, ES, FS, GS, + * + * contains 19 register values in the following order: + * + * GS, FS, ES, DS, EDI, ESI, EBP, ESP, EBX, EDX, ECX, EAX, TRAPNO, ERR, + * EIP, CS, EFL, UESP, SS + * + * sys_reg_map gives the offset (in words) for each register within a + * KnThreadCtx. + * + */ + +static int sys_reg_map[] = { 11, 10, 9, 8, 17, 6, 5, 4, + 14, 16, 15, 18, 3, 2, 1, 0 }; + + +/* We must store somewhere the 3 frame registers unused by gdb + * that must be restored to get the right SETREGS ptrace. + */ + +#define UNUSED_REGS 3 +static unsigned long unused_gdb_regs[UNUSED_REGS]; + +#define SSP 7 +#define TRAPNO 12 +#define ERR 13 + +void +store_unused_regs (regs) + xdr_regs *regs; +{ + unsigned long *regs_addr = (unsigned long *) regs; + + unused_gdb_regs[0] = *(regs_addr + SSP); + unused_gdb_regs[1] = *(regs_addr + TRAPNO); + unused_gdb_regs[2] = *(regs_addr + ERR); +} + +void +restore_unused_regs (regs) + xdr_regs *regs; +{ + unsigned long *regs_addr = (unsigned long *) regs; + + *(regs_addr + SSP) = unused_gdb_regs[0]; + *(regs_addr + TRAPNO) = unused_gdb_regs[1]; + *(regs_addr + ERR) = unused_gdb_regs[2]; +} + + + +void +put_registers_in_gdb_order(regs) + xdr_regs *regs; +{ + int regno; + for (regno = 0; regno < NUM_REGS; regno++) + { + unsigned long *reg_addr = ((unsigned long *) regs + sys_reg_map[regno]); + SWAP_TARGET_AND_HOST(reg_addr,sizeof(int)); + supply_register (regno, (char *) reg_addr); + } + store_unused_regs (regs); +} + +void +put_registers_in_frame_order (regs) + xdr_regs *regs; +{ + int regno; + for (regno = 0; regno < NUM_REGS; regno++) + { + unsigned long *reg_addr = ((unsigned long *) regs) + sys_reg_map[regno]; + *reg_addr = read_register (regno); + /* register must NOT be swapped here (already done by gdb) */ + } + restore_unused_regs (regs); +} + +#endif /* TARGET_i386 */ + +#if defined TARGET_sparc + +/* + * The global variable "registers" (findvar.c) must contain + * REGISTER_BYTES register values in the following order: + * + * "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", + * "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", + * "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", + * "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7", + * + * "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + * "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", + * "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", + * "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", + * + * "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr" }; + * + * contains register values in the following order: + * + * PSR PC nPC Y G1 G2 G3 G4 G5 G6 G7 O0 O1 O2 O3 O4 O5 O6 O7 + * L0 L1 L2 L3 L4 L5 L6 L7 I0 I1 I2 I3 I4 I5 I6 I7 + * + * sys_reg_map gives the offset (in words) for each relevant register + * within a KnThreadCtx. + * + */ + +static int sys_reg_map[] = { + -1, 4, 5, 6, 7, 8, 9, 10, /* g */ + 11, 12, 13, 14, 15, 16, 17, 18, /* o */ + 19, 20, 21, 22, 23, 24, 25, 26, /* l */ + 27, 28, 29, 30, 31, 32, 33, 34, /* i */ + -1, -1, -1, -1, -1, -1, -1, -1, /* f0-7 */ + -1, -1, -1, -1, -1, -1, -1, -1, /* f8-15 */ + -1, -1, -1, -1, -1, -1, -1, -1, /* f16-23 */ + -1, -1, -1, -1, -1, -1, -1, -1, /* f24-31 */ + 3, 0, -1, -1, 1, 2, -1, -1 /* y, psr, ...*/ +}; + +void +put_registers_in_gdb_order(regs) + xdr_regs *regs; +{ + int regno; + unsigned long reg; + static long zero = 0, minusone = -1; + + /* g0 has always the value 0 */ + supply_register (0, (char*) &zero); + + /* look at remaining registers */ + for (regno = 1; regno < NUM_REGS; regno++) + { + if (sys_reg_map[regno] == -1) { + supply_register(regno, (char*) &minusone); + } else { + reg = ntohl(*(((unsigned long*)regs) + sys_reg_map[regno])); + supply_register (regno, (char*) ®); + } + } +} + +void +put_registers_in_frame_order (regs) + xdr_regs *regs; +{ + int regno; + unsigned long *reg_addr; + + for (regno = 0; regno < NUM_REGS; regno++) + { + if (sys_reg_map[regno] == -1) { /* register not needed */ + continue; + } + reg_addr = ((unsigned long *) regs) + sys_reg_map[regno]; + *reg_addr = htonl(read_register(regno)); + } +} + +#endif /* TARGET_sparc */ + +#if defined TARGET_powerpc + +/* + * The global variable "registers" (findvar.c) must contain + * REGISTER_BYTES register values in the following order: + * + * "r0" - "r31" + * + * "f0", "f31" ( 64 bits long ) + * + * "pc", "msr", "cr", "lr", "cntr", "xer", "mq" + * + * + */ + +static int sys_reg_map[] = { + R_R0, R_R1, R_R2, R_R3, R_R4, R_R5, R_R6, R_R7, /* r0-r31 */ + R_R8, R_R9, R_R10, R_R11, R_R12, R_R13, R_R14, R_R15, + R_R16, R_R17, R_R18, R_R19, R_R20, R_R21, R_R22, R_R23, + R_R24, R_R25, R_R26, R_R27, R_R28, R_R29, R_R30, R_R31, + -1, -1, -1, -1, -1, -1, -1, -1, /* f0-7 */ + -1, -1, -1, -1, -1, -1, -1, -1, /* f8-15 */ + -1, -1, -1, -1, -1, -1, -1, -1, /* f16-23 */ + -1, -1, -1, -1, -1, -1, -1, -1, /* f24-31 */ + R_PC, R_MSR, R_CR, R_LR, R_CTR, R_XER, R_MQ, -1 +}; + + void +put_registers_in_gdb_order(regs) +xdr_regs *regs; +{ + int regno; + unsigned long *reg_addr; + static long minusone[2] = {-1, -1}; + + /* look at remaining registers */ + for (regno = 0; regno < NUM_REGS; regno++) + { + if (regno >= sizeof(sys_reg_map)/sizeof(int)) + break; + if (sys_reg_map[regno] == -1) { + reg_addr = (unsigned long *) minusone; + } else { + reg_addr = ((unsigned long *) regs + sys_reg_map[regno]); + SWAP_TARGET_AND_HOST(reg_addr,sizeof(int)); + } + supply_register (regno, (char *) reg_addr); + } +} + + void +put_registers_in_frame_order (regs) + xdr_regs *regs; +{ + int regno; + unsigned long *reg_addr; + assert(NUM_REGS <= sizeof(sys_reg_map)/4); + for (regno = 0; regno < NUM_REGS; regno++) { + if (regno >= sizeof(sys_reg_map)/sizeof(int)) + break; + if (sys_reg_map[regno] == -1) { /* register not needed */ + continue; + } + reg_addr = ((unsigned long *) regs) + sys_reg_map[regno]; + *reg_addr = read_register (regno); + + } +} + +#endif /* TARGET_powerpc */ + + +void +rtems_fetch_inferior_registers(regno) + int regno; +{ + xdr_regs inferior_registers; + int threadid=100000; + + registers_fetched (); + + errno = 0; + + threadid=GET_CURRENT_THREAD_ID (); + + call_ptrace (RPT_GETREGS, original_pid, (int) &inferior_registers, threadid); + if (errno) + error("Unable to get register values for current thread\n"); + + put_registers_in_gdb_order (&inferior_registers); +} + +int +rtems_store_inferior_registers (regno) + int regno; /* always -1 */ +{ + xdr_regs inferior_registers; + int result = 0; + int threadid=100000; + + put_registers_in_frame_order (&inferior_registers); + threadid=GET_CURRENT_THREAD_ID (); + + result = call_ptrace (RPT_SETREGS, original_pid, (int) &inferior_registers, threadid); + + if (errno) + error("Unable to set remote registers for current thread\n"); + + return result; +} + +#if !defined(USE_PROC_FS) +void +fetch_inferior_registers (regno) + int regno; +{ + rtems_fetch_inferior_registers (-1); +} + +void +store_inferior_registers (regno) + int regno; +{ + rtems_store_inferior_registers (-1); +} + +int +proc_iterate_over_mappings (int (*func) (int, CORE_ADDR)) +{ +} +#endif /* USE_PROC_FS */ + + +void +_initialize_tracing () +{ + add_com ("trace-ptrace", class_obscure, toggle_trace_ptrace, + "Toggle flag for tracing all ptrace(2) requests"); +} + +void +_initialize_csite () +{ +} +#endif /* RTEMS */ + + + diff -Naur gdb-5.2-PLUS_CG/gdb/thread_rte.c gdb-5.2-PLUS_RDBG/gdb/thread_rte.c --- gdb-5.2-PLUS_CG/gdb/thread_rte.c Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/thread_rte.c Wed Jun 12 11:17:58 2002 @@ -0,0 +1,1104 @@ +/* + **************************************************************** + * + * Component = GDB - GNU Debugger for multithreaded processes. + * + * + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + **************************************************************** + */ + +/* This file is part of GDB. + +GDB 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, or (at your option) +any later version. + +GDB 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 GDB; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +#include +#include +#include +#include + +#include "defs.h" /* Definition of CORE_ADDR */ +#include "frame.h" +#include "inferior.h" +#define free bogon_free +#include "thread_rte.h" +#undef free +#include "command.h" +#include "target.h" + +#define ERROR_NO_INFERIOR \ + if (original_pid == 0) error ("No inferior or core file."); + +/* test the arguments of the command */ +#define ALL_OK 1 +#define SOME_OK -1 +#define NONE_OK -2 +#define NO_ARGS -3 + + /* + * External function declarations. + */ +extern void fatal (); +extern void print_command (); +extern void printf_filtered (); + +#ifdef __STDC__ +extern void *xmalloc (); +#else +extern char *xmalloc (); +#endif +extern void error (); + + /* + * External data declarations. + */ + +extern int inferior_pid; +extern int original_pid; +extern struct cmd_list_element *cmdlist; +extern int remote_sys_can_debug_thread; +extern int remote_debug_in_progress; + /* + * Pointer to current ptrace function: + * - ptrace(2) for local debugging. + * - remote_ptrace for remote debugging (Sun RPC to RDB) + */ +extern int (*current_ptrace_function) (); +/* To memorise that thread which has hit the break-point */ +struct thread *original_target_thread = NULL; +extern int add_thread(); + /* + * Forward function declarations. + */ +static void suspend_1_thread (); +static void resume_1_thread (); +static void attach_1_thread (); +static void detach_1_thread (); +static void map_threads (); +static void normal_stop_thread (); + + +struct thread *thread_chain; /* Chain of all threads */ +struct thread *current_target_thread; /* Current target thread */ +unsigned int thread_count; /* Number of threads */ +struct cmd_list_element *threadlist; /* list head for thread related commands */ +int thread_args = 0; /* location (sic) were arguments for */ + /* thread related commands are stored */ + +#ifdef LOCAL_SYS_CAN_DEBUG_THREAD +int local_sys_can_debug_thread = LOCAL_SYS_CAN_DEBUG_THREAD; +#else +int local_sys_can_debug_thread = 0; +#endif + +int +get_current_thread_id() +{ + unsigned int current_target_thread_id; + + if (! ((local_sys_can_debug_thread) || + (remote_sys_can_debug_thread && remote_debug_in_progress))) { + return 100; /* same value as the one used in update_thread_chain */ + } + + errno = 0; + current_target_thread_id = current_ptrace_function (RPT_GETTARGETTHREAD, original_pid, 0, 0); + + if (errno) + error ("RPT_GETTARGETTHREAD failed: %d (errno=%d)\n", + current_target_thread_id, errno); + return current_target_thread_id; +} + + +static struct thread * +get_thread_by_gdbid (gdbId) + unsigned int gdbId; +{ + struct thread *t = thread_chain; + + if (t == 0) + return 0; + else + while (t) + if (t->gdb_id == gdbId) + return t; + else + t = t->next; + + return 0; +} + +static struct thread * +get_thread_by_id (id) + unsigned int id; +{ + struct thread *t = thread_chain; + + if (t == 0) + return 0; + else + while (t) + if (t->id == id) + return t; + else + t = t->next; + + return 0; +} + +static struct thread * +get_thread_by_name (name) + char *name; +{ + struct thread *t = thread_chain; + + if (t == 0) + return 0; + else + while (t) + if (strcmp (t->name, name) == 0) + return t; + else + t = t->next; + + return 0; +} + +static int +test_args (args) + char *args; +{ + char *args_copy; + char *arg; + struct thread *thread; + int nb_errors = 0; + int found = 0; + int id; + + if (!args || *args == ' ') + return (NO_ARGS); + + /* strtok would change the string ARGS passed as an argument */ + args_copy = xmalloc(strlen(args)+1); + (void) strcpy(args_copy, args); + + arg = strtok (args_copy, " \t"); + while (arg) + { + thread = get_thread_by_name (arg); + if (!thread) + { + id = atoi (arg); + thread = get_thread_by_id ((unsigned) id); + if (!thread) { + printf("%s is not a thread.\n", arg); + nb_errors++; + } + else + found++; + } + else + found++; + + arg = strtok(NULL, " \t"); + } + + if (found == 0) + return (NONE_OK); + + if (nb_errors == 0) + return (ALL_OK); + + return (SOME_OK); +} + +static void +rte_add_thread (id, name, gdbThdId) + unsigned int id; + char *name; + unsigned int gdbThdId; +{ + register struct thread *new_thread, *work_thread; + + /* Allocate a new thread structure and initialize it */ + new_thread = (struct thread *) xmalloc (sizeof (struct thread)); + new_thread->next = 0; + new_thread->id = id; + new_thread->gdb_id = gdbThdId; + (void) strncpy(new_thread->name, name, THREADNAMEMAX); + new_thread->name[THREADNAMEMAX] = '\0'; + new_thread->detached = 0; + new_thread->suspended = 0; + + /* Add new thread to the end of the thread chain */ + work_thread = thread_chain; + if (work_thread == 0) + thread_chain = new_thread; + else + { + while (work_thread->next) + work_thread = work_thread->next; + work_thread->next = new_thread; + } + thread_count++; +} + + +static void +delete_thread (t) + struct thread *t; +{ + struct thread *work_thread; + unsigned char found = 0; + + if (thread_chain == t) + { + thread_chain = t->next; + found = 1; + } + else + { + ALL_THREADS(work_thread) + if (work_thread->next == t) + { + work_thread->next = t->next; + found = 1; + } + } + + if (found) + { + if (t == current_target_thread) { + original_target_thread = 0; + current_target_thread = 0; + } + free ((char *) t); + thread_count--; + } +} + + +void +clear_thread_chain () +{ + struct thread *thread; + struct thread *next; + + if (thread_chain != NULL){ + thread = thread_chain; + while (thread != NULL){ + next = thread->next; + delete_thread (thread); + thread = next; + } + thread_chain == NULL ; + } + +} + +/* + * Print for each thread in the inferior the following data: + * it's local identifier, it's symbolic name (if any), two flags + * indicating if it is detached resp. suspended. + * The information in thread_chain is updated automatically each + * time the inferior stops. + */ +static void +thread_info (arg) + char *arg; +{ + struct thread *thread; + + ERROR_NO_INFERIOR; + + if (thread_chain == 0) + { + printf_filtered ("No threads.\n"); + return; + } + + printf_filtered ("There are %d threads:\n\ +Id.\tName\t\tDetached\tSuspended\n\n", thread_count); + if (arg == 0 || *arg == ' ') { + ALL_THREADS(thread) + print_1_thread (thread); + + } + else { + if ( ! (thread = get_thread_by_name (arg)) ) + if ( ! (thread = get_thread_by_id ((unsigned) atoi (arg))) ) + error ("%s is not a thread.", arg); + print_1_thread (thread); + } +} + +char * +rtems_pid_to_str (pid) + int pid; +{ + struct thread *t; + static char thrBuf[128]; + + + if ( ! (t = get_thread_by_id (pid)) ) + error ("%d is not a thread.", pid); + + sprintf (thrBuf, "Rtems thread %d (%s) (%s )", pid, t->suspended ? "Suspended" : "Not suspended", + t == current_target_thread ? " <= current target thread" : ""); + return thrBuf; +} + +static void +thread_info_no_args() +{ + thread_info((char*) thread_args); +} + +void +print_thread (t) + int t; +{ + struct thread *thd; + thd = get_thread_by_id (t); + + if (thd) { + print_1_thread (thd); + } else { + error ("%d is not a thread.", t); + } +} + +void +print_1_thread (t) + struct thread *t; +{ + printf_filtered("%d\t%-16s%s\t\t%s\t%s\n", + t->id, + t->name, + t->detached ? "Yes" : "No ", + t->suspended ? "Yes" : "No ", + t == current_target_thread ? " <= current target thread" : ""); +} + + +/* + * Get or set the current target thread. + */ +static void +target_thread_command () + +{ + char tmp[32]; + struct thread *thread; + char *arg; + + arg = (char*) thread_args; + + ERROR_NO_INFERIOR; + + if (arg == 0 || *arg == ' ') + { + /* Print thread identifier of current target thread */ + if (current_target_thread) + { + (void) sprintf (tmp, "%d", current_target_thread->id); + print_command (tmp); + } + else + error ("No current target thread."); + } + else + { + /* Set current target thread. + * Arg can be a symbolic thread name or a (numeric) thread identifier. + */ + if ( ! (thread = get_thread_by_name (arg)) ) + if ( ! (thread = get_thread_by_id ((unsigned) atoi (arg))) ) + error ("%s is not a thread.", arg); + + /* Check if new target thread is not the same as the old one */ + if (thread == current_target_thread) + return; + + errno = 0; + (void) current_ptrace_function (RPT_SETTARGETTHREAD, original_pid, 0, + (int) thread->id); + if (errno) { + error ("RPT_SETTARGETTHREAD failed for %s: errno = %d", arg, errno); + } + current_target_thread = thread; + + inferior_pid = thread->id; + flush_cached_frames(); + registers_changed(); + + /* Update register context in REGISTERS for new target thread */ + target_fetch_registers (-1); + stop_pc = read_pc (); + set_current_frame ( create_new_frame (read_register (FP_REGNUM), + read_pc ())); + normal_stop_thread(); + + } +} + + +/* + * Attach the threads specified in the argument list, no arg means + * the current target thread. + * When a thread is attached, it will stop the inferior + * whenever it hits a breakpoint. + */ +static void +attach_thread_command () +{ + char *args; + + args = (char*) thread_args; + + ERROR_NO_INFERIOR; + + if (args == 0 || *args == ' ') + attach_1_thread (current_target_thread); + else + map_threads (args, attach_1_thread); +} + + +static void +attach_1_thread (t) + struct thread *t; +{ + t->detached = 0; +} + + +/* + * Detach the threads specified in the argument list, no arg means + * the current target thread. + * When a thread is detached, it will not stop the inferior + * whenever it hits a breakpoint, but gdb will restart the inferior + * immediately in a user transparent way. + */ +static void +detach_thread_command () +{ + char *args; + + args = (char*) thread_args; + + ERROR_NO_INFERIOR; + + if (args == 0 || *args == ' ') + detach_1_thread (current_target_thread); + else + map_threads (args, detach_1_thread); +} + + +static void +detach_1_thread (t) + struct thread *t; +{ + t->detached = 1; +} + + +/* + * Resume the threads specified in the argument list, no arg means + * the current target thread. Resuming a thread annulates the effect + * of a previous 'suspend', so that the threads will really run upon + * the next 'continue' command. + */ +static void +resume_thread_command () +{ + char *args; + + args = (char*) thread_args; + + if (isSystemDebug()) { + printf_filtered ("Invalid command when debugging system.\n"); + return; + } + + ERROR_NO_INFERIOR; + + if (args == 0 || *args == ' ') + resume_1_thread (current_target_thread); + else + map_threads (args, resume_1_thread); +} + + +static void +resume_1_thread (thread) + struct thread *thread; +{ + if (thread->suspended == 1) + { + thread->suspended = 0; + errno = 0; + (void) current_ptrace_function (RPT_THREADRESUME, original_pid, 0, + (int) thread->id); + if (errno) + error ("RPT_THREADRESUME failed for thread %d", thread->id); + } +} + + +/* + * Suspend the threads specified in the argument list, no arg means + * the current target thread. + * When a thread is suspended, it stay blocked at each 'continue' command + * until is resumed again. + */ + void +suspend_thread_command () +{ + char *args; + + if (isSystemDebug()) { + printf_filtered ("Invalid command when debugging system.\n"); + return; + } + args = (char*) thread_args; + + ERROR_NO_INFERIOR; + + if (args == 0 || *args == ' ') + suspend_1_thread (current_target_thread); + else + map_threads (args, suspend_1_thread); + +} + + +static void +suspend_1_thread (thread) + struct thread *thread; +{ + if (thread->suspended == 0) + { + thread->suspended = 1; + errno = 0; + (void) current_ptrace_function (RPT_THREADSUSPEND, original_pid, 0, + (int) thread->id); + if (errno) + error ("RPT_THREADSUSPEND failed for thread %d", thread->id); + } +} + + +/* + * Suspend all threads but the current target thread. + * This is used in case the user wants to do a command like + * 'step', 'next', 'finish', etc. + */ +void +suspend_all_other_threads () +{ + struct thread *t; + + if (! ((local_sys_can_debug_thread) || + (remote_sys_can_debug_thread && remote_debug_in_progress) + ) + ) { + return; + } + resume_1_thread (current_target_thread); + ALL_THREADS(t) + if (t != current_target_thread) + suspend_1_thread (t); +} + + +/* + * Call function on each of the threads specified in args. + * Args can be composed of thread identifiers and thread symbolic names. + */ +static void +map_threads (args, function) + char *args; + void (*function) (); +{ + register char *arg; + register int id; /* thread identifier */ + register int gdbId; + register struct thread *thread; + char found; /* nonzero if thread in args is valid */ + char all_but_flag = 0; + + if (args == 0) + error_no_arg ("one or more threads."); + + arg = strtok (args, " \t"); + + if (!strcmp(arg, "all")) { + ALL_THREADS(thread) + function(thread); + return; + } + + if (!strcmp(arg, "allbut")) { + all_but_flag = 1; + ALL_THREADS(thread) + thread->command_apply = 1; + arg = strtok(NULL, " \t"); + } + else { + ALL_THREADS(thread) + thread->command_apply = 0; + } + + while (arg) { + found = 1; + thread = 0; /* get_thread_by_name (arg);*/ + if (!thread) { + gdbId = atoi (arg); + thread = get_thread_by_id ((unsigned) gdbId); + if (!thread) + found = 0; + } + + if (found) { + if (all_but_flag) + thread->command_apply = 0; + else + thread->command_apply = 1; + } + else + (void) printf ("%s is not a thread.\n", arg); + + arg = strtok(NULL, " \t"); + } + ALL_THREADS(thread) { + if (thread->command_apply) + function(thread); + } +} + + +/* + * Update thread_chain, the list of all threads in the inferior. + */ +void +update_thread_chain () +{ + KernThread threads[UTHREAD_MAX]; + struct thread *thread; + char threadName[THREADNAMEMAX]; + int i; + int nb_threads; + + ERROR_NO_INFERIOR; + + if (! ((local_sys_can_debug_thread) || + (remote_sys_can_debug_thread && remote_debug_in_progress) + ) + ) { + rte_add_thread(100, "main-thread"); + return; + } + errno = 0; + nb_threads = current_ptrace_function (RPT_THREADLIST, original_pid, + threads, sizeof(KernThread) * UTHREAD_MAX); + + if (errno) + error ("RPT_THREADLIST failed"); + + /* Update the thread chain: threads might have been + * deleted or renamed, new threads might have been created, etc. + */ + + if (nb_threads == 0) + error("process has 0 threads, can not debug it ..."); + + for ( i = 0; i < nb_threads; i++ ) + { + errno = 0; + + current_ptrace_function (RPT_GETTHREADNAME, original_pid, threadName, + threads[i].threadLi); + + if (errno) { + if (isSystemDebug() == 0) + error ("RPT_GETTHREADNAME failed"); + } + + if ( (thread = get_thread_by_id (threads[i].threadLi)) == 0 ) { + /* A new thread has been created */ + int gdb_thd_id; + + gdb_thd_id = add_thread(threads[i].threadLi); + rte_add_thread (threads[i].threadLi, threadName, gdb_thd_id); + } + else + { + /* Check if thread's name has changed; update if necessary */ + if ( ! ( + (strcmp (thread->name, threadName) == 0) || + (threadName[0] == '\0') + ) + ) + (void) strncpy(thread->name, threadName, THREADNAMEMAX); + } + } + /* Check if thread_chain contains threads that do not exist anymore */ + + thread = thread_chain; + while(thread) + { + unsigned char found = 0; + struct thread *toBeDeleted; + + for ( i = 0; i < nb_threads; i++ ) + if (thread->id == threads[i].threadLi) + { + found = 1; + break; + } + if (!found) + { + (void) printf ("Thread %d (%s) has been deleted.\n", + thread->id, thread->name); + toBeDeleted = thread; + thread = thread->next; + delete_thread (toBeDeleted->id); + delete_thread (toBeDeleted); + } + else + thread = thread->next; + } + + get_current_target_thread (nb_threads != 0); +} + + + /* + * Ask the system for the local identifier of the current target thread. + */ +void +get_current_target_thread (stop_if_error) +int stop_if_error; +{ + unsigned int current_target_thread_id; + + ERROR_NO_INFERIOR; + if (! ((local_sys_can_debug_thread) || + (remote_sys_can_debug_thread && remote_debug_in_progress) + ) + ) { + current_target_thread = get_thread_by_id(100); + return; + } + + errno = 0; + current_target_thread_id = current_ptrace_function (RPT_GETTARGETTHREAD, original_pid, 0, 0); + if (errno) { + if (stop_if_error) + error ("RPT_GETTARGETTHREAD failed: %d, %d", current_target_thread_id, errno); + else + printf_filtered("WARNING : No threads in actor\n"); + } + current_target_thread = get_thread_by_id (current_target_thread_id); + original_target_thread = get_thread_by_id (current_target_thread_id); +} + +static void +normal_stop_thread () +{ + /* Make sure that the current_frame's pc is correct. This + is a correction for setting up the frame info before doing + DECR_PC_AFTER_BREAK */ + if (original_pid) + (get_current_frame ())->pc = read_pc (); + + select_frame (get_current_frame (), 0); + + printf ("\nthread %d [%s], ", + current_target_thread->id, current_target_thread->name); + + print_stack_frame (selected_frame, -1, 1); +} + + +/* ARGSUSED */ +static void +thread_command (exp, from_tty) + char *exp; + int from_tty; +{ + struct expression *expr = (struct expression*) parse_expression (exp); + register struct cleanup *old_chain + = make_cleanup (free_current_contents, &expr); + + evaluate_expression (expr); + do_cleanups (old_chain); +} + +/* ARGUSED */ +static void +name_thread_command() +{ + char *loc_args; + int id; + struct thread *requested_thread; + char *args; + extern int actor_debugging; + + ERROR_NO_INFERIOR; + + if (actor_debugging == 1) + { + printf("thread names are not supported for actors, only for processes\n"); + return; + } + + args = (char*) thread_args; + +#ifdef DEBUG_THREAD_CMD + printf("name_thread_command: args = %s\n", args); +#endif + if (args == 0 || *args == ' ') + { + print_1_thread(current_target_thread); + return; + } + + loc_args = strtok (args, " \t"); +#ifdef DEBUG_THREAD_CMD + printf("name_thread_command: firs loc args = %s\n", loc_args); +#endif + id = atoi (loc_args); + requested_thread = get_thread_by_id ((unsigned) id); + if (!requested_thread) + { + printf ("%d is not a valid thread id.\n", id); + return; + } + loc_args = strtok(NULL, " \t"); +#ifdef DEBUG_THREAD_CMD + printf("name_thread_command: second loc args = %s\n", loc_args); +#endif + if (loc_args == 0) + { + print_1_thread(requested_thread); + return; + } + strncpy (requested_thread->name, loc_args, THREADNAMEMAX); + errno = 0; + current_ptrace_function (RPT_SETTHREADNAME, original_pid, loc_args, + requested_thread->id); + if (errno) + error("cannot set the name inside system table (stored in gdb only)"); +} + + +#ifdef TEST_EV +static void +ev_func() +{ + int i; + int j; + char *args; + + args = (char*) thread_args; + + printf("EV FUNC: args = %s\n", args); + i = strlen((char*)args) + 1; + for (j =0; j...]\n\ +The threads whose names or identifiers are passed as arguments are suspended.\n\ +A suspended thread will not run upon the following 'continue' command.\n\ +The suspended status of a thread is a boolean value, whose current value can\n\ +be obtained with the 'info threads' command.\n\ +No arg means the current target thread is suspended.", + &thread_cmd_list); + c->function.cfunc = suspend_thread_command; + + c = add_set_cmd ("resume", class_run, var_string, (char *)&thread_args, + "Resume one or more threads.\n\ +Syntax: thread resume [all | [allbut] ...]\n\ +The threads whose names or identifiers are passed as arguments are resumed,\n\ +i.e. the effect of a previous 'suspend-thread' will be annulated.\n\ +A resumed thread will run upon the following 'continue' command.\n\ +The suspended status of a thread is a boolean value, whose current value can\n\ +be obtained with the 'info threads' command.\n\ +No arg means the current target thread is resumed.", + &thread_cmd_list); + + c->function.cfunc = resume_thread_command; + + c = add_set_cmd ("detach", class_run, var_string, (char *)&thread_args, + "Detach one or more threads.\n\ +Syntax: thread detach [all | [allbut] ...]\n\ +The threads whose names or identifiers are passed as arguments are detached.\n\ +When such a thread hits a breakpoint, it will be ignored and the inferior\n\ +continues its execution. No arg means the current target thread is detached.", + &thread_cmd_list); + + c->function.cfunc = detach_thread_command; + + c = add_set_cmd ("attach", class_run, var_string, (char *)&thread_args, + "Attach one or more threads.\n\ +Syntax: thread attach [all | [allbut] ...]\n\ +The threads whose names or identifiers are passed as arguments are attached.\n\ +When such a thread hits a breakpoint the inferior will stop executing\n\ +and gdb regains control. No arg means the current target thread is attached.", + &thread_cmd_list); + + c->function.cfunc = attach_thread_command; + + c = add_set_cmd ("target", class_threads, var_string, (char *)&thread_args, + "Set/get the target-thread. \n\ +Syntax: thread target []\n\ +The argument is either the thread's symbolic name or its local identifier.", + &thread_cmd_list); + + c->function.cfunc = target_thread_command; + +} + +void +_initialize_rtems_threads() /*_initialize_rtems_threads ()*/ +{ + struct cmd_list_element *c; + + thread_chain = 0; + current_target_thread = 0; + thread_count = 0; + threadlist = (struct cmd_list_element *) 0; + + add_cmd ("rte_threads", class_threads, NULL, "Thread commands.", &cmdlist); + add_prefix_cmd ("rte_thread", class_threads, thread_command, +"Thread management prefix command\n", &threadlist, "rte_thread ", 1, &cmdlist); + +#ifdef TEST_EV + c = add_set_cmd ("ev", class_threads, var_string, (char *)&thread_args, + "test thread suffix command.\n", + &threadlist); + c->function.cfunc = ev_func; +#endif + + c = add_set_cmd ("suspend", class_threads, var_string, (char *)&thread_args, + "Suspend one or more threads.\n\ +Syntax: thread suspend [all | [allbut] ...]\n\ +The threads whose names or identifiers are passed as arguments are suspended.\n\ +A suspended thread will not run upon the following 'continue' command.\n\ +The suspended status of a thread is a boolean value, whose current value can\n\ +be obtained with the 'info threads' command.\n\ +No arg means the current target thread is suspended.", + &threadlist); + + c->function.cfunc = suspend_thread_command; + + c = add_set_cmd ("resume", class_threads, var_string, (char *)&thread_args, + "Resume one or more threads.\n\ +Syntax: thread resume [all | [allbut] ...]\n\ +The threads whose names or identifiers are passed as arguments are resumed,\n\ +i.e. the effect of a previous 'suspend-thread' will be annulated.\n\ +A resumed thread will run upon the following 'continue' command.\n\ +The suspended status of a thread is a boolean value, whose current value can\n\ +be obtained with the 'info threads' command.\n\ +No arg means the current target thread is resumed.", + &threadlist); + + c->function.cfunc = resume_thread_command; + + c = add_set_cmd ("detach", class_threads, var_string, (char *)&thread_args, + "Detach one or more threads.\n\ +Syntax: thread detach [all | [allbut] ...]\n\ +The threads whose names or identifiers are passed as arguments are detached.\n\ +When such a thread hits a breakpoint, it will be ignored and the inferior\n\ +continues its execution. No arg means the current target thread is detached.", + &threadlist); + + c->function.cfunc = detach_thread_command; + + c = add_set_cmd ("attach", class_threads, var_string, (char *)&thread_args, + "Attach one or more threads.\n\ +Syntax: thread attach [all | [allbut] ...]\n\ +The threads whose names or identifiers are passed as arguments are attached.\n\ +When such a thread hits a breakpoint the inferior will stop executing\n\ +and gdb regains control. No arg means the current target thread is attached.", + &threadlist); + + c->function.cfunc = attach_thread_command; + + + c = add_set_cmd ("info", class_threads, var_string, (char *)&thread_args, + "List all threads descriptors, or the thread specified.\n\ +Syntax: thread info []\n\ +The first column displays the thread's local identifier, the second column\n\ +its symbolic name. The third column is \"Yes\" for a detached thread and\n\ +\"No\" for an attached thread. The fourth column tells if is suspended or not.", + &threadlist); + + c->function.cfunc = thread_info_no_args; + + c = add_set_cmd ("target", class_threads, var_string, (char *)&thread_args, + "Set/get the target-thread. \n\ +Syntax: thread target []\n\ +The argument is either the thread's symbolic name or its local identifier.", + &threadlist); + + c->function.cfunc = target_thread_command; + + c = add_set_cmd ("name", class_threads, var_string, (char *)&thread_args, + "Set/get the symbolic name of a thread.\n\ +Syntax: thread name []\n\ +The thread is specified by its local id.", + &threadlist); + + c->function.cfunc = name_thread_command; + + add_info ("threads", thread_info, + "List all threads descriptors, or the thread specified.\n\ +The first column displays the thread's local identifier, the second column\n\ +its symbolic name. The third column is \"Yes\" for a detached thread and\n\ +\"No\" for an attached thread. The fourth column tells if is suspended or not."); + +} + + diff -Naur gdb-5.2-PLUS_CG/gdb/thread_rte.h gdb-5.2-PLUS_RDBG/gdb/thread_rte.h --- gdb-5.2-PLUS_CG/gdb/thread_rte.h Wed Dec 31 18:00:00 1969 +++ gdb-5.2-PLUS_RDBG/gdb/thread_rte.h Wed Jun 12 11:17:59 2002 @@ -0,0 +1,72 @@ +/* + **************************************************************** + * + * Component = GDB - GNU Debugger for multithreaded processes. + **************************************************************** + * Copyright(C) 2000 Canon Research Center France SA. + * + * Developped by : + * Eric Valette, mail to : valette@crf.canon.fr + * Emmanuel Raguet, mail to : raguet@crf.canon.fr + * + * $Header: /sunHome/valette/CVS-Chorus-Root/gdb/PATCH/GDB-5.0/Rtems/patch-gdb-5.0-rtems,v 1.2 2000/06/07 16:37:11 valette Exp $ + * + */ + +/* This file is part of GDB. + +GDB 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, or (at your option) +any later version. + +GDB 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 GDB; see the file COPYING. If not, write to +the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef THREAD_OS_H +#define THREAD_OS_H + +#include "rtems/remdeb.h" + +/* + * External thread function declarations. + */ +extern void print_1_thread (); +extern void cont_1_thread (); +extern void get_current_target_thread (); +extern void update_thread_chain (); +extern void clear_thread_chain (); +extern void suspend_all_other_threads (); +extern int get_current_thread_id (); + + +struct thread { + struct thread *next; /* next thread in chain */ + unsigned int id; /* thread local identifier */ + unsigned int gdb_id; /* thread's identifier in gdb */ + char name[THREADNAMEMAX+1]; /* thread symbolic name */ + char detached; /* nonzero if thread is detached */ + char suspended ; /* nonzero if thread is suspended */ + char command_apply; /* nonzero if current command */ + /* must be applied on this thread */ +}; + +extern struct thread *thread_chain; /* Chain of all threads */ + +extern struct thread *current_target_thread; /* Current target thread */ +extern struct thread *original_target_thread; /* Original target thread */ + +#define ALL_THREADS(t) for (t = thread_chain; t; t = t->next) +#define GET_CURRENT_THREAD_ID() get_current_thread_id() + +#endif /* THREAD_OS_H */ + + + +