diff options
Diffstat (limited to 'gdb/gdbserver')
44 files changed, 0 insertions, 17896 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog deleted file mode 100644 index 00a9cd6..0000000 --- a/gdb/gdbserver/ChangeLog +++ /dev/null @@ -1,1099 +0,0 @@ -2006-07-22 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.ac: Check for more headers which are missing on - Windows. Automatically supply -lwsock32 and USE_WIN32API. - * configure.srv: Add Cygwin and mingw32. - * remote-utils.c: Don't include headers unconditionally which - are missing on mingw32. Include <winsock.h> for mingw32. - (remote_open): Adjust for mingw32 support. Flush - standard error after writing to it. - (remote_close, putpkt_binary, input_interrupt, block_async_io) - (unblock_async_io, enable_async_io, disable_async_io) - (readchar, getpkt): Update for Winsock support. - (prepare_resume_reply): Expect a protocol signal number. - * server.c: Disable <sys/wait.h> on mingw32. - (start_inferior): Adjust for mingw32 support. Flush - standard error after writing to it. - (attach_inferior): Likewise. Use protocol signal - numbers. - (main): Skip 'D' packet on mingw32. Use protocol signal numbers - and names. - * win32-i386-low.c: New file. - * Makefile.in (XM_CLIBS): Set. - (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS). - (win32-i386-low.o): New dependency rule. - * linux-low.c (linux_wait): Use target signal numbers. - * target.h (struct target_ops): Doc fix. - * server.h (target_signal_to_name): New prototype. - * gdbreplay.c: Don't include headers unconditionally which - are missing on mingw32. Include <winsock.h> for mingw32. - (remote_close, remote_open): Adjust for Winsock support. - * configure, config.in: Regenerated. - -2006-07-12 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (decode_xfer_read, write_qxfer_response): New. - (handle_query): Take a packet length argument. Handle - qXfer:auxv:read instead of qPart:auxv:read. Mention it in - the qSupported response. - (main): Update call to handle_query. - -2006-06-22 Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c (remote_escape_output, remote_unescape_input): New. - (putpkt_binary): Renamed from putpkt and adjusted for binary - data. - (putpkt): New wrapper for putpkt_binary. - (readchar): Don't mask off the high bit. - (decode_X_packet): New function. - * server.c (main): Call putpkt_binary if a handler sets the packet - length. Save the length of the incoming packet. Handle 'X'. - * server.h (gdb_byte, remote_escape_output, decode_X_packet): New. - -2006-06-21 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (handle_query): Handle qSupported. - -2006-05-30 Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c (all_symbols_looked_up): New variable. - (look_up_one_symbol): Check it. - * server.h (look_up_one_symbol): New declaration. - * thread-db.c (thread_db_init): Set all_symbols_looked_up. - -2006-05-30 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (linux-arm-low.o): Update dependencies. - * linux-arm-low.c: Include "gdb_proc_service.h". - (PTRACE_GET_THREAD_AREA): Define. - (ps_get_thread_area): New function. - -2006-05-09 Nathan Sidwell <nathan@codesourcery.com> - - * configure.srv (m68k*-*-uclinux*): New target. - * linux-low.c (linux_create_inferior): Use vfork on mmuless systems. - (linux_resume_one_process): Remove extraneous cast. - (linux_read_offsets): New. - (linux_target_op): Add linux_read_offsets on mmuless systems. - * server.c (handle_query): Add qOffsets logic. - * target.h (struct target_ops): Add read_offsets. - -2006-03-15 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h". - (PTRACE_GET_THREAD_AREA): Define. - (ps_get_thread_area): New function. - * Makefile.in (linux-i386-low.o, linux-mips-low.o) - (linux-x86-64-low.o): Update. - -2006-03-15 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.ac: Remove checks for prfpregset_t. - * gdb_proc_service.h: New file. - * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the - new "gdb_proc_service.h". - * proc-service.c: Likewise. - (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t. - (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument. - * Makefile.in (gdb_proc_service_h): Updated. - * configure, config.in: Regenerated. - -2006-03-03 Daniel Jacobowitz <dan@codesourcery.com> - - * remote-utils.c (prepare_resume_reply): Move declaration - of gdb_id_from_wait to the top of the block. - -2006-02-15 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (regsets_store_inferior_registers): Read the regset - from the target before filling it. - -2006-02-08 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (attach_inferior): Return SIGTRAP for a successful - attach. - -2006-02-01 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (OBS): Add version.o. - (STAGESTUFF): Delete. - (version.o): Add dependencies. - (version.c): Replace rule. - (clean): Remove version.c. - * server.c (gdbserver_version): New. - (gdbserver_usage): Use printf. - (main): Handle --version and --help. - * server.h (version, host_name): Add declarations. - -2005-12-23 Eli Zaretskii <eliz@gnu.org> - - * linux-arm-low.c: - * linux-arm-low.c: - * inferiors.c: - * i387-fp.h: - * i387-fp.c: - * gdbreplay.c: - * regcache.c: - * proc-service.c: - * mem-break.h: - * mem-break.c: - * linux-x86-64-low.c: - * linux-sh-low.c: - * linux-s390-low.c: - * linux-ppc64-low.c: - * linux-ppc-low.c: - * linux-mips-low.c: - * linux-m68k-low.c: - * linux-m32r-low.c: - * linux-low.h: - * linux-low.c: - * linux-ia64-low.c: - * linux-i386-low.c: - * linux-crisv32-low.c: - * thread-db.c: - * terminal.h: - * target.h: - * target.c: - * server.h: - * server.c: - * remote-utils.c: - * regcache.h: - * utils.c: - * Makefile.in: - * configure.ac: - * gdbserver.1: Add (C) after Copyright. Update the FSF - address. - -2005-11-13 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-arm-low.c (arm_eabi_breakpoint): New variable. - (arm_breakpoint_at): Recognize both breakpoints. - (the_low_target): Use the correct breakpoint instruction. - -2005-11-02 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.srv (x86_64-*-linux*): Turn on thread_db support. - * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len) - (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New. - (the_low_target): Update. - -2005-10-25 Andreas Schwab <schwab@suse.de> - - * server.c (main): Allocate mem_buf with PBUFSIZ bytes. - - * linux-ia64-low.c (ia64_regmap): Remove NAT registers. - (ia64_num_regs): Reduce to 462. - -2005-09-17 Daniel Jacobowitz <dan@codesourcery.com> - - * acinclude.m4: Correct quoting. - * aclocal.m4: Regenerated. - - Suggested by SZOKOVACS Robert <szo@ies.hu>: - * thread-db.c (thread_db_err_str): Handle TD_VERSION. - (thread_db_init): Call thread_db_err_str. - * configure.ac: Check for TD_VERSION. - * config.in, configure: Regenerated. - -2005-07-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - * server.h (error, fatal, warning): Add ATTR_FORMAT. - -2005-07-13 Daniel Jacobowitz <dan@codesourcery.com> - - * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS - is not available. Define HAVE_PTRACE_GETREGS if it is. - * config.in, configure: Regenerated. - * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64. - * linux-i386-low.c, linux-m68k-low.c: Update to use - HAVE_PTRACE_GETREGS. - * linux-low.c (regsets_fetch_inferior_registers) - (regsets_store_inferior_registers): Only return 0 if we processed - GENERAL_REGS. - * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New. - * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New. - -2005-07-13 Daniel Jacobowitz <dan@codesourcery.com> - - * inferiors.c (struct thread_info): Add gdb_id. - (add_thread): Add gdb_id argument. - (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New. - * linux-low.c (linux_create_inferior, linux_attach_lwp): Update - calls to add_thread. - * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id. - * server.c (handle_query): Use thread_to_gdb_id. - (handle_v_cont, main): Use gdb_id_to_thread_id. - * server.h (add_thread): Update prototype. - (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New - prototypes. - -2005-07-13 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (fetch_register, usr_store_inferior_registers): Handle - left-padded registers. - * linux-low.h (struct linux_target_ops): Add left_pad_xfer. - * linux-ppc64-low.c (the_low_target): Set left_pad_xfer. - -2005-07-01 Steve Ellcey <sje@cup.hp.com> - - * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS. - * configure: Regenerate. - * config.in: Regenerate. - * server.h (NEED_DECLARATION_STRERROR): - Replace with !HAVE_DECL_STRERROR. - -2005-06-16 Daniel Jacobowitz <dan@codesourcery.com> - - * linux-low.c (linux_wait, linux_send_signal): Don't test - an unsigned long variable for > 0 if it could be MAX_ULONG. - * server.c (myresume): Likewise. - * target.c (set_desired_inferior): Likewise. - -2005-06-13 Mark Kettenis <kettenis@gnu.org> - - * configure.ac: Simplify and improve check for socklen_t. - * configure, config.in: Regenerate. - -2005-06-12 Daniel Jacobowitz <dan@codesourcery.com> - - * acconfig.h: Remove. - * configure.ac: Add a test for socklen_t. Use three-argument - AC_DEFINE throughout. - * config.in: Regenerated using autoheader 2.59. - * configure: Regenerated. - - * gdbreplay.c (socklen_t): Provide a default. - (remote_open): Use socklen_t. - * remote-utils.c (socklen_t): Provide a default. - (remote_open): Use socklen_t. - (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use - unsigned char. - - * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned - char for buffers. - * linux-low.c (linux_read_memory, linux_write_memory) - (linux_read_auxv): Likewise. - * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read) - (check_mem_write): Likewise. - * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write): - Likewise. - * regcache.c (struct inferior_rgcache_data, registers_to_string) - (registers_from_string, register_data): Likewise. - * server.c (handle_query, main): Likewise. - * server.h (convert_ascii_to_int, convert_int_to_ascii) - (decode_M_packet): Likewise. - * target.c (read_inferior_memory, write_inferior_memory): Likewise. - * target.h (struct target_ops): Update read_memory, write_memory, - and read_auxv. - (read_inferior_memory, write_inferior_memory): Update. - * linux-low.h (struct linux_target_ops): Change type of breakpoint - to unsigned char *. - * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c, - linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c, - linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c, - linux-s390-low.c, linux-sh-low.c: Update for changes in - read_inferior_memory and the_low_target->breakpoint. - -2005-05-28 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (SFILES): Add linux-ppc64-low.c. - (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets. - * configure.srv: Add powerpc64-*-linux*. - * linux-ppc64-low.c: New file. - -2005-05-23 Orjan Friberg <orjanf@axis.com> - - * linux-cris-low.c: New file with support for CRIS. - * linux-crisv32-low.c: Ditto for CRISv32. - * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c. - (clean): Add reg-cris.c and reg-crisv32.c. - Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c, - reg-crisv32.o, and reg-crisv32.c to make rules. - * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of - recognized targets. - -2005-05-16 Ulrich Weigand <uweigand@de.ibm.com> - - * linux-low.c (fetch_register): Ensure buffer size is a multiple - of sizeof (PTRACE_XFER_TYPE). - (usr_store_inferior_registers): Likewise. Zero out excess bytes. - -2005-05-12 Orjan Friberg <orjanf@axis.com> - - * target.h (struct target_ops): Add insert_watchpoint, - remove_watchpoint, stopped_by_watchpoint, stopped_data_address function - pointers for hardware watchpoint support. - * linux-low.h (struct linux_target_ops): Ditto. - * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint) - (linux_stopped_by_watchpoint, linux_stopped_data_address): New. Add - to linux_target_ops. - * remote-utils.c (prepare_resume_reply): Add watchpoint information to - reply packet. - * server.c (main): Recognize 'Z' and 'z' packets. - -2005-05-10 Ulrich Weigand <uweigand@de.ibm.com> - - * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define. - (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions. - (the_low_target): Add new members. - -2005-05-04 Daniel Jacobowitz <dan@codesourcery.com> - - * proc-service.c (ps_lgetregs): Search all_processes instead of - all_threads. - -2005-05-04 Daniel Jacobowitz <dan@codesourcery.com> - - * server.c (start_inferior): Change return type to int. - (attach_inferior): Change sigptr to int *. - (handle_v_cont, handle_v_requests): Change signal to int *. - (main): Change signal to int. - -2005-04-15 Kei Sakamoto <sakamoto.kei@renesas.com> - - * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o. - * configure.srv: Add m32r*-*-linux*. - * linux-m32r-low.c: New file. - -2005-03-04 Daniel Jacobowitz <dan@codesourcery.com> - - * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly. - -2005-03-03 Daniel Jacobowitz <dan@codesourcery.com> - - * inferiors.c (change_inferior_id, add_thread, find_inferior_id): - Take unsigned long arguments for PIDs. - * linux-low.c (add_process, linux_attach_lwp, linux_attach) - (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop) - (wait_for_sigstop, linux_resume_one_process) - (regsets_fetch_inferior_registers, linux_send_signal) - (linux_read_auxv): Likewise. Update the types of variables holding - PIDs. Update format string specifiers. - * linux-low.h (struct process_info, linux_attach_lwp): Likewise. - * remote-utils.c (prepare_resume_reply): Likewise. - * server.c (cont_thread, general_thread, step_thread) - (thread_from_wait, old_thread_from_wait, signal_pid): Change type to - unsigned long. - (handle_query): Update format specifiers. - (handle_v_cont, main): Use strtoul for thread IDs. - * server.h (struct inferior_list_entry): Use unsigned long for ID. - (add_thread, find_inferior_id, change_inferior_id, cont_thread) - (general_thread, step_thread, thread_from_wait) - (old_thread_from_wait): Update. - * target.h (struct thread_resume): Use unsigned long for THREAD. - (struct target_ops): Use unsigned long for arguments to attach and - thread_alive. - -2005-02-24 Daniel Jacobowitz <dan@codesourcery.com> - - * acinclude.m4: Include bfd/bfd.m4 directly. - * configure.ac: Use AC_ARG_PROGRAM. Suggested by Aron Griffis - <agriffis@toolchain.org>. - * aclocal.m4, configure: Regenerated. - -2005-01-07 Andrew Cagney <cagney@gnu.org> - - * configure.ac: Rename configure.in, require autoconf 2.59. - * configure: Re-generate. - -2004-12-08 Daniel Jacobowitz <dan@debian.org> - - * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area. Reset - LIBS when finished. - * aclocal.m4: Regenerated. - * configure: Regenerated. - -2004-11-21 Andreas Schwab <schwab@suse.de> - - * linux-m68k-low.c (m68k_num_gregs): Define. - (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset) - (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New. - (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc) - (m68k_breakpoint_at): New. Add to the_low_target. - - * configure.srv (m68*-*-linux*): Set srv_linux_regsets and - srv_linux_thread_db to yes. - -2004-10-20 Joel Brobecker <brobecker@gnat.com> - - * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing. - (ARCH_SET_FS): Likewise. - (ARCH_GET_FS): Likewise. - (ARCH_GET_GS): Likewise. - -2004-10-16 Daniel Jacobowitz <dan@debian.org> - - * linux-i386-low.c (ps_get_thread_area): New. - * linux-x86-64-low.c (ps_get_thread_area): New. - * linux-low.c: Include <sys/syscall.h>. - (linux_kill_one_process): Don't kill the first thread here. - (linux_kill): Kill the first thread here. - (kill_lwp): New function. - (send_sigstop, linux_send_signal): Use it. - * proc-service.c: Clean up #ifdefs. - (fpregset_info): Delete. - (ps_lgetregs): Update and enable implementation. - (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled - implementations. - * remote-utils.c (struct sym_cache, symbol_cache): New. - (input_interrupt): Print a clearer message. - (async_io_enabled): New variable. - (enable_async_io, disable_async_io): Use it. Update comments. - (look_up_one_symbol): Use the symbol cache. - * thread-db.c (thread_db_look_up_symbols): New function. - (thread_db_init): Update comments. Call thread_db_look_up_symbols. - -2004-10-16 Daniel Jacobowitz <dan@debian.org> - - * configure.in: Test for -rdynamic. - * configure: Regenerated. - * Makefile (INTERNAL_LDFLAGS): New. - (gdbserver, gdbreplay): Use it. - -2004-09-02 Andrew Cagney <cagney@gnu.org> - - * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE. - -2004-03-23 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_wait): Clear all_processes list also. - -2004-03-12 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c: Include <errno.h>. Remove extern declaration of - errno. - -2004-03-12 Daniel Jacobowitz <drow@mvista.com> - - * gdbreplay.c, server.h, utils.c: Update copyright years. - -2004-03-04 Nathan J. Williams <nathanw@wasabisystems.com> - - * server.c (main): Print child status or termination signal from - variable 'signal', not 'sig'. - -2004-03-04 Nathan J. Williams <nathanw@wasabisystems.com> - - * linux-low.c (linux_read_memory): Change return type to - int. Check for and return error from ptrace(). - * target.c (read_inferior_memory): Change return type to int. Pass - back return status from the_target->read_memory(). - * target.h (struct target_ops): Adapt *read_memory() prototype. - Update comment. - (read_inferior_memory): Adapt prototype. - * server.c (main): Return an error packet if - read_inferior_memory() returns an error. - -2004-03-04 Daniel Jacobowitz <drow@mvista.com> - - * Makefile.in (distclean): Remove config.h, stamp-h, and config.log. - Unify with other clean targets. - -2004-02-29 Daniel Jacobowitz <drow@mvista.com> - - * server.c (handle_v_cont): Call set_desired_inferior. - -2004-02-29 Daniel Jacobowitz <drow@mvista.com> - - * remote-utils.c (prepare_resume_reply): Always supply "thread:". - -2004-02-29 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_wait): Unblock async I/O. - (linux_resume): Block and enable async I/O. - * remote-utils.c (block_async_io, unblock_async_io): New functions. - * server.h (block_async_io, unblock_async_io): Add prototypes. - -2004-02-29 Daniel Jacobowitz <drow@mvista.com> - - * remote-utils.c (remote_open): Print a status notice after - opening a TCP port. - * server.c (attach_inferior): Print a status notice after - attaching. - -2004-02-29 Daniel Jacobowitz <drow@mvista.com> - - * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode. - -2004-02-26 Daniel Jacobowitz <drow@mvista.com> - - * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the - error packet. - * server.c, target.h: Update copyright years. - -2004-02-25 Roland McGrath <roland@redhat.com> - - * target.h (struct target_ops): New member `read_auxv'. - * server.c (handle_query): Handle qPart:auxv:read: query using that. - * linux-low.c (linux_read_auxv): New function. - (linux_target_ops): Initialize `read_auxv' member to that. - -2004-02-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> - - Committed by Jim Blandy <jimb@redhat.com>. - - * linux-s390-low.c (s390_num_regs): Update. - (s390_regmap): Remove control registers. Use __s390x__ predefine - instead of GPR_SIZE to distiguish s390 and s390x targets. - -2004-01-31 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c: Update copyright year. - (check_removed_breakpoint): Clear pending_is_breakpoint. - (linux_set_resume_request, linux_queue_one_thread) - (resume_status_pending_p): New functions. - (linux_continue_one_thread): Use process->resume. - (linux_resume): Only resume threads if there are no pending events. - * linux-low.h (struct process_info): Add resume request - pointer. - -2004-01-30 Daniel Jacobowitz <drow@mvista.com> - - * regcache.c (new_register_cache): Clear the allocated register - buffer. Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>. - -2003-10-13 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_resume): Take a struct thread_resume * - argument. - (linux_wait): Update call. - (resume_ptr): New static variable. - (linux_continue_one_thread): Renamed from - linux_continue_one_process. Use resume_ptr. - (linux_resume): Use linux_continue_one_thread. - * server.c (handle_v_cont, handle_v_requests): New functions. - (myresume): New function. - (main): Handle 'v' case. - * target.h (struct thread_resume): New type. - (struct target_ops): Change argument of "resume" to struct - thread_resume *. - (myresume): Delete macro. - -2003-08-08 H.J. Lu <hongjiu.lu@intel.com> - - * Makefile.in (install-only): Create dest dir. Support DESTDIR. - (uninstall): Support DESTDIR. - -Mon Jul 21 20:09:34 UTC 2003 Brendan Conoboy <blc@redhat.com> - - * configure.srv: Add xscale*linux copy of arm*linux entry. - -2003-07-24 Daniel Jacobowitz <drow@mvista.com> - - * linux-arm-low.c (arm_reinsert_addr): New function. - (the_low_target): Add arm_reinsert_addr. - -2003-07-08 Mark Kettenis <kettenis@gnu.org> - - * mem-break.c: Remove whitespace at end of file. - -2003-06-28 Daniel Jacobowitz <drow@mvista.com> - - * configure.in: Check whether we need to prototype strerror. - * server.h: Optionally prototype strerror. - * gdbreplay.c (perror_with_name): Use strerror. - * linux-low.c (linux_attach_lwp): Use strerror. - * utils.c (perror_with_name): Use strerror. - * config.in, configure: Regenerated. - -2003-06-28 Daniel Jacobowitz <drow@mvista.com> - - * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by - SUGIOKA Toshinobu <sugioka@itonet.co.jp>. - -2003-06-20 Daniel Jacobowitz <drow@mvista.com> - - * Makefile.in (SFILES): Update. - * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c, - low-sun3.c: Remove files. - -2003-06-17 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c: Move comment to linux_thread_alive where it belonged. - (linux_detach_one_process, linux_detach): New functions. - (linux_target_ops): Add linux_detach. - * server.c (main): Handle 'D' packet. - * target.h (struct target_ops): Add "detach" member. - (detach_inferior): Define. - -2003-06-13 Mark Kettenis <kettenis@gnu.org> - - From Kelley Cook <kelleycook@wideopenwest.com>: - * configure.srv: Accept i[34567]86 variants. - -2003-06-05 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_wait_for_event): Correct comment typos. - (linux_resume_one_process): Call check_removed_breakpoint. - (linux_send_signal): New function. - (linux_target_ops): Add linux_send_signal. - * remote-utils.c (putpkt, input_interrupt): Use send_signal instead - of kill. - * target.h (struct target_ops): Add send_signal. - -2003-05-29 Jim Blandy <jimb@redhat.com> - - * linux-low.c (usr_store_inferior_registers): Transfer buf in - PTRACE_XFER_TYPE-sized chunks, not int-sized chunks. Otherwise, - if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing - away part of the register's value. - -2003-03-26 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_create_inferior): Use __SIGRTMIN. - (linux_wait_for_event, linux_init_signals): Likewise. - -2003-03-17 Daniel Jacobowitz <drow@mvista.com> - - * configure.in: Check for stdlib.h. - * configure: Regenerated. - * config.in: Regenerated. - -2003-01-04 Andreas Schwab <schwab@suse.de> - - * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31. - -2003-01-02 Andrew Cagney <ac131313@redhat.com> - - * Makefile.in: Remove obsolete code. - -2002-11-20 Daniel Jacobowitz <drow@mvista.com> - - * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of - defined(PT_FPR0_HI). - -2002-11-17 Stuart Hughes <seh@zee2.com> - - * linux-arm-low.c (arm_num_regs): Increase. - (arm_regmap): Include status register. - -2002-11-17 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (register_addr): Remove incorrect -1 check. - -2002-08-29 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (linux_create_inferior): Call setpgid. Return - the new PID. - (unstopped_p, linux_signal_pid): Remove. - (linux_target_ops): Remove linux_signal_pid. - * remote-utils.c (putpkt, input_interrupt): Use signal_pid - global instead of target method. - * target.h (struct target_ops): Remove signal_pid. Update comment - for create_inferior. - * server.c (signal_pid): New variable. - (create_inferior): Set signal_pid. Block SIGTTOU and SIGTTIN in - gdbserver. Set the child to be the foreground process group. - (attach_inferior): Set signal_pid. - -2002-08-23 Daniel Jacobowitz <drow@mvista.com> - - * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2. - -2002-08-20 Jim Blandy <jimb@redhat.com> - - * Makefile.in (LDFLAGS): Allow the configure script to establish a - default for this. - -2002-08-01 Andrew Cagney <cagney@redhat.com> - - * Makefile.in: Make chill references obsolete. - -2002-07-24 Kevin Buettner <kevinb@redhat.com> - - * configure.in (unistd.h): Add to AC_CHECK_HEADERS list. - * configure: Regenerate. - * config.in: Regenerate. - -2002-07-09 David O'Brien <obrien@FreeBSD.org> - - * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include. - (perror_with_name, remote_close, remote_open, expect, play): Static. - -2002-07-04 Michal Ludvig <mludvig@suse.cz> - - * linux-x86-64-low.c (x86_64_regmap): Make it an array of - byte offsets instead of an array of indexes. - (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const. - -2002-06-13 Daniel Jacobowitz <drow@mvista.com> - - * regcache.c: Add comment. - -2002-06-11 Daniel Jacobowitz <drow@mvista.com> - - * thread-db.c: New file. - * proc-service.c: New file. - * acinclude.m4: New file. - * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h, - proc-service.o, and thread-db.o. - (linux-low.o): Add USE_THREAD_DB. - * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T, - HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN. - * aclocal.m4: Regenerated. - * config.in: Regenerated. - * configure: Regenerated. - * configure.in: Check for proc_service.h, sys/procfs.h, - thread_db.h, and linux/elf.h headrs. - Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and - PRFPREGSET_T_BROKEN. Introduce srv_thread_depfiles and USE_THREAD_DB. - Check for -lthread_db and thread support. - * configure.srv: Enable thread_db support for ARM, i386, MIPS, - PowerPC, and SuperH. - * i387-fp.c: Constify arguments. - * i387-fp.h: Likewise. - * inferiors.c: (struct thread_info): Renamed from - `struct inferior_info'. Remove PID member. Use generic inferior - list header. All uses updated. - (inferiors, signal_pid): Removed. - (all_threads): New variable. - (get_thread): Define. - (add_inferior_to_list): New function. - (for_each_inferior): New function. - (change_inferior_id): New function. - (add_inferior): Removed. - (remove_inferior): New function. - (add_thread): New function. - (free_one_thread): New function. - (remove_thread): New function. - (clear_inferiors): Use for_each_inferior and free_one_thread. - (find_inferior): New function. - (find_inferior_id): New function. - (inferior_target_data): Update argument type. - (set_inferior_target_data): Likewise. - (inferior_regcache_data): Likewise. - (set_inferior_regcache_data): Likewise. - * linux-low.c (linux_bp_reinsert): Remove. - (all_processes, stopping_threads, using_thrads) - (struct pending_signals, debug_threads, pid_of): New. - (inferior_pid): Replace with macro. - (struct inferior_linux_data): Remove. - (get_stop_pc, add_process): New functions. - (linux_create_inferior): Restore SIGRTMIN+1 before calling exec. - Use add_process and add_thread. - (linux_attach_lwp): New function, based on old linux_attach. Use - add_process and add_thread. Set stop_expected for new threads. - (linux_attach): New function. - (linux_kill_one_process): New function. - (linux_kill): Kill all LWPs. - (linux_thread_alive): Use find_inferior_id. - (check_removed_breakpoints, status_pending_p): New functions. - (linux_wait_for_process): Renamed from linux_wait_for_one_inferior. - Update. Use WNOHANG. Wait for cloned processes also. Update process - struct for the found process. - (linux_wait_for_event): New function. - (linux_wait): Use it. Support LWPs. - (send_sigstop, wait_for_sigstop, stop_all_processes) - (linux_resume_one_process, linux_continue_one_process): New functions. - (linux_resume): Support LWPs. - (REGISTER_RAW_SIZE): Remove. - (fetch_register): Use register_size instead. Call supply_register. - (usr_store_inferior_registers): Likewise. Call collect_register. - Fix recursive case. - (regsets_fetch_inferior_registers): Improve error message. - (regsets_store_inferior_registers): Add debugging. - (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB. - (unstopped_p, linux_signal_pid): New functions. - (linux_target_ops): Add linux_signal_pid. - (linux_init_signals): New function. - (initialize_low): Call it. Initialize using_threads. - * regcache.c (inferior_regcache_data): Add valid - flag. - (get_regcache): Fetch registers lazily. Add fetch argument - and update all callers. - (regcache_invalidate_one, regcache_invalidate): New - functions. - (new_register_cache): Renamed from create_register_cache. - Return the new regcache. - (free_register_cache): Change argument to a void *. - (registers_to_string, registers_from_string): Call get_regcache - with fetch flag set. - (register_data): Make static. Pass fetch flag to get_regcache. - (supply_register): Call get_regcache with fetch flag clear. - (collect_register): Call get_regcache with fetch flag set. - (collect_register_as_string): New function. - * regcache.h: Update. - * remote-utils.c (putpkt): Flush after debug output and use - stderr. - Handle input interrupts while waiting for an ACK. - (input_interrupt): Use signal_pid method. - (getpkt): Flush after debug output and use stderr. - (outreg): Use collect_register_as_string. - (new_thread_notify, dead_thread_notify): New functions. - (prepare_resume_reply): Check using_threads. Set thread_from_wait - and general_thread. - (look_up_one_symbol): Flush after debug output. - * server.c (step_thread, server_waiting): New variables. - (start_inferior): Don't use signal_pid. Update call to mywait. - (attach_inferior): Update call to mywait. - (handle_query): Handle qfThreadInfo and qsThreadInfo. - (main): Don't fetch/store registers explicitly. Use - set_desired_inferior. Support proposed ``Hs'' packet. Update - calls to mywait. - * server.h: Update. - (struct inferior_list, struct_inferior_list_entry): New. - * target.c (set_desired_inferior): New. - (write_inferior_memory): Constify. - (mywait): New function. - * target.h: Update. - (struct target_ops): New signal_pid method. - (mywait): Removed macro, added prototype. - - * linux-low.h (regset_func): Removed. - (regset_fill_func, regset_store_func): New. - (enum regset_type): New. - (struct regset_info): Add type field. Use new operation types. - (struct linux_target_ops): stop_pc renamed to get_pc. - Add decr_pc_after_break and breakpoint_at. - (get_process, get_thread_proess, get_process_thread) - (strut process_info, all_processes, linux_attach_lwp) - (thread_db_init): New. - - * linux-arm-low.c (arm_get_pc, arm_set_pc, - arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New. - (the_low_target): Add new members. - * linux-i386-low.c (i386_store_gregset, i386_store_fpregset) - (i386_store_fpxregset): Constify. - (target_regsets): Add new kind identifier. - (i386_get_pc): Renamed from i386_stop_pc. Simplify. - (i386_set_pc): Add debugging. - (i386_breakpoint_at): New function. - (the_low_target): Add new members. - * linux-mips-low.c (mips_get_pc, mips_set_pc) - (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr) - (mips_breakpoint_at): New. - (the_low_target): Add new members. - * linux-ppc-low.c (ppc_get_pc, ppc_set_pc) - (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New. - (the_low_target): Add new members. - * linux-sh-low.c (sh_get_pc, sh_set_pc) - (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New. - (the_low_target): Add new members. - * linux-x86-64-low.c (target_regsets): Add new kind - identifier. - -2002-05-15 Daniel Jacobowitz <drow@mvista.com> - - From Martin Pool <mbp@samba.org>: - * server.c (gdbserver_usage): New function. - (main): Call it. - -2002-05-14 Daniel Jacobowitz <drow@mvista.com> - - * mem-break.c (reinsert_breakpoint_by_bp): Correct typo - stop_at -> stop_pc. - -2002-05-04 Andrew Cagney <ac131313@redhat.com> - - * Makefile.in: Remove obsolete code. - -2002-04-24 Michal Ludvig <mludvig@suse.cz> - - * linux-low.c (regsets_fetch_inferior_registers), - (regsets_store_inferior_registers): Removed cast to int from - ptrace() calls. - * regcache.h: Added declaration of struct inferior_info. - -2002-04-20 Daniel Jacobowitz <drow@mvista.com> - - * inferiors.c (struct inferior_info): Add regcache_data. - (add_inferior): Call create_register_cache. - (clear_inferiors): Call free_register_cache. - (inferior_regcache_data, set_inferior_regcache_data): New functions. - * regcache.c (struct inferior_regcache_data): New. - (registers): Remove. - (get_regcache): New function. - (create_register_cache, free_register_cache): New functions. - (set_register_cache): Don't initialize the register cache here. - (registers_to_string, registers_from_string, register_data): Call - get_regcache. - * regcache.h: Add prototypes. - * server.h: Likewise. - -2002-04-20 Daniel Jacobowitz <drow@mvista.com> - - * mem-break.c: New file. - * mem-break.h: New file. - * Makefile.in: Add mem-break.o rule; update server.h - dependencies. - * inferiors.c (struct inferior_info): Add target_data - member. - (clear_inferiors): Free target_data member if set. - (inferior_target_data, set_inferior_target_data): New functions. - * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len) - (i386_stop_pc, i386_set_pc): New. Add to the_low_target. - * linux-low.c (linux_bp_reinsert): New variable. - (struct inferior_linux_data): New. - (linux_create_inferior): Use set_inferior_target_data. - (linux_attach): Likewise. Call add_inferior. - (linux_wait_for_one_inferior): New function. - (linux_wait): Call it. - (linux_write_memory): Add const. - (initialize_low): Call set_breakpoint_data. - * linux-low.h (struct linux_target_ops): Add breakpoint - handling members. - * server.c (attach_inferior): Remove extra add_inferior - call. - * server.h: Include mem-break.h. Update inferior.c - prototypes. - * target.c (read_inferior_memory) - (write_inferior_memory): New functions. - * target.h (read_inferior_memory) - (write_inferior_memory): Change macros to prototypes. - (struct target_ops): Update comments. Add const to write_memory - definition. - -2002-04-11 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.c (usr_store_inferior_registers): Support - registers which are allowed to fail to store. - * linux-low.h (linux_target_ops): Likewise. - * linux-ppc-low.c (ppc_regmap): Support FPSCR. - (ppc_cannot_store_register): FPSCR may not be storable. - -2002-04-09 Daniel Jacobowitz <drow@mvista.com> - - * server.h: Include <string.h> if HAVE_STRING_H. - * ChangeLog: Correct paths in last ChangeLog entry. - -2002-04-09 Daniel Jacobowitz <drow@mvista.com> - - * linux-low.h: Remove obsolete prototypes. - (struct linux_target_ops): New. - (extern the_low_target): New. - * linux-low.c (num_regs, regmap): Remove declarations. - (register_addr): Use the_low_target explicitly. - (fetch_register): Likewise. - (usr_fetch_inferior_registers): Likewise. - (usr_store_inferior_registers): Likewise. - * linux-arm-low.c (num_regs): Remove. - (arm_num_regs): Define. - (arm_regmap): Renamed from regmap, made static. - (arm_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (arm_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-i386-low.c (num_regs): Remove. - (i386_num_regs): Define. - (i386_regmap): Renamed from regmap, made static. - (i386_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (i386_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-ia64-low.c (num_regs): Remove. - (ia64_num_regs): Define. - (ia64_regmap): Renamed from regmap, made static. - (ia64_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (ia64_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-m68k-low.c (num_regs): Remove. - (m68k_num_regs): Define. - (m68k_regmap): Renamed from regmap, made static. - (m68k_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (m68k_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-mips-low.c (num_regs): Remove. - (mips_num_regs): Define. - (mips_regmap): Renamed from regmap, made static. - (mips_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (mips_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-ppc-low.c (num_regs): Remove. - (ppc_num_regs): Define. - (ppc_regmap): Renamed from regmap, made static. - (ppc_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (ppc_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-s390-low.c (num_regs): Remove. - (s390_num_regs): Define. - (s390_regmap): Renamed from regmap, made static. - (s390_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (s390_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-sh-low.c (num_regs): Remove. - (sh_num_regs): Define. - (sh_regmap): Renamed from regmap, made static. - (sh_cannot_fetch_register): Renamed from cannot_fetch_register, - made static. - (sh_cannot_store_register): Renamed from cannot_store_register, - made static. - (the_low_target): New. - * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap. - (the_low_target): New. - -2002-04-09 Daniel Jacobowitz <drow@mvista.com> - - * Makefile.in: Add stamp-h target. - * configure.in: Create stamp-h. - * configure: Regenerated. - -2002-04-09 Daniel Jacobowitz <drow@mvista.com> - - * inferiors.c: New file. - * target.c: New file. - * target.h: New file. - * Makefile.in: Add target.o and inferiors.o. Update - dependencies. - * linux-low.c (inferior_pid): New static variable, - moved from server.c. - (linux_create_inferior): Renamed from create_inferior. - Call add_inferior. Return 0 on success instead of a PID. - (linux_attach): Renamed from myattach. - (linux_kill): Renamed from kill_inferior. Call clear_inferiors (). - (linux_thread_alive): Renamed from mythread_alive. - (linux_wait): Renamed from mywait. Call clear_inferiors () if the - child dies. - (linux_resume): Renamed from myresume. Add missing ``return 0''. - (regsets_store_inferior_registers): Correct error message. - Add missing ``return 0''. - (linux_fetch_registers): Renamed from fetch_inferior_registers. - (linux_store_registers): Renamed from store_inferior_registers. - (linux_read_memory): Renamed from read_inferior_memory. - (linux_write_memory): Renamed from write_inferior_memory. - (linux_target_ops): New structure. - (initialize_low): Call set_target_ops (). - * remote-utils.c (unhexify): New function. - (hexify): New function. - (input_interrupt): Send signals to ``signal_pid''. - * server.c (inferior_pid): Remove. - (start_inferior): Update create_inferior call. - (attach_inferior): Call add_inferior. - (handle_query): New function. - (main): Call handle_query for `q' packets. - * server.h: Include "target.h". Remove obsolete prototypes. - Add prototypes for "inferiors.c", "target.c", hexify, and unhexify. - -2002-04-09 Daniel Jacobowitz <drow@mvista.com> - - * Makefile.in: Add WARN_CFLAGS. Update configury - dependencies. - * configure.in: Check for <string.h> - * configure: Regenerate. - * config.in: Regenerate. - * gdbreplay.c: Include needed system headers. - (remote_open): Remove strchr prototype. - * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS. - * regcache.c (supply_register): Change buf argument to const void *. - (supply_register_by_name): Likewise. - (collect_register): Change buf argument to void *. - (collect_register_by_name): Likewise. - * regcache.h: Add missing prototypes. - * remote-utils.c: Include <arpa/inet.h> for inet_ntoa. - * server.c (handle_query): New function. - (attached): New static variable, moved out of main. - (main): Quiet longjmp clobber warnings. - * server.h: Add ATTR_NORETURN and ATTR_FORMAT. Update prototypes. - * utils.c (error): Remove NORETURN. - (fatal): Likewise. diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in deleted file mode 100644 index 01642c8..0000000 --- a/gdb/gdbserver/Makefile.in +++ /dev/null @@ -1,338 +0,0 @@ -# Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 -# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -host_alias = @host_alias@ -target_alias = @target_alias@ -program_transform_name = @program_transform_name@ -bindir = @bindir@ -libdir = @libdir@ -tooldir = $(libdir)/$(target_alias) - -datadir = @datadir@ -mandir = @mandir@ -man1dir = $(mandir)/man1 -man2dir = $(mandir)/man2 -man3dir = $(mandir)/man3 -man4dir = $(mandir)/man4 -man5dir = $(mandir)/man5 -man6dir = $(mandir)/man6 -man7dir = $(mandir)/man7 -man8dir = $(mandir)/man8 -man9dir = $(mandir)/man9 -infodir = @infodir@ -htmldir = $(prefix)/html -includedir = @includedir@ - -SHELL = /bin/sh - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -CC = @CC@ - -# Directory containing source files. Don't clean up the spacing, -# this exact string is matched for by the "configure" script. -srcdir = @srcdir@ -VPATH = @srcdir@ - -# It is also possible that you will need to add -I/usr/include/sys to the -# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which -# is where it should be according to Posix). - -# Set this up with gcc if you have gnu ld and the loader will print out -# line numbers for undefinded refs. -#CC-LD=gcc -static -CC-LD=${CC} - -# Where is the "include" directory? Traditionally ../include or ./include -INCLUDE_DIR = ${srcdir}/../../include -INCLUDE_DEP = $$(INCLUDE_DIR) - -# Where are the BFD library? -BFD_DIR = ../../bfd -BFD = $(BFD_DIR)/libbfd.a -BFD_SRC = $(srcdir)/$(BFD_DIR) -BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) - -# Where is the source dir for the READLINE library? Traditionally in .. or . -# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.) -READLINE_DIR = ${srcdir}/../readline -READLINE_DEP = $$(READLINE_DIR) - -# All the includes used for CFLAGS and for lint. -# -I. for config files. -# -I${srcdir} for our headers. -# -I$(srcdir)/../regformats for regdef.h. -INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../regformats -I$(INCLUDE_DIR) - -# M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS -# from the config/ directory. -GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS} -#PROFILE_CFLAGS = -pg - -WARN_CFLAGS = -Wall - -# CFLAGS is specifically reserved for setting from the command line -# when running make. I.E. "make CFLAGS=-Wmissing-prototypes". -CFLAGS = @CFLAGS@ - -# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. -INTERNAL_CFLAGS = $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \ - ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS} - -# LDFLAGS is specifically reserved for setting from the command line -# when running make. -LDFLAGS = @LDFLAGS@ -INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@ - -# Perhaps should come from parent Makefile -VERSION = gdbserver-4.12.3 -DIST=gdb - -LINT=/usr/5bin/lint -LINTFLAGS= $(BFD_CFLAGS) - -# All source files that go into linking GDB remote server. - -SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c \ - $(srcdir)/mem-break.c $(srcdir)/proc-service.c $(srcdir)/regcache.c \ - $(srcdir)/remote-utils.c $(srcdir)/server.c $(srcdir)/target.c \ - $(srcdir)/thread-db.c $(srcdir)/utils.c \ - $(srcdir)/linux-arm-low.c $(srcdir)/linux-cris-low.c \ - $(srcdir)/linux-crisv32-low.c $(srcdir)/linux-i386-low.c \ - $(srcdir)/i387-fp.c \ - $(srcdir)/linux-ia64-low.c $(srcdir)/linux-low.c \ - $(srcdir)/linux-m32r-low.c \ - $(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \ - $(srcdir)/linux-ppc-low.c $(srcdir)/linux-ppc64-low.c \ - $(srcdir)/linux-s390-low.c \ - $(srcdir)/linux-sh-low.c $(srcdir)/linux-x86-64-low.c - -DEPFILES = @GDBSERVER_DEPFILES@ - -SOURCES = $(SFILES) -TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS} - -OBS = inferiors.o regcache.o remote-utils.o server.o signals.o target.o \ - utils.o version.o \ - mem-break.o \ - $(DEPFILES) -GDBSERVER_LIBS = @GDBSERVER_LIBS@ -XM_CLIBS = @LIBS@ - -# Prevent Sun make from putting in the machine type. Setting -# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1. -.c.o: - ${CC} -c ${INTERNAL_CFLAGS} $< - -all: gdbserver gdbreplay - -# Traditionally "install" depends on "all". But it may be useful -# not to; for example, if the user has made some trivial change to a -# source file and doesn't care about rebuilding or just wants to save the -# time it takes for make to check that all is up to date. -# install-only is intended to address that need. -install: all install-only -install-only: - n=`echo gdbserver | sed '$(program_transform_name)'`; \ - if [ x$$n = x ]; then n=gdbserver; else true; fi; \ - $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \ - $(INSTALL_PROGRAM) gdbserver $(DESTDIR)$(bindir)/$$n; \ - $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(man1dir); \ - $(INSTALL_DATA) $(srcdir)/gdbserver.1 $(DESTDIR)$(man1dir)/$$n.1 - -uninstall: force - n=`echo gdbserver | sed '$(program_transform_name)'`; \ - if [ x$$n = x ]; then n=gdbserver; else true; fi; \ - rm -f $(bindir)/$$n $(DESTDIR)$(man1dir)/$$n.1 - -installcheck: -check: -info dvi: -install-info: -html: -install-html: -clean-info: - -gdbserver: $(OBS) ${ADD_DEPS} ${CDEPS} - rm -f gdbserver - ${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver $(OBS) \ - $(GDBSERVER_LIBS) $(XM_CLIBS) - -gdbreplay: gdbreplay.o - rm -f gdbreplay - ${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay gdbreplay.o \ - $(XM_CLIBS) - -# Put the proper machine-specific files first, so M-. on a machine -# specific routine gets the one for the correct machine. -# The xyzzy stuff below deals with empty DEPFILES -TAGS: ${TAGFILES} - etags `find ${srcdir}/../config -name $(DEPRECATED_TM_FILE) -print` \ - `find ${srcdir}/../config -name ${XM_FILE} -print` \ - `find ${srcdir}/../config -name ${NAT_FILE} -print` \ - `for i in yzzy ${DEPFILES}; do \ - if [ x$$i != xyzzy ]; then \ - echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \ - fi; \ - done` \ - ${TAGFILES} -tags: TAGS - -clean: - rm -f *.o ${ADD_FILES} *~ - rm -f version.c - rm -f gdbserver gdbreplay core make.log - rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m32r.c reg-m68k.c reg-mips.c - rm -f reg-ppc.c reg-sh.c reg-x86-64.c reg-i386-linux.c - rm -f reg-cris.c reg-crisv32.c - -maintainer-clean realclean distclean: clean - rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log - rm -f Makefile - -config.h: stamp-h ; @true -stamp-h: config.in config.status - CONFIG_FILES="" CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status - -Makefile: Makefile.in config.status - CONFIG_HEADERS="" $(SHELL) ./config.status - -config.status: configure configure.srv - $(SHELL) ./config.status --recheck - -force: - -version.c: Makefile $(srcdir)/../version.in - rm -f version.c-tmp version.c - echo '#include "server.h"' >> version.c-tmp - echo 'const char version[] = "'"`sed q ${srcdir}/../version.in`"'";' >> version.c-tmp - echo 'const char host_name[] = "$(host_alias)";' >> version.c-tmp - mv version.c-tmp version.c -version.o: version.c $(server_h) - -# GNU Make has an annoying habit of putting *all* the Makefile variables -# into the environment, unless you include this target as a circumvention. -# Rumor is that this will be fixed (and this target can be removed) -# in GNU Make 4.0. -.NOEXPORT: - -# GNU Make 3.63 has a different problem: it keeps tacking command line -# overrides onto the definition of $(MAKE). This variable setting -# will remove them. -MAKEOVERRIDES= - -gdb_proc_service_h = $(srcdir)/gdb_proc_service.h -regdat_sh = $(srcdir)/../regformats/regdat.sh -regdef_h = $(srcdir)/../regformats/regdef.h -regcache_h = $(srcdir)/regcache.h -server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \ - $(srcdir)/mem-break.h - -inferiors.o: inferiors.c $(server_h) -mem-break.o: mem-break.c $(server_h) -proc-service.o: proc-service.c $(server_h) $(gdb_proc_service_h) -regcache.o: regcache.c $(server_h) $(regdef_h) -remote-utils.o: remote-utils.c terminal.h $(server_h) -server.o: server.c $(server_h) -target.o: target.c $(server_h) -thread-db.o: thread-db.c $(server_h) $(gdb_proc_service_h) -utils.o: utils.c $(server_h) - -signals.o: ../signals/signals.c $(server_h) - $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER - -i387-fp.o: i387-fp.c $(server_h) - -linux_low_h = $(srcdir)/linux-low.h - -linux-low.o: linux-low.c $(linux_low_h) $(server_h) - $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< @USE_THREAD_DB@ - -linux-arm-low.o: linux-arm-low.c $(linux_low_h) $(server_h) \ - $(gdb_proc_service_h) -linux-cris-low.o: linux-cris-low.c $(linux_low_h) $(server_h) -linux-crisv32-low.o: linux-crisv32-low.c $(linux_low_h) $(server_h) -linux-i386-low.o: linux-i386-low.c $(linux_low_h) $(server_h) \ - $(gdb_proc_service_h) -linux-ia64-low.o: linux-ia64-low.c $(linux_low_h) $(server_h) -linux-m32r-low.o: linux-m32r-low.c $(linux_low_h) $(server_h) -linux-mips-low.o: linux-mips-low.c $(linux_low_h) $(server_h) \ - $(gdb_proc_service_h) -linux-ppc-low.o: linux-ppc-low.c $(linux_low_h) $(server_h) -linux-ppc64-low.o: linux-ppc64-low.c $(linux_low_h) $(server_h) -linux-s390-low.o: linux-s390-low.c $(linux_low_h) $(server_h) -linux-sh-low.o: linux-sh-low.c $(linux_low_h) $(server_h) -linux-x86-64-low.o: linux-x86-64-low.c $(linux_low_h) $(server_h) \ - $(gdb_proc_service_h) - -win32-i386-low.o: win32-i386-low.c $(server_h) $(regdef_h) $(regcache_h) - -reg-arm.o : reg-arm.c $(regdef_h) -reg-arm.c : $(srcdir)/../regformats/reg-arm.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-arm.dat reg-arm.c -reg-cris.o : reg-cris.c $(regdef_h) -reg-cris.c : $(srcdir)/../regformats/reg-cris.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-cris.dat reg-cris.c -reg-crisv32.o : reg-crisv32.c $(regdef_h) -reg-crisv32.c : $(srcdir)/../regformats/reg-crisv32.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-crisv32.dat reg-crisv32.c -reg-i386.o : reg-i386.c $(regdef_h) -reg-i386.c : $(srcdir)/../regformats/reg-i386.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-i386.dat reg-i386.c -reg-i386-linux.o : reg-i386-linux.c $(regdef_h) -reg-i386-linux.c : $(srcdir)/../regformats/reg-i386-linux.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-i386-linux.dat reg-i386-linux.c -reg-ia64.o : reg-ia64.c $(regdef_h) -reg-ia64.c : $(srcdir)/../regformats/reg-ia64.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-ia64.dat reg-ia64.c -reg-m32r.o : reg-m32r.c $(regdef_h) -reg-m32r.c : $(srcdir)/../regformats/reg-m32r.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-m32r.dat reg-m32r.c -reg-m68k.o : reg-m68k.c $(regdef_h) -reg-m68k.c : $(srcdir)/../regformats/reg-m68k.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-m68k.dat reg-m68k.c -reg-mips.o : reg-mips.c $(regdef_h) -reg-mips.c : $(srcdir)/../regformats/reg-mips.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-mips.dat reg-mips.c -reg-ppc.o : reg-ppc.c $(regdef_h) -reg-ppc.c : $(srcdir)/../regformats/reg-ppc.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-ppc.dat reg-ppc.c -reg-ppc64.o : reg-ppc64.c $(regdef_h) -reg-ppc64.c : $(srcdir)/../regformats/reg-ppc64.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-ppc64.dat reg-ppc64.c -reg-s390.o : reg-s390.c $(regdef_h) -reg-s390.c : $(srcdir)/../regformats/reg-s390.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-s390.dat reg-s390.c -reg-s390x.o : reg-s390x.c $(regdef_h) -reg-s390x.c : $(srcdir)/../regformats/reg-s390x.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-s390x.dat reg-s390x.c -reg-sh.o : reg-sh.c $(regdef_h) -reg-sh.c : $(srcdir)/../regformats/reg-sh.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-sh.dat reg-sh.c -reg-x86-64.o : reg-x86-64.c $(regdef_h) -reg-x86-64.c : $(srcdir)/../regformats/reg-x86-64.dat $(regdat_sh) - sh $(regdat_sh) $(srcdir)/../regformats/reg-x86-64.dat reg-x86-64.c - -# This is the end of "Makefile.in". diff --git a/gdb/gdbserver/README b/gdb/gdbserver/README deleted file mode 100644 index 71887ca..0000000 --- a/gdb/gdbserver/README +++ /dev/null @@ -1,138 +0,0 @@ - README for GDBserver & GDBreplay - by Stu Grossman and Fred Fish - -Introduction: - -This is GDBserver, a remote server for Un*x-like systems. It can be used to -control the execution of a program on a target system from a GDB on a different -host. GDB and GDBserver communicate using the standard remote serial protocol -implemented in remote.c, and various *-stub.c files. They communicate via -either a serial line or a TCP connection. - -Usage (server (target) side): - -First, you need to have a copy of the program you want to debug put onto -the target system. The program can be stripped to save space if needed, as -GDBserver doesn't care about symbols. All symbol handling is taken care of by -the GDB running on the host system. - -To use the server, you log on to the target system, and run the `gdbserver' -program. You must tell it (a) how to communicate with GDB, (b) the name of -your program, and (c) its arguments. The general syntax is: - - target> gdbserver COMM PROGRAM [ARGS ...] - -For example, using a serial port, you might say: - - target> gdbserver /dev/com1 emacs foo.txt - -This tells gdbserver to debug emacs with an argument of foo.txt, and to -communicate with GDB via /dev/com1. Gdbserver now waits patiently for the -host GDB to communicate with it. - -To use a TCP connection, you could say: - - target> gdbserver host:2345 emacs foo.txt - -This says pretty much the same thing as the last example, except that we are -going to communicate with the host GDB via TCP. The `host:2345' argument means -that we are expecting to see a TCP connection from `host' to local TCP port -2345. (Currently, the `host' part is ignored.) You can choose any number you -want for the port number as long as it does not conflict with any existing TCP -ports on the target system. This same port number must be used in the host -GDBs `target remote' command, which will be described shortly. Note that if -you chose a port number that conflicts with another service, gdbserver will -print an error message and exit. - -On some targets, gdbserver can also attach to running programs. This is -accomplished via the --attach argument. The syntax is: - - target> gdbserver COMM --attach PID - -PID is the process ID of a currently running process. It isn't necessary -to point gdbserver at a binary for the running process. - -Usage (host side): - -You need an unstripped copy of the target program on your host system, since -GDB needs to examine it's symbol tables and such. Start up GDB as you normally -would, with the target program as the first argument. (You may need to use the ---baud option if the serial line is running at anything except 9600 baud.) -Ie: `gdb TARGET-PROG', or `gdb --baud BAUD TARGET-PROG'. After that, the only -new command you need to know about is `target remote'. It's argument is either -a device name (usually a serial device, like `/dev/ttyb'), or a HOST:PORT -descriptor. For example: - - (gdb) target remote /dev/ttyb - -communicates with the server via serial line /dev/ttyb, and: - - (gdb) target remote the-target:2345 - -communicates via a TCP connection to port 2345 on host `the-target', where -you previously started up gdbserver with the same port number. Note that for -TCP connections, you must start up gdbserver prior to using the `target remote' -command, otherwise you may get an error that looks something like -`Connection refused'. - -Building gdbserver: - -The supported targets as of February 2002 are: - arm-*-linux-gnu - i386-*-linux-gnu - ia64-*-linux-gnu - m68k-*-linux-gnu - mips-*-linux-gnu - powerpc-*-linux-gnu - sh-*-linux-gnu - -Configuring gdbserver you should specify the same machine for host and -target (which are the machine that gdbserver is going to run on. This -is not the same as the machine that gdb is going to run on; building -gdbserver automatically as part of building a whole tree of tools does -not currently work if cross-compilation is involved (we don't get the -right CC in the Makefile, to start with)). - -Building gdbserver for your target is very straightforward. If you build -GDB natively on a target which gdbserver supports, it will be built -automatically when you build GDB. You can also build just gdbserver: - - % mkdir obj - % cd obj - % path-to-gdbserver-sources/configure - % make - -If you prefer to cross-compile to your target, then you can also build -gdbserver that way. In a Bourne shell, for example: - - % export CC=your-cross-compiler - % path-to-gdbserver-sources/configure your-target-name - % make - -Using GDBreplay: - -A special hacked down version of gdbserver can be used to replay remote -debug log files created by gdb. Before using the gdb "target" command to -initiate a remote debug session, use "set remotelogfile <filename>" to tell -gdb that you want to make a recording of the serial or tcp session. Note -that when replaying the session, gdb communicates with gdbreplay via tcp, -regardless of whether the original session was via a serial link or tcp. - -Once you are done with the remote debug session, start gdbreplay and -tell it the name of the log file and the host and port number that gdb -should connect to (typically the same as the host running gdb): - - $ gdbreplay logfile host:port - -Then start gdb (preferably in a different screen or window) and use the -"target" command to connect to gdbreplay: - - (gdb) target remote host:port - -Repeat the same sequence of user commands to gdb that you gave in the -original debug session. Gdb should not be able to tell that it is talking -to gdbreplay rather than a real target, all other things being equal. Note -that gdbreplay echos the command lines to stderr, as well as the contents of -the packets it sends and receives. The last command echoed by gdbreplay is -the next command that needs to be typed to gdb to continue the session in -sync with the original session. diff --git a/gdb/gdbserver/acinclude.m4 b/gdb/gdbserver/acinclude.m4 deleted file mode 100644 index be7fe27..0000000 --- a/gdb/gdbserver/acinclude.m4 +++ /dev/null @@ -1,43 +0,0 @@ -dnl gdb/gdbserver/configure.in uses BFD_HAVE_SYS_PROCFS_TYPE. -sinclude(../../bfd/bfd.m4) - -AC_DEFUN([SRV_CHECK_THREAD_DB], -[AC_CACHE_CHECK([for libthread_db],[srv_cv_thread_db], - [old_LIBS="$LIBS" - LIBS="$LIBS -lthread_db" - AC_TRY_LINK( - [void ps_pglobal_lookup() {} - void ps_pdread() {} - void ps_pdwrite() {} - void ps_lgetregs() {} - void ps_lsetregs() {} - void ps_lgetfpregs() {} - void ps_lsetfpregs() {} - void ps_get_thread_area() {} - void ps_getpid() {}], - [td_ta_new();], - [srv_cv_thread_db="-lthread_db"], - [srv_cv_thread_db=no - - if test "$prefix" = "/usr" || test "$prefix" = "NONE"; then - thread_db="/lib/libthread_db.so.1" - else - thread_db='$prefix/lib/libthread_db.so.1' - fi - LIBS="$old_LIBS `eval echo "$thread_db"`" - AC_TRY_LINK( - [void ps_pglobal_lookup() {} - void ps_pdread() {} - void ps_pdwrite() {} - void ps_lgetregs() {} - void ps_lsetregs() {} - void ps_lgetfpregs() {} - void ps_lsetfpregs() {} - void ps_get_thread_area() {} - void ps_getpid() {}], - [td_ta_new();], - [srv_cv_thread_db="$thread_db"], - [srv_cv_thread_db=no]) - ]) - LIBS="$old_LIBS" -])]) diff --git a/gdb/gdbserver/aclocal.m4 b/gdb/gdbserver/aclocal.m4 deleted file mode 100644 index 1e4ae30..0000000 --- a/gdb/gdbserver/aclocal.m4 +++ /dev/null @@ -1,14 +0,0 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_include([acinclude.m4]) diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in deleted file mode 100644 index 70116aa..0000000 --- a/gdb/gdbserver/config.in +++ /dev/null @@ -1,134 +0,0 @@ -/* config.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the <arpa/inet.h> header file. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the declaration of `strerror', and to 0 if you - don't. */ -#undef HAVE_DECL_STRERROR - -/* Define if <sys/procfs.h> has elf_fpregset_t. */ -#undef HAVE_ELF_FPREGSET_T - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the <linux/elf.h> header file. */ -#undef HAVE_LINUX_ELF_H - -/* Define if the target supports register sets. */ -#undef HAVE_LINUX_REGSETS - -/* Define if the target supports PTRACE_PEEKUSR for register access. */ -#undef HAVE_LINUX_USRREGS - -/* Define if <sys/procfs.h> has lwpid_t. */ -#undef HAVE_LWPID_T - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the <netdb.h> header file. */ -#undef HAVE_NETDB_H - -/* Define to 1 if you have the <netinet/in.h> header file. */ -#undef HAVE_NETINET_IN_H - -/* Define to 1 if you have the <netinet/tcp.h> header file. */ -#undef HAVE_NETINET_TCP_H - -/* Define if <sys/procfs.h> has prgregset_t. */ -#undef HAVE_PRGREGSET_T - -/* Define to 1 if you have the <proc_service.h> header file. */ -#undef HAVE_PROC_SERVICE_H - -/* Define if <sys/procfs.h> has psaddr_t. */ -#undef HAVE_PSADDR_T - -/* Define if the target supports PTRACE_GETFPXREGS for extended register - access. */ -#undef HAVE_PTRACE_GETFPXREGS - -/* Define if the target supports PTRACE_GETREGS for register access. */ -#undef HAVE_PTRACE_GETREGS - -/* Define to 1 if you have the <sgtty.h> header file. */ -#undef HAVE_SGTTY_H - -/* Define to 1 if the system has the type `socklen_t'. */ -#undef HAVE_SOCKLEN_T - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the <sys/ioctl.h> header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the <sys/procfs.h> header file. */ -#undef HAVE_SYS_PROCFS_H - -/* Define to 1 if you have the <sys/reg.h> header file. */ -#undef HAVE_SYS_REG_H - -/* Define to 1 if you have the <sys/socket.h> header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <sys/wait.h> header file. */ -#undef HAVE_SYS_WAIT_H - -/* Define if TD_VERSION is available. */ -#undef HAVE_TD_VERSION - -/* Define to 1 if you have the <terminal.h> header file. */ -#undef HAVE_TERMINAL_H - -/* Define to 1 if you have the <termios.h> header file. */ -#undef HAVE_TERMIOS_H - -/* Define to 1 if you have the <termio.h> header file. */ -#undef HAVE_TERMIO_H - -/* Define to 1 if you have the <thread_db.h> header file. */ -#undef HAVE_THREAD_DB_H - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if we should use the Windows API, instead of the POSIX API. On - Windows, we use the Windows API when building for MinGW, but the POSIX API - when building for Cygwin. */ -#undef USE_WIN32API diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure deleted file mode 100755 index 1888bc3..0000000 --- a/gdb/gdbserver/configure +++ /dev/null @@ -1,5925 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -# Find out whether ``test -x'' works. Don't use a zero-byte file, as -# systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - as_executable_p="test -x" -else - as_executable_p=: -fi -rm -f conf$$.file - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 </dev/null 6>&1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="server.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include <stdio.h> -#if HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif -#if HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif -#if STDC_HEADERS -# include <stdlib.h> -# include <stddef.h> -#else -# if HAVE_STDLIB_H -# include <stdlib.h> -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include <memory.h> -# endif -# include <string.h> -#endif -#if HAVE_STRINGS_H -# include <strings.h> -#endif -#if HAVE_INTTYPES_H -# include <inttypes.h> -#endif -#if HAVE_STDINT_H -# include <stdint.h> -#endif -#if HAVE_UNISTD_H -# include <unistd.h> -#endif" - -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -target -target_cpu -target_vendor -target_os -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -CPP -GREP -EGREP -RDYNAMIC -GDBSERVER_DEPFILES -GDBSERVER_LIBS -USE_THREAD_DB -LIBOBJS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -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=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -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_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$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 ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - 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 | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$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 ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - 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 | -n) - 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 ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$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_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - 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 "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# 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 the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - 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 - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # 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 <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --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 - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a - nonstandard directory <lib dir> - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if - you have headers in a nonstandard directory <include dir> - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.60 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.60. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_config_headers="$ac_config_headers config.h:config.in" - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -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 "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6; } -if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -echo "$as_me: error: invalid value of canonical target" >&2;} - { (exit 1); exit 1; }; };; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$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 -# AmigaOS /C/install, which installs bootblocks on floppy discs -# 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" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /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 - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_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. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&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}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_GREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -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 <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - - - - - - - - - - - - - - - -for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h thread_db.h linux/elf.h stdlib.h unistd.h terminal.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h netinet/tcp.h arpa/inet.h sys/wait.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -{ echo "$as_me:$LINENO: checking whether strerror is declared" >&5 -echo $ECHO_N "checking whether strerror is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_strerror+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef strerror - char *p = (char *) strerror; - return !p; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl_strerror=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_strerror=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror" >&5 -echo "${ECHO_T}$ac_cv_have_decl_strerror" >&6; } -if test $ac_cv_have_decl_strerror = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR 1 -_ACEOF - - -else - cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR 0 -_ACEOF - - -fi - - - -{ echo "$as_me:$LINENO: checking for socklen_t" >&5 -echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } -if test "${ac_cv_type_socklen_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/types.h> -#include <sys/socket.h> - - -typedef socklen_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_socklen_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_socklen_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 -echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } -if test $ac_cv_type_socklen_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_SOCKLEN_T 1 -_ACEOF - - -fi - -. ${srcdir}/configure.srv - -if test "${srv_mingw}" = "yes"; then - LIBS="$LIBS -lwsock32" - -cat >>confdefs.h <<\_ACEOF -#define USE_WIN32API 1 -_ACEOF - -fi - -if test "${srv_linux_usrregs}" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LINUX_USRREGS 1 -_ACEOF - -fi - -if test "${srv_linux_regsets}" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LINUX_REGSETS 1 -_ACEOF - - - { echo "$as_me:$LINENO: checking for PTRACE_GETREGS" >&5 -echo $ECHO_N "checking for PTRACE_GETREGS... $ECHO_C" >&6; } - if test "${gdbsrv_cv_have_ptrace_getregs+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/ptrace.h> -int -main () -{ -PTRACE_GETREGS; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gdbsrv_cv_have_ptrace_getregs=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gdbsrv_cv_have_ptrace_getregs=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - { echo "$as_me:$LINENO: result: $gdbsrv_cv_have_ptrace_getregs" >&5 -echo "${ECHO_T}$gdbsrv_cv_have_ptrace_getregs" >&6; } - if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PTRACE_GETREGS 1 -_ACEOF - - fi - - { echo "$as_me:$LINENO: checking for PTRACE_GETFPXREGS" >&5 -echo $ECHO_N "checking for PTRACE_GETFPXREGS... $ECHO_C" >&6; } - if test "${gdbsrv_cv_have_ptrace_getfpxregs+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/ptrace.h> -int -main () -{ -PTRACE_GETFPXREGS; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gdbsrv_cv_have_ptrace_getfpxregs=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gdbsrv_cv_have_ptrace_getfpxregs=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - { echo "$as_me:$LINENO: result: $gdbsrv_cv_have_ptrace_getfpxregs" >&5 -echo "${ECHO_T}$gdbsrv_cv_have_ptrace_getfpxregs" >&6; } - if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PTRACE_GETFPXREGS 1 -_ACEOF - - fi -fi - -if test "$ac_cv_header_sys_procfs_h" = yes; then - { echo "$as_me:$LINENO: checking for lwpid_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for lwpid_t in sys/procfs.h... $ECHO_C" >&6; } - if test "${bfd_cv_have_sys_procfs_type_lwpid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _SYSCALL32 -#include <sys/procfs.h> -int -main () -{ -lwpid_t avar - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - bfd_cv_have_sys_procfs_type_lwpid_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - bfd_cv_have_sys_procfs_type_lwpid_t=no - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LWPID_T 1 -_ACEOF - - fi - { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_lwpid_t" >&6; } - - { echo "$as_me:$LINENO: checking for psaddr_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for psaddr_t in sys/procfs.h... $ECHO_C" >&6; } - if test "${bfd_cv_have_sys_procfs_type_psaddr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _SYSCALL32 -#include <sys/procfs.h> -int -main () -{ -psaddr_t avar - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - bfd_cv_have_sys_procfs_type_psaddr_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - bfd_cv_have_sys_procfs_type_psaddr_t=no - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PSADDR_T 1 -_ACEOF - - fi - { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_psaddr_t" >&6; } - - { echo "$as_me:$LINENO: checking for prgregset_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for prgregset_t in sys/procfs.h... $ECHO_C" >&6; } - if test "${bfd_cv_have_sys_procfs_type_prgregset_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _SYSCALL32 -#include <sys/procfs.h> -int -main () -{ -prgregset_t avar - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - bfd_cv_have_sys_procfs_type_prgregset_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - bfd_cv_have_sys_procfs_type_prgregset_t=no - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PRGREGSET_T 1 -_ACEOF - - fi - { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prgregset_t" >&6; } - - { echo "$as_me:$LINENO: checking for elf_fpregset_t in sys/procfs.h" >&5 -echo $ECHO_N "checking for elf_fpregset_t in sys/procfs.h... $ECHO_C" >&6; } - if test "${bfd_cv_have_sys_procfs_type_elf_fpregset_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _SYSCALL32 -#include <sys/procfs.h> -int -main () -{ -elf_fpregset_t avar - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - bfd_cv_have_sys_procfs_type_elf_fpregset_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - bfd_cv_have_sys_procfs_type_elf_fpregset_t=no - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test $bfd_cv_have_sys_procfs_type_elf_fpregset_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ELF_FPREGSET_T 1 -_ACEOF - - fi - { echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&5 -echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; } - -fi - -srv_thread_depfiles= -srv_libs= -USE_THREAD_DB= - -if test "$srv_linux_thread_db" = "yes"; then - { echo "$as_me:$LINENO: checking for libthread_db" >&5 -echo $ECHO_N "checking for libthread_db... $ECHO_C" >&6; } -if test "${srv_cv_thread_db+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - old_LIBS="$LIBS" - LIBS="$LIBS -lthread_db" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -void ps_pglobal_lookup() {} - void ps_pdread() {} - void ps_pdwrite() {} - void ps_lgetregs() {} - void ps_lsetregs() {} - void ps_lgetfpregs() {} - void ps_lsetfpregs() {} - void ps_get_thread_area() {} - void ps_getpid() {} -int -main () -{ -td_ta_new(); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - srv_cv_thread_db="-lthread_db" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - srv_cv_thread_db=no - - if test "$prefix" = "/usr" || test "$prefix" = "NONE"; then - thread_db="/lib/libthread_db.so.1" - else - thread_db='$prefix/lib/libthread_db.so.1' - fi - LIBS="$old_LIBS `eval echo "$thread_db"`" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -void ps_pglobal_lookup() {} - void ps_pdread() {} - void ps_pdwrite() {} - void ps_lgetregs() {} - void ps_lsetregs() {} - void ps_lgetfpregs() {} - void ps_lsetfpregs() {} - void ps_get_thread_area() {} - void ps_getpid() {} -int -main () -{ -td_ta_new(); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - srv_cv_thread_db="$thread_db" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - srv_cv_thread_db=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$old_LIBS" - -fi -{ echo "$as_me:$LINENO: result: $srv_cv_thread_db" >&5 -echo "${ECHO_T}$srv_cv_thread_db" >&6; } - if test "$srv_cv_thread_db" = no; then - { echo "$as_me:$LINENO: WARNING: Could not find libthread_db." >&5 -echo "$as_me: WARNING: Could not find libthread_db." >&2;} - { echo "$as_me:$LINENO: WARNING: Disabling thread support in gdbserver." >&5 -echo "$as_me: WARNING: Disabling thread support in gdbserver." >&2;} - srv_linux_thread_db=no - else - srv_libs="$srv_cv_thread_db" - fi - old_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -rdynamic" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - RDYNAMIC=-rdynamic -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - RDYNAMIC= -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - LDFLAGS="$old_LDFLAGS" -fi - -if test "$srv_linux_thread_db" = "yes"; then - srv_thread_depfiles="thread-db.o proc-service.o" - USE_THREAD_DB="-DUSE_THREAD_DB" - { echo "$as_me:$LINENO: checking for TD_VERSION" >&5 -echo $ECHO_N "checking for TD_VERSION... $ECHO_C" >&6; } -if test "${gdbsrv_cv_have_td_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <thread_db.h> -int -main () -{ -TD_VERSION; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - gdbsrv_cv_have_td_version=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - gdbsrv_cv_have_td_version=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $gdbsrv_cv_have_td_version" >&5 -echo "${ECHO_T}$gdbsrv_cv_have_td_version" >&6; } - if test $gdbsrv_cv_have_td_version = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_TD_VERSION 1 -_ACEOF - - fi -fi - -GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles" -GDBSERVER_LIBS="$srv_libs" - - - - - -ac_config_files="$ac_config_files Makefile" - -ac_config_commands="$ac_config_commands default" - -cat >confcache <<\_ACEOF -# 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, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# 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. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -# Find out whether ``test -x'' works. Don't use a zero-byte file, as -# systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - as_executable_p="test -x" -else - as_executable_p=: -fi -rm -f conf$$.file - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.60. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to <bug-autoconf@gnu.org>." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.60, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -target!$target$ac_delim -target_cpu!$target_cpu$ac_delim -target_vendor!$target_vendor$ac_delim -target_os!$target_os$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -RDYNAMIC!$RDYNAMIC$ac_delim -GDBSERVER_DEPFILES!$GDBSERVER_DEPFILES$ac_delim -GDBSERVER_LIBS!$GDBSERVER_LIBS$ac_delim -USE_THREAD_DB!$USE_THREAD_DB$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 68; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS <conf$$subs.sed -rm -f conf$$subs.sed -cat >>$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" - ;; - - :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "default":C) case x$CONFIG_HEADERS in -xconfig.h:config.in) -echo > stamp-h ;; -esac - ;; - - esac -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac deleted file mode 100644 index e43b28a..0000000 --- a/gdb/gdbserver/configure.ac +++ /dev/null @@ -1,150 +0,0 @@ -dnl Autoconf configure script for GDB server. -dnl Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006 -dnl Free Software Foundation, Inc. -dnl -dnl This file is part of GDB. -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, -dnl Boston, MA 02110-1301, USA. - -dnl Process this file with autoconf to produce a configure script. - -AC_PREREQ(2.59)dnl - -AC_INIT(server.c) -AC_CONFIG_HEADER(config.h:config.in) - -AC_PROG_CC - -AC_CANONICAL_SYSTEM - -AC_PROG_INSTALL - -AC_ARG_PROGRAM - -AC_HEADER_STDC - -AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl - proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl - stdlib.h unistd.h dnl - terminal.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl - netinet/tcp.h arpa/inet.h sys/wait.h) - -AC_CHECK_DECLS(strerror) - -AC_CHECK_TYPES(socklen_t, [], [], -[#include <sys/types.h> -#include <sys/socket.h> -]) -. ${srcdir}/configure.srv - -if test "${srv_mingw}" = "yes"; then - LIBS="$LIBS -lwsock32" - AC_DEFINE(USE_WIN32API, 1, - [Define if we should use the Windows API, instead of the - POSIX API. On Windows, we use the Windows API when - building for MinGW, but the POSIX API when building - for Cygwin.]) -fi - -if test "${srv_linux_usrregs}" = "yes"; then - AC_DEFINE(HAVE_LINUX_USRREGS, 1, - [Define if the target supports PTRACE_PEEKUSR for register ] - [access.]) -fi - -if test "${srv_linux_regsets}" = "yes"; then - AC_DEFINE(HAVE_LINUX_REGSETS, 1, - [Define if the target supports register sets.]) - - AC_MSG_CHECKING(for PTRACE_GETREGS) - AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs, - [AC_TRY_COMPILE([#include <sys/ptrace.h>], - [PTRACE_GETREGS;], - [gdbsrv_cv_have_ptrace_getregs=yes], - [gdbsrv_cv_have_ptrace_getregs=no])]) - AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs) - if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then - AC_DEFINE(HAVE_PTRACE_GETREGS, 1, - [Define if the target supports PTRACE_GETREGS for register ] - [access.]) - fi - - AC_MSG_CHECKING(for PTRACE_GETFPXREGS) - AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs, - [AC_TRY_COMPILE([#include <sys/ptrace.h>], - [PTRACE_GETFPXREGS;], - [gdbsrv_cv_have_ptrace_getfpxregs=yes], - [gdbsrv_cv_have_ptrace_getfpxregs=no])]) - AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs) - if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then - AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1, - [Define if the target supports PTRACE_GETFPXREGS for extended ] - [register access.]) - fi -fi - -if test "$ac_cv_header_sys_procfs_h" = yes; then - BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t) - BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t) - BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t) - BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t) -fi - -srv_thread_depfiles= -srv_libs= -USE_THREAD_DB= - -if test "$srv_linux_thread_db" = "yes"; then - SRV_CHECK_THREAD_DB - if test "$srv_cv_thread_db" = no; then - AC_WARN([Could not find libthread_db.]) - AC_WARN([Disabling thread support in gdbserver.]) - srv_linux_thread_db=no - else - srv_libs="$srv_cv_thread_db" - fi - old_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -rdynamic" - AC_TRY_LINK([], [], [RDYNAMIC=-rdynamic], [RDYNAMIC=]) - AC_SUBST(RDYNAMIC) - LDFLAGS="$old_LDFLAGS" -fi - -if test "$srv_linux_thread_db" = "yes"; then - srv_thread_depfiles="thread-db.o proc-service.o" - USE_THREAD_DB="-DUSE_THREAD_DB" - AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version, - [AC_TRY_COMPILE([#include <thread_db.h>], [TD_VERSION;], - [gdbsrv_cv_have_td_version=yes], - [gdbsrv_cv_have_td_version=no])]) - if test $gdbsrv_cv_have_td_version = yes; then - AC_DEFINE(HAVE_TD_VERSION, 1, [Define if TD_VERSION is available.]) - fi -fi - -GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles" -GDBSERVER_LIBS="$srv_libs" - -AC_SUBST(GDBSERVER_DEPFILES) -AC_SUBST(GDBSERVER_LIBS) -AC_SUBST(USE_THREAD_DB) - -AC_OUTPUT(Makefile, -[case x$CONFIG_HEADERS in -xconfig.h:config.in) -echo > stamp-h ;; -esac -]) diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv deleted file mode 100644 index 46383db..0000000 --- a/gdb/gdbserver/configure.srv +++ /dev/null @@ -1,113 +0,0 @@ -# Mappings from configuration triplets to gdbserver build options. -# This is invoked from the autoconf-generated configure script, to -# produce the appropriate Makefile substitutions. - -# This file sets the following shell variables: -# srv_regobj The register protocol appropriate for this target. -# srv_tgtobj Any other target-specific modules appropriate -# for this target. -# -# In addition, on GNU/Linux the following shell variables will be set: -# srv_linux_regsets Set to "yes" if ptrace(PTRACE_GETREGS) and friends -# may be available on this platform; unset otherwise. -# They will only be used if <sys/ptrace.h> defines -# PTRACE_GETREGS. -# srv_linux_usrregs Set to "yes" if we can get at registers via -# PTRACE_PEEKUSR / PTRACE_POKEUSR. - -# Input is taken from the "${target}" variable. - -case "${target}" in - arm*-*-linux*) srv_regobj=reg-arm.o - srv_tgtobj="linux-low.o linux-arm-low.o" - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; - crisv32-*-linux*) srv_regobj=reg-crisv32.o - srv_tgtobj="linux-low.o linux-crisv32-low.o" - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - cris-*-linux*) srv_regobj=reg-cris.o - srv_tgtobj="linux-low.o linux-cris-low.o" - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; - i[34567]86-*-cygwin*) srv_regobj=reg-i386.o - srv_tgtobj="win32-i386-low.o" - ;; - i[34567]86-*-linux*) srv_regobj=reg-i386-linux.o - srv_tgtobj="linux-low.o linux-i386-low.o i387-fp.o" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - i[34567]86-*-mingw*) srv_regobj=reg-i386.o - srv_tgtobj="win32-i386-low.o" - srv_mingw=yes - ;; - ia64-*-linux*) srv_regobj=reg-ia64.o - srv_tgtobj="linux-low.o linux-ia64-low.o" - srv_linux_usrregs=yes - ;; - m32r*-*-linux*) srv_regobj=reg-m32r.o - srv_tgtobj="linux-low.o linux-m32r-low.o" - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; - m68*-*-linux*) srv_regobj=reg-m68k.o - srv_tgtobj="linux-low.o linux-m68k-low.o" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - m68*-*-uclinux*) srv_regobj=reg-m68k.o - srv_tgtobj="linux-low.o linux-m68k-low.o" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - mips*-*-linux*) srv_regobj=reg-mips.o - srv_tgtobj="linux-low.o linux-mips-low.o" - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; - powerpc64-*-linux*) srv_regobj=reg-ppc64.o - srv_tgtobj="linux-low.o linux-ppc64-low.o" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - powerpc-*-linux*) srv_regobj=reg-ppc.o - srv_tgtobj="linux-low.o linux-ppc-low.o" - srv_linux_usrregs=yes - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - s390-*-linux*) srv_regobj=reg-s390.o - srv_tgtobj="linux-low.o linux-s390-low.o" - srv_linux_usrregs=yes - ;; - s390x-*-linux*) srv_regobj=reg-s390x.o - srv_tgtobj="linux-low.o linux-s390-low.o" - srv_linux_usrregs=yes - ;; - sh*-*-linux*) srv_regobj=reg-sh.o - srv_tgtobj="linux-low.o linux-sh-low.o" - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; - x86_64-*-linux*) srv_regobj=reg-x86-64.o - srv_tgtobj="linux-low.o linux-x86-64-low.o i387-fp.o" - srv_linux_regsets=yes - srv_linux_thread_db=yes - ;; - xscale*-*-linux*) srv_regobj=reg-arm.o - srv_tgtobj="linux-low.o linux-arm-low.o" - srv_linux_usrregs=yes - srv_linux_thread_db=yes - ;; - *) echo "Error: target not supported by gdbserver." - exit 1 - ;; -esac diff --git a/gdb/gdbserver/gdb_proc_service.h b/gdb/gdbserver/gdb_proc_service.h deleted file mode 100644 index e5aefbd..0000000 --- a/gdb/gdbserver/gdb_proc_service.h +++ /dev/null @@ -1,75 +0,0 @@ -/* <proc_service.h> replacement for systems that don't have it. - Copyright (C) 2000, 2006 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#ifndef GDB_PROC_SERVICE_H -#define GDB_PROC_SERVICE_H - -#include <sys/types.h> - -#ifdef HAVE_PROC_SERVICE_H -#include <proc_service.h> -#else - -#ifdef HAVE_SYS_PROCFS_H -#include <sys/procfs.h> -#endif - -/* Not all platforms bring in <linux/elf.h> via <sys/procfs.h>. If - <sys/procfs.h> wasn't enough to find elf_fpregset_t, try the kernel - headers also (but don't if we don't need to). */ -#ifndef HAVE_ELF_FPREGSET_T -# ifdef HAVE_LINUX_ELF_H -# include <linux/elf.h> -# endif -#endif - -typedef enum -{ - PS_OK, /* Success. */ - PS_ERR, /* Generic error. */ - PS_BADPID, /* Bad process handle. */ - PS_BADLID, /* Bad LWP id. */ - PS_BADADDR, /* Bad address. */ - PS_NOSYM, /* Symbol not found. */ - PS_NOFREGS /* FPU register set not available. */ -} ps_err_e; - -#ifndef HAVE_LWPID_T -typedef unsigned int lwpid_t; -#endif - -#ifndef HAVE_PSADDR_T -typedef unsigned long psaddr_t; -#endif - -#ifndef HAVE_PRGREGSET_T -typedef elf_gregset_t prgregset_t; -#endif - -#endif /* HAVE_PROC_SERVICE_H */ - -/* Structure that identifies the target process. */ -struct ps_prochandle -{ - /* The process id is all we need. */ - pid_t pid; -}; - -#endif /* gdb_proc_service.h */ diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c deleted file mode 100644 index 34d55bf..0000000 --- a/gdb/gdbserver/gdbreplay.c +++ /dev/null @@ -1,371 +0,0 @@ -/* Replay a remote debug session logfile for GDB. - Copyright (C) 1996, 1998, 1999, 2000, 2002, 2003, 2005, 2006 - Free Software Foundation, Inc. - Written by Fred Fish (fnf@cygnus.com) from pieces of gdbserver. - - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "config.h" -#include <stdio.h> -#include <sys/file.h> -#include <signal.h> -#include <ctype.h> -#include <fcntl.h> -#include <errno.h> - -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#if HAVE_NETDB_H -#include <netdb.h> -#endif -#if HAVE_NETINET_TCP_H -#include <netinet/tcp.h> -#endif - -#if USE_WIN32API -#include <winsock.h> -#endif - -#ifndef HAVE_SOCKLEN_T -typedef int socklen_t; -#endif - -/* Sort of a hack... */ -#define EOL (EOF - 1) - -static int remote_desc; - -/* Print the system error message for errno, and also mention STRING - as the file name for which the error was encountered. - Then return to command level. */ - -static void -perror_with_name (char *string) -{ -#ifndef STDC_HEADERS - extern int errno; -#endif - const char *err; - char *combined; - - err = strerror (errno); - if (err == NULL) - err = "unknown error"; - - combined = (char *) alloca (strlen (err) + strlen (string) + 3); - strcpy (combined, string); - strcat (combined, ": "); - strcat (combined, err); - fprintf (stderr, "\n%s.\n", combined); - fflush (stderr); - exit (1); -} - -static void -sync_error (FILE *fp, char *desc, int expect, int got) -{ - fprintf (stderr, "\n%s\n", desc); - fprintf (stderr, "At logfile offset %ld, expected '0x%x' got '0x%x'\n", - ftell (fp), expect, got); - fflush (stderr); - exit (1); -} - -static void -remote_close (void) -{ -#ifdef USE_WIN32API - closesocket (remote_desc); -#else - close (remote_desc); -#endif -} - -/* Open a connection to a remote debugger. - NAME is the filename used for communication. */ - -static void -remote_open (char *name) -{ - if (!strchr (name, ':')) - { - fprintf (stderr, "%s: Must specify tcp connection as host:addr\n", name); - fflush (stderr); - exit (1); - } - else - { -#ifdef USE_WIN32API - static int winsock_initialized; -#endif - char *port_str; - int port; - struct sockaddr_in sockaddr; - socklen_t tmp; - int tmp_desc; - - port_str = strchr (name, ':'); - - port = atoi (port_str + 1); - -#ifdef USE_WIN32API - if (!winsock_initialized) - { - WSADATA wsad; - - WSAStartup (MAKEWORD (1, 0), &wsad); - winsock_initialized = 1; - } -#endif - - tmp_desc = socket (PF_INET, SOCK_STREAM, 0); - if (tmp_desc < 0) - perror_with_name ("Can't open socket"); - - /* Allow rapid reuse of this port. */ - tmp = 1; - setsockopt (tmp_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp, - sizeof (tmp)); - - sockaddr.sin_family = PF_INET; - sockaddr.sin_port = htons (port); - sockaddr.sin_addr.s_addr = INADDR_ANY; - - if (bind (tmp_desc, (struct sockaddr *) &sockaddr, sizeof (sockaddr)) - || listen (tmp_desc, 1)) - perror_with_name ("Can't bind address"); - - tmp = sizeof (sockaddr); - remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, &tmp); - if (remote_desc == -1) - perror_with_name ("Accept failed"); - - /* Enable TCP keep alive process. */ - tmp = 1; - setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp)); - - /* Tell TCP not to delay small packets. This greatly speeds up - interactive response. */ - tmp = 1; - setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY, - (char *) &tmp, sizeof (tmp)); - - close (tmp_desc); /* No longer need this */ - -#ifndef USE_WIN32API - close (tmp_desc); /* No longer need this */ - - signal (SIGPIPE, SIG_IGN); /* If we don't do this, then gdbreplay simply - exits when the remote side dies. */ -#else - closesocket (tmp_desc); /* No longer need this */ -#endif - } - -#if defined(F_SETFL) && defined (FASYNC) - fcntl (remote_desc, F_SETFL, FASYNC); -#endif - - fprintf (stderr, "Replay logfile using %s\n", name); - fflush (stderr); -} - -static int -tohex (int ch) -{ - if (ch >= '0' && ch <= '9') - { - return (ch - '0'); - } - if (ch >= 'A' && ch <= 'F') - { - return (ch - 'A' + 10); - } - if (ch >= 'a' && ch <= 'f') - { - return (ch - 'a' + 10); - } - fprintf (stderr, "\nInvalid hex digit '%c'\n", ch); - fflush (stderr); - exit (1); -} - -static int -logchar (FILE *fp) -{ - int ch; - int ch2; - - ch = fgetc (fp); - fputc (ch, stdout); - fflush (stdout); - switch (ch) - { - case '\n': - ch = EOL; - break; - case '\\': - ch = fgetc (fp); - fputc (ch, stdout); - fflush (stdout); - switch (ch) - { - case '\\': - break; - case 'b': - ch = '\b'; - break; - case 'f': - ch = '\f'; - break; - case 'n': - ch = '\n'; - break; - case 'r': - ch = '\r'; - break; - case 't': - ch = '\t'; - break; - case 'v': - ch = '\v'; - break; - case 'x': - ch2 = fgetc (fp); - fputc (ch2, stdout); - fflush (stdout); - ch = tohex (ch2) << 4; - ch2 = fgetc (fp); - fputc (ch2, stdout); - fflush (stdout); - ch |= tohex (ch2); - break; - default: - /* Treat any other char as just itself */ - break; - } - default: - break; - } - return (ch); -} - -/* Accept input from gdb and match with chars from fp (after skipping one - blank) up until a \n is read from fp (which is not matched) */ - -static void -expect (FILE *fp) -{ - int fromlog; - unsigned char fromgdb; - - if ((fromlog = logchar (fp)) != ' ') - { - sync_error (fp, "Sync error during gdb read of leading blank", ' ', - fromlog); - } - do - { - fromlog = logchar (fp); - if (fromlog == EOL) - { - break; - } - read (remote_desc, &fromgdb, 1); - } - while (fromlog == fromgdb); - if (fromlog != EOL) - { - sync_error (fp, "Sync error during read of gdb packet", fromlog, - fromgdb); - } -} - -/* Play data back to gdb from fp (after skipping leading blank) up until a - \n is read from fp (which is discarded and not sent to gdb). */ - -static void -play (FILE *fp) -{ - int fromlog; - char ch; - - if ((fromlog = logchar (fp)) != ' ') - { - sync_error (fp, "Sync error skipping blank during write to gdb", ' ', - fromlog); - } - while ((fromlog = logchar (fp)) != EOL) - { - ch = fromlog; - write (remote_desc, &ch, 1); - } -} - -int -main (int argc, char *argv[]) -{ - FILE *fp; - int ch; - - if (argc < 3) - { - fprintf (stderr, "Usage: gdbreplay <logfile> <host:port>\n"); - fflush (stderr); - exit (1); - } - fp = fopen (argv[1], "r"); - if (fp == NULL) - { - perror_with_name (argv[1]); - } - remote_open (argv[2]); - while ((ch = logchar (fp)) != EOF) - { - switch (ch) - { - case 'w': - /* data sent from gdb to gdbreplay, accept and match it */ - expect (fp); - break; - case 'r': - /* data sent from gdbreplay to gdb, play it */ - play (fp); - break; - case 'c': - /* Command executed by gdb */ - while ((ch = logchar (fp)) != EOL); - break; - } - } - remote_close (); - exit (0); -} diff --git a/gdb/gdbserver/gdbserver.1 b/gdb/gdbserver/gdbserver.1 deleted file mode 100644 index 2ca0788..0000000 --- a/gdb/gdbserver/gdbserver.1 +++ /dev/null @@ -1,116 +0,0 @@ -.\" Copyright (C) 1993 Free Software Foundation, Inc. -.\" See section COPYING for conditions for redistribution -.TH gdbserver 1 "2 November 1993" "Cygnus Support" "GNU Development Tools" -.SH NAME -gdbserver \- Remote Server for the GNU Debugger -.SH SYNOPSIS -.na -.TP -.B gdbserver -.RB tty -.RB prog -.RB "[\|" args... "\|]" -.PP -.B gdbserver -.RB tty -.B --attach -.RB PID -.ad b -.SH DESCRIPTION -GDBSERVER is a program that allows you to run GDB on a different machine -than the one which is running the program being debugged. - -Usage (server (target) side): - -First, you need to have a copy of the program you want to debug put onto -the target system. The program can be stripped to save space if needed, as -GDBserver doesn't care about symbols. All symbol handling is taken care of by -the GDB running on the host system. - -To use the server, you log on to the target system, and run the `gdbserver' -program. You must tell it (a) how to communicate with GDB, (b) the name of -your program, and (c) its arguments. The general syntax is: - - target> gdbserver COMM PROGRAM [ARGS ...] - -For example, using a serial port, you might say: - - target> gdbserver /dev/com1 emacs foo.txt - -This tells gdbserver to debug emacs with an argument of foo.txt, and to -communicate with GDB via /dev/com1. Gdbserver now waits patiently for the -host GDB to communicate with it. - -To use a TCP connection, you could say: - - target> gdbserver host:2345 emacs foo.txt - -This says pretty much the same thing as the last example, except that we are -going to communicate with the host GDB via TCP. The `host:2345' argument means -that we are expecting to see a TCP connection from `host' to local TCP port -2345. (Currently, the `host' part is ignored.) You can choose any number you -want for the port number as long as it does not conflict with any existing TCP -ports on the target system. This same port number must be used in the host -GDBs `target remote' command, which will be described shortly. Note that if -you chose a port number that conflicts with another service, gdbserver will -print an error message and exit. - -On some targets, gdbserver can also attach to running programs. -This is accomplished via the --attach argument. The syntax is: - - target> gdbserver COMM --attach PID - -PID is the process ID of a currently running process. It isn't -necessary to point gdbserver at a binary for the running process. - -Usage (host side): - -You need an unstripped copy of the target program on your host system, since -GDB needs to examine it's symbol tables and such. Start up GDB as you normally -would, with the target program as the first argument. (You may need to use the ---baud option if the serial line is running at anything except 9600 baud.) -Ie: `gdb TARGET-PROG', or `gdb --baud BAUD TARGET-PROG'. After that, the only -new command you need to know about is `target remote'. It's argument is either -a device name (usually a serial device, like `/dev/ttyb'), or a HOST:PORT -descriptor. For example: - - (gdb) target remote /dev/ttyb - -communicates with the server via serial line /dev/ttyb, and: - - (gdb) target remote the-target:2345 - -communicates via a TCP connection to port 2345 on host `the-target', where -you previously started up gdbserver with the same port number. Note that for -TCP connections, you must start up gdbserver prior to using the `target remote' -command, otherwise you may get an error that looks something like -`Connection refused'. -.SH OPTIONS -You have to supply the name of the program to debug -and the tty to communicate on; the remote GDB will do everything else. -Any remaining arguments will be passed to the program verbatim. -.SH "SEE ALSO" -.RB "`\|" gdb "\|'" -entry in -.B info\c -\&; -.I -Using GDB: A Guide to the GNU Source-Level Debugger\c -, Richard M. Stallman and Roland H. Pesch, July 1991. -.SH COPYING -Copyright (c) 1993 Free Software Foundation, Inc. -.PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the Free Software Foundation instead of in -the original English. diff --git a/gdb/gdbserver/i387-fp.c b/gdb/gdbserver/i387-fp.c deleted file mode 100644 index 830729b..0000000 --- a/gdb/gdbserver/i387-fp.c +++ /dev/null @@ -1,290 +0,0 @@ -/* i387-specific utility functions, for the remote server for GDB. - Copyright (C) 2000, 2001, 2002, 2005 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "i387-fp.h" - -int num_xmm_registers = 8; - -/* Note: These functions preserve the reserved bits in control registers. - However, gdbserver promptly throws away that information. */ - -/* These structs should have the proper sizes and alignment on both - i386 and x86-64 machines. */ - -struct i387_fsave { - /* All these are only sixteen bits, plus padding, except for fop (which - is only eleven bits), and fooff / fioff (which are 32 bits each). */ - unsigned int fctrl; - unsigned int fstat; - unsigned int ftag; - unsigned int fioff; - unsigned short fiseg; - unsigned short fop; - unsigned int fooff; - unsigned int foseg; - - /* Space for eight 80-bit FP values. */ - unsigned char st_space[80]; -}; - -struct i387_fxsave { - /* All these are only sixteen bits, plus padding, except for fop (which - is only eleven bits), and fooff / fioff (which are 32 bits each). */ - unsigned short fctrl; - unsigned short fstat; - unsigned short ftag; - unsigned short fop; - unsigned int fioff; - unsigned int fiseg; - unsigned int fooff; - unsigned int foseg; - - unsigned int mxcsr; - - unsigned int _pad1; - - /* Space for eight 80-bit FP values in 128-bit spaces. */ - unsigned char st_space[128]; - - /* Space for eight 128-bit XMM values, or 16 on x86-64. */ - unsigned char xmm_space[256]; -}; - -void -i387_cache_to_fsave (void *buf) -{ - struct i387_fsave *fp = (struct i387_fsave *) buf; - int i; - int st0_regnum = find_regno ("st0"); - unsigned long val, val2; - - for (i = 0; i < 8; i++) - collect_register (i + st0_regnum, ((char *) &fp->st_space[0]) + i * 10); - - collect_register_by_name ("fioff", &fp->fioff); - collect_register_by_name ("fooff", &fp->fooff); - - /* This one's 11 bits... */ - collect_register_by_name ("fop", &val2); - fp->fop = (val2 & 0x7FF) | (fp->fop & 0xF800); - - /* Some registers are 16-bit. */ - collect_register_by_name ("fctrl", &val); - *(unsigned short *) &fp->fctrl = val; - - collect_register_by_name ("fstat", &val); - val &= 0xFFFF; - *(unsigned short *) &fp->fstat = val; - - collect_register_by_name ("ftag", &val); - val &= 0xFFFF; - *(unsigned short *) &fp->ftag = val; - - collect_register_by_name ("fiseg", &val); - val &= 0xFFFF; - *(unsigned short *) &fp->fiseg = val; - - collect_register_by_name ("foseg", &val); - val &= 0xFFFF; - *(unsigned short *) &fp->foseg = val; -} - -void -i387_fsave_to_cache (const void *buf) -{ - struct i387_fsave *fp = (struct i387_fsave *) buf; - int i; - int st0_regnum = find_regno ("st0"); - unsigned long val; - - for (i = 0; i < 8; i++) - supply_register (i + st0_regnum, ((char *) &fp->st_space[0]) + i * 10); - - supply_register_by_name ("fioff", &fp->fioff); - supply_register_by_name ("fooff", &fp->fooff); - - /* Some registers are 16-bit. */ - val = fp->fctrl & 0xFFFF; - supply_register_by_name ("fctrl", &val); - - val = fp->fstat & 0xFFFF; - supply_register_by_name ("fstat", &val); - - val = fp->ftag & 0xFFFF; - supply_register_by_name ("ftag", &val); - - val = fp->fiseg & 0xFFFF; - supply_register_by_name ("fiseg", &val); - - val = fp->foseg & 0xFFFF; - supply_register_by_name ("foseg", &val); - - val = (fp->fop) & 0x7FF; - supply_register_by_name ("fop", &val); -} - -void -i387_cache_to_fxsave (void *buf) -{ - struct i387_fxsave *fp = (struct i387_fxsave *) buf; - int i; - int st0_regnum = find_regno ("st0"); - int xmm0_regnum = find_regno ("xmm0"); - unsigned long val, val2; - - for (i = 0; i < 8; i++) - collect_register (i + st0_regnum, ((char *) &fp->st_space[0]) + i * 16); - for (i = 0; i < num_xmm_registers; i++) - collect_register (i + xmm0_regnum, ((char *) &fp->xmm_space[0]) + i * 16); - - collect_register_by_name ("fioff", &fp->fioff); - collect_register_by_name ("fooff", &fp->fooff); - collect_register_by_name ("mxcsr", &fp->mxcsr); - - /* This one's 11 bits... */ - collect_register_by_name ("fop", &val2); - fp->fop = (val2 & 0x7FF) | (fp->fop & 0xF800); - - /* Some registers are 16-bit. */ - collect_register_by_name ("fctrl", &val); - *(unsigned short *) &fp->fctrl = val; - - collect_register_by_name ("fstat", &val); - val &= 0xFFFF; - *(unsigned short *) &fp->fstat = val; - - /* Convert to the simplifed tag form stored in fxsave data. */ - collect_register_by_name ("ftag", &val); - val &= 0xFFFF; - for (i = 7; i >= 0; i--) - { - int tag = (val >> (i * 2)) & 3; - - if (tag != 3) - val2 |= (1 << i); - } - *(unsigned short *) &fp->ftag = val2; - - collect_register_by_name ("fiseg", &val); - val &= 0xFFFF; - *(unsigned short *) &fp->fiseg = val; - - collect_register_by_name ("foseg", &val); - val &= 0xFFFF; - *(unsigned short *) &fp->foseg = val; -} - -static int -i387_ftag (struct i387_fxsave *fp, int regno) -{ - unsigned char *raw = &fp->st_space[regno * 16]; - unsigned int exponent; - unsigned long fraction[2]; - int integer; - - integer = raw[7] & 0x80; - exponent = (((raw[9] & 0x7f) << 8) | raw[8]); - fraction[0] = ((raw[3] << 24) | (raw[2] << 16) | (raw[1] << 8) | raw[0]); - fraction[1] = (((raw[7] & 0x7f) << 24) | (raw[6] << 16) - | (raw[5] << 8) | raw[4]); - - if (exponent == 0x7fff) - { - /* Special. */ - return (2); - } - else if (exponent == 0x0000) - { - if (fraction[0] == 0x0000 && fraction[1] == 0x0000 && !integer) - { - /* Zero. */ - return (1); - } - else - { - /* Special. */ - return (2); - } - } - else - { - if (integer) - { - /* Valid. */ - return (0); - } - else - { - /* Special. */ - return (2); - } - } -} - -void -i387_fxsave_to_cache (const void *buf) -{ - struct i387_fxsave *fp = (struct i387_fxsave *) buf; - int i, top; - int st0_regnum = find_regno ("st0"); - int xmm0_regnum = find_regno ("xmm0"); - unsigned long val; - - for (i = 0; i < 8; i++) - supply_register (i + st0_regnum, ((char *) &fp->st_space[0]) + i * 16); - for (i = 0; i < num_xmm_registers; i++) - supply_register (i + xmm0_regnum, ((char *) &fp->xmm_space[0]) + i * 16); - - supply_register_by_name ("fioff", &fp->fioff); - supply_register_by_name ("fooff", &fp->fooff); - supply_register_by_name ("mxcsr", &fp->mxcsr); - - /* Some registers are 16-bit. */ - val = fp->fctrl & 0xFFFF; - supply_register_by_name ("fctrl", &val); - - val = fp->fstat & 0xFFFF; - supply_register_by_name ("fstat", &val); - - /* Generate the form of ftag data that GDB expects. */ - top = (fp->fstat >> 11) & 0x7; - val = 0; - for (i = 7; i >= 0; i--) - { - int tag; - if (val & (1 << i)) - tag = i387_ftag (fp, (i + 8 - top) % 8); - else - tag = 3; - val |= tag << (2 * i); - } - supply_register_by_name ("ftag", &val); - - val = fp->fiseg & 0xFFFF; - supply_register_by_name ("fiseg", &val); - - val = fp->foseg & 0xFFFF; - supply_register_by_name ("foseg", &val); - - val = (fp->fop) & 0x7FF; - supply_register_by_name ("fop", &val); -} diff --git a/gdb/gdbserver/i387-fp.h b/gdb/gdbserver/i387-fp.h deleted file mode 100644 index e799415..0000000 --- a/gdb/gdbserver/i387-fp.h +++ /dev/null @@ -1,33 +0,0 @@ -/* i387-specific utility functions, for the remote server for GDB. - Copyright (C) 2000, 2001, 2002 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#ifndef I387_FP_H -#define I387_FP_H - -void i387_cache_to_fsave (void *buf); -void i387_fsave_to_cache (const void *buf); - -void i387_cache_to_fxsave (void *buf); -void i387_fxsave_to_cache (const void *buf); - -extern int num_xmm_registers; - -#endif /* I387_FP_H */ diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c deleted file mode 100644 index 6fa665f..0000000 --- a/gdb/gdbserver/inferiors.c +++ /dev/null @@ -1,239 +0,0 @@ -/* Inferior process information for the remote server for GDB. - Copyright (C) 2002, 2005 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include <stdlib.h> - -#include "server.h" - -struct thread_info -{ - struct inferior_list_entry entry; - void *target_data; - void *regcache_data; - unsigned int gdb_id; -}; - -struct inferior_list all_threads; - -struct thread_info *current_inferior; - -#define get_thread(inf) ((struct thread_info *)(inf)) - -void -add_inferior_to_list (struct inferior_list *list, - struct inferior_list_entry *new_inferior) -{ - new_inferior->next = NULL; - if (list->tail != NULL) - list->tail->next = new_inferior; - else - list->head = new_inferior; - list->tail = new_inferior; -} - -void -for_each_inferior (struct inferior_list *list, - void (*action) (struct inferior_list_entry *)) -{ - struct inferior_list_entry *cur = list->head, *next; - - while (cur != NULL) - { - next = cur->next; - (*action) (cur); - cur = next; - } -} - -void -change_inferior_id (struct inferior_list *list, - unsigned long new_id) -{ - if (list->head != list->tail) - error ("tried to change thread ID after multiple threads are created"); - - list->head->id = new_id; -} - -void -remove_inferior (struct inferior_list *list, - struct inferior_list_entry *entry) -{ - struct inferior_list_entry **cur; - - if (list->head == entry) - { - list->head = entry->next; - if (list->tail == entry) - list->tail = list->head; - return; - } - - cur = &list->head; - while (*cur && (*cur)->next != entry) - cur = &(*cur)->next; - - if (*cur == NULL) - return; - - (*cur)->next = entry->next; - - if (list->tail == entry) - list->tail = *cur; -} - -void -add_thread (unsigned long thread_id, void *target_data, unsigned int gdb_id) -{ - struct thread_info *new_thread - = (struct thread_info *) malloc (sizeof (*new_thread)); - - memset (new_thread, 0, sizeof (*new_thread)); - - new_thread->entry.id = thread_id; - - add_inferior_to_list (&all_threads, & new_thread->entry); - - if (current_inferior == NULL) - current_inferior = new_thread; - - new_thread->target_data = target_data; - set_inferior_regcache_data (new_thread, new_register_cache ()); - new_thread->gdb_id = gdb_id; -} - -unsigned int -thread_id_to_gdb_id (unsigned long thread_id) -{ - struct inferior_list_entry *inf = all_threads.head; - - while (inf != NULL) - { - struct thread_info *thread = get_thread (inf); - if (inf->id == thread_id) - return thread->gdb_id; - inf = inf->next; - } - - return 0; -} - -unsigned int -thread_to_gdb_id (struct thread_info *thread) -{ - return thread->gdb_id; -} - -unsigned long -gdb_id_to_thread_id (unsigned int gdb_id) -{ - struct inferior_list_entry *inf = all_threads.head; - - while (inf != NULL) - { - struct thread_info *thread = get_thread (inf); - if (thread->gdb_id == gdb_id) - return inf->id; - inf = inf->next; - } - - return 0; -} - -static void -free_one_thread (struct inferior_list_entry *inf) -{ - struct thread_info *thread = get_thread (inf); - free_register_cache (inferior_regcache_data (thread)); - free (thread); -} - -void -remove_thread (struct thread_info *thread) -{ - remove_inferior (&all_threads, (struct inferior_list_entry *) thread); - free_one_thread (&thread->entry); -} - -void -clear_inferiors (void) -{ - for_each_inferior (&all_threads, free_one_thread); - - all_threads.head = all_threads.tail = NULL; -} - -struct inferior_list_entry * -find_inferior (struct inferior_list *list, - int (*func) (struct inferior_list_entry *, void *), void *arg) -{ - struct inferior_list_entry *inf = list->head; - - while (inf != NULL) - { - if ((*func) (inf, arg)) - return inf; - inf = inf->next; - } - - return NULL; -} - -struct inferior_list_entry * -find_inferior_id (struct inferior_list *list, unsigned long id) -{ - struct inferior_list_entry *inf = list->head; - - while (inf != NULL) - { - if (inf->id == id) - return inf; - inf = inf->next; - } - - return NULL; -} - -void * -inferior_target_data (struct thread_info *inferior) -{ - return inferior->target_data; -} - -void -set_inferior_target_data (struct thread_info *inferior, void *data) -{ - inferior->target_data = data; -} - -void * -inferior_regcache_data (struct thread_info *inferior) -{ - return inferior->regcache_data; -} - -void -set_inferior_regcache_data (struct thread_info *inferior, void *data) -{ - inferior->regcache_data = data; -} diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c deleted file mode 100644 index c01f97a..0000000 --- a/gdb/gdbserver/linux-arm-low.c +++ /dev/null @@ -1,150 +0,0 @@ -/* GNU/Linux/ARM specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" - -#include <sys/ptrace.h> - -#include "gdb_proc_service.h" - -#ifndef PTRACE_GET_THREAD_AREA -#define PTRACE_GET_THREAD_AREA 22 -#endif - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -#define arm_num_regs 26 - -static int arm_regmap[] = { - 0, 4, 8, 12, 16, 20, 24, 28, - 32, 36, 40, 44, 48, 52, 56, 60, - -1, -1, -1, -1, -1, -1, -1, -1, -1, - 64 -}; - -static int -arm_cannot_store_register (int regno) -{ - return (regno >= arm_num_regs); -} - -static int -arm_cannot_fetch_register (int regno) -{ - return (regno >= arm_num_regs); -} - -extern int debug_threads; - -static CORE_ADDR -arm_get_pc () -{ - unsigned long pc; - collect_register_by_name ("pc", &pc); - if (debug_threads) - fprintf (stderr, "stop pc is %08lx\n", pc); - return pc; -} - -static void -arm_set_pc (CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name ("pc", &newpc); -} - -/* Correct in either endianness. We do not support Thumb yet. */ -static const unsigned long arm_breakpoint = 0xef9f0001; -#define arm_breakpoint_len 4 - -/* For new EABI binaries. We recognize it regardless of which ABI - is used for gdbserver, so single threaded debugging should work - OK, but for multi-threaded debugging we only insert the current - ABI's breakpoint instruction. For now at least. */ -static const unsigned long arm_eabi_breakpoint = 0xe7f001f0; - -static int -arm_breakpoint_at (CORE_ADDR where) -{ - unsigned long insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, 4); - if (insn == arm_breakpoint) - return 1; - - if (insn == arm_eabi_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - two. */ - - return 0; -} - -/* We only place breakpoints in empty marker functions, and thread locking - is outside of the function. So rather than importing software single-step, - we can just run until exit. */ -static CORE_ADDR -arm_reinsert_addr () -{ - unsigned long pc; - collect_register_by_name ("lr", &pc); - return pc; -} - -/* Fetch the thread-local storage pointer for libthread_db. */ - -ps_err_e -ps_get_thread_area (const struct ps_prochandle *ph, - lwpid_t lwpid, int idx, void **base) -{ - if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) - return PS_ERR; - - /* IDX is the bias from the thread pointer to the beginning of the - thread descriptor. It has to be subtracted due to implementation - quirks in libthread_db. */ - *base = (void *) ((char *)*base - idx); - - return PS_OK; -} - -struct linux_target_ops the_low_target = { - arm_num_regs, - arm_regmap, - arm_cannot_fetch_register, - arm_cannot_store_register, - arm_get_pc, - arm_set_pc, -#ifndef __ARM_EABI__ - (const unsigned char *) &arm_breakpoint, -#else - (const unsigned char *) &arm_eabi_breakpoint, -#endif - arm_breakpoint_len, - arm_reinsert_addr, - 0, - arm_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-cris-low.c b/gdb/gdbserver/linux-cris-low.c deleted file mode 100644 index d331dcc..0000000 --- a/gdb/gdbserver/linux-cris-low.c +++ /dev/null @@ -1,125 +0,0 @@ -/* GNU/Linux/CRIS specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" -#include <sys/ptrace.h> - -/* CRISv10 */ -#define cris_num_regs 32 - -/* Locations need to match <include/asm/arch/ptrace.h>. */ -static int cris_regmap[] = { - 15*4, 14*4, 13*4, 12*4, - 11*4, 10*4, 9*4, 8*4, - 7*4, 6*4, 5*4, 4*4, - 3*4, 2*4, 23*4, 19*4, - - -1, -1, -1, -1, - -1, 17*4, -1, 16*4, - -1, -1, -1, 18*4, - -1, 17*4, -1, -1 - -}; - -static int -cris_cannot_store_register (int regno) -{ - if (cris_regmap[regno] == -1) - return 1; - - return (regno >= cris_num_regs); -} - -static int -cris_cannot_fetch_register (int regno) -{ - if (cris_regmap[regno] == -1) - return 1; - - return (regno >= cris_num_regs); -} - -extern int debug_threads; - -static CORE_ADDR -cris_get_pc (void) -{ - unsigned long pc; - collect_register_by_name ("pc", &pc); - if (debug_threads) - fprintf (stderr, "stop pc is %08lx\n", pc); - return pc; -} - -static void -cris_set_pc (CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name ("pc", &newpc); -} - -static const unsigned short cris_breakpoint = 0xe938; -#define cris_breakpoint_len 2 - -static int -cris_breakpoint_at (CORE_ADDR where) -{ - unsigned short insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, - cris_breakpoint_len); - if (insn == cris_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -/* We only place breakpoints in empty marker functions, and thread locking - is outside of the function. So rather than importing software single-step, - we can just run until exit. */ -static CORE_ADDR -cris_reinsert_addr (void) -{ - unsigned long pc; - collect_register_by_name ("srp", &pc); - return pc; -} - -struct linux_target_ops the_low_target = { - cris_num_regs, - cris_regmap, - cris_cannot_fetch_register, - cris_cannot_store_register, - cris_get_pc, - cris_set_pc, - (const unsigned char *) &cris_breakpoint, - cris_breakpoint_len, - cris_reinsert_addr, - 0, - cris_breakpoint_at, - 0, - 0, - 0, - 0, -}; diff --git a/gdb/gdbserver/linux-crisv32-low.c b/gdb/gdbserver/linux-crisv32-low.c deleted file mode 100644 index b6379f8..0000000 --- a/gdb/gdbserver/linux-crisv32-low.c +++ /dev/null @@ -1,380 +0,0 @@ -/* GNU/Linux/CRIS specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" -#include <sys/ptrace.h> - -/* CRISv32 */ -#define cris_num_regs 49 - -/* Note: Ignoring USP (having the stack pointer in two locations causes trouble - without any significant gain). */ - -/* Locations need to match <include/asm/arch/ptrace.h>. */ -static int cris_regmap[] = { - 1*4, 2*4, 3*4, 4*4, - 5*4, 6*4, 7*4, 8*4, - 9*4, 10*4, 11*4, 12*4, - 13*4, 14*4, 24*4, 15*4, - - -1, -1, -1, 16*4, - -1, 22*4, 23*4, 17*4, - -1, -1, 21*4, 20*4, - -1, 19*4, -1, 18*4, - - 25*4, - - 26*4, -1, -1, 29*4, - 30*4, 31*4, 32*4, 33*4, - 34*4, 35*4, 36*4, 37*4, - 38*4, 39*4, 40*4, -1 - -}; - -extern int debug_threads; - -static CORE_ADDR -cris_get_pc (void) -{ - unsigned long pc; - collect_register_by_name ("pc", &pc); - if (debug_threads) - fprintf (stderr, "stop pc is %08lx\n", pc); - return pc; -} - -static void -cris_set_pc (CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name ("pc", &newpc); -} - -static const unsigned short cris_breakpoint = 0xe938; -#define cris_breakpoint_len 2 - -static int -cris_breakpoint_at (CORE_ADDR where) -{ - unsigned short insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, - cris_breakpoint_len); - if (insn == cris_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -/* We only place breakpoints in empty marker functions, and thread locking - is outside of the function. So rather than importing software single-step, - we can just run until exit. */ - -/* FIXME: This function should not be needed, since we have PTRACE_SINGLESTEP - for CRISv32. Without it, td_ta_event_getmsg in thread_db_create_event - will fail when debugging multi-threaded applications. */ - -static CORE_ADDR -cris_reinsert_addr (void) -{ - unsigned long pc; - collect_register_by_name ("srp", &pc); - return pc; -} - -static void -cris_write_data_breakpoint (int bp, unsigned long start, unsigned long end) -{ - switch (bp) - { - case 0: - supply_register_by_name ("s3", &start); - supply_register_by_name ("s4", &end); - break; - case 1: - supply_register_by_name ("s5", &start); - supply_register_by_name ("s6", &end); - break; - case 2: - supply_register_by_name ("s7", &start); - supply_register_by_name ("s8", &end); - break; - case 3: - supply_register_by_name ("s9", &start); - supply_register_by_name ("s10", &end); - break; - case 4: - supply_register_by_name ("s11", &start); - supply_register_by_name ("s12", &end); - break; - case 5: - supply_register_by_name ("s13", &start); - supply_register_by_name ("s14", &end); - break; - } -} - -static int -cris_insert_watchpoint (char type, CORE_ADDR addr, int len) -{ - int bp; - unsigned long bp_ctrl; - unsigned long start, end; - unsigned long ccs; - - /* Breakpoint/watchpoint types (GDB terminology): - 0 = memory breakpoint for instructions - (not supported; done via memory write instead) - 1 = hardware breakpoint for instructions (not supported) - 2 = write watchpoint (supported) - 3 = read watchpoint (supported) - 4 = access watchpoint (supported). */ - - if (type < '2' || type > '4') - { - /* Unsupported. */ - return 1; - } - - /* Read watchpoints are set as access watchpoints, because of GDB's - inability to deal with pure read watchpoints. */ - if (type == '3') - type = '4'; - - /* Get the configuration register. */ - collect_register_by_name ("s0", &bp_ctrl); - - /* The watchpoint allocation scheme is the simplest possible. - For example, if a region is watched for read and - a write watch is requested, a new watchpoint will - be used. Also, if a watch for a region that is already - covered by one or more existing watchpoints, a new - watchpoint will be used. */ - - /* First, find a free data watchpoint. */ - for (bp = 0; bp < 6; bp++) - { - /* Each data watchpoint's control registers occupy 2 bits - (hence the 3), starting at bit 2 for D0 (hence the 2) - with 4 bits between for each watchpoint (yes, the 4). */ - if (!(bp_ctrl & (0x3 << (2 + (bp * 4))))) - break; - } - - if (bp > 5) - { - /* We're out of watchpoints. */ - return -1; - } - - /* Configure the control register first. */ - if (type == '3' || type == '4') - { - /* Trigger on read. */ - bp_ctrl |= (1 << (2 + bp * 4)); - } - if (type == '2' || type == '4') - { - /* Trigger on write. */ - bp_ctrl |= (2 << (2 + bp * 4)); - } - - /* Setup the configuration register. */ - supply_register_by_name ("s0", &bp_ctrl); - - /* Setup the range. */ - start = addr; - end = addr + len - 1; - - /* Configure the watchpoint register. */ - cris_write_data_breakpoint (bp, start, end); - - collect_register_by_name ("ccs", &ccs); - /* Set the S1 flag to enable watchpoints. */ - ccs |= (1 << 19); - supply_register_by_name ("ccs", &ccs); - - return 0; -} - -static int -cris_remove_watchpoint (char type, CORE_ADDR addr, int len) -{ - int bp; - unsigned long bp_ctrl; - unsigned long start, end; - - /* Breakpoint/watchpoint types: - 0 = memory breakpoint for instructions - (not supported; done via memory write instead) - 1 = hardware breakpoint for instructions (not supported) - 2 = write watchpoint (supported) - 3 = read watchpoint (supported) - 4 = access watchpoint (supported). */ - if (type < '2' || type > '4') - return -1; - - /* Read watchpoints are set as access watchpoints, because of GDB's - inability to deal with pure read watchpoints. */ - if (type == '3') - type = '4'; - - /* Get the configuration register. */ - collect_register_by_name ("s0", &bp_ctrl); - - /* Try to find a watchpoint that is configured for the - specified range, then check that read/write also matches. */ - - /* Ugly pointer arithmetic, since I cannot rely on a - single switch (addr) as there may be several watchpoints with - the same start address for example. */ - - unsigned long bp_d_regs[12]; - - /* Get all range registers to simplify search. */ - collect_register_by_name ("s3", &bp_d_regs[0]); - collect_register_by_name ("s4", &bp_d_regs[1]); - collect_register_by_name ("s5", &bp_d_regs[2]); - collect_register_by_name ("s6", &bp_d_regs[3]); - collect_register_by_name ("s7", &bp_d_regs[4]); - collect_register_by_name ("s8", &bp_d_regs[5]); - collect_register_by_name ("s9", &bp_d_regs[6]); - collect_register_by_name ("s10", &bp_d_regs[7]); - collect_register_by_name ("s11", &bp_d_regs[8]); - collect_register_by_name ("s12", &bp_d_regs[9]); - collect_register_by_name ("s13", &bp_d_regs[10]); - collect_register_by_name ("s14", &bp_d_regs[11]); - - for (bp = 0; bp < 6; bp++) - { - if (bp_d_regs[bp * 2] == addr - && bp_d_regs[bp * 2 + 1] == (addr + len - 1)) { - /* Matching range. */ - int bitpos = 2 + bp * 4; - int rw_bits; - - /* Read/write bits for this BP. */ - rw_bits = (bp_ctrl & (0x3 << bitpos)) >> bitpos; - - if ((type == '3' && rw_bits == 0x1) - || (type == '2' && rw_bits == 0x2) - || (type == '4' && rw_bits == 0x3)) - { - /* Read/write matched. */ - break; - } - } - } - - if (bp > 5) - { - /* No watchpoint matched. */ - return -1; - } - - /* Found a matching watchpoint. Now, deconfigure it by - both disabling read/write in bp_ctrl and zeroing its - start/end addresses. */ - bp_ctrl &= ~(3 << (2 + (bp * 4))); - /* Setup the configuration register. */ - supply_register_by_name ("s0", &bp_ctrl); - - start = end = 0; - /* Configure the watchpoint register. */ - cris_write_data_breakpoint (bp, start, end); - - /* Note that we don't clear the S1 flag here. It's done when continuing. */ - return 0; -} - -static int -cris_stopped_by_watchpoint (void) -{ - unsigned long exs; - - collect_register_by_name ("exs", &exs); - - return (((exs & 0xff00) >> 8) == 0xc); -} - -static CORE_ADDR -cris_stopped_data_address (void) -{ - unsigned long eda; - - collect_register_by_name ("eda", &eda); - - /* FIXME: Possibly adjust to match watched range. */ - return eda; -} - -static void -cris_fill_gregset (void *buf) -{ - int i; - - for (i = 0; i < cris_num_regs; i++) - { - if (cris_regmap[i] != -1) - collect_register (i, ((char *) buf) + cris_regmap[i]); - } -} - -static void -cris_store_gregset (const void *buf) -{ - int i; - - for (i = 0; i < cris_num_regs; i++) - { - if (cris_regmap[i] != -1) - supply_register (i, ((char *) buf) + cris_regmap[i]); - } -} - -typedef unsigned long elf_gregset_t[cris_num_regs]; - -struct regset_info target_regsets[] = { - { PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t), - GENERAL_REGS, cris_fill_gregset, cris_store_gregset }, - { 0, 0, -1, -1, NULL, NULL } -}; - -struct linux_target_ops the_low_target = { - -1, - NULL, - NULL, - NULL, - cris_get_pc, - cris_set_pc, - (const unsigned char *) &cris_breakpoint, - cris_breakpoint_len, - cris_reinsert_addr, - 0, - cris_breakpoint_at, - cris_insert_watchpoint, - cris_remove_watchpoint, - cris_stopped_by_watchpoint, - cris_stopped_data_address, -}; diff --git a/gdb/gdbserver/linux-i386-low.c b/gdb/gdbserver/linux-i386-low.c deleted file mode 100644 index c0daf0b..0000000 --- a/gdb/gdbserver/linux-i386-low.c +++ /dev/null @@ -1,201 +0,0 @@ -/* GNU/Linux/i386 specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" -#include "i387-fp.h" - -#include "gdb_proc_service.h" - -#include <sys/ptrace.h> - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -#ifndef PTRACE_GET_THREAD_AREA -#define PTRACE_GET_THREAD_AREA 25 -#endif - -/* This module only supports access to the general purpose registers. */ - -#define i386_num_regs 16 - -/* This stuff comes from i386-linux-nat.c. */ - -/* Mapping between the general-purpose registers in `struct user' - format and GDB's register array layout. */ -static int i386_regmap[] = -{ - EAX * 4, ECX * 4, EDX * 4, EBX * 4, - UESP * 4, EBP * 4, ESI * 4, EDI * 4, - EIP * 4, EFL * 4, CS * 4, SS * 4, - DS * 4, ES * 4, FS * 4, GS * 4 -}; - -/* Called by libthread_db. */ - -ps_err_e -ps_get_thread_area (const struct ps_prochandle *ph, - lwpid_t lwpid, int idx, void **base) -{ - unsigned int desc[4]; - - if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, - (void *) idx, (unsigned long) &desc) < 0) - return PS_ERR; - - *(int *)base = desc[1]; - return PS_OK; -} - -static int -i386_cannot_store_register (int regno) -{ - return (regno >= i386_num_regs); -} - -static int -i386_cannot_fetch_register (int regno) -{ - return (regno >= i386_num_regs); -} - - -#ifdef HAVE_PTRACE_GETREGS -#include <sys/procfs.h> -#include <sys/ptrace.h> - -static void -i386_fill_gregset (void *buf) -{ - int i; - - for (i = 0; i < i386_num_regs; i++) - collect_register (i, ((char *) buf) + i386_regmap[i]); - - collect_register_by_name ("orig_eax", ((char *) buf) + ORIG_EAX * 4); -} - -static void -i386_store_gregset (const void *buf) -{ - int i; - - for (i = 0; i < i386_num_regs; i++) - supply_register (i, ((char *) buf) + i386_regmap[i]); - - supply_register_by_name ("orig_eax", ((char *) buf) + ORIG_EAX * 4); -} - -static void -i386_fill_fpregset (void *buf) -{ - i387_cache_to_fsave (buf); -} - -static void -i386_store_fpregset (const void *buf) -{ - i387_fsave_to_cache (buf); -} - -static void -i386_fill_fpxregset (void *buf) -{ - i387_cache_to_fxsave (buf); -} - -static void -i386_store_fpxregset (const void *buf) -{ - i387_fxsave_to_cache (buf); -} - -#endif /* HAVE_PTRACE_GETREGS */ - -struct regset_info target_regsets[] = { -#ifdef HAVE_PTRACE_GETREGS - { PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t), - GENERAL_REGS, - i386_fill_gregset, i386_store_gregset }, -# ifdef HAVE_PTRACE_GETFPXREGS - { PTRACE_GETFPXREGS, PTRACE_SETFPXREGS, sizeof (elf_fpxregset_t), - EXTENDED_REGS, - i386_fill_fpxregset, i386_store_fpxregset }, -# endif - { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof (elf_fpregset_t), - FP_REGS, - i386_fill_fpregset, i386_store_fpregset }, -#endif /* HAVE_PTRACE_GETREGS */ - { 0, 0, -1, -1, NULL, NULL } -}; - -static const unsigned char i386_breakpoint[] = { 0xCC }; -#define i386_breakpoint_len 1 - -extern int debug_threads; - -static CORE_ADDR -i386_get_pc () -{ - unsigned long pc; - - collect_register_by_name ("eip", &pc); - - if (debug_threads) - fprintf (stderr, "stop pc (before any decrement) is %08lx\n", pc); - return pc; -} - -static void -i386_set_pc (CORE_ADDR newpc) -{ - if (debug_threads) - fprintf (stderr, "set pc to %08lx\n", (long) newpc); - supply_register_by_name ("eip", &newpc); -} - -static int -i386_breakpoint_at (CORE_ADDR pc) -{ - unsigned char c; - - read_inferior_memory (pc, &c, 1); - if (c == 0xCC) - return 1; - - return 0; -} - -struct linux_target_ops the_low_target = { - i386_num_regs, - i386_regmap, - i386_cannot_fetch_register, - i386_cannot_store_register, - i386_get_pc, - i386_set_pc, - i386_breakpoint, - i386_breakpoint_len, - NULL, - 1, - i386_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-ia64-low.c b/gdb/gdbserver/linux-ia64-low.c deleted file mode 100644 index d38be7d..0000000 --- a/gdb/gdbserver/linux-ia64-low.c +++ /dev/null @@ -1,285 +0,0 @@ -/* GNU/Linux/IA64 specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -#define ia64_num_regs 462 - -#include <asm/ptrace_offsets.h> - -static int ia64_regmap[] = - { - /* general registers */ - -1, /* gr0 not available; i.e, it's always zero */ - PT_R1, - PT_R2, - PT_R3, - PT_R4, - PT_R5, - PT_R6, - PT_R7, - PT_R8, - PT_R9, - PT_R10, - PT_R11, - PT_R12, - PT_R13, - PT_R14, - PT_R15, - PT_R16, - PT_R17, - PT_R18, - PT_R19, - PT_R20, - PT_R21, - PT_R22, - PT_R23, - PT_R24, - PT_R25, - PT_R26, - PT_R27, - PT_R28, - PT_R29, - PT_R30, - PT_R31, - /* gr32 through gr127 not directly available via the ptrace interface */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - /* Floating point registers */ - -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */ - PT_F2, - PT_F3, - PT_F4, - PT_F5, - PT_F6, - PT_F7, - PT_F8, - PT_F9, - PT_F10, - PT_F11, - PT_F12, - PT_F13, - PT_F14, - PT_F15, - PT_F16, - PT_F17, - PT_F18, - PT_F19, - PT_F20, - PT_F21, - PT_F22, - PT_F23, - PT_F24, - PT_F25, - PT_F26, - PT_F27, - PT_F28, - PT_F29, - PT_F30, - PT_F31, - PT_F32, - PT_F33, - PT_F34, - PT_F35, - PT_F36, - PT_F37, - PT_F38, - PT_F39, - PT_F40, - PT_F41, - PT_F42, - PT_F43, - PT_F44, - PT_F45, - PT_F46, - PT_F47, - PT_F48, - PT_F49, - PT_F50, - PT_F51, - PT_F52, - PT_F53, - PT_F54, - PT_F55, - PT_F56, - PT_F57, - PT_F58, - PT_F59, - PT_F60, - PT_F61, - PT_F62, - PT_F63, - PT_F64, - PT_F65, - PT_F66, - PT_F67, - PT_F68, - PT_F69, - PT_F70, - PT_F71, - PT_F72, - PT_F73, - PT_F74, - PT_F75, - PT_F76, - PT_F77, - PT_F78, - PT_F79, - PT_F80, - PT_F81, - PT_F82, - PT_F83, - PT_F84, - PT_F85, - PT_F86, - PT_F87, - PT_F88, - PT_F89, - PT_F90, - PT_F91, - PT_F92, - PT_F93, - PT_F94, - PT_F95, - PT_F96, - PT_F97, - PT_F98, - PT_F99, - PT_F100, - PT_F101, - PT_F102, - PT_F103, - PT_F104, - PT_F105, - PT_F106, - PT_F107, - PT_F108, - PT_F109, - PT_F110, - PT_F111, - PT_F112, - PT_F113, - PT_F114, - PT_F115, - PT_F116, - PT_F117, - PT_F118, - PT_F119, - PT_F120, - PT_F121, - PT_F122, - PT_F123, - PT_F124, - PT_F125, - PT_F126, - PT_F127, - /* predicate registers - we don't fetch these individually */ - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - /* branch registers */ - PT_B0, - PT_B1, - PT_B2, - PT_B3, - PT_B4, - PT_B5, - PT_B6, - PT_B7, - /* virtual frame pointer and virtual return address pointer */ - -1, -1, - /* other registers */ - PT_PR, - PT_CR_IIP, /* ip */ - PT_CR_IPSR, /* psr */ - PT_CFM, /* cfm */ - /* kernel registers not visible via ptrace interface (?) */ - -1, -1, -1, -1, -1, -1, -1, -1, - /* hole */ - -1, -1, -1, -1, -1, -1, -1, -1, - PT_AR_RSC, - PT_AR_BSP, - PT_AR_BSPSTORE, - PT_AR_RNAT, - -1, - -1, /* Not available: FCR, IA32 floating control register */ - -1, -1, - -1, /* Not available: EFLAG */ - -1, /* Not available: CSD */ - -1, /* Not available: SSD */ - -1, /* Not available: CFLG */ - -1, /* Not available: FSR */ - -1, /* Not available: FIR */ - -1, /* Not available: FDR */ - -1, - PT_AR_CCV, - -1, -1, -1, - PT_AR_UNAT, - -1, -1, -1, - PT_AR_FPSR, - -1, -1, -1, - -1, /* Not available: ITC */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, - PT_AR_PFS, - PT_AR_LC, - -1, /* Not available: EC, the Epilog Count register */ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, - }; - -static int -ia64_cannot_store_register (int regno) -{ - return 0; -} - -static int -ia64_cannot_fetch_register (int regno) -{ - return 0; -} - -struct linux_target_ops the_low_target = { - ia64_num_regs, - ia64_regmap, - ia64_cannot_fetch_register, - ia64_cannot_store_register, -}; diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c deleted file mode 100644 index b0f0b60..0000000 --- a/gdb/gdbserver/linux-low.c +++ /dev/null @@ -1,1643 +0,0 @@ -/* Low level interface to ptrace, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" - -#include <sys/wait.h> -#include <stdio.h> -#include <sys/param.h> -#include <sys/dir.h> -#include <sys/ptrace.h> -#include <sys/user.h> -#include <signal.h> -#include <sys/ioctl.h> -#include <fcntl.h> -#include <string.h> -#include <stdlib.h> -#include <unistd.h> -#include <errno.h> -#include <sys/syscall.h> - -/* ``all_threads'' is keyed by the LWP ID - it should be the thread ID instead, - however. This requires changing the ID in place when we go from !using_threads - to using_threads, immediately. - - ``all_processes'' is keyed by the process ID - which on Linux is (presently) - the same as the LWP ID. */ - -struct inferior_list all_processes; - -/* FIXME this is a bit of a hack, and could be removed. */ -int stopping_threads; - -/* FIXME make into a target method? */ -int using_threads; - -static void linux_resume_one_process (struct inferior_list_entry *entry, - int step, int signal); -static void linux_resume (struct thread_resume *resume_info); -static void stop_all_processes (void); -static int linux_wait_for_event (struct thread_info *child); - -struct pending_signals -{ - int signal; - struct pending_signals *prev; -}; - -#define PTRACE_ARG3_TYPE long -#define PTRACE_XFER_TYPE long - -#ifdef HAVE_LINUX_REGSETS -static int use_regsets_p = 1; -#endif - -int debug_threads = 0; - -#define pid_of(proc) ((proc)->head.id) - -/* FIXME: Delete eventually. */ -#define inferior_pid (pid_of (get_thread_process (current_inferior))) - -/* This function should only be called if the process got a SIGTRAP. - The SIGTRAP could mean several things. - - On i386, where decr_pc_after_break is non-zero: - If we were single-stepping this process using PTRACE_SINGLESTEP, - we will get only the one SIGTRAP (even if the instruction we - stepped over was a breakpoint). The value of $eip will be the - next instruction. - If we continue the process using PTRACE_CONT, we will get a - SIGTRAP when we hit a breakpoint. The value of $eip will be - the instruction after the breakpoint (i.e. needs to be - decremented). If we report the SIGTRAP to GDB, we must also - report the undecremented PC. If we cancel the SIGTRAP, we - must resume at the decremented PC. - - (Presumably, not yet tested) On a non-decr_pc_after_break machine - with hardware or kernel single-step: - If we single-step over a breakpoint instruction, our PC will - point at the following instruction. If we continue and hit a - breakpoint instruction, our PC will point at the breakpoint - instruction. */ - -static CORE_ADDR -get_stop_pc (void) -{ - CORE_ADDR stop_pc = (*the_low_target.get_pc) (); - - if (get_thread_process (current_inferior)->stepping) - return stop_pc; - else - return stop_pc - the_low_target.decr_pc_after_break; -} - -static void * -add_process (unsigned long pid) -{ - struct process_info *process; - - process = (struct process_info *) malloc (sizeof (*process)); - memset (process, 0, sizeof (*process)); - - process->head.id = pid; - - /* Default to tid == lwpid == pid. */ - process->tid = pid; - process->lwpid = pid; - - add_inferior_to_list (&all_processes, &process->head); - - return process; -} - -/* Start an inferior process and returns its pid. - ALLARGS is a vector of program-name and args. */ - -static int -linux_create_inferior (char *program, char **allargs) -{ - void *new_process; - int pid; - -#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_MMU__) - pid = vfork (); -#else - pid = fork (); -#endif - if (pid < 0) - perror_with_name ("fork"); - - if (pid == 0) - { - ptrace (PTRACE_TRACEME, 0, 0, 0); - - signal (__SIGRTMIN + 1, SIG_DFL); - - setpgid (0, 0); - - execv (program, allargs); - - fprintf (stderr, "Cannot exec %s: %s.\n", program, - strerror (errno)); - fflush (stderr); - _exit (0177); - } - - new_process = add_process (pid); - add_thread (pid, new_process, pid); - - return pid; -} - -/* Attach to an inferior process. */ - -void -linux_attach_lwp (unsigned long pid, unsigned long tid) -{ - struct process_info *new_process; - - if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0) - { - fprintf (stderr, "Cannot attach to process %ld: %s (%d)\n", pid, - strerror (errno), errno); - fflush (stderr); - - /* If we fail to attach to an LWP, just return. */ - if (!using_threads) - _exit (0177); - return; - } - - new_process = (struct process_info *) add_process (pid); - add_thread (tid, new_process, pid); - - /* The next time we wait for this LWP we'll see a SIGSTOP as PTRACE_ATTACH - brings it to a halt. We should ignore that SIGSTOP and resume the process - (unless this is the first process, in which case the flag will be cleared - in linux_attach). - - On the other hand, if we are currently trying to stop all threads, we - should treat the new thread as if we had sent it a SIGSTOP. This works - because we are guaranteed that add_process added us to the end of the - list, and so the new thread has not yet reached wait_for_sigstop (but - will). */ - if (! stopping_threads) - new_process->stop_expected = 1; -} - -int -linux_attach (unsigned long pid) -{ - struct process_info *process; - - linux_attach_lwp (pid, pid); - - /* Don't ignore the initial SIGSTOP if we just attached to this process. */ - process = (struct process_info *) find_inferior_id (&all_processes, pid); - process->stop_expected = 0; - - return 0; -} - -/* Kill the inferior process. Make us have no inferior. */ - -static void -linux_kill_one_process (struct inferior_list_entry *entry) -{ - struct thread_info *thread = (struct thread_info *) entry; - struct process_info *process = get_thread_process (thread); - int wstat; - - /* We avoid killing the first thread here, because of a Linux kernel (at - least 2.6.0-test7 through 2.6.8-rc4) bug; if we kill the parent before - the children get a chance to be reaped, it will remain a zombie - forever. */ - if (entry == all_threads.head) - return; - - do - { - ptrace (PTRACE_KILL, pid_of (process), 0, 0); - - /* Make sure it died. The loop is most likely unnecessary. */ - wstat = linux_wait_for_event (thread); - } while (WIFSTOPPED (wstat)); -} - -static void -linux_kill (void) -{ - struct thread_info *thread = (struct thread_info *) all_threads.head; - struct process_info *process = get_thread_process (thread); - int wstat; - - for_each_inferior (&all_threads, linux_kill_one_process); - - /* See the comment in linux_kill_one_process. We did not kill the first - thread in the list, so do so now. */ - do - { - ptrace (PTRACE_KILL, pid_of (process), 0, 0); - - /* Make sure it died. The loop is most likely unnecessary. */ - wstat = linux_wait_for_event (thread); - } while (WIFSTOPPED (wstat)); -} - -static void -linux_detach_one_process (struct inferior_list_entry *entry) -{ - struct thread_info *thread = (struct thread_info *) entry; - struct process_info *process = get_thread_process (thread); - - ptrace (PTRACE_DETACH, pid_of (process), 0, 0); -} - -static void -linux_detach (void) -{ - for_each_inferior (&all_threads, linux_detach_one_process); -} - -/* Return nonzero if the given thread is still alive. */ -static int -linux_thread_alive (unsigned long tid) -{ - if (find_inferior_id (&all_threads, tid) != NULL) - return 1; - else - return 0; -} - -/* Return nonzero if this process stopped at a breakpoint which - no longer appears to be inserted. Also adjust the PC - appropriately to resume where the breakpoint used to be. */ -static int -check_removed_breakpoint (struct process_info *event_child) -{ - CORE_ADDR stop_pc; - struct thread_info *saved_inferior; - - if (event_child->pending_is_breakpoint == 0) - return 0; - - if (debug_threads) - fprintf (stderr, "Checking for breakpoint.\n"); - - saved_inferior = current_inferior; - current_inferior = get_process_thread (event_child); - - stop_pc = get_stop_pc (); - - /* If the PC has changed since we stopped, then we shouldn't do - anything. This happens if, for instance, GDB handled the - decr_pc_after_break subtraction itself. */ - if (stop_pc != event_child->pending_stop_pc) - { - if (debug_threads) - fprintf (stderr, "Ignoring, PC was changed.\n"); - - event_child->pending_is_breakpoint = 0; - current_inferior = saved_inferior; - return 0; - } - - /* If the breakpoint is still there, we will report hitting it. */ - if ((*the_low_target.breakpoint_at) (stop_pc)) - { - if (debug_threads) - fprintf (stderr, "Ignoring, breakpoint is still present.\n"); - current_inferior = saved_inferior; - return 0; - } - - if (debug_threads) - fprintf (stderr, "Removed breakpoint.\n"); - - /* For decr_pc_after_break targets, here is where we perform the - decrement. We go immediately from this function to resuming, - and can not safely call get_stop_pc () again. */ - if (the_low_target.set_pc != NULL) - (*the_low_target.set_pc) (stop_pc); - - /* We consumed the pending SIGTRAP. */ - event_child->pending_is_breakpoint = 0; - event_child->status_pending_p = 0; - event_child->status_pending = 0; - - current_inferior = saved_inferior; - return 1; -} - -/* Return 1 if this process has an interesting status pending. This function - may silently resume an inferior process. */ -static int -status_pending_p (struct inferior_list_entry *entry, void *dummy) -{ - struct process_info *process = (struct process_info *) entry; - - if (process->status_pending_p) - if (check_removed_breakpoint (process)) - { - /* This thread was stopped at a breakpoint, and the breakpoint - is now gone. We were told to continue (or step...) all threads, - so GDB isn't trying to single-step past this breakpoint. - So instead of reporting the old SIGTRAP, pretend we got to - the breakpoint just after it was removed instead of just - before; resume the process. */ - linux_resume_one_process (&process->head, 0, 0); - return 0; - } - - return process->status_pending_p; -} - -static void -linux_wait_for_process (struct process_info **childp, int *wstatp) -{ - int ret; - int to_wait_for = -1; - - if (*childp != NULL) - to_wait_for = (*childp)->lwpid; - - while (1) - { - ret = waitpid (to_wait_for, wstatp, WNOHANG); - - if (ret == -1) - { - if (errno != ECHILD) - perror_with_name ("waitpid"); - } - else if (ret > 0) - break; - - ret = waitpid (to_wait_for, wstatp, WNOHANG | __WCLONE); - - if (ret == -1) - { - if (errno != ECHILD) - perror_with_name ("waitpid (WCLONE)"); - } - else if (ret > 0) - break; - - usleep (1000); - } - - if (debug_threads - && (!WIFSTOPPED (*wstatp) - || (WSTOPSIG (*wstatp) != 32 - && WSTOPSIG (*wstatp) != 33))) - fprintf (stderr, "Got an event from %d (%x)\n", ret, *wstatp); - - if (to_wait_for == -1) - *childp = (struct process_info *) find_inferior_id (&all_processes, ret); - - (*childp)->stopped = 1; - (*childp)->pending_is_breakpoint = 0; - - if (debug_threads - && WIFSTOPPED (*wstatp)) - { - current_inferior = (struct thread_info *) - find_inferior_id (&all_threads, (*childp)->tid); - /* For testing only; i386_stop_pc prints out a diagnostic. */ - if (the_low_target.get_pc != NULL) - get_stop_pc (); - } -} - -static int -linux_wait_for_event (struct thread_info *child) -{ - CORE_ADDR stop_pc; - struct process_info *event_child; - int wstat; - - /* Check for a process with a pending status. */ - /* It is possible that the user changed the pending task's registers since - it stopped. We correctly handle the change of PC if we hit a breakpoint - (in check_removed_breakpoint); signals should be reported anyway. */ - if (child == NULL) - { - event_child = (struct process_info *) - find_inferior (&all_processes, status_pending_p, NULL); - if (debug_threads && event_child) - fprintf (stderr, "Got a pending child %ld\n", event_child->lwpid); - } - else - { - event_child = get_thread_process (child); - if (event_child->status_pending_p - && check_removed_breakpoint (event_child)) - event_child = NULL; - } - - if (event_child != NULL) - { - if (event_child->status_pending_p) - { - if (debug_threads) - fprintf (stderr, "Got an event from pending child %ld (%04x)\n", - event_child->lwpid, event_child->status_pending); - wstat = event_child->status_pending; - event_child->status_pending_p = 0; - event_child->status_pending = 0; - current_inferior = get_process_thread (event_child); - return wstat; - } - } - - /* We only enter this loop if no process has a pending wait status. Thus - any action taken in response to a wait status inside this loop is - responding as soon as we detect the status, not after any pending - events. */ - while (1) - { - if (child == NULL) - event_child = NULL; - else - event_child = get_thread_process (child); - - linux_wait_for_process (&event_child, &wstat); - - if (event_child == NULL) - error ("event from unknown child"); - - current_inferior = (struct thread_info *) - find_inferior_id (&all_threads, event_child->tid); - - if (using_threads) - { - /* Check for thread exit. */ - if (! WIFSTOPPED (wstat)) - { - if (debug_threads) - fprintf (stderr, "Thread %ld (LWP %ld) exiting\n", - event_child->tid, event_child->head.id); - - /* If the last thread is exiting, just return. */ - if (all_threads.head == all_threads.tail) - return wstat; - - dead_thread_notify (event_child->tid); - - remove_inferior (&all_processes, &event_child->head); - free (event_child); - remove_thread (current_inferior); - current_inferior = (struct thread_info *) all_threads.head; - - /* If we were waiting for this particular child to do something... - well, it did something. */ - if (child != NULL) - return wstat; - - /* Wait for a more interesting event. */ - continue; - } - - if (WIFSTOPPED (wstat) - && WSTOPSIG (wstat) == SIGSTOP - && event_child->stop_expected) - { - if (debug_threads) - fprintf (stderr, "Expected stop.\n"); - event_child->stop_expected = 0; - linux_resume_one_process (&event_child->head, - event_child->stepping, 0); - continue; - } - - /* FIXME drow/2002-06-09: Get signal numbers from the inferior's - thread library? */ - if (WIFSTOPPED (wstat) - && (WSTOPSIG (wstat) == __SIGRTMIN - || WSTOPSIG (wstat) == __SIGRTMIN + 1)) - { - if (debug_threads) - fprintf (stderr, "Ignored signal %d for %ld (LWP %ld).\n", - WSTOPSIG (wstat), event_child->tid, - event_child->head.id); - linux_resume_one_process (&event_child->head, - event_child->stepping, - WSTOPSIG (wstat)); - continue; - } - } - - /* If this event was not handled above, and is not a SIGTRAP, report - it. */ - if (!WIFSTOPPED (wstat) || WSTOPSIG (wstat) != SIGTRAP) - return wstat; - - /* If this target does not support breakpoints, we simply report the - SIGTRAP; it's of no concern to us. */ - if (the_low_target.get_pc == NULL) - return wstat; - - stop_pc = get_stop_pc (); - - /* bp_reinsert will only be set if we were single-stepping. - Notice that we will resume the process after hitting - a gdbserver breakpoint; single-stepping to/over one - is not supported (yet). */ - if (event_child->bp_reinsert != 0) - { - if (debug_threads) - fprintf (stderr, "Reinserted breakpoint.\n"); - reinsert_breakpoint (event_child->bp_reinsert); - event_child->bp_reinsert = 0; - - /* Clear the single-stepping flag and SIGTRAP as we resume. */ - linux_resume_one_process (&event_child->head, 0, 0); - continue; - } - - if (debug_threads) - fprintf (stderr, "Hit a (non-reinsert) breakpoint.\n"); - - if (check_breakpoints (stop_pc) != 0) - { - /* We hit one of our own breakpoints. We mark it as a pending - breakpoint, so that check_removed_breakpoint () will do the PC - adjustment for us at the appropriate time. */ - event_child->pending_is_breakpoint = 1; - event_child->pending_stop_pc = stop_pc; - - /* Now we need to put the breakpoint back. We continue in the event - loop instead of simply replacing the breakpoint right away, - in order to not lose signals sent to the thread that hit the - breakpoint. Unfortunately this increases the window where another - thread could sneak past the removed breakpoint. For the current - use of server-side breakpoints (thread creation) this is - acceptable; but it needs to be considered before this breakpoint - mechanism can be used in more general ways. For some breakpoints - it may be necessary to stop all other threads, but that should - be avoided where possible. - - If breakpoint_reinsert_addr is NULL, that means that we can - use PTRACE_SINGLESTEP on this platform. Uninsert the breakpoint, - mark it for reinsertion, and single-step. - - Otherwise, call the target function to figure out where we need - our temporary breakpoint, create it, and continue executing this - process. */ - if (the_low_target.breakpoint_reinsert_addr == NULL) - { - event_child->bp_reinsert = stop_pc; - uninsert_breakpoint (stop_pc); - linux_resume_one_process (&event_child->head, 1, 0); - } - else - { - reinsert_breakpoint_by_bp - (stop_pc, (*the_low_target.breakpoint_reinsert_addr) ()); - linux_resume_one_process (&event_child->head, 0, 0); - } - - continue; - } - - /* If we were single-stepping, we definitely want to report the - SIGTRAP. The single-step operation has completed, so also - clear the stepping flag; in general this does not matter, - because the SIGTRAP will be reported to the client, which - will give us a new action for this thread, but clear it for - consistency anyway. It's safe to clear the stepping flag - because the only consumer of get_stop_pc () after this point - is check_removed_breakpoint, and pending_is_breakpoint is not - set. It might be wiser to use a step_completed flag instead. */ - if (event_child->stepping) - { - event_child->stepping = 0; - return wstat; - } - - /* A SIGTRAP that we can't explain. It may have been a breakpoint. - Check if it is a breakpoint, and if so mark the process information - accordingly. This will handle both the necessary fiddling with the - PC on decr_pc_after_break targets and suppressing extra threads - hitting a breakpoint if two hit it at once and then GDB removes it - after the first is reported. Arguably it would be better to report - multiple threads hitting breakpoints simultaneously, but the current - remote protocol does not allow this. */ - if ((*the_low_target.breakpoint_at) (stop_pc)) - { - event_child->pending_is_breakpoint = 1; - event_child->pending_stop_pc = stop_pc; - } - - return wstat; - } - - /* NOTREACHED */ - return 0; -} - -/* Wait for process, returns status. */ - -static unsigned char -linux_wait (char *status) -{ - int w; - struct thread_info *child = NULL; - -retry: - /* If we were only supposed to resume one thread, only wait for - that thread - if it's still alive. If it died, however - which - can happen if we're coming from the thread death case below - - then we need to make sure we restart the other threads. We could - pick a thread at random or restart all; restarting all is less - arbitrary. */ - if (cont_thread != 0 && cont_thread != -1) - { - child = (struct thread_info *) find_inferior_id (&all_threads, - cont_thread); - - /* No stepping, no signal - unless one is pending already, of course. */ - if (child == NULL) - { - struct thread_resume resume_info; - resume_info.thread = -1; - resume_info.step = resume_info.sig = resume_info.leave_stopped = 0; - linux_resume (&resume_info); - } - } - - enable_async_io (); - unblock_async_io (); - w = linux_wait_for_event (child); - stop_all_processes (); - disable_async_io (); - - /* If we are waiting for a particular child, and it exited, - linux_wait_for_event will return its exit status. Similarly if - the last child exited. If this is not the last child, however, - do not report it as exited until there is a 'thread exited' response - available in the remote protocol. Instead, just wait for another event. - This should be safe, because if the thread crashed we will already - have reported the termination signal to GDB; that should stop any - in-progress stepping operations, etc. - - Report the exit status of the last thread to exit. This matches - LinuxThreads' behavior. */ - - if (all_threads.head == all_threads.tail) - { - if (WIFEXITED (w)) - { - fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w)); - *status = 'W'; - clear_inferiors (); - free (all_processes.head); - all_processes.head = all_processes.tail = NULL; - return WEXITSTATUS (w); - } - else if (!WIFSTOPPED (w)) - { - fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w)); - *status = 'X'; - clear_inferiors (); - free (all_processes.head); - all_processes.head = all_processes.tail = NULL; - return target_signal_from_host (WTERMSIG (w)); - } - } - else - { - if (!WIFSTOPPED (w)) - goto retry; - } - - *status = 'T'; - return target_signal_from_host (WSTOPSIG (w)); -} - -/* Send a signal to an LWP. For LinuxThreads, kill is enough; however, if - thread groups are in use, we need to use tkill. */ - -static int -kill_lwp (unsigned long lwpid, int signo) -{ - static int tkill_failed; - - errno = 0; - -#ifdef SYS_tkill - if (!tkill_failed) - { - int ret = syscall (SYS_tkill, lwpid, signo); - if (errno != ENOSYS) - return ret; - errno = 0; - tkill_failed = 1; - } -#endif - - return kill (lwpid, signo); -} - -static void -send_sigstop (struct inferior_list_entry *entry) -{ - struct process_info *process = (struct process_info *) entry; - - if (process->stopped) - return; - - /* If we already have a pending stop signal for this process, don't - send another. */ - if (process->stop_expected) - { - process->stop_expected = 0; - return; - } - - if (debug_threads) - fprintf (stderr, "Sending sigstop to process %ld\n", process->head.id); - - kill_lwp (process->head.id, SIGSTOP); - process->sigstop_sent = 1; -} - -static void -wait_for_sigstop (struct inferior_list_entry *entry) -{ - struct process_info *process = (struct process_info *) entry; - struct thread_info *saved_inferior, *thread; - int wstat; - unsigned long saved_tid; - - if (process->stopped) - return; - - saved_inferior = current_inferior; - saved_tid = ((struct inferior_list_entry *) saved_inferior)->id; - thread = (struct thread_info *) find_inferior_id (&all_threads, - process->tid); - wstat = linux_wait_for_event (thread); - - /* If we stopped with a non-SIGSTOP signal, save it for later - and record the pending SIGSTOP. If the process exited, just - return. */ - if (WIFSTOPPED (wstat) - && WSTOPSIG (wstat) != SIGSTOP) - { - if (debug_threads) - fprintf (stderr, "Stopped with non-sigstop signal\n"); - process->status_pending_p = 1; - process->status_pending = wstat; - process->stop_expected = 1; - } - - if (linux_thread_alive (saved_tid)) - current_inferior = saved_inferior; - else - { - if (debug_threads) - fprintf (stderr, "Previously current thread died.\n"); - - /* Set a valid thread as current. */ - set_desired_inferior (0); - } -} - -static void -stop_all_processes (void) -{ - stopping_threads = 1; - for_each_inferior (&all_processes, send_sigstop); - for_each_inferior (&all_processes, wait_for_sigstop); - stopping_threads = 0; -} - -/* Resume execution of the inferior process. - If STEP is nonzero, single-step it. - If SIGNAL is nonzero, give it that signal. */ - -static void -linux_resume_one_process (struct inferior_list_entry *entry, - int step, int signal) -{ - struct process_info *process = (struct process_info *) entry; - struct thread_info *saved_inferior; - - if (process->stopped == 0) - return; - - /* If we have pending signals or status, and a new signal, enqueue the - signal. Also enqueue the signal if we are waiting to reinsert a - breakpoint; it will be picked up again below. */ - if (signal != 0 - && (process->status_pending_p || process->pending_signals != NULL - || process->bp_reinsert != 0)) - { - struct pending_signals *p_sig; - p_sig = malloc (sizeof (*p_sig)); - p_sig->prev = process->pending_signals; - p_sig->signal = signal; - process->pending_signals = p_sig; - } - - if (process->status_pending_p && !check_removed_breakpoint (process)) - return; - - saved_inferior = current_inferior; - current_inferior = get_process_thread (process); - - if (debug_threads) - fprintf (stderr, "Resuming process %ld (%s, signal %d, stop %s)\n", inferior_pid, - step ? "step" : "continue", signal, - process->stop_expected ? "expected" : "not expected"); - - /* This bit needs some thinking about. If we get a signal that - we must report while a single-step reinsert is still pending, - we often end up resuming the thread. It might be better to - (ew) allow a stack of pending events; then we could be sure that - the reinsert happened right away and not lose any signals. - - Making this stack would also shrink the window in which breakpoints are - uninserted (see comment in linux_wait_for_process) but not enough for - complete correctness, so it won't solve that problem. It may be - worthwhile just to solve this one, however. */ - if (process->bp_reinsert != 0) - { - if (debug_threads) - fprintf (stderr, " pending reinsert at %08lx", (long)process->bp_reinsert); - if (step == 0) - fprintf (stderr, "BAD - reinserting but not stepping.\n"); - step = 1; - - /* Postpone any pending signal. It was enqueued above. */ - signal = 0; - } - - check_removed_breakpoint (process); - - if (debug_threads && the_low_target.get_pc != NULL) - { - fprintf (stderr, " "); - (*the_low_target.get_pc) (); - } - - /* If we have pending signals, consume one unless we are trying to reinsert - a breakpoint. */ - if (process->pending_signals != NULL && process->bp_reinsert == 0) - { - struct pending_signals **p_sig; - - p_sig = &process->pending_signals; - while ((*p_sig)->prev != NULL) - p_sig = &(*p_sig)->prev; - - signal = (*p_sig)->signal; - free (*p_sig); - *p_sig = NULL; - } - - regcache_invalidate_one ((struct inferior_list_entry *) - get_process_thread (process)); - errno = 0; - process->stopped = 0; - process->stepping = step; - ptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, process->lwpid, 0, signal); - - current_inferior = saved_inferior; - if (errno) - perror_with_name ("ptrace"); -} - -static struct thread_resume *resume_ptr; - -/* This function is called once per thread. We look up the thread - in RESUME_PTR, and mark the thread with a pointer to the appropriate - resume request. - - This algorithm is O(threads * resume elements), but resume elements - is small (and will remain small at least until GDB supports thread - suspension). */ -static void -linux_set_resume_request (struct inferior_list_entry *entry) -{ - struct process_info *process; - struct thread_info *thread; - int ndx; - - thread = (struct thread_info *) entry; - process = get_thread_process (thread); - - ndx = 0; - while (resume_ptr[ndx].thread != -1 && resume_ptr[ndx].thread != entry->id) - ndx++; - - process->resume = &resume_ptr[ndx]; -} - -/* This function is called once per thread. We check the thread's resume - request, which will tell us whether to resume, step, or leave the thread - stopped; and what signal, if any, it should be sent. For threads which - we aren't explicitly told otherwise, we preserve the stepping flag; this - is used for stepping over gdbserver-placed breakpoints. */ - -static void -linux_continue_one_thread (struct inferior_list_entry *entry) -{ - struct process_info *process; - struct thread_info *thread; - int step; - - thread = (struct thread_info *) entry; - process = get_thread_process (thread); - - if (process->resume->leave_stopped) - return; - - if (process->resume->thread == -1) - step = process->stepping || process->resume->step; - else - step = process->resume->step; - - linux_resume_one_process (&process->head, step, process->resume->sig); - - process->resume = NULL; -} - -/* This function is called once per thread. We check the thread's resume - request, which will tell us whether to resume, step, or leave the thread - stopped; and what signal, if any, it should be sent. We queue any needed - signals, since we won't actually resume. We already have a pending event - to report, so we don't need to preserve any step requests; they should - be re-issued if necessary. */ - -static void -linux_queue_one_thread (struct inferior_list_entry *entry) -{ - struct process_info *process; - struct thread_info *thread; - - thread = (struct thread_info *) entry; - process = get_thread_process (thread); - - if (process->resume->leave_stopped) - return; - - /* If we have a new signal, enqueue the signal. */ - if (process->resume->sig != 0) - { - struct pending_signals *p_sig; - p_sig = malloc (sizeof (*p_sig)); - p_sig->prev = process->pending_signals; - p_sig->signal = process->resume->sig; - process->pending_signals = p_sig; - } - - process->resume = NULL; -} - -/* Set DUMMY if this process has an interesting status pending. */ -static int -resume_status_pending_p (struct inferior_list_entry *entry, void *flag_p) -{ - struct process_info *process = (struct process_info *) entry; - - /* Processes which will not be resumed are not interesting, because - we might not wait for them next time through linux_wait. */ - if (process->resume->leave_stopped) - return 0; - - /* If this thread has a removed breakpoint, we won't have any - events to report later, so check now. check_removed_breakpoint - may clear status_pending_p. We avoid calling check_removed_breakpoint - for any thread that we are not otherwise going to resume - this - lets us preserve stopped status when two threads hit a breakpoint. - GDB removes the breakpoint to single-step a particular thread - past it, then re-inserts it and resumes all threads. We want - to report the second thread without resuming it in the interim. */ - if (process->status_pending_p) - check_removed_breakpoint (process); - - if (process->status_pending_p) - * (int *) flag_p = 1; - - return 0; -} - -static void -linux_resume (struct thread_resume *resume_info) -{ - int pending_flag; - - /* Yes, the use of a global here is rather ugly. */ - resume_ptr = resume_info; - - for_each_inferior (&all_threads, linux_set_resume_request); - - /* If there is a thread which would otherwise be resumed, which - has a pending status, then don't resume any threads - we can just - report the pending status. Make sure to queue any signals - that would otherwise be sent. */ - pending_flag = 0; - find_inferior (&all_processes, resume_status_pending_p, &pending_flag); - - if (debug_threads) - { - if (pending_flag) - fprintf (stderr, "Not resuming, pending status\n"); - else - fprintf (stderr, "Resuming, no pending status\n"); - } - - if (pending_flag) - for_each_inferior (&all_threads, linux_queue_one_thread); - else - { - block_async_io (); - enable_async_io (); - for_each_inferior (&all_threads, linux_continue_one_thread); - } -} - -#ifdef HAVE_LINUX_USRREGS - -int -register_addr (int regnum) -{ - int addr; - - if (regnum < 0 || regnum >= the_low_target.num_regs) - error ("Invalid register number %d.", regnum); - - addr = the_low_target.regmap[regnum]; - - return addr; -} - -/* Fetch one register. */ -static void -fetch_register (int regno) -{ - CORE_ADDR regaddr; - int i, size; - char *buf; - - if (regno >= the_low_target.num_regs) - return; - if ((*the_low_target.cannot_fetch_register) (regno)) - return; - - regaddr = register_addr (regno); - if (regaddr == -1) - return; - size = (register_size (regno) + sizeof (PTRACE_XFER_TYPE) - 1) - & - sizeof (PTRACE_XFER_TYPE); - buf = alloca (size); - for (i = 0; i < size; i += sizeof (PTRACE_XFER_TYPE)) - { - errno = 0; - *(PTRACE_XFER_TYPE *) (buf + i) = - ptrace (PTRACE_PEEKUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, 0); - regaddr += sizeof (PTRACE_XFER_TYPE); - if (errno != 0) - { - /* Warning, not error, in case we are attached; sometimes the - kernel doesn't let us at the registers. */ - char *err = strerror (errno); - char *msg = alloca (strlen (err) + 128); - sprintf (msg, "reading register %d: %s", regno, err); - error (msg); - goto error_exit; - } - } - if (the_low_target.left_pad_xfer - && register_size (regno) < sizeof (PTRACE_XFER_TYPE)) - supply_register (regno, (buf + sizeof (PTRACE_XFER_TYPE) - - register_size (regno))); - else - supply_register (regno, buf); - -error_exit:; -} - -/* Fetch all registers, or just one, from the child process. */ -static void -usr_fetch_inferior_registers (int regno) -{ - if (regno == -1 || regno == 0) - for (regno = 0; regno < the_low_target.num_regs; regno++) - fetch_register (regno); - else - fetch_register (regno); -} - -/* 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). */ -static void -usr_store_inferior_registers (int regno) -{ - CORE_ADDR regaddr; - int i, size; - char *buf; - - if (regno >= 0) - { - if (regno >= the_low_target.num_regs) - return; - - if ((*the_low_target.cannot_store_register) (regno) == 1) - return; - - regaddr = register_addr (regno); - if (regaddr == -1) - return; - errno = 0; - size = (register_size (regno) + sizeof (PTRACE_XFER_TYPE) - 1) - & - sizeof (PTRACE_XFER_TYPE); - buf = alloca (size); - memset (buf, 0, size); - if (the_low_target.left_pad_xfer - && register_size (regno) < sizeof (PTRACE_XFER_TYPE)) - collect_register (regno, (buf + sizeof (PTRACE_XFER_TYPE) - - register_size (regno))); - else - collect_register (regno, buf); - for (i = 0; i < size; i += sizeof (PTRACE_XFER_TYPE)) - { - errno = 0; - ptrace (PTRACE_POKEUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr, - *(PTRACE_XFER_TYPE *) (buf + i)); - if (errno != 0) - { - if ((*the_low_target.cannot_store_register) (regno) == 0) - { - char *err = strerror (errno); - char *msg = alloca (strlen (err) + 128); - sprintf (msg, "writing register %d: %s", - regno, err); - error (msg); - return; - } - } - regaddr += sizeof (PTRACE_XFER_TYPE); - } - } - else - for (regno = 0; regno < the_low_target.num_regs; regno++) - usr_store_inferior_registers (regno); -} -#endif /* HAVE_LINUX_USRREGS */ - - - -#ifdef HAVE_LINUX_REGSETS - -static int -regsets_fetch_inferior_registers () -{ - struct regset_info *regset; - int saw_general_regs = 0; - - regset = target_regsets; - - while (regset->size >= 0) - { - void *buf; - int res; - - if (regset->size == 0) - { - regset ++; - continue; - } - - buf = malloc (regset->size); - res = ptrace (regset->get_request, inferior_pid, 0, buf); - if (res < 0) - { - if (errno == EIO) - { - /* If we get EIO on the first regset, do not try regsets again. - If we get EIO on a later regset, disable that regset. */ - if (regset == target_regsets) - { - use_regsets_p = 0; - return -1; - } - else - { - regset->size = 0; - continue; - } - } - else - { - char s[256]; - sprintf (s, "ptrace(regsets_fetch_inferior_registers) PID=%ld", - inferior_pid); - perror (s); - } - } - else if (regset->type == GENERAL_REGS) - saw_general_regs = 1; - regset->store_function (buf); - regset ++; - } - if (saw_general_regs) - return 0; - else - return 1; -} - -static int -regsets_store_inferior_registers () -{ - struct regset_info *regset; - int saw_general_regs = 0; - - regset = target_regsets; - - while (regset->size >= 0) - { - void *buf; - int res; - - if (regset->size == 0) - { - regset ++; - continue; - } - - buf = malloc (regset->size); - - /* First fill the buffer with the current register set contents, - in case there are any items in the kernel's regset that are - not in gdbserver's regcache. */ - res = ptrace (regset->get_request, inferior_pid, 0, buf); - - if (res == 0) - { - /* Then overlay our cached registers on that. */ - regset->fill_function (buf); - - /* Only now do we write the register set. */ - res = ptrace (regset->set_request, inferior_pid, 0, buf); - } - - if (res < 0) - { - if (errno == EIO) - { - /* If we get EIO on the first regset, do not try regsets again. - If we get EIO on a later regset, disable that regset. */ - if (regset == target_regsets) - { - use_regsets_p = 0; - return -1; - } - else - { - regset->size = 0; - continue; - } - } - else - { - perror ("Warning: ptrace(regsets_store_inferior_registers)"); - } - } - else if (regset->type == GENERAL_REGS) - saw_general_regs = 1; - regset ++; - free (buf); - } - if (saw_general_regs) - return 0; - else - return 1; - return 0; -} - -#endif /* HAVE_LINUX_REGSETS */ - - -void -linux_fetch_registers (int regno) -{ -#ifdef HAVE_LINUX_REGSETS - if (use_regsets_p) - { - if (regsets_fetch_inferior_registers () == 0) - return; - } -#endif -#ifdef HAVE_LINUX_USRREGS - usr_fetch_inferior_registers (regno); -#endif -} - -void -linux_store_registers (int regno) -{ -#ifdef HAVE_LINUX_REGSETS - if (use_regsets_p) - { - if (regsets_store_inferior_registers () == 0) - return; - } -#endif -#ifdef HAVE_LINUX_USRREGS - usr_store_inferior_registers (regno); -#endif -} - - -/* Copy LEN bytes from inferior's memory starting at MEMADDR - to debugger memory starting at MYADDR. */ - -static int -linux_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) - / sizeof (PTRACE_XFER_TYPE); - /* Allocate buffer of that many longwords. */ - register PTRACE_XFER_TYPE *buffer - = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE)); - - /* Read all the longwords */ - for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE)) - { - errno = 0; - buffer[i] = ptrace (PTRACE_PEEKTEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0); - if (errno) - return errno; - } - - /* Copy appropriate bytes out of the buffer. */ - memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), len); - - return 0; -} - -/* Copy LEN bytes of data from debugger memory at MYADDR - to inferior's memory at MEMADDR. - On failure (cannot write the inferior) - returns the value of errno. */ - -static int -linux_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len) -{ - register int i; - /* Round starting address down to longword boundary. */ - register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE); - /* Round ending address up; get number of longwords that makes. */ - register int count - = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) / sizeof (PTRACE_XFER_TYPE); - /* Allocate buffer of that many longwords. */ - register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE)); - extern int errno; - - if (debug_threads) - { - fprintf (stderr, "Writing %02x to %08lx\n", (unsigned)myaddr[0], (long)memaddr); - } - - /* Fill start and end extra bytes of buffer with existing memory data. */ - - buffer[0] = ptrace (PTRACE_PEEKTEXT, inferior_pid, - (PTRACE_ARG3_TYPE) addr, 0); - - if (count > 1) - { - buffer[count - 1] - = ptrace (PTRACE_PEEKTEXT, inferior_pid, - (PTRACE_ARG3_TYPE) (addr + (count - 1) - * sizeof (PTRACE_XFER_TYPE)), - 0); - } - - /* Copy data to be written over corresponding part of buffer */ - - memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), myaddr, len); - - /* Write the entire buffer. */ - - for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE)) - { - errno = 0; - ptrace (PTRACE_POKETEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, buffer[i]); - if (errno) - return errno; - } - - return 0; -} - -static void -linux_look_up_symbols (void) -{ -#ifdef USE_THREAD_DB - if (using_threads) - return; - - using_threads = thread_db_init (); -#endif -} - -static void -linux_send_signal (int signum) -{ - extern unsigned long signal_pid; - - if (cont_thread != 0 && cont_thread != -1) - { - struct process_info *process; - - process = get_thread_process (current_inferior); - kill_lwp (process->lwpid, signum); - } - else - kill_lwp (signal_pid, signum); -} - -/* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET - to debugger memory starting at MYADDR. */ - -static int -linux_read_auxv (CORE_ADDR offset, unsigned char *myaddr, unsigned int len) -{ - char filename[PATH_MAX]; - int fd, n; - - snprintf (filename, sizeof filename, "/proc/%ld/auxv", inferior_pid); - - fd = open (filename, O_RDONLY); - if (fd < 0) - return -1; - - if (offset != (CORE_ADDR) 0 - && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset) - n = -1; - else - n = read (fd, myaddr, len); - - close (fd); - - return n; -} - -/* These watchpoint related wrapper functions simply pass on the function call - if the target has registered a corresponding function. */ - -static int -linux_insert_watchpoint (char type, CORE_ADDR addr, int len) -{ - if (the_low_target.insert_watchpoint != NULL) - return the_low_target.insert_watchpoint (type, addr, len); - else - /* Unsupported (see target.h). */ - return 1; -} - -static int -linux_remove_watchpoint (char type, CORE_ADDR addr, int len) -{ - if (the_low_target.remove_watchpoint != NULL) - return the_low_target.remove_watchpoint (type, addr, len); - else - /* Unsupported (see target.h). */ - return 1; -} - -static int -linux_stopped_by_watchpoint (void) -{ - if (the_low_target.stopped_by_watchpoint != NULL) - return the_low_target.stopped_by_watchpoint (); - else - return 0; -} - -static CORE_ADDR -linux_stopped_data_address (void) -{ - if (the_low_target.stopped_data_address != NULL) - return the_low_target.stopped_data_address (); - else - return 0; -} - -#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_MMU__) -#if defined(__mcoldfire__) -/* These should really be defined in the kernel's ptrace.h header. */ -#define PT_TEXT_ADDR 49*4 -#define PT_DATA_ADDR 50*4 -#define PT_TEXT_END_ADDR 51*4 -#endif - -/* Under uClinux, programs are loaded at non-zero offsets, which we need - to tell gdb about. */ - -static int -linux_read_offsets (CORE_ADDR *text_p, CORE_ADDR *data_p) -{ -#if defined(PT_TEXT_ADDR) && defined(PT_DATA_ADDR) && defined(PT_TEXT_END_ADDR) - unsigned long text, text_end, data; - int pid = get_thread_process (current_inferior)->head.id; - - errno = 0; - - text = ptrace (PTRACE_PEEKUSER, pid, (long)PT_TEXT_ADDR, 0); - text_end = ptrace (PTRACE_PEEKUSER, pid, (long)PT_TEXT_END_ADDR, 0); - data = ptrace (PTRACE_PEEKUSER, pid, (long)PT_DATA_ADDR, 0); - - if (errno == 0) - { - /* Both text and data offsets produced at compile-time (and so - used by gdb) are relative to the beginning of the program, - with the data segment immediately following the text segment. - However, the actual runtime layout in memory may put the data - somewhere else, so when we send gdb a data base-address, we - use the real data base address and subtract the compile-time - data base-address from it (which is just the length of the - text segment). BSS immediately follows data in both - cases. */ - *text_p = text; - *data_p = data - (text_end - text); - - return 1; - } -#endif - return 0; -} -#endif - -static struct target_ops linux_target_ops = { - linux_create_inferior, - linux_attach, - linux_kill, - linux_detach, - linux_thread_alive, - linux_resume, - linux_wait, - linux_fetch_registers, - linux_store_registers, - linux_read_memory, - linux_write_memory, - linux_look_up_symbols, - linux_send_signal, - linux_read_auxv, - linux_insert_watchpoint, - linux_remove_watchpoint, - linux_stopped_by_watchpoint, - linux_stopped_data_address, -#if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_MMU__) - linux_read_offsets, -#endif -}; - -static void -linux_init_signals () -{ - /* FIXME drow/2002-06-09: As above, we should check with LinuxThreads - to find what the cancel signal actually is. */ - signal (__SIGRTMIN+1, SIG_IGN); -} - -void -initialize_low (void) -{ - using_threads = 0; - set_target_ops (&linux_target_ops); - set_breakpoint_data (the_low_target.breakpoint, - the_low_target.breakpoint_len); - init_registers (); - linux_init_signals (); -} diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h deleted file mode 100644 index 516b40d..0000000 --- a/gdb/gdbserver/linux-low.h +++ /dev/null @@ -1,130 +0,0 @@ -/* Internal interfaces for the GNU/Linux specific target code for gdbserver. - Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#ifdef HAVE_LINUX_REGSETS -typedef void (*regset_fill_func) (void *); -typedef void (*regset_store_func) (const void *); -enum regset_type { - GENERAL_REGS, - FP_REGS, - EXTENDED_REGS, -}; - -struct regset_info -{ - int get_request, set_request; - int size; - enum regset_type type; - regset_fill_func fill_function; - regset_store_func store_function; -}; -extern struct regset_info target_regsets[]; -#endif - -struct linux_target_ops -{ - int num_regs; - int *regmap; - int (*cannot_fetch_register) (int); - - /* Returns 0 if we can store the register, 1 if we can not - store the register, and 2 if failure to store the register - is acceptable. */ - int (*cannot_store_register) (int); - CORE_ADDR (*get_pc) (void); - void (*set_pc) (CORE_ADDR newpc); - const unsigned char *breakpoint; - int breakpoint_len; - CORE_ADDR (*breakpoint_reinsert_addr) (void); - - - int decr_pc_after_break; - int (*breakpoint_at) (CORE_ADDR pc); - - /* Watchpoint related functions. See target.h for comments. */ - int (*insert_watchpoint) (char type, CORE_ADDR addr, int len); - int (*remove_watchpoint) (char type, CORE_ADDR addr, int len); - int (*stopped_by_watchpoint) (void); - CORE_ADDR (*stopped_data_address) (void); - - /* Whether to left-pad registers for PEEKUSR/POKEUSR if they are smaller - than an xfer unit. */ - int left_pad_xfer; -}; - -extern struct linux_target_ops the_low_target; - -#define get_process(inf) ((struct process_info *)(inf)) -#define get_thread_process(thr) (get_process (inferior_target_data (thr))) -#define get_process_thread(proc) ((struct thread_info *) \ - find_inferior_id (&all_threads, \ - get_process (proc)->tid)) - -struct process_info -{ - struct inferior_list_entry head; - int thread_known; - unsigned long lwpid; - unsigned long tid; - - /* If this flag is set, the next SIGSTOP will be ignored (the process will - be immediately resumed). */ - int stop_expected; - - /* If this flag is set, the process is known to be stopped right now (stop - event already received in a wait()). */ - int stopped; - - /* If this flag is set, we have sent a SIGSTOP to this process and are - waiting for it to stop. */ - int sigstop_sent; - - /* If this flag is set, STATUS_PENDING is a waitstatus that has not yet - been reported. */ - int status_pending_p; - int status_pending; - - /* If this flag is set, the pending status is a (GDB-placed) breakpoint. */ - int pending_is_breakpoint; - CORE_ADDR pending_stop_pc; - - /* If this is non-zero, it is a breakpoint to be reinserted at our next - stop (SIGTRAP stops only). */ - CORE_ADDR bp_reinsert; - - /* If this flag is set, the last continue operation on this process - was a single-step. */ - int stepping; - - /* If this is non-zero, it points to a chain of signals which need to - be delivered to this process. */ - struct pending_signals *pending_signals; - - /* A link used when resuming. It is initialized from the resume request, - and then processed and cleared in linux_resume_one_process. */ - - struct thread_resume *resume; -}; - -extern struct inferior_list all_processes; - -void linux_attach_lwp (unsigned long pid, unsigned long tid); - -int thread_db_init (void); diff --git a/gdb/gdbserver/linux-m32r-low.c b/gdb/gdbserver/linux-m32r-low.c deleted file mode 100644 index dc48df9..0000000 --- a/gdb/gdbserver/linux-m32r-low.c +++ /dev/null @@ -1,99 +0,0 @@ -/* GNU/Linux/m32r specific low level interface, for the remote server for GDB. - Copyright (C) 2005 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -#define m32r_num_regs 25 - -static int m32r_regmap[] = { -#ifdef PT_R0 - PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5, PT_R6, PT_R7, - PT_R8, PT_R9, PT_R10, PT_R11, PT_R12, PT_FP, PT_LR, PT_SPU, - PT_PSW, PT_CBR, PT_SPI, PT_SPU, PT_BPC, PT_PC, PT_ACCL, PT_ACCH, PT_EVB -#else - 4 * 4, 4 * 5, 4 * 6, 4 * 7, 4 * 0, 4 * 1, 4 * 2, 4 * 8, - 4 * 9, 4 * 10, 4 * 11, 4 * 12, 4 * 13, 4 * 24, 4 * 25, 4 * 23, - 4 * 19, 4 * 31, 4 * 26, 4 * 23, 4 * 20, 4 * 30, 4 * 16, 4 * 15, 4 * 32 -#endif -}; - -static int -m32r_cannot_store_register (int regno) -{ - return (regno >= m32r_num_regs); -} - -static int -m32r_cannot_fetch_register (int regno) -{ - return (regno >= m32r_num_regs); -} - -static CORE_ADDR -m32r_get_pc () -{ - unsigned long pc; - collect_register_by_name ("pc", &pc); - return pc; -} - -static void -m32r_set_pc (CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name ("pc", &newpc); -} - -static const unsigned short m32r_breakpoint = 0x10f1; -#define m32r_breakpoint_len 2 - -static int -m32r_breakpoint_at (CORE_ADDR where) -{ - unsigned short insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, - m32r_breakpoint_len); - if (insn == m32r_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -struct linux_target_ops the_low_target = { - m32r_num_regs, - m32r_regmap, - m32r_cannot_fetch_register, - m32r_cannot_store_register, - m32r_get_pc, - m32r_set_pc, - (const unsigned char *) &m32r_breakpoint, - m32r_breakpoint_len, - NULL, - 0, - m32r_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c deleted file mode 100644 index aa5a5dd..0000000 --- a/gdb/gdbserver/linux-m68k-low.c +++ /dev/null @@ -1,168 +0,0 @@ -/* GNU/Linux/m68k specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -#define m68k_num_regs 29 -#define m68k_num_gregs 18 - -/* This table must line up with REGISTER_NAMES in tm-m68k.h */ -static int m68k_regmap[] = -{ -#ifdef PT_D0 - PT_D0 * 4, PT_D1 * 4, PT_D2 * 4, PT_D3 * 4, - PT_D4 * 4, PT_D5 * 4, PT_D6 * 4, PT_D7 * 4, - PT_A0 * 4, PT_A1 * 4, PT_A2 * 4, PT_A3 * 4, - PT_A4 * 4, PT_A5 * 4, PT_A6 * 4, PT_USP * 4, - PT_SR * 4, PT_PC * 4, -#else - 14 * 4, 0 * 4, 1 * 4, 2 * 4, 3 * 4, 4 * 4, 5 * 4, 6 * 4, - 7 * 4, 8 * 4, 9 * 4, 10 * 4, 11 * 4, 12 * 4, 13 * 4, 15 * 4, - 17 * 4, 18 * 4, -#endif -#ifdef PT_FP0 - PT_FP0 * 4, PT_FP1 * 4, PT_FP2 * 4, PT_FP3 * 4, - PT_FP4 * 4, PT_FP5 * 4, PT_FP6 * 4, PT_FP7 * 4, - PT_FPCR * 4, PT_FPSR * 4, PT_FPIAR * 4 -#else - 21 * 4, 24 * 4, 27 * 4, 30 * 4, 33 * 4, 36 * 4, - 39 * 4, 42 * 4, 45 * 4, 46 * 4, 47 * 4 -#endif -}; - -static int -m68k_cannot_store_register (int regno) -{ - return (regno >= m68k_num_regs); -} - -static int -m68k_cannot_fetch_register (int regno) -{ - return (regno >= m68k_num_regs); -} - -#ifdef HAVE_PTRACE_GETREGS -#include <sys/procfs.h> -#include <sys/ptrace.h> - -static void -m68k_fill_gregset (void *buf) -{ - int i; - - for (i = 0; i < m68k_num_gregs; i++) - collect_register (i, (char *) buf + m68k_regmap[i]); -} - -static void -m68k_store_gregset (const void *buf) -{ - int i; - - for (i = 0; i < m68k_num_gregs; i++) - supply_register (i, (const char *) buf + m68k_regmap[i]); -} - -static void -m68k_fill_fpregset (void *buf) -{ - int i; - - for (i = m68k_num_gregs; i < m68k_num_regs; i++) - collect_register (i, ((char *) buf - + (m68k_regmap[i] - m68k_regmap[m68k_num_gregs]))); -} - -static void -m68k_store_fpregset (const void *buf) -{ - int i; - - for (i = m68k_num_gregs; i < m68k_num_regs; i++) - supply_register (i, ((const char *) buf - + (m68k_regmap[i] - m68k_regmap[m68k_num_gregs]))); -} - -#endif /* HAVE_PTRACE_GETREGS */ - -struct regset_info target_regsets[] = { -#ifdef HAVE_PTRACE_GETREGS - { PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t), - GENERAL_REGS, - m68k_fill_gregset, m68k_store_gregset }, - { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof (elf_fpregset_t), - FP_REGS, - m68k_fill_fpregset, m68k_store_fpregset }, -#endif /* HAVE_PTRACE_GETREGS */ - { 0, 0, -1, -1, NULL, NULL } -}; - -static const unsigned char m68k_breakpoint[] = { 0x4E, 0x4F }; -#define m68k_breakpoint_len 2 - -static CORE_ADDR -m68k_get_pc () -{ - unsigned long pc; - - collect_register_by_name ("pc", &pc); - return pc; -} - -static void -m68k_set_pc (CORE_ADDR value) -{ - unsigned long newpc = value; - - supply_register_by_name ("pc", &newpc); -} - -static int -m68k_breakpoint_at (CORE_ADDR pc) -{ - unsigned char c[2]; - - read_inferior_memory (pc, c, 2); - if (c[0] == 0x4E && c[1] == 0x4F) - return 1; - - return 0; -} - -struct linux_target_ops the_low_target = { - m68k_num_regs, - m68k_regmap, - m68k_cannot_fetch_register, - m68k_cannot_store_register, - m68k_get_pc, - m68k_set_pc, - m68k_breakpoint, - m68k_breakpoint_len, - NULL, - 2, - m68k_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c deleted file mode 100644 index 7829550..0000000 --- a/gdb/gdbserver/linux-mips-low.c +++ /dev/null @@ -1,180 +0,0 @@ -/* GNU/Linux/MIPS specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2005, 2006 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" - -#include <sys/ptrace.h> - -#include "gdb_proc_service.h" - -#ifndef PTRACE_GET_THREAD_AREA -#define PTRACE_GET_THREAD_AREA 25 -#endif - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -#define mips_num_regs 90 - -#include <asm/ptrace.h> - -/* Return the ptrace ``address'' of register REGNO. */ - -/* Matches mips_generic32_regs */ -static int mips_regmap[] = { - 0, 1, 2, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, - - -1, MMLO, MMHI, BADVADDR, CAUSE, PC, - - FPR_BASE, FPR_BASE + 1, FPR_BASE + 2, FPR_BASE + 3, - FPR_BASE + 4, FPR_BASE + 5, FPR_BASE + 6, FPR_BASE + 7, - FPR_BASE + 8, FPR_BASE + 8, FPR_BASE + 10, FPR_BASE + 11, - FPR_BASE + 12, FPR_BASE + 13, FPR_BASE + 14, FPR_BASE + 15, - FPR_BASE + 16, FPR_BASE + 17, FPR_BASE + 18, FPR_BASE + 19, - FPR_BASE + 20, FPR_BASE + 21, FPR_BASE + 22, FPR_BASE + 23, - FPR_BASE + 24, FPR_BASE + 25, FPR_BASE + 26, FPR_BASE + 27, - FPR_BASE + 28, FPR_BASE + 29, FPR_BASE + 30, FPR_BASE + 31, - FPC_CSR, FPC_EIR, - - -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -}; - -/* From mips-linux-nat.c. */ - -/* Pseudo registers can not be read. ptrace does not provide a way to - read (or set) PS_REGNUM, and there's no point in reading or setting - ZERO_REGNUM. We also can not set BADVADDR, CAUSE, or FCRIR via - ptrace(). */ - -static int -mips_cannot_fetch_register (int regno) -{ - if (mips_regmap[regno] == -1) - return 1; - - if (find_regno ("zero") == regno) - return 1; - - return 0; -} - -static int -mips_cannot_store_register (int regno) -{ - if (mips_regmap[regno] == -1) - return 1; - - if (find_regno ("zero") == regno) - return 1; - - if (find_regno ("cause") == regno) - return 1; - - if (find_regno ("bad") == regno) - return 1; - - if (find_regno ("fir") == regno) - return 1; - - return 0; -} - -static CORE_ADDR -mips_get_pc () -{ - unsigned long pc; - collect_register_by_name ("pc", &pc); - return pc; -} - -static void -mips_set_pc (CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name ("pc", &newpc); -} - -/* Correct in either endianness. */ -static const unsigned long mips_breakpoint = 0x0005000d; -#define mips_breakpoint_len 4 - -/* We only place breakpoints in empty marker functions, and thread locking - is outside of the function. So rather than importing software single-step, - we can just run until exit. */ -static CORE_ADDR -mips_reinsert_addr () -{ - unsigned long pc; - collect_register_by_name ("ra", &pc); - return pc; -} - -static int -mips_breakpoint_at (CORE_ADDR where) -{ - unsigned long insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, 4); - if (insn == mips_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -/* Fetch the thread-local storage pointer for libthread_db. */ - -ps_err_e -ps_get_thread_area (const struct ps_prochandle *ph, - lwpid_t lwpid, int idx, void **base) -{ - if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) - return PS_ERR; - - /* IDX is the bias from the thread pointer to the beginning of the - thread descriptor. It has to be subtracted due to implementation - quirks in libthread_db. */ - *base = (void *) ((char *)*base - idx); - - return PS_OK; -} - -struct linux_target_ops the_low_target = { - mips_num_regs, - mips_regmap, - mips_cannot_fetch_register, - mips_cannot_store_register, - mips_get_pc, - mips_set_pc, - (const unsigned char *) &mips_breakpoint, - mips_breakpoint_len, - mips_reinsert_addr, - 0, - mips_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c deleted file mode 100644 index b66dd1d..0000000 --- a/gdb/gdbserver/linux-ppc-low.c +++ /dev/null @@ -1,135 +0,0 @@ -/* GNU/Linux/PowerPC specific low level interface, for the remote server for - GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2005 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" - -#include <asm/ptrace.h> - -#define ppc_num_regs 71 - -/* Currently, don't check/send MQ. */ -static int ppc_regmap[] = - {PT_R0 * 4, PT_R1 * 4, PT_R2 * 4, PT_R3 * 4, - PT_R4 * 4, PT_R5 * 4, PT_R6 * 4, PT_R7 * 4, - PT_R8 * 4, PT_R9 * 4, PT_R10 * 4, PT_R11 * 4, - PT_R12 * 4, PT_R13 * 4, PT_R14 * 4, PT_R15 * 4, - PT_R16 * 4, PT_R17 * 4, PT_R18 * 4, PT_R19 * 4, - PT_R20 * 4, PT_R21 * 4, PT_R22 * 4, PT_R23 * 4, - PT_R24 * 4, PT_R25 * 4, PT_R26 * 4, PT_R27 * 4, - PT_R28 * 4, PT_R29 * 4, PT_R30 * 4, PT_R31 * 4, - PT_FPR0*4, PT_FPR0*4 + 8, PT_FPR0*4+16, PT_FPR0*4+24, - PT_FPR0*4+32, PT_FPR0*4+40, PT_FPR0*4+48, PT_FPR0*4+56, - PT_FPR0*4+64, PT_FPR0*4+72, PT_FPR0*4+80, PT_FPR0*4+88, - PT_FPR0*4+96, PT_FPR0*4+104, PT_FPR0*4+112, PT_FPR0*4+120, - PT_FPR0*4+128, PT_FPR0*4+136, PT_FPR0*4+144, PT_FPR0*4+152, - PT_FPR0*4+160, PT_FPR0*4+168, PT_FPR0*4+176, PT_FPR0*4+184, - PT_FPR0*4+192, PT_FPR0*4+200, PT_FPR0*4+208, PT_FPR0*4+216, - PT_FPR0*4+224, PT_FPR0*4+232, PT_FPR0*4+240, PT_FPR0*4+248, - PT_NIP * 4, PT_MSR * 4, PT_CCR * 4, PT_LNK * 4, - PT_CTR * 4, PT_XER * 4, PT_FPSCR * 4, }; - -static int -ppc_cannot_store_register (int regno) -{ - /* Some kernels do not allow us to store fpscr. */ - if (regno == find_regno ("fpscr")) - return 2; - - return 0; -} - -static int -ppc_cannot_fetch_register (int regno) -{ - return 0; -} - -static CORE_ADDR -ppc_get_pc (void) -{ - unsigned long pc; - - collect_register_by_name ("pc", &pc); - return (CORE_ADDR) pc; -} - -static void -ppc_set_pc (CORE_ADDR pc) -{ - unsigned long newpc = pc; - - supply_register_by_name ("pc", &newpc); -} - -/* Correct in either endianness. Note that this file is - for PowerPC only, not PowerPC64. - This instruction is "twge r2, r2", which GDB uses as a software - breakpoint. */ -static const unsigned long ppc_breakpoint = 0x7d821008; -#define ppc_breakpoint_len 4 - -static int -ppc_breakpoint_at (CORE_ADDR where) -{ - unsigned long insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, 4); - if (insn == ppc_breakpoint) - return 1; - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -/* Provide only a fill function for the general register set. ps_lgetregs - will use this for NPTL support. */ - -static void ppc_fill_gregset (void *buf) -{ - int i; - - for (i = 0; i < 32; i++) - collect_register (i, (char *) buf + ppc_regmap[i]); - - for (i = 64; i < 70; i++) - collect_register (i, (char *) buf + ppc_regmap[i]); -} - -struct regset_info target_regsets[] = { - { 0, 0, 0, GENERAL_REGS, ppc_fill_gregset, NULL }, - { 0, 0, -1, -1, NULL, NULL } -}; - -struct linux_target_ops the_low_target = { - ppc_num_regs, - ppc_regmap, - ppc_cannot_fetch_register, - ppc_cannot_store_register, - ppc_get_pc, - ppc_set_pc, - (const unsigned char *) &ppc_breakpoint, - ppc_breakpoint_len, - NULL, - 0, - ppc_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-ppc64-low.c b/gdb/gdbserver/linux-ppc64-low.c deleted file mode 100644 index 04022cc..0000000 --- a/gdb/gdbserver/linux-ppc64-low.c +++ /dev/null @@ -1,136 +0,0 @@ -/* GNU/Linux/PowerPC64 specific low level interface, for the remote server for - GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2005 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" - -#include <asm/ptrace.h> - -#define ppc_num_regs 71 - -/* We use a constant for FPSCR instead of PT_FPSCR, because - many shipped PPC64 kernels had the wrong value in ptrace.h. */ -static int ppc_regmap[] = - {PT_R0 * 8, PT_R1 * 8, PT_R2 * 8, PT_R3 * 8, - PT_R4 * 8, PT_R5 * 8, PT_R6 * 8, PT_R7 * 8, - PT_R8 * 8, PT_R9 * 8, PT_R10 * 8, PT_R11 * 8, - PT_R12 * 8, PT_R13 * 8, PT_R14 * 8, PT_R15 * 8, - PT_R16 * 8, PT_R17 * 8, PT_R18 * 8, PT_R19 * 8, - PT_R20 * 8, PT_R21 * 8, PT_R22 * 8, PT_R23 * 8, - PT_R24 * 8, PT_R25 * 8, PT_R26 * 8, PT_R27 * 8, - PT_R28 * 8, PT_R29 * 8, PT_R30 * 8, PT_R31 * 8, - PT_FPR0*8, PT_FPR0*8 + 8, PT_FPR0*8+16, PT_FPR0*8+24, - PT_FPR0*8+32, PT_FPR0*8+40, PT_FPR0*8+48, PT_FPR0*8+56, - PT_FPR0*8+64, PT_FPR0*8+72, PT_FPR0*8+80, PT_FPR0*8+88, - PT_FPR0*8+96, PT_FPR0*8+104, PT_FPR0*8+112, PT_FPR0*8+120, - PT_FPR0*8+128, PT_FPR0*8+136, PT_FPR0*8+144, PT_FPR0*8+152, - PT_FPR0*8+160, PT_FPR0*8+168, PT_FPR0*8+176, PT_FPR0*8+184, - PT_FPR0*8+192, PT_FPR0*8+200, PT_FPR0*8+208, PT_FPR0*8+216, - PT_FPR0*8+224, PT_FPR0*8+232, PT_FPR0*8+240, PT_FPR0*8+248, - PT_NIP * 8, PT_MSR * 8, PT_CCR * 8, PT_LNK * 8, - PT_CTR * 8, PT_XER * 8, PT_FPR0*8 + 256 }; - -static int -ppc_cannot_store_register (int regno) -{ - return 0; -} - -static int -ppc_cannot_fetch_register (int regno) -{ - return 0; -} - -static CORE_ADDR -ppc_get_pc (void) -{ - unsigned long pc; - - collect_register_by_name ("pc", &pc); - return (CORE_ADDR) pc; -} - -static void -ppc_set_pc (CORE_ADDR pc) -{ - unsigned long newpc = pc; - - supply_register_by_name ("pc", &newpc); -} - -/* Correct in either endianness. - This instruction is "twge r2, r2", which GDB uses as a software - breakpoint. */ -static const unsigned int ppc_breakpoint = 0x7d821008; -#define ppc_breakpoint_len 4 - -static int -ppc_breakpoint_at (CORE_ADDR where) -{ - unsigned int insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, 4); - if (insn == ppc_breakpoint) - return 1; - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -/* Provide only a fill function for the general register set. ps_lgetregs - will use this for NPTL support. */ - -static void ppc_fill_gregset (void *buf) -{ - int i; - - for (i = 0; i < 32; i++) - collect_register (i, (char *) buf + ppc_regmap[i]); - - for (i = 64; i < 70; i++) - collect_register (i, (char *) buf + ppc_regmap[i]); -} - -struct regset_info target_regsets[] = { - { 0, 0, 0, GENERAL_REGS, ppc_fill_gregset, NULL }, - { 0, 0, -1, -1, NULL, NULL } -}; - -struct linux_target_ops the_low_target = { - ppc_num_regs, - ppc_regmap, - ppc_cannot_fetch_register, - ppc_cannot_store_register, - ppc_get_pc, - ppc_set_pc, - (const unsigned char *) &ppc_breakpoint, - ppc_breakpoint_len, - NULL, - 0, - ppc_breakpoint_at, - NULL, - NULL, - NULL, - NULL, - 1 -}; diff --git a/gdb/gdbserver/linux-s390-low.c b/gdb/gdbserver/linux-s390-low.c deleted file mode 100644 index 7ebb8e9..0000000 --- a/gdb/gdbserver/linux-s390-low.c +++ /dev/null @@ -1,125 +0,0 @@ -/* GNU/Linux S/390 specific low level interface, for the remote server - for GDB. - Copyright (C) 2001, 2002, 2005 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* This file is used for both 31-bit and 64-bit S/390 systems. */ - -#include "server.h" -#include "linux-low.h" - -#include <asm/ptrace.h> - -#define s390_num_regs 51 - -static int s390_regmap[] = { - PT_PSWMASK, PT_PSWADDR, - - PT_GPR0, PT_GPR1, PT_GPR2, PT_GPR3, - PT_GPR4, PT_GPR5, PT_GPR6, PT_GPR7, - PT_GPR8, PT_GPR9, PT_GPR10, PT_GPR11, - PT_GPR12, PT_GPR13, PT_GPR14, PT_GPR15, - - PT_ACR0, PT_ACR1, PT_ACR2, PT_ACR3, - PT_ACR4, PT_ACR5, PT_ACR6, PT_ACR7, - PT_ACR8, PT_ACR9, PT_ACR10, PT_ACR11, - PT_ACR12, PT_ACR13, PT_ACR14, PT_ACR15, - - PT_FPC, - -#ifndef __s390x__ - PT_FPR0_HI, PT_FPR1_HI, PT_FPR2_HI, PT_FPR3_HI, - PT_FPR4_HI, PT_FPR5_HI, PT_FPR6_HI, PT_FPR7_HI, - PT_FPR8_HI, PT_FPR9_HI, PT_FPR10_HI, PT_FPR11_HI, - PT_FPR12_HI, PT_FPR13_HI, PT_FPR14_HI, PT_FPR15_HI, -#else - PT_FPR0, PT_FPR1, PT_FPR2, PT_FPR3, - PT_FPR4, PT_FPR5, PT_FPR6, PT_FPR7, - PT_FPR8, PT_FPR9, PT_FPR10, PT_FPR11, - PT_FPR12, PT_FPR13, PT_FPR14, PT_FPR15, -#endif -}; - -static int -s390_cannot_fetch_register (int regno) -{ - if (s390_regmap[regno] == -1) - return 1; - - return 0; -} - -static int -s390_cannot_store_register (int regno) -{ - if (s390_regmap[regno] == -1) - return 1; - - return 0; -} - - -static const unsigned char s390_breakpoint[] = { 0, 1 }; -#define s390_breakpoint_len 2 - -static CORE_ADDR -s390_get_pc () -{ - unsigned long pc; - collect_register_by_name ("pswa", &pc); -#ifndef __s390x__ - pc &= 0x7fffffff; -#endif - return pc; -} - -static void -s390_set_pc (CORE_ADDR newpc) -{ - unsigned long pc = newpc; -#ifndef __s390x__ - pc |= 0x80000000; -#endif - supply_register_by_name ("pswa", &pc); -} - -static int -s390_breakpoint_at (CORE_ADDR pc) -{ - unsigned char c[s390_breakpoint_len]; - read_inferior_memory (pc, c, s390_breakpoint_len); - return memcmp (c, s390_breakpoint, s390_breakpoint_len) == 0; -} - - -struct linux_target_ops the_low_target = { - s390_num_regs, - s390_regmap, - s390_cannot_fetch_register, - s390_cannot_store_register, - s390_get_pc, - s390_set_pc, - s390_breakpoint, - s390_breakpoint_len, - NULL, - s390_breakpoint_len, - s390_breakpoint_at, -}; - diff --git a/gdb/gdbserver/linux-sh-low.c b/gdb/gdbserver/linux-sh-low.c deleted file mode 100644 index e3b5a33..0000000 --- a/gdb/gdbserver/linux-sh-low.c +++ /dev/null @@ -1,105 +0,0 @@ -/* GNU/Linux/SH specific low level interface, for the remote server for GDB. - Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2005 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" - -#ifdef HAVE_SYS_REG_H -#include <sys/reg.h> -#endif - -#include <asm/ptrace.h> - -#define sh_num_regs 41 - -/* Currently, don't check/send MQ. */ -static int sh_regmap[] = { - 0, 4, 8, 12, 16, 20, 24, 28, - 32, 36, 40, 44, 48, 52, 56, 60, - - REG_PC*4, REG_PR*4, REG_GBR*4, -1, - REG_MACH*4, REG_MACL*4, REG_SR*4, - REG_FPUL*4, REG_FPSCR*4, - - REG_FPREG0*4+0, REG_FPREG0*4+4, REG_FPREG0*4+8, REG_FPREG0*4+12, - REG_FPREG0*4+16, REG_FPREG0*4+20, REG_FPREG0*4+24, REG_FPREG0*4+28, - REG_FPREG0*4+32, REG_FPREG0*4+36, REG_FPREG0*4+40, REG_FPREG0*4+44, - REG_FPREG0*4+48, REG_FPREG0*4+52, REG_FPREG0*4+56, REG_FPREG0*4+60, -}; - -static int -sh_cannot_store_register (int regno) -{ - return 0; -} - -static int -sh_cannot_fetch_register (int regno) -{ - return 0; -} - -static CORE_ADDR -sh_get_pc () -{ - unsigned long pc; - collect_register_by_name ("pc", &pc); - return pc; -} - -static void -sh_set_pc (CORE_ADDR pc) -{ - unsigned long newpc = pc; - supply_register_by_name ("pc", &newpc); -} - -/* Correct in either endianness, obviously. */ -static const unsigned short sh_breakpoint = 0xc3c3; -#define sh_breakpoint_len 2 - -static int -sh_breakpoint_at (CORE_ADDR where) -{ - unsigned short insn; - - (*the_target->read_memory) (where, (unsigned char *) &insn, 2); - if (insn == sh_breakpoint) - return 1; - - /* If necessary, recognize more trap instructions here. GDB only uses the - one. */ - return 0; -} - -struct linux_target_ops the_low_target = { - sh_num_regs, - sh_regmap, - sh_cannot_fetch_register, - sh_cannot_store_register, - sh_get_pc, - sh_set_pc, - (const unsigned char *) &sh_breakpoint, - sh_breakpoint_len, - NULL, - 0, - sh_breakpoint_at, -}; diff --git a/gdb/gdbserver/linux-x86-64-low.c b/gdb/gdbserver/linux-x86-64-low.c deleted file mode 100644 index 43cd10b..0000000 --- a/gdb/gdbserver/linux-x86-64-low.c +++ /dev/null @@ -1,169 +0,0 @@ -/* GNU/Linux/x86-64 specific low level interface, for the remote server - for GDB. - Copyright (C) 2002, 2004, 2005, 2006 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "linux-low.h" -#include "i387-fp.h" - -#include "gdb_proc_service.h" - -#include <sys/reg.h> -#include <sys/procfs.h> -#include <sys/ptrace.h> - -/* This definition comes from prctl.h, but some kernels may not have it. */ -#ifndef PTRACE_ARCH_PRCTL -#define PTRACE_ARCH_PRCTL 30 -#endif - -/* The following definitions come from prctl.h, but may be absent - for certain configurations. */ -#ifndef ARCH_GET_FS -#define ARCH_SET_GS 0x1001 -#define ARCH_SET_FS 0x1002 -#define ARCH_GET_FS 0x1003 -#define ARCH_GET_GS 0x1004 -#endif - -static int x86_64_regmap[] = { - RAX * 8, RBX * 8, RCX * 8, RDX * 8, - RSI * 8, RDI * 8, RBP * 8, RSP * 8, - R8 * 8, R9 * 8, R10 * 8, R11 * 8, - R12 * 8, R13 * 8, R14 * 8, R15 * 8, - RIP * 8, EFLAGS * 8, CS * 8, SS * 8, - DS * 8, ES * 8, FS * 8, GS * 8 -}; - -#define X86_64_NUM_GREGS (sizeof(x86_64_regmap)/sizeof(int)) - -/* Called by libthread_db. */ - -ps_err_e -ps_get_thread_area (const struct ps_prochandle *ph, - lwpid_t lwpid, int idx, void **base) -{ - switch (idx) - { - case FS: - if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_FS) == 0) - return PS_OK; - break; - case GS: - if (ptrace (PTRACE_ARCH_PRCTL, lwpid, base, ARCH_GET_GS) == 0) - return PS_OK; - break; - default: - return PS_BADADDR; - } - return PS_ERR; -} - -static void -x86_64_fill_gregset (void *buf) -{ - int i; - - for (i = 0; i < X86_64_NUM_GREGS; i++) - collect_register (i, ((char *) buf) + x86_64_regmap[i]); -} - -static void -x86_64_store_gregset (const void *buf) -{ - int i; - - for (i = 0; i < X86_64_NUM_GREGS; i++) - supply_register (i, ((char *) buf) + x86_64_regmap[i]); -} - -static void -x86_64_fill_fpregset (void *buf) -{ - i387_cache_to_fxsave (buf); -} - -static void -x86_64_store_fpregset (const void *buf) -{ - i387_fxsave_to_cache (buf); -} - -struct regset_info target_regsets[] = { - { PTRACE_GETREGS, PTRACE_SETREGS, sizeof (elf_gregset_t), - GENERAL_REGS, - x86_64_fill_gregset, x86_64_store_gregset }, - { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof (elf_fpregset_t), - FP_REGS, - x86_64_fill_fpregset, x86_64_store_fpregset }, - { 0, 0, -1, -1, NULL, NULL } -}; - -static const unsigned char x86_64_breakpoint[] = { 0xCC }; -#define x86_64_breakpoint_len 1 - -extern int debug_threads; - -static CORE_ADDR -x86_64_get_pc () -{ - unsigned long pc; - - collect_register_by_name ("rip", &pc); - - if (debug_threads) - fprintf (stderr, "stop pc (before any decrement) is %08lx\n", pc); - return pc; -} - -static void -x86_64_set_pc (CORE_ADDR newpc) -{ - if (debug_threads) - fprintf (stderr, "set pc to %08lx\n", (long) newpc); - supply_register_by_name ("rip", &newpc); -} - -static int -x86_64_breakpoint_at (CORE_ADDR pc) -{ - unsigned char c; - - read_inferior_memory (pc, &c, 1); - if (c == 0xCC) - return 1; - - return 0; -} - -struct linux_target_ops the_low_target = { - -1, - NULL, - NULL, - NULL, - x86_64_get_pc, - x86_64_set_pc, - x86_64_breakpoint, - x86_64_breakpoint_len, - NULL, - 1, - x86_64_breakpoint_at, -}; diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c deleted file mode 100644 index 37fd455..0000000 --- a/gdb/gdbserver/mem-break.c +++ /dev/null @@ -1,278 +0,0 @@ -/* Memory breakpoint operations for the remote server for GDB. - Copyright (C) 2002, 2003, 2005 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" - -const unsigned char *breakpoint_data; -int breakpoint_len; - -#define MAX_BREAKPOINT_LEN 8 - -struct breakpoint -{ - struct breakpoint *next; - CORE_ADDR pc; - unsigned char old_data[MAX_BREAKPOINT_LEN]; - - /* Non-zero iff we are stepping over this breakpoint. */ - int reinserting; - - /* Non-NULL iff this breakpoint was inserted to step over - another one. Points to the other breakpoint (which is also - in the *next chain somewhere). */ - struct breakpoint *breakpoint_to_reinsert; - - /* Function to call when we hit this breakpoint. */ - void (*handler) (CORE_ADDR); -}; - -struct breakpoint *breakpoints; - -void -set_breakpoint_at (CORE_ADDR where, void (*handler) (CORE_ADDR)) -{ - struct breakpoint *bp; - - if (breakpoint_data == NULL) - error ("Target does not support breakpoints."); - - bp = malloc (sizeof (struct breakpoint)); - memset (bp, 0, sizeof (struct breakpoint)); - - (*the_target->read_memory) (where, bp->old_data, - breakpoint_len); - (*the_target->write_memory) (where, breakpoint_data, - breakpoint_len); - - bp->pc = where; - bp->handler = handler; - - bp->next = breakpoints; - breakpoints = bp; -} - -static void -delete_breakpoint (struct breakpoint *bp) -{ - struct breakpoint *cur; - - if (breakpoints == bp) - { - breakpoints = bp->next; - (*the_target->write_memory) (bp->pc, bp->old_data, - breakpoint_len); - free (bp); - return; - } - cur = breakpoints; - while (cur->next) - { - if (cur->next == bp) - { - cur->next = bp->next; - (*the_target->write_memory) (bp->pc, bp->old_data, - breakpoint_len); - free (bp); - return; - } - } - warning ("Could not find breakpoint in list."); -} - -static struct breakpoint * -find_breakpoint_at (CORE_ADDR where) -{ - struct breakpoint *bp = breakpoints; - - while (bp != NULL) - { - if (bp->pc == where) - return bp; - bp = bp->next; - } - - return NULL; -} - -static void -reinsert_breakpoint_handler (CORE_ADDR stop_pc) -{ - struct breakpoint *stop_bp, *orig_bp; - - stop_bp = find_breakpoint_at (stop_pc); - if (stop_bp == NULL) - error ("lost the stopping breakpoint."); - - orig_bp = stop_bp->breakpoint_to_reinsert; - if (orig_bp == NULL) - error ("no breakpoint to reinsert"); - - (*the_target->write_memory) (orig_bp->pc, breakpoint_data, - breakpoint_len); - orig_bp->reinserting = 0; - delete_breakpoint (stop_bp); -} - -void -reinsert_breakpoint_by_bp (CORE_ADDR stop_pc, CORE_ADDR stop_at) -{ - struct breakpoint *bp, *orig_bp; - - set_breakpoint_at (stop_at, reinsert_breakpoint_handler); - - orig_bp = find_breakpoint_at (stop_pc); - if (orig_bp == NULL) - error ("Could not find original breakpoint in list."); - - bp = find_breakpoint_at (stop_at); - if (bp == NULL) - error ("Could not find breakpoint in list (reinserting by breakpoint)."); - bp->breakpoint_to_reinsert = orig_bp; - - (*the_target->write_memory) (orig_bp->pc, orig_bp->old_data, - breakpoint_len); - orig_bp->reinserting = 1; -} - -void -uninsert_breakpoint (CORE_ADDR stopped_at) -{ - struct breakpoint *bp; - - bp = find_breakpoint_at (stopped_at); - if (bp == NULL) - error ("Could not find breakpoint in list (uninserting)."); - - (*the_target->write_memory) (bp->pc, bp->old_data, - breakpoint_len); - bp->reinserting = 1; -} - -void -reinsert_breakpoint (CORE_ADDR stopped_at) -{ - struct breakpoint *bp; - - bp = find_breakpoint_at (stopped_at); - if (bp == NULL) - error ("Could not find breakpoint in list (uninserting)."); - if (! bp->reinserting) - error ("Breakpoint already inserted at reinsert time."); - - (*the_target->write_memory) (bp->pc, breakpoint_data, - breakpoint_len); - bp->reinserting = 0; -} - -int -check_breakpoints (CORE_ADDR stop_pc) -{ - struct breakpoint *bp; - - bp = find_breakpoint_at (stop_pc); - if (bp == NULL) - return 0; - if (bp->reinserting) - { - warning ("Hit a removed breakpoint?"); - return 0; - } - - (*bp->handler) (bp->pc); - return 1; -} - -void -set_breakpoint_data (const unsigned char *bp_data, int bp_len) -{ - breakpoint_data = bp_data; - breakpoint_len = bp_len; -} - -void -check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len) -{ - struct breakpoint *bp = breakpoints; - CORE_ADDR mem_end = mem_addr + mem_len; - - for (; bp != NULL; bp = bp->next) - { - CORE_ADDR bp_end = bp->pc + breakpoint_len; - CORE_ADDR start, end; - int copy_offset, copy_len, buf_offset; - - if (mem_addr >= bp_end) - continue; - if (bp->pc >= mem_end) - continue; - - start = bp->pc; - if (mem_addr > start) - start = mem_addr; - - end = bp_end; - if (end > mem_end) - end = mem_end; - - copy_len = end - start; - copy_offset = start - bp->pc; - buf_offset = start - mem_addr; - - memcpy (buf + buf_offset, bp->old_data + copy_offset, copy_len); - } -} - -void -check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len) -{ - struct breakpoint *bp = breakpoints; - CORE_ADDR mem_end = mem_addr + mem_len; - - for (; bp != NULL; bp = bp->next) - { - CORE_ADDR bp_end = bp->pc + breakpoint_len; - CORE_ADDR start, end; - int copy_offset, copy_len, buf_offset; - - if (mem_addr >= bp_end) - continue; - if (bp->pc >= mem_end) - continue; - - start = bp->pc; - if (mem_addr > start) - start = mem_addr; - - end = bp_end; - if (end > mem_end) - end = mem_end; - - copy_len = end - start; - copy_offset = start - bp->pc; - buf_offset = start - mem_addr; - - memcpy (bp->old_data + copy_offset, buf + buf_offset, copy_len); - if (bp->reinserting == 0) - memcpy (buf + buf_offset, breakpoint_data + copy_offset, copy_len); - } -} diff --git a/gdb/gdbserver/mem-break.h b/gdb/gdbserver/mem-break.h deleted file mode 100644 index 332d0e7..0000000 --- a/gdb/gdbserver/mem-break.h +++ /dev/null @@ -1,71 +0,0 @@ -/* Memory breakpoint interfaces for the remote server for GDB. - Copyright (C) 2002, 2005 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#ifndef MEM_BREAK_H -#define MEM_BREAK_H - -/* Breakpoints are opaque. */ - -/* Create a new breakpoint at WHERE, and call HANDLER when - it is hit. */ - -void set_breakpoint_at (CORE_ADDR where, - void (*handler) (CORE_ADDR)); - -/* Create a reinsertion breakpoint at STOP_AT for the breakpoint - currently at STOP_PC (and temporarily remove the breakpoint at - STOP_PC). */ - -void reinsert_breakpoint_by_bp (CORE_ADDR stop_pc, CORE_ADDR stop_at); - -/* Change the status of the breakpoint at WHERE to inserted. */ - -void reinsert_breakpoint (CORE_ADDR where); - -/* Change the status of the breakpoint at WHERE to uninserted. */ - -void uninsert_breakpoint (CORE_ADDR where); - -/* See if any breakpoint claims ownership of STOP_PC. Call the handler for - the breakpoint, if found. */ - -int check_breakpoints (CORE_ADDR stop_pc); - -/* See if any breakpoints shadow the target memory area from MEM_ADDR - to MEM_ADDR + MEM_LEN. Update the data already read from the target - (in BUF) if necessary. */ - -void check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len); - -/* See if any breakpoints shadow the target memory area from MEM_ADDR - to MEM_ADDR + MEM_LEN. Update the data to be written to the target - (in BUF) if necessary, as well as the original data for any breakpoints. */ - -void check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len); - -/* Set the byte pattern to insert for memory breakpoints. This function - must be called before any breakpoints are set. */ - -void set_breakpoint_data (const unsigned char *bp_data, int bp_len); - -#endif /* MEM_BREAK_H */ diff --git a/gdb/gdbserver/proc-service.c b/gdb/gdbserver/proc-service.c deleted file mode 100644 index 99083f1..0000000 --- a/gdb/gdbserver/proc-service.c +++ /dev/null @@ -1,165 +0,0 @@ -/* libthread_db helper functions for the remote server for GDB. - Copyright (C) 2002, 2004, 2005, 2006 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" - -/* This file is currently tied to GNU/Linux. It should scale well to - another libthread_db implementation, with the approriate gdbserver - hooks, but for now this means we can use GNU/Linux's target data. */ - -#include "linux-low.h" - -#include "gdb_proc_service.h" - -typedef struct ps_prochandle *gdb_ps_prochandle_t; -typedef void *gdb_ps_read_buf_t; -typedef const void *gdb_ps_write_buf_t; -typedef size_t gdb_ps_size_t; - -#ifdef HAVE_LINUX_REGSETS -#define HAVE_REGSETS -#endif - -#ifdef HAVE_REGSETS -static struct regset_info * -gregset_info(void) -{ - int i = 0; - - while (target_regsets[i].size != -1) - { - if (target_regsets[i].type == GENERAL_REGS) - break; - i++; - } - - return &target_regsets[i]; -} -#endif - -/* Search for the symbol named NAME within the object named OBJ within - the target process PH. If the symbol is found the address of the - symbol is stored in SYM_ADDR. */ - -ps_err_e -ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *obj, - const char *name, psaddr_t *sym_addr) -{ - CORE_ADDR addr; - - if (look_up_one_symbol (name, &addr) == 0) - return PS_NOSYM; - - *sym_addr = (psaddr_t) (unsigned long) addr; - return PS_OK; -} - -/* Read SIZE bytes from the target process PH at address ADDR and copy - them into BUF. */ - -ps_err_e -ps_pdread (gdb_ps_prochandle_t ph, psaddr_t addr, - gdb_ps_read_buf_t buf, gdb_ps_size_t size) -{ - read_inferior_memory ((unsigned long) addr, buf, size); - return PS_OK; -} - -/* Write SIZE bytes from BUF into the target process PH at address ADDR. */ - -ps_err_e -ps_pdwrite (gdb_ps_prochandle_t ph, psaddr_t addr, - gdb_ps_write_buf_t buf, gdb_ps_size_t size) -{ - return write_inferior_memory ((unsigned long) addr, buf, size); -} - -/* Get the general registers of LWP LWPID within the target process PH - and store them in GREGSET. */ - -ps_err_e -ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset) -{ -#ifdef HAVE_REGSETS - struct process_info *process; - struct thread_info *reg_inferior, *save_inferior; - - process = (struct process_info *) find_inferior_id (&all_processes, - lwpid); - if (process == NULL) - return PS_ERR; - - reg_inferior = get_process_thread (process); - save_inferior = current_inferior; - current_inferior = reg_inferior; - - the_target->fetch_registers (0); - gregset_info()->fill_function (gregset); - - current_inferior = save_inferior; - return PS_OK; -#else - return PS_ERR; -#endif -} - -/* Set the general registers of LWP LWPID within the target process PH - from GREGSET. */ - -ps_err_e -ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset) -{ - /* Unneeded. */ - return PS_ERR; -} - -/* Get the floating-point registers of LWP LWPID within the target - process PH and store them in FPREGSET. */ - -ps_err_e -ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, void *fpregset) -{ - /* Unneeded. */ - return PS_ERR; -} - -/* Set the floating-point registers of LWP LWPID within the target - process PH from FPREGSET. */ - -ps_err_e -ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, void *fpregset) -{ - /* Unneeded. */ - return PS_ERR; -} - -/* Return overall process id of the target PH. Special for GNU/Linux - -- not used on Solaris. */ - -pid_t -ps_getpid (gdb_ps_prochandle_t ph) -{ - return ph->pid; -} - - diff --git a/gdb/gdbserver/regcache.c b/gdb/gdbserver/regcache.c deleted file mode 100644 index c8ea2ad..0000000 --- a/gdb/gdbserver/regcache.c +++ /dev/null @@ -1,240 +0,0 @@ -/* Register support routines for the remote server for GDB. - Copyright (C) 2001, 2002, 2004, 2005 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "regdef.h" - -#include <stdlib.h> -#include <string.h> - -/* The private data for the register cache. Note that we have one - per inferior; this is primarily for simplicity, as the performance - benefit is minimal. */ - -struct inferior_regcache_data -{ - int registers_valid; - unsigned char *registers; -}; - -static int register_bytes; - -static struct reg *reg_defs; -static int num_registers; - -const char **gdbserver_expedite_regs; - -static struct inferior_regcache_data * -get_regcache (struct thread_info *inf, int fetch) -{ - struct inferior_regcache_data *regcache; - - regcache = (struct inferior_regcache_data *) inferior_regcache_data (inf); - - if (regcache == NULL) - fatal ("no register cache"); - - /* FIXME - fetch registers for INF */ - if (fetch && regcache->registers_valid == 0) - { - fetch_inferior_registers (0); - regcache->registers_valid = 1; - } - - return regcache; -} - -void -regcache_invalidate_one (struct inferior_list_entry *entry) -{ - struct thread_info *thread = (struct thread_info *) entry; - struct inferior_regcache_data *regcache; - - regcache = (struct inferior_regcache_data *) inferior_regcache_data (thread); - - if (regcache->registers_valid) - { - struct thread_info *saved_inferior = current_inferior; - - current_inferior = thread; - store_inferior_registers (-1); - current_inferior = saved_inferior; - } - - regcache->registers_valid = 0; -} - -void -regcache_invalidate () -{ - for_each_inferior (&all_threads, regcache_invalidate_one); -} - -int -registers_length (void) -{ - return 2 * register_bytes; -} - -void * -new_register_cache (void) -{ - struct inferior_regcache_data *regcache; - - regcache = malloc (sizeof (*regcache)); - - /* Make sure to zero-initialize the register cache when it is created, - in case there are registers the target never fetches. This way they'll - read as zero instead of garbage. */ - regcache->registers = calloc (1, register_bytes); - if (regcache->registers == NULL) - fatal ("Could not allocate register cache."); - - regcache->registers_valid = 0; - - return regcache; -} - -void -free_register_cache (void *regcache_p) -{ - struct inferior_regcache_data *regcache - = (struct inferior_regcache_data *) regcache_p; - - free (regcache->registers); - free (regcache); -} - -void -set_register_cache (struct reg *regs, int n) -{ - int offset, i; - - reg_defs = regs; - num_registers = n; - - offset = 0; - for (i = 0; i < n; i++) - { - regs[i].offset = offset; - offset += regs[i].size; - } - - register_bytes = offset / 8; -} - -void -registers_to_string (char *buf) -{ - unsigned char *registers = get_regcache (current_inferior, 1)->registers; - - convert_int_to_ascii (registers, buf, register_bytes); -} - -void -registers_from_string (char *buf) -{ - int len = strlen (buf); - unsigned char *registers = get_regcache (current_inferior, 1)->registers; - - if (len != register_bytes * 2) - { - warning ("Wrong sized register packet (expected %d bytes, got %d)", 2*register_bytes, len); - if (len > register_bytes * 2) - len = register_bytes * 2; - } - convert_ascii_to_int (buf, registers, len / 2); -} - -struct reg * -find_register_by_name (const char *name) -{ - int i; - - for (i = 0; i < num_registers; i++) - if (!strcmp (name, reg_defs[i].name)) - return ®_defs[i]; - fatal ("Unknown register %s requested", name); - return 0; -} - -int -find_regno (const char *name) -{ - int i; - - for (i = 0; i < num_registers; i++) - if (!strcmp (name, reg_defs[i].name)) - return i; - fatal ("Unknown register %s requested", name); - return -1; -} - -struct reg * -find_register_by_number (int n) -{ - return ®_defs[n]; -} - -int -register_size (int n) -{ - return reg_defs[n].size / 8; -} - -static unsigned char * -register_data (int n, int fetch) -{ - unsigned char *registers - = get_regcache (current_inferior, fetch)->registers; - - return registers + (reg_defs[n].offset / 8); -} - -void -supply_register (int n, const void *buf) -{ - memcpy (register_data (n, 0), buf, register_size (n)); -} - -void -supply_register_by_name (const char *name, const void *buf) -{ - supply_register (find_regno (name), buf); -} - -void -collect_register (int n, void *buf) -{ - memcpy (buf, register_data (n, 1), register_size (n)); -} - -void -collect_register_as_string (int n, char *buf) -{ - convert_int_to_ascii (register_data (n, 1), buf, register_size (n)); -} - -void -collect_register_by_name (const char *name, void *buf) -{ - collect_register (find_regno (name), buf); -} diff --git a/gdb/gdbserver/regcache.h b/gdb/gdbserver/regcache.h deleted file mode 100644 index ec8531e..0000000 --- a/gdb/gdbserver/regcache.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Register support routines for the remote server for GDB. - Copyright (C) 2001, 2002 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#ifndef REGCACHE_H -#define REGCACHE_H - -struct inferior_list_entry; - -/* Create a new register cache for INFERIOR. */ - -void *new_register_cache (void); - -/* Release all memory associated with the register cache for INFERIOR. */ - -void free_register_cache (void *regcache); - -/* Invalidate cached registers for one or all threads. */ - -void regcache_invalidate_one (struct inferior_list_entry *); -void regcache_invalidate (void); - -/* Convert all registers to a string in the currently specified remote - format. */ - -void registers_to_string (char *buf); - -/* Convert a string to register values and fill our register cache. */ - -void registers_from_string (char *buf); - -/* Return the size in bytes of a string-encoded register packet. */ - -int registers_length (void); - -/* Return a pointer to the description of register ``n''. */ - -struct reg *find_register_by_number (int n); - -int register_size (int n); - -int find_regno (const char *name); - -extern const char **gdbserver_expedite_regs; - -void supply_register (int n, const void *buf); - -void supply_register_by_name (const char *name, const void *buf); - -void collect_register (int n, void *buf); - -void collect_register_as_string (int n, char *buf); - -void collect_register_by_name (const char *name, void *buf); - -#endif /* REGCACHE_H */ diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c deleted file mode 100644 index 8da223f..0000000 --- a/gdb/gdbserver/remote-utils.c +++ /dev/null @@ -1,1002 +0,0 @@ -/* Remote utility routines for the remote server for GDB. - Copyright (C) 1986, 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#if HAVE_TERMINAL_H -#include "terminal.h" -#endif -#include <stdio.h> -#include <string.h> -#if HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> -#endif -#include <sys/file.h> -#if HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#if HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#if HAVE_NETDB_H -#include <netdb.h> -#endif -#if HAVE_NETINET_TCP_H -#include <netinet/tcp.h> -#endif -#if HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> -#endif -#include <signal.h> -#include <fcntl.h> -#include <sys/time.h> -#include <unistd.h> -#if HAVE_ARPA_INET_H -#include <arpa/inet.h> -#endif - -#if USE_WIN32API -#include <winsock.h> -#endif - -#ifndef HAVE_SOCKLEN_T -typedef int socklen_t; -#endif - -/* A cache entry for a successfully looked-up symbol. */ -struct sym_cache -{ - const char *name; - CORE_ADDR addr; - struct sym_cache *next; -}; - -/* The symbol cache. */ -static struct sym_cache *symbol_cache; - -/* If this flag has been set, assume cache misses are - failures. */ -int all_symbols_looked_up; - -int remote_debug = 0; -struct ui_file *gdb_stdlog; - -static int remote_desc; - -/* FIXME headerize? */ -extern int using_threads; -extern int debug_threads; - -/* Open a connection to a remote debugger. - NAME is the filename used for communication. */ - -void -remote_open (char *name) -{ -#if defined(F_SETFL) && defined (FASYNC) - int save_fcntl_flags; -#endif - - if (!strchr (name, ':')) - { -#ifdef USE_WIN32API - error ("Only <host>:<port> is supported on this platform."); -#else - remote_desc = open (name, O_RDWR); - if (remote_desc < 0) - perror_with_name ("Could not open remote device"); - -#ifdef HAVE_TERMIOS - { - struct termios termios; - tcgetattr (remote_desc, &termios); - - termios.c_iflag = 0; - termios.c_oflag = 0; - termios.c_lflag = 0; - termios.c_cflag &= ~(CSIZE | PARENB); - termios.c_cflag |= CLOCAL | CS8; - termios.c_cc[VMIN] = 1; - termios.c_cc[VTIME] = 0; - - tcsetattr (remote_desc, TCSANOW, &termios); - } -#endif - -#ifdef HAVE_TERMIO - { - struct termio termio; - ioctl (remote_desc, TCGETA, &termio); - - termio.c_iflag = 0; - termio.c_oflag = 0; - termio.c_lflag = 0; - termio.c_cflag &= ~(CSIZE | PARENB); - termio.c_cflag |= CLOCAL | CS8; - termio.c_cc[VMIN] = 1; - termio.c_cc[VTIME] = 0; - - ioctl (remote_desc, TCSETA, &termio); - } -#endif - -#ifdef HAVE_SGTTY - { - struct sgttyb sg; - - ioctl (remote_desc, TIOCGETP, &sg); - sg.sg_flags = RAW; - ioctl (remote_desc, TIOCSETP, &sg); - } -#endif - - fprintf (stderr, "Remote debugging using %s\n", name); -#endif /* USE_WIN32API */ - } - else - { -#ifdef USE_WIN32API - static int winsock_initialized; -#endif - char *port_str; - int port; - struct sockaddr_in sockaddr; - socklen_t tmp; - int tmp_desc; - - port_str = strchr (name, ':'); - - port = atoi (port_str + 1); - -#ifdef USE_WIN32API - if (!winsock_initialized) - { - WSADATA wsad; - - WSAStartup (MAKEWORD (1, 0), &wsad); - winsock_initialized = 1; - } -#endif - - tmp_desc = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); - if (tmp_desc < 0) - perror_with_name ("Can't open socket"); - - /* Allow rapid reuse of this port. */ - tmp = 1; - setsockopt (tmp_desc, SOL_SOCKET, SO_REUSEADDR, (char *) &tmp, - sizeof (tmp)); - - sockaddr.sin_family = PF_INET; - sockaddr.sin_port = htons (port); - sockaddr.sin_addr.s_addr = INADDR_ANY; - - if (bind (tmp_desc, (struct sockaddr *) &sockaddr, sizeof (sockaddr)) - || listen (tmp_desc, 1)) - perror_with_name ("Can't bind address"); - - fprintf (stderr, "Listening on port %d\n", port); - fflush (stderr); - - tmp = sizeof (sockaddr); - remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, &tmp); - if (remote_desc == -1) - perror_with_name ("Accept failed"); - - /* Enable TCP keep alive process. */ - tmp = 1; - setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp)); - - /* Tell TCP not to delay small packets. This greatly speeds up - interactive response. */ - tmp = 1; - setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY, - (char *) &tmp, sizeof (tmp)); - - -#ifndef USE_WIN32API - close (tmp_desc); /* No longer need this */ - - signal (SIGPIPE, SIG_IGN); /* If we don't do this, then gdbserver simply - exits when the remote side dies. */ -#else - closesocket (tmp_desc); /* No longer need this */ -#endif - - /* Convert IP address to string. */ - fprintf (stderr, "Remote debugging from host %s\n", - inet_ntoa (sockaddr.sin_addr)); - } - -#if defined(F_SETFL) && defined (FASYNC) - save_fcntl_flags = fcntl (remote_desc, F_GETFL, 0); - fcntl (remote_desc, F_SETFL, save_fcntl_flags | FASYNC); -#if defined (F_SETOWN) - fcntl (remote_desc, F_SETOWN, getpid ()); -#endif -#endif - disable_async_io (); -} - -void -remote_close (void) -{ -#ifdef USE_WIN32API - closesocket (remote_desc); -#else - close (remote_desc); -#endif -} - -/* Convert hex digit A to a number. */ - -static int -fromhex (int a) -{ - if (a >= '0' && a <= '9') - return a - '0'; - else if (a >= 'a' && a <= 'f') - return a - 'a' + 10; - else - error ("Reply contains invalid hex digit"); - return 0; -} - -int -unhexify (char *bin, const char *hex, int count) -{ - int i; - - for (i = 0; i < count; i++) - { - if (hex[0] == 0 || hex[1] == 0) - { - /* Hex string is short, or of uneven length. - Return the count that has been converted so far. */ - return i; - } - *bin++ = fromhex (hex[0]) * 16 + fromhex (hex[1]); - hex += 2; - } - return i; -} - -static void -decode_address (CORE_ADDR *addrp, const char *start, int len) -{ - CORE_ADDR addr; - char ch; - int i; - - addr = 0; - for (i = 0; i < len; i++) - { - ch = start[i]; - addr = addr << 4; - addr = addr | (fromhex (ch) & 0x0f); - } - *addrp = addr; -} - -/* Convert number NIB to a hex digit. */ - -static int -tohex (int nib) -{ - if (nib < 10) - return '0' + nib; - else - return 'a' + nib - 10; -} - -int -hexify (char *hex, const char *bin, int count) -{ - int i; - - /* May use a length, or a nul-terminated string as input. */ - if (count == 0) - count = strlen (bin); - - for (i = 0; i < count; i++) - { - *hex++ = tohex ((*bin >> 4) & 0xf); - *hex++ = tohex (*bin++ & 0xf); - } - *hex = 0; - return i; -} - -/* Convert BUFFER, binary data at least LEN bytes long, into escaped - binary data in OUT_BUF. Set *OUT_LEN to the length of the data - encoded in OUT_BUF, and return the number of bytes in OUT_BUF - (which may be more than *OUT_LEN due to escape characters). The - total number of bytes in the output buffer will be at most - OUT_MAXLEN. */ - -int -remote_escape_output (const gdb_byte *buffer, int len, - gdb_byte *out_buf, int *out_len, - int out_maxlen) -{ - int input_index, output_index; - - output_index = 0; - for (input_index = 0; input_index < len; input_index++) - { - gdb_byte b = buffer[input_index]; - - if (b == '$' || b == '#' || b == '}' || b == '*') - { - /* These must be escaped. */ - if (output_index + 2 > out_maxlen) - break; - out_buf[output_index++] = '}'; - out_buf[output_index++] = b ^ 0x20; - } - else - { - if (output_index + 1 > out_maxlen) - break; - out_buf[output_index++] = b; - } - } - - *out_len = input_index; - return output_index; -} - -/* Convert BUFFER, escaped data LEN bytes long, into binary data - in OUT_BUF. Return the number of bytes written to OUT_BUF. - Raise an error if the total number of bytes exceeds OUT_MAXLEN. - - This function reverses remote_escape_output. It allows more - escaped characters than that function does, in particular because - '*' must be escaped to avoid the run-length encoding processing - in reading packets. */ - -static int -remote_unescape_input (const gdb_byte *buffer, int len, - gdb_byte *out_buf, int out_maxlen) -{ - int input_index, output_index; - int escaped; - - output_index = 0; - escaped = 0; - for (input_index = 0; input_index < len; input_index++) - { - gdb_byte b = buffer[input_index]; - - if (output_index + 1 > out_maxlen) - error ("Received too much data from the target."); - - if (escaped) - { - out_buf[output_index++] = b ^ 0x20; - escaped = 0; - } - else if (b == '}') - escaped = 1; - else - out_buf[output_index++] = b; - } - - if (escaped) - error ("Unmatched escape character in target response."); - - return output_index; -} - -/* Send a packet to the remote machine, with error checking. - The data of the packet is in BUF, and the length of the - packet is in CNT. Returns >= 0 on success, -1 otherwise. */ - -int -putpkt_binary (char *buf, int cnt) -{ - int i; - unsigned char csum = 0; - char *buf2; - char buf3[1]; - char *p; - - buf2 = malloc (PBUFSIZ); - - /* Copy the packet into buffer BUF2, encapsulating it - and giving it a checksum. */ - - p = buf2; - *p++ = '$'; - - for (i = 0; i < cnt; i++) - { - csum += buf[i]; - *p++ = buf[i]; - } - *p++ = '#'; - *p++ = tohex ((csum >> 4) & 0xf); - *p++ = tohex (csum & 0xf); - - *p = '\0'; - - /* Send it over and over until we get a positive ack. */ - - do - { - int cc; - - if (send (remote_desc, buf2, p - buf2, 0) != p - buf2) - { - perror ("putpkt(write)"); - return -1; - } - - if (remote_debug) - { - fprintf (stderr, "putpkt (\"%s\"); [looking for ack]\n", buf2); - fflush (stderr); - } - cc = recv (remote_desc, buf3, 1, 0); - if (remote_debug) - { - fprintf (stderr, "[received '%c' (0x%x)]\n", buf3[0], buf3[0]); - fflush (stderr); - } - - if (cc <= 0) - { - if (cc == 0) - fprintf (stderr, "putpkt(read): Got EOF\n"); - else - perror ("putpkt(read)"); - - free (buf2); - return -1; - } - - /* Check for an input interrupt while we're here. */ - if (buf3[0] == '\003') - (*the_target->send_signal) (SIGINT); - } - while (buf3[0] != '+'); - - free (buf2); - return 1; /* Success! */ -} - -/* Send a packet to the remote machine, with error checking. The data - of the packet is in BUF, and the packet should be a NUL-terminated - string. Returns >= 0 on success, -1 otherwise. */ - -int -putpkt (char *buf) -{ - return putpkt_binary (buf, strlen (buf)); -} - -#ifndef USE_WIN32API - -/* Come here when we get an input interrupt from the remote side. This - interrupt should only be active while we are waiting for the child to do - something. About the only thing that should come through is a ^C, which - will cause us to send a SIGINT to the child. */ - -static void -input_interrupt (int unused) -{ - fd_set readset; - struct timeval immediate = { 0, 0 }; - - /* Protect against spurious interrupts. This has been observed to - be a problem under NetBSD 1.4 and 1.5. */ - - FD_ZERO (&readset); - FD_SET (remote_desc, &readset); - if (select (remote_desc + 1, &readset, 0, 0, &immediate) > 0) - { - int cc; - char c = 0; - - cc = recv (remote_desc, &c, 1, 0); - - if (cc != 1 || c != '\003') - { - fprintf (stderr, "input_interrupt, count = %d c = %d ('%c')\n", - cc, c, c); - return; - } - - (*the_target->send_signal) (SIGINT); - } -} -#endif - -/* Asynchronous I/O support. SIGIO must be enabled when waiting, in order to - accept Control-C from the client, and must be disabled when talking to - the client. */ - -void -block_async_io (void) -{ -#ifndef USE_WIN32API - sigset_t sigio_set; - sigemptyset (&sigio_set); - sigaddset (&sigio_set, SIGIO); - sigprocmask (SIG_BLOCK, &sigio_set, NULL); -#endif -} - -void -unblock_async_io (void) -{ -#ifndef USE_WIN32API - sigset_t sigio_set; - sigemptyset (&sigio_set); - sigaddset (&sigio_set, SIGIO); - sigprocmask (SIG_UNBLOCK, &sigio_set, NULL); -#endif -} - -/* Current state of asynchronous I/O. */ -static int async_io_enabled; - -/* Enable asynchronous I/O. */ -void -enable_async_io (void) -{ - if (async_io_enabled) - return; - -#ifndef USE_WIN32API - signal (SIGIO, input_interrupt); -#endif - async_io_enabled = 1; -} - -/* Disable asynchronous I/O. */ -void -disable_async_io (void) -{ - if (!async_io_enabled) - return; - -#ifndef USE_WIN32API - signal (SIGIO, SIG_IGN); -#endif - async_io_enabled = 0; -} - -/* Returns next char from remote GDB. -1 if error. */ - -static int -readchar (void) -{ - static unsigned char buf[BUFSIZ]; - static int bufcnt = 0; - static unsigned char *bufp; - - if (bufcnt-- > 0) - return *bufp++; - - bufcnt = recv (remote_desc, buf, sizeof (buf), 0); - - if (bufcnt <= 0) - { - if (bufcnt == 0) - fprintf (stderr, "readchar: Got EOF\n"); - else - perror ("readchar"); - - return -1; - } - - bufp = buf; - bufcnt--; - return *bufp++ & 0x7f; -} - -/* Read a packet from the remote machine, with error checking, - and store it in BUF. Returns length of packet, or negative if error. */ - -int -getpkt (char *buf) -{ - char *bp; - unsigned char csum, c1, c2; - int c; - - while (1) - { - csum = 0; - - while (1) - { - c = readchar (); - if (c == '$') - break; - if (remote_debug) - { - fprintf (stderr, "[getpkt: discarding char '%c']\n", c); - fflush (stderr); - } - - if (c < 0) - return -1; - } - - bp = buf; - while (1) - { - c = readchar (); - if (c < 0) - return -1; - if (c == '#') - break; - *bp++ = c; - csum += c; - } - *bp = 0; - - c1 = fromhex (readchar ()); - c2 = fromhex (readchar ()); - - if (csum == (c1 << 4) + c2) - break; - - fprintf (stderr, "Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n", - (c1 << 4) + c2, csum, buf); - send (remote_desc, "-", 1, 0); - } - - if (remote_debug) - { - fprintf (stderr, "getpkt (\"%s\"); [sending ack] \n", buf); - fflush (stderr); - } - - send (remote_desc, "+", 1, 0); - - if (remote_debug) - { - fprintf (stderr, "[sent ack]\n"); - fflush (stderr); - } - - return bp - buf; -} - -void -write_ok (char *buf) -{ - buf[0] = 'O'; - buf[1] = 'K'; - buf[2] = '\0'; -} - -void -write_enn (char *buf) -{ - /* Some day, we should define the meanings of the error codes... */ - buf[0] = 'E'; - buf[1] = '0'; - buf[2] = '1'; - buf[3] = '\0'; -} - -void -convert_int_to_ascii (unsigned char *from, char *to, int n) -{ - int nib; - int ch; - while (n--) - { - ch = *from++; - nib = ((ch & 0xf0) >> 4) & 0x0f; - *to++ = tohex (nib); - nib = ch & 0x0f; - *to++ = tohex (nib); - } - *to++ = 0; -} - - -void -convert_ascii_to_int (char *from, unsigned char *to, int n) -{ - int nib1, nib2; - while (n--) - { - nib1 = fromhex (*from++); - nib2 = fromhex (*from++); - *to++ = (((nib1 & 0x0f) << 4) & 0xf0) | (nib2 & 0x0f); - } -} - -static char * -outreg (int regno, char *buf) -{ - if ((regno >> 12) != 0) - *buf++ = tohex ((regno >> 12) & 0xf); - if ((regno >> 8) != 0) - *buf++ = tohex ((regno >> 8) & 0xf); - *buf++ = tohex ((regno >> 4) & 0xf); - *buf++ = tohex (regno & 0xf); - *buf++ = ':'; - collect_register_as_string (regno, buf); - buf += 2 * register_size (regno); - *buf++ = ';'; - - return buf; -} - -void -new_thread_notify (int id) -{ - char own_buf[256]; - - /* The `n' response is not yet part of the remote protocol. Do nothing. */ - if (1) - return; - - if (server_waiting == 0) - return; - - sprintf (own_buf, "n%x", id); - disable_async_io (); - putpkt (own_buf); - enable_async_io (); -} - -void -dead_thread_notify (int id) -{ - char own_buf[256]; - - /* The `x' response is not yet part of the remote protocol. Do nothing. */ - if (1) - return; - - sprintf (own_buf, "x%x", id); - disable_async_io (); - putpkt (own_buf); - enable_async_io (); -} - -void -prepare_resume_reply (char *buf, char status, unsigned char sig) -{ - int nib; - - *buf++ = status; - - nib = ((sig & 0xf0) >> 4); - *buf++ = tohex (nib); - nib = sig & 0x0f; - *buf++ = tohex (nib); - - if (status == 'T') - { - const char **regp = gdbserver_expedite_regs; - - if (the_target->stopped_by_watchpoint != NULL - && (*the_target->stopped_by_watchpoint) ()) - { - CORE_ADDR addr; - int i; - - strncpy (buf, "watch:", 6); - buf += 6; - - addr = (*the_target->stopped_data_address) (); - - /* Convert each byte of the address into two hexadecimal chars. - Note that we take sizeof (void *) instead of sizeof (addr); - this is to avoid sending a 64-bit address to a 32-bit GDB. */ - for (i = sizeof (void *) * 2; i > 0; i--) - { - *buf++ = tohex ((addr >> (i - 1) * 4) & 0xf); - } - *buf++ = ';'; - } - - while (*regp) - { - buf = outreg (find_regno (*regp), buf); - regp ++; - } - - /* Formerly, if the debugger had not used any thread features we would not - burden it with a thread status response. This was for the benefit of - GDB 4.13 and older. However, in recent GDB versions the check - (``if (cont_thread != 0)'') does not have the desired effect because of - sillyness in the way that the remote protocol handles specifying a thread. - Since thread support relies on qSymbol support anyway, assume GDB can handle - threads. */ - - if (using_threads) - { - unsigned int gdb_id_from_wait; - - /* FIXME right place to set this? */ - thread_from_wait = ((struct inferior_list_entry *)current_inferior)->id; - gdb_id_from_wait = thread_to_gdb_id (current_inferior); - - if (debug_threads) - fprintf (stderr, "Writing resume reply for %ld\n\n", thread_from_wait); - /* This if (1) ought to be unnecessary. But remote_wait in GDB - will claim this event belongs to inferior_ptid if we do not - specify a thread, and there's no way for gdbserver to know - what inferior_ptid is. */ - if (1 || old_thread_from_wait != thread_from_wait) - { - general_thread = thread_from_wait; - sprintf (buf, "thread:%x;", gdb_id_from_wait); - buf += strlen (buf); - old_thread_from_wait = thread_from_wait; - } - } - } - /* For W and X, we're done. */ - *buf++ = 0; -} - -void -decode_m_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr) -{ - int i = 0, j = 0; - char ch; - *mem_addr_ptr = *len_ptr = 0; - - while ((ch = from[i++]) != ',') - { - *mem_addr_ptr = *mem_addr_ptr << 4; - *mem_addr_ptr |= fromhex (ch) & 0x0f; - } - - for (j = 0; j < 4; j++) - { - if ((ch = from[i++]) == 0) - break; - *len_ptr = *len_ptr << 4; - *len_ptr |= fromhex (ch) & 0x0f; - } -} - -void -decode_M_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr, - unsigned char *to) -{ - int i = 0; - char ch; - *mem_addr_ptr = *len_ptr = 0; - - while ((ch = from[i++]) != ',') - { - *mem_addr_ptr = *mem_addr_ptr << 4; - *mem_addr_ptr |= fromhex (ch) & 0x0f; - } - - while ((ch = from[i++]) != ':') - { - *len_ptr = *len_ptr << 4; - *len_ptr |= fromhex (ch) & 0x0f; - } - - convert_ascii_to_int (&from[i++], to, *len_ptr); -} - -int -decode_X_packet (char *from, int packet_len, CORE_ADDR *mem_addr_ptr, - unsigned int *len_ptr, unsigned char *to) -{ - int i = 0; - char ch; - *mem_addr_ptr = *len_ptr = 0; - - while ((ch = from[i++]) != ',') - { - *mem_addr_ptr = *mem_addr_ptr << 4; - *mem_addr_ptr |= fromhex (ch) & 0x0f; - } - - while ((ch = from[i++]) != ':') - { - *len_ptr = *len_ptr << 4; - *len_ptr |= fromhex (ch) & 0x0f; - } - - if (remote_unescape_input ((const gdb_byte *) &from[i], packet_len - i, - to, *len_ptr) != *len_ptr) - return -1; - - return 0; -} - -/* Ask GDB for the address of NAME, and return it in ADDRP if found. - Returns 1 if the symbol is found, 0 if it is not, -1 on error. */ - -int -look_up_one_symbol (const char *name, CORE_ADDR *addrp) -{ - char own_buf[266], *p, *q; - int len; - struct sym_cache *sym; - - /* Check the cache first. */ - for (sym = symbol_cache; sym; sym = sym->next) - if (strcmp (name, sym->name) == 0) - { - *addrp = sym->addr; - return 1; - } - - /* If we've passed the call to thread_db_look_up_symbols, then - anything not in the cache must not exist; we're not interested - in any libraries loaded after that point, only in symbols in - libpthread.so. It might not be an appropriate time to look - up a symbol, e.g. while we're trying to fetch registers. */ - if (all_symbols_looked_up) - return 0; - - /* Send the request. */ - strcpy (own_buf, "qSymbol:"); - hexify (own_buf + strlen ("qSymbol:"), name, strlen (name)); - if (putpkt (own_buf) < 0) - return -1; - - /* FIXME: Eventually add buffer overflow checking (to getpkt?) */ - len = getpkt (own_buf); - if (len < 0) - return -1; - - if (strncmp (own_buf, "qSymbol:", strlen ("qSymbol:")) != 0) - { - /* Malformed response. */ - if (remote_debug) - { - fprintf (stderr, "Malformed response to qSymbol, ignoring.\n"); - fflush (stderr); - } - - return -1; - } - - p = own_buf + strlen ("qSymbol:"); - q = p; - while (*q && *q != ':') - q++; - - /* Make sure we found a value for the symbol. */ - if (p == q || *q == '\0') - return 0; - - decode_address (addrp, p, q - p); - - /* Save the symbol in our cache. */ - sym = malloc (sizeof (*sym)); - sym->name = strdup (name); - sym->addr = *addrp; - sym->next = symbol_cache; - symbol_cache = sym; - - return 1; -} diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c deleted file mode 100644 index 854e2b1..0000000 --- a/gdb/gdbserver/server.c +++ /dev/null @@ -1,853 +0,0 @@ -/* Main code for remote server for GDB. - Copyright (C) 1989, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004, - 2005, 2006 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" - -#include <unistd.h> -#include <signal.h> -#if HAVE_SYS_WAIT_H -#include <sys/wait.h> -#endif - -unsigned long cont_thread; -unsigned long general_thread; -unsigned long step_thread; -unsigned long thread_from_wait; -unsigned long old_thread_from_wait; -int extended_protocol; -int server_waiting; - -jmp_buf toplevel; - -/* The PID of the originally created or attached inferior. Used to - send signals to the process when GDB sends us an asynchronous interrupt - (user hitting Control-C in the client), and to wait for the child to exit - when no longer debugging it. */ - -unsigned long signal_pid; - -static int -start_inferior (char *argv[], char *statusptr) -{ -#ifdef SIGTTOU - signal (SIGTTOU, SIG_DFL); - signal (SIGTTIN, SIG_DFL); -#endif - - signal_pid = create_inferior (argv[0], argv); - - fprintf (stderr, "Process %s created; pid = %ld\n", argv[0], - signal_pid); - fflush (stderr); - -#ifdef SIGTTOU - signal (SIGTTOU, SIG_IGN); - signal (SIGTTIN, SIG_IGN); - tcsetpgrp (fileno (stderr), signal_pid); -#endif - - /* Wait till we are at 1st instruction in program, return signal number. */ - return mywait (statusptr, 0); -} - -static int -attach_inferior (int pid, char *statusptr, int *sigptr) -{ - /* myattach should return -1 if attaching is unsupported, - 0 if it succeeded, and call error() otherwise. */ - - if (myattach (pid) != 0) - return -1; - - fprintf (stderr, "Attached; pid = %d\n", pid); - fflush (stderr); - - /* FIXME - It may be that we should get the SIGNAL_PID from the - attach function, so that it can be the main thread instead of - whichever we were told to attach to. */ - signal_pid = pid; - - *sigptr = mywait (statusptr, 0); - - /* GDB knows to ignore the first SIGSTOP after attaching to a running - process using the "attach" command, but this is different; it's - just using "target remote". Pretend it's just starting up. */ - if (*statusptr == 'T' && *sigptr == TARGET_SIGNAL_STOP) - *sigptr = TARGET_SIGNAL_TRAP; - - return 0; -} - -extern int remote_debug; - -/* Decode a qXfer read request. Return 0 if everything looks OK, - or -1 otherwise. */ - -static int -decode_xfer_read (char *buf, char **annex, CORE_ADDR *ofs, unsigned int *len) -{ - /* Extract and NUL-terminate the annex. */ - *annex = buf; - while (*buf && *buf != ':') - buf++; - if (*buf == '\0') - return -1; - *buf++ = 0; - - /* After the read/write marker and annex, qXfer looks like a - traditional 'm' packet. */ - decode_m_packet (buf, ofs, len); - - return 0; -} - -/* Write the response to a successful qXfer read. Returns the - length of the (binary) data stored in BUF, corresponding - to as much of DATA/LEN as we could fit. IS_MORE controls - the first character of the response. */ -static int -write_qxfer_response (char *buf, unsigned char *data, int len, int is_more) -{ - int out_len; - - if (is_more) - buf[0] = 'm'; - else - buf[0] = 'l'; - - return remote_escape_output (data, len, (unsigned char *) buf + 1, &out_len, - PBUFSIZ - 2) + 1; -} - -/* Handle all of the extended 'q' packets. */ -void -handle_query (char *own_buf, int *new_packet_len_p) -{ - static struct inferior_list_entry *thread_ptr; - - if (strcmp ("qSymbol::", own_buf) == 0) - { - if (the_target->look_up_symbols != NULL) - (*the_target->look_up_symbols) (); - - strcpy (own_buf, "OK"); - return; - } - - if (strcmp ("qfThreadInfo", own_buf) == 0) - { - thread_ptr = all_threads.head; - sprintf (own_buf, "m%x", thread_to_gdb_id ((struct thread_info *)thread_ptr)); - thread_ptr = thread_ptr->next; - return; - } - - if (strcmp ("qsThreadInfo", own_buf) == 0) - { - if (thread_ptr != NULL) - { - sprintf (own_buf, "m%x", thread_to_gdb_id ((struct thread_info *)thread_ptr)); - thread_ptr = thread_ptr->next; - return; - } - else - { - sprintf (own_buf, "l"); - return; - } - } - - if (the_target->read_offsets != NULL - && strcmp ("qOffsets", own_buf) == 0) - { - CORE_ADDR text, data; - - if (the_target->read_offsets (&text, &data)) - sprintf (own_buf, "Text=%lX;Data=%lX;Bss=%lX", - (long)text, (long)data, (long)data); - else - write_enn (own_buf); - - return; - } - - if (the_target->read_auxv != NULL - && strncmp ("qXfer:auxv:read:", own_buf, 16) == 0) - { - unsigned char *data; - int n; - CORE_ADDR ofs; - unsigned int len; - char *annex; - - /* Reject any annex; grab the offset and length. */ - if (decode_xfer_read (own_buf + 16, &annex, &ofs, &len) < 0 - || annex[0] != '\0') - { - strcpy (own_buf, "E00"); - return; - } - - /* Read one extra byte, as an indicator of whether there is - more. */ - if (len > PBUFSIZ - 2) - len = PBUFSIZ - 2; - data = malloc (len + 1); - n = (*the_target->read_auxv) (ofs, data, len + 1); - if (n > len) - *new_packet_len_p = write_qxfer_response (own_buf, data, len, 1); - else - *new_packet_len_p = write_qxfer_response (own_buf, data, n, 0); - - free (data); - - return; - } - - /* Protocol features query. */ - if (strncmp ("qSupported", own_buf, 10) == 0 - && (own_buf[10] == ':' || own_buf[10] == '\0')) - { - sprintf (own_buf, "PacketSize=%x", PBUFSIZ - 1); - - if (the_target->read_auxv != NULL) - strcat (own_buf, ";qPart:auxv:read+"); - - return; - } - - /* Otherwise we didn't know what packet it was. Say we didn't - understand it. */ - own_buf[0] = 0; -} - -/* Parse vCont packets. */ -void -handle_v_cont (char *own_buf, char *status, int *signal) -{ - char *p, *q; - int n = 0, i = 0; - struct thread_resume *resume_info, default_action; - - /* Count the number of semicolons in the packet. There should be one - for every action. */ - p = &own_buf[5]; - while (p) - { - n++; - p++; - p = strchr (p, ';'); - } - /* Allocate room for one extra action, for the default remain-stopped - behavior; if no default action is in the list, we'll need the extra - slot. */ - resume_info = malloc ((n + 1) * sizeof (resume_info[0])); - - default_action.thread = -1; - default_action.leave_stopped = 1; - default_action.step = 0; - default_action.sig = 0; - - p = &own_buf[5]; - i = 0; - while (*p) - { - p++; - - resume_info[i].leave_stopped = 0; - - if (p[0] == 's' || p[0] == 'S') - resume_info[i].step = 1; - else if (p[0] == 'c' || p[0] == 'C') - resume_info[i].step = 0; - else - goto err; - - if (p[0] == 'S' || p[0] == 'C') - { - int sig; - sig = strtol (p + 1, &q, 16); - if (p == q) - goto err; - p = q; - - if (!target_signal_to_host_p (sig)) - goto err; - resume_info[i].sig = target_signal_to_host (sig); - } - else - { - resume_info[i].sig = 0; - p = p + 1; - } - - if (p[0] == 0) - { - resume_info[i].thread = -1; - default_action = resume_info[i]; - - /* Note: we don't increment i here, we'll overwrite this entry - the next time through. */ - } - else if (p[0] == ':') - { - unsigned int gdb_id = strtoul (p + 1, &q, 16); - unsigned long thread_id; - - if (p == q) - goto err; - p = q; - if (p[0] != ';' && p[0] != 0) - goto err; - - thread_id = gdb_id_to_thread_id (gdb_id); - if (thread_id) - resume_info[i].thread = thread_id; - else - goto err; - - i++; - } - } - - resume_info[i] = default_action; - - /* Still used in occasional places in the backend. */ - if (n == 1 && resume_info[0].thread != -1) - cont_thread = resume_info[0].thread; - else - cont_thread = -1; - set_desired_inferior (0); - - (*the_target->resume) (resume_info); - - free (resume_info); - - *signal = mywait (status, 1); - prepare_resume_reply (own_buf, *status, *signal); - return; - -err: - /* No other way to report an error... */ - strcpy (own_buf, ""); - free (resume_info); - return; -} - -/* Handle all of the extended 'v' packets. */ -void -handle_v_requests (char *own_buf, char *status, int *signal) -{ - if (strncmp (own_buf, "vCont;", 6) == 0) - { - handle_v_cont (own_buf, status, signal); - return; - } - - if (strncmp (own_buf, "vCont?", 6) == 0) - { - strcpy (own_buf, "vCont;c;C;s;S"); - return; - } - - /* Otherwise we didn't know what packet it was. Say we didn't - understand it. */ - own_buf[0] = 0; - return; -} - -void -myresume (int step, int sig) -{ - struct thread_resume resume_info[2]; - int n = 0; - - if (step || sig || (cont_thread != 0 && cont_thread != -1)) - { - resume_info[0].thread - = ((struct inferior_list_entry *) current_inferior)->id; - resume_info[0].step = step; - resume_info[0].sig = sig; - resume_info[0].leave_stopped = 0; - n++; - } - resume_info[n].thread = -1; - resume_info[n].step = 0; - resume_info[n].sig = 0; - resume_info[n].leave_stopped = (cont_thread != 0 && cont_thread != -1); - - (*the_target->resume) (resume_info); -} - -static int attached; - -static void -gdbserver_version (void) -{ - printf ("GNU gdbserver %s\n" - "Copyright (C) 2006 Free Software Foundation, Inc.\n" - "gdbserver is free software, covered by the GNU General Public License.\n" - "This gdbserver was configured as \"%s\"\n", - version, host_name); -} - -static void -gdbserver_usage (void) -{ - printf ("Usage:\tgdbserver COMM PROG [ARGS ...]\n" - "\tgdbserver COMM --attach PID\n" - "\n" - "COMM may either be a tty device (for serial debugging), or \n" - "HOST:PORT to listen for a TCP connection.\n"); -} - -int -main (int argc, char *argv[]) -{ - char ch, status, *own_buf; - unsigned char *mem_buf; - int i = 0; - int signal; - unsigned int len; - CORE_ADDR mem_addr; - int bad_attach; - int pid; - char *arg_end; - - if (argc >= 2 && strcmp (argv[1], "--version") == 0) - { - gdbserver_version (); - exit (0); - } - - if (argc >= 2 && strcmp (argv[1], "--help") == 0) - { - gdbserver_usage (); - exit (0); - } - - if (setjmp (toplevel)) - { - fprintf (stderr, "Exiting\n"); - exit (1); - } - - bad_attach = 0; - pid = 0; - attached = 0; - if (argc >= 3 && strcmp (argv[2], "--attach") == 0) - { - if (argc == 4 - && argv[3] != '\0' - && (pid = strtoul (argv[3], &arg_end, 10)) != 0 - && *arg_end == '\0') - { - ; - } - else - bad_attach = 1; - } - - if (argc < 3 || bad_attach) - { - gdbserver_usage (); - exit (1); - } - - initialize_low (); - - own_buf = malloc (PBUFSIZ); - mem_buf = malloc (PBUFSIZ); - - if (pid == 0) - { - /* Wait till we are at first instruction in program. */ - signal = start_inferior (&argv[2], &status); - - /* We are now stopped at the first instruction of the target process */ - } - else - { - switch (attach_inferior (pid, &status, &signal)) - { - case -1: - error ("Attaching not supported on this target"); - break; - default: - attached = 1; - break; - } - } - - while (1) - { - remote_open (argv[1]); - - restart: - setjmp (toplevel); - while (1) - { - unsigned char sig; - int packet_len; - int new_packet_len = -1; - - packet_len = getpkt (own_buf); - if (packet_len <= 0) - break; - - i = 0; - ch = own_buf[i++]; - switch (ch) - { - case 'q': - handle_query (own_buf, &new_packet_len); - break; - case 'd': - remote_debug = !remote_debug; - break; -#ifndef USE_WIN32API - /* Skip "detach" support on mingw32, since we don't have - waitpid. */ - case 'D': - fprintf (stderr, "Detaching from inferior\n"); - detach_inferior (); - write_ok (own_buf); - putpkt (own_buf); - remote_close (); - - /* If we are attached, then we can exit. Otherwise, we need to - hang around doing nothing, until the child is gone. */ - if (!attached) - { - int status, ret; - - do { - ret = waitpid (signal_pid, &status, 0); - if (WIFEXITED (status) || WIFSIGNALED (status)) - break; - } while (ret != -1 || errno != ECHILD); - } - - exit (0); -#endif - - case '!': - if (attached == 0) - { - extended_protocol = 1; - prepare_resume_reply (own_buf, status, signal); - } - else - { - /* We can not use the extended protocol if we are - attached, because we can not restart the running - program. So return unrecognized. */ - own_buf[0] = '\0'; - } - break; - case '?': - prepare_resume_reply (own_buf, status, signal); - break; - case 'H': - if (own_buf[1] == 'c' || own_buf[1] == 'g' || own_buf[1] == 's') - { - unsigned long gdb_id, thread_id; - - gdb_id = strtoul (&own_buf[2], NULL, 16); - thread_id = gdb_id_to_thread_id (gdb_id); - if (thread_id == 0) - { - write_enn (own_buf); - break; - } - - if (own_buf[1] == 'g') - { - general_thread = thread_id; - set_desired_inferior (1); - } - else if (own_buf[1] == 'c') - cont_thread = thread_id; - else if (own_buf[1] == 's') - step_thread = thread_id; - - write_ok (own_buf); - } - else - { - /* Silently ignore it so that gdb can extend the protocol - without compatibility headaches. */ - own_buf[0] = '\0'; - } - break; - case 'g': - set_desired_inferior (1); - registers_to_string (own_buf); - break; - case 'G': - set_desired_inferior (1); - registers_from_string (&own_buf[1]); - write_ok (own_buf); - break; - case 'm': - decode_m_packet (&own_buf[1], &mem_addr, &len); - if (read_inferior_memory (mem_addr, mem_buf, len) == 0) - convert_int_to_ascii (mem_buf, own_buf, len); - else - write_enn (own_buf); - break; - case 'M': - decode_M_packet (&own_buf[1], &mem_addr, &len, mem_buf); - if (write_inferior_memory (mem_addr, mem_buf, len) == 0) - write_ok (own_buf); - else - write_enn (own_buf); - break; - case 'X': - if (decode_X_packet (&own_buf[1], packet_len - 1, - &mem_addr, &len, mem_buf) < 0 - || write_inferior_memory (mem_addr, mem_buf, len) != 0) - write_enn (own_buf); - else - write_ok (own_buf); - break; - case 'C': - convert_ascii_to_int (own_buf + 1, &sig, 1); - if (target_signal_to_host_p (sig)) - signal = target_signal_to_host (sig); - else - signal = 0; - set_desired_inferior (0); - myresume (0, signal); - signal = mywait (&status, 1); - prepare_resume_reply (own_buf, status, signal); - break; - case 'S': - convert_ascii_to_int (own_buf + 1, &sig, 1); - if (target_signal_to_host_p (sig)) - signal = target_signal_to_host (sig); - else - signal = 0; - set_desired_inferior (0); - myresume (1, signal); - signal = mywait (&status, 1); - prepare_resume_reply (own_buf, status, signal); - break; - case 'c': - set_desired_inferior (0); - myresume (0, 0); - signal = mywait (&status, 1); - prepare_resume_reply (own_buf, status, signal); - break; - case 's': - set_desired_inferior (0); - myresume (1, 0); - signal = mywait (&status, 1); - prepare_resume_reply (own_buf, status, signal); - break; - case 'Z': - { - char *lenptr; - char *dataptr; - CORE_ADDR addr = strtoul (&own_buf[3], &lenptr, 16); - int len = strtol (lenptr + 1, &dataptr, 16); - char type = own_buf[1]; - - if (the_target->insert_watchpoint == NULL - || (type < '2' || type > '4')) - { - /* No watchpoint support or not a watchpoint command; - unrecognized either way. */ - own_buf[0] = '\0'; - } - else - { - int res; - - res = (*the_target->insert_watchpoint) (type, addr, len); - if (res == 0) - write_ok (own_buf); - else if (res == 1) - /* Unsupported. */ - own_buf[0] = '\0'; - else - write_enn (own_buf); - } - break; - } - case 'z': - { - char *lenptr; - char *dataptr; - CORE_ADDR addr = strtoul (&own_buf[3], &lenptr, 16); - int len = strtol (lenptr + 1, &dataptr, 16); - char type = own_buf[1]; - - if (the_target->remove_watchpoint == NULL - || (type < '2' || type > '4')) - { - /* No watchpoint support or not a watchpoint command; - unrecognized either way. */ - own_buf[0] = '\0'; - } - else - { - int res; - - res = (*the_target->remove_watchpoint) (type, addr, len); - if (res == 0) - write_ok (own_buf); - else if (res == 1) - /* Unsupported. */ - own_buf[0] = '\0'; - else - write_enn (own_buf); - } - break; - } - case 'k': - fprintf (stderr, "Killing inferior\n"); - kill_inferior (); - /* When using the extended protocol, we start up a new - debugging session. The traditional protocol will - exit instead. */ - if (extended_protocol) - { - write_ok (own_buf); - fprintf (stderr, "GDBserver restarting\n"); - - /* Wait till we are at 1st instruction in prog. */ - signal = start_inferior (&argv[2], &status); - goto restart; - break; - } - else - { - exit (0); - break; - } - case 'T': - { - unsigned long gdb_id, thread_id; - - gdb_id = strtoul (&own_buf[1], NULL, 16); - thread_id = gdb_id_to_thread_id (gdb_id); - if (thread_id == 0) - { - write_enn (own_buf); - break; - } - - if (mythread_alive (thread_id)) - write_ok (own_buf); - else - write_enn (own_buf); - } - break; - case 'R': - /* Restarting the inferior is only supported in the - extended protocol. */ - if (extended_protocol) - { - kill_inferior (); - write_ok (own_buf); - fprintf (stderr, "GDBserver restarting\n"); - - /* Wait till we are at 1st instruction in prog. */ - signal = start_inferior (&argv[2], &status); - goto restart; - break; - } - else - { - /* It is a request we don't understand. Respond with an - empty packet so that gdb knows that we don't support this - request. */ - own_buf[0] = '\0'; - break; - } - case 'v': - /* Extended (long) request. */ - handle_v_requests (own_buf, &status, &signal); - break; - default: - /* It is a request we don't understand. Respond with an - empty packet so that gdb knows that we don't support this - request. */ - own_buf[0] = '\0'; - break; - } - - if (new_packet_len != -1) - putpkt_binary (own_buf, new_packet_len); - else - putpkt (own_buf); - - if (status == 'W') - fprintf (stderr, - "\nChild exited with status %d\n", signal); - if (status == 'X') - fprintf (stderr, "\nChild terminated with signal = 0x%x (%s)\n", - target_signal_to_host (signal), - target_signal_to_name (signal)); - if (status == 'W' || status == 'X') - { - if (extended_protocol) - { - fprintf (stderr, "Killing inferior\n"); - kill_inferior (); - write_ok (own_buf); - fprintf (stderr, "GDBserver restarting\n"); - - /* Wait till we are at 1st instruction in prog. */ - signal = start_inferior (&argv[2], &status); - goto restart; - break; - } - else - { - fprintf (stderr, "GDBserver exiting\n"); - exit (0); - } - } - } - - /* We come here when getpkt fails. - - For the extended remote protocol we exit (and this is the only - way we gracefully exit!). - - For the traditional remote protocol close the connection, - and re-open it at the top of the loop. */ - if (extended_protocol) - { - remote_close (); - exit (0); - } - else - { - fprintf (stderr, "Remote side has terminated connection. " - "GDBserver will reopen the connection.\n"); - remote_close (); - } - } -} diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h deleted file mode 100644 index 00e281a..0000000 --- a/gdb/gdbserver/server.h +++ /dev/null @@ -1,201 +0,0 @@ -/* Common definitions for remote server for GDB. - Copyright (C) 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, - 2006 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#ifndef SERVER_H -#define SERVER_H - -#include "config.h" - -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <errno.h> -#include <setjmp.h> - -#ifdef HAVE_STRING_H -#include <string.h> -#endif - -#if !HAVE_DECL_STRERROR -#ifndef strerror -extern char *strerror (int); /* X3.159-1989 4.11.6.2 */ -#endif -#endif - -#ifndef ATTR_NORETURN -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) -#define ATTR_NORETURN __attribute__ ((noreturn)) -#else -#define ATTR_NORETURN /* nothing */ -#endif -#endif - -#ifndef ATTR_FORMAT -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4)) -#define ATTR_FORMAT(type, x, y) __attribute__ ((format(type, x, y))) -#else -#define ATTR_FORMAT(type, x, y) /* nothing */ -#endif -#endif - -/* A type used for binary buffers. */ -typedef unsigned char gdb_byte; - -/* FIXME: This should probably be autoconf'd for. It's an integer type at - least the size of a (void *). */ -typedef long long CORE_ADDR; - -/* Generic information for tracking a list of ``inferiors'' - threads, - processes, etc. */ -struct inferior_list -{ - struct inferior_list_entry *head; - struct inferior_list_entry *tail; -}; -struct inferior_list_entry -{ - unsigned long id; - struct inferior_list_entry *next; -}; - -/* Opaque type for user-visible threads. */ -struct thread_info; - -#include "regcache.h" -#include "gdb/signals.h" - -#include "target.h" -#include "mem-break.h" - -/* Target-specific functions */ - -void initialize_low (); - -/* From inferiors.c. */ - -extern struct inferior_list all_threads; -void add_inferior_to_list (struct inferior_list *list, - struct inferior_list_entry *new_inferior); -void for_each_inferior (struct inferior_list *list, - void (*action) (struct inferior_list_entry *)); -extern struct thread_info *current_inferior; -void remove_inferior (struct inferior_list *list, - struct inferior_list_entry *entry); -void remove_thread (struct thread_info *thread); -void add_thread (unsigned long thread_id, void *target_data, unsigned int); -unsigned int thread_id_to_gdb_id (unsigned long); -unsigned int thread_to_gdb_id (struct thread_info *); -unsigned long gdb_id_to_thread_id (unsigned int); -void clear_inferiors (void); -struct inferior_list_entry *find_inferior - (struct inferior_list *, - int (*func) (struct inferior_list_entry *, - void *), - void *arg); -struct inferior_list_entry *find_inferior_id (struct inferior_list *list, - unsigned long id); -void *inferior_target_data (struct thread_info *); -void set_inferior_target_data (struct thread_info *, void *); -void *inferior_regcache_data (struct thread_info *); -void set_inferior_regcache_data (struct thread_info *, void *); -void change_inferior_id (struct inferior_list *list, - unsigned long new_id); - -/* Public variables in server.c */ - -extern unsigned long cont_thread; -extern unsigned long general_thread; -extern unsigned long step_thread; -extern unsigned long thread_from_wait; -extern unsigned long old_thread_from_wait; -extern int server_waiting; - -extern jmp_buf toplevel; - -/* From remote-utils.c */ - -extern int all_symbols_looked_up; - -int putpkt (char *buf); -int putpkt_binary (char *buf, int len); -int getpkt (char *buf); -void remote_open (char *name); -void remote_close (void); -void write_ok (char *buf); -void write_enn (char *buf); -void enable_async_io (void); -void disable_async_io (void); -void unblock_async_io (void); -void block_async_io (void); -void convert_ascii_to_int (char *from, unsigned char *to, int n); -void convert_int_to_ascii (unsigned char *from, char *to, int n); -void new_thread_notify (int id); -void dead_thread_notify (int id); -void prepare_resume_reply (char *buf, char status, unsigned char sig); - -void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr, - unsigned int *len_ptr); -void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr, - unsigned int *len_ptr, unsigned char *to); -int decode_X_packet (char *from, int packet_len, CORE_ADDR * mem_addr_ptr, - unsigned int *len_ptr, unsigned char *to); - -int unhexify (char *bin, const char *hex, int count); -int hexify (char *hex, const char *bin, int count); -int remote_escape_output (const gdb_byte *buffer, int len, - gdb_byte *out_buf, int *out_len, - int out_maxlen); - -int look_up_one_symbol (const char *name, CORE_ADDR *addrp); - -/* Functions from ``signals.c''. */ -enum target_signal target_signal_from_host (int hostsig); -int target_signal_to_host_p (enum target_signal oursig); -int target_signal_to_host (enum target_signal oursig); -char *target_signal_to_name (enum target_signal); - -/* Functions from utils.c */ - -void perror_with_name (char *string); -void error (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2); -void fatal (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2); -void warning (const char *string,...) ATTR_FORMAT (printf, 1, 2); - -/* Functions from the register cache definition. */ - -void init_registers (void); - -/* Maximum number of bytes to read/write at once. The value here - is chosen to fill up a packet (the headers account for the 32). */ -#define MAXBUFBYTES(N) (((N)-32)/2) - -/* Buffer sizes for transferring memory, registers, etc. Round up PBUFSIZ to - hold all the registers, at least. */ -#define PBUFSIZ ((registers_length () + 32 > 2000) \ - ? (registers_length () + 32) \ - : 2000) - -/* Version information, from version.c. */ -extern const char version[]; -extern const char host_name[]; - -#endif /* SERVER_H */ diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c deleted file mode 100644 index 066690f..0000000 --- a/gdb/gdbserver/target.c +++ /dev/null @@ -1,114 +0,0 @@ -/* Target operations for the remote server for GDB. - Copyright (C) 2002, 2004, 2005 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" - -struct target_ops *the_target; - -void -set_desired_inferior (int use_general) -{ - struct thread_info *found; - - if (use_general == 1) - { - found = (struct thread_info *) find_inferior_id (&all_threads, - general_thread); - } - else - { - found = NULL; - - /* If we are continuing any (all) thread(s), use step_thread - to decide which thread to step and/or send the specified - signal to. */ - if ((step_thread != 0 && step_thread != -1) - && (cont_thread == 0 || cont_thread == -1)) - found = (struct thread_info *) find_inferior_id (&all_threads, - step_thread); - - if (found == NULL) - found = (struct thread_info *) find_inferior_id (&all_threads, - cont_thread); - } - - if (found == NULL) - current_inferior = (struct thread_info *) all_threads.head; - else - current_inferior = found; -} - -int -read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - int res; - res = (*the_target->read_memory) (memaddr, myaddr, len); - check_mem_read (memaddr, myaddr, len); - return res; -} - -int -write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr, - int len) -{ - /* Lacking cleanups, there is some potential for a memory leak if the - write fails and we go through error(). Make sure that no more than - one buffer is ever pending by making BUFFER static. */ - static unsigned char *buffer = 0; - int res; - - if (buffer != NULL) - free (buffer); - - buffer = malloc (len); - memcpy (buffer, myaddr, len); - check_mem_write (memaddr, buffer, len); - res = (*the_target->write_memory) (memaddr, buffer, len); - free (buffer); - buffer = NULL; - - return res; -} - -unsigned char -mywait (char *statusp, int connected_wait) -{ - unsigned char ret; - - if (connected_wait) - server_waiting = 1; - - ret = (*the_target->wait) (statusp); - - if (connected_wait) - server_waiting = 0; - - return ret; -} - -void -set_target_ops (struct target_ops *target) -{ - the_target = (struct target_ops *) malloc (sizeof (*the_target)); - memcpy (the_target, target, sizeof (*the_target)); -} diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h deleted file mode 100644 index 9ee87a2..0000000 --- a/gdb/gdbserver/target.h +++ /dev/null @@ -1,202 +0,0 @@ -/* Target operations for the remote server for GDB. - Copyright (C) 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#ifndef TARGET_H -#define TARGET_H - -/* This structure describes how to resume a particular thread (or - all threads) based on the client's request. If thread is -1, then - this entry applies to all threads. These are generally passed around - as an array, and terminated by a thread == -1 entry. */ - -struct thread_resume -{ - unsigned long thread; - - /* If non-zero, leave this thread stopped. */ - int leave_stopped; - - /* If non-zero, we want to single-step. */ - int step; - - /* If non-zero, send this signal when we resume. */ - int sig; -}; - -struct target_ops -{ - /* Start a new process. - - PROGRAM is a path to the program to execute. - ARGS is a standard NULL-terminated array of arguments, - to be passed to the inferior as ``argv''. - - Returns the new PID on success, -1 on failure. Registers the new - process with the process list. */ - - int (*create_inferior) (char *program, char **args); - - /* Attach to a running process. - - PID is the process ID to attach to, specified by the user - or a higher layer. */ - - int (*attach) (unsigned long pid); - - /* Kill all inferiors. */ - - void (*kill) (void); - - /* Detach from all inferiors. */ - - void (*detach) (void); - - /* Return 1 iff the thread with process ID PID is alive. */ - - int (*thread_alive) (unsigned long pid); - - /* Resume the inferior process. */ - - void (*resume) (struct thread_resume *resume_info); - - /* Wait for the inferior process to change state. - - STATUS will be filled in with a response code to send to GDB. - - Returns the signal which caused the process to stop, in the - remote protocol numbering (e.g. TARGET_SIGNAL_STOP), or the - exit code as an integer if *STATUS is 'W'. */ - - unsigned char (*wait) (char *status); - - /* Fetch registers from the inferior process. - - If REGNO is -1, fetch all registers; otherwise, fetch at least REGNO. */ - - void (*fetch_registers) (int regno); - - /* Store registers to the inferior process. - - If REGNO is -1, store all registers; otherwise, store at least REGNO. */ - - void (*store_registers) (int regno); - - /* Read memory from the inferior process. This should generally be - called through read_inferior_memory, which handles breakpoint shadowing. - - Read LEN bytes at MEMADDR into a buffer at MYADDR. - - Returns 0 on success and errno on failure. */ - - int (*read_memory) (CORE_ADDR memaddr, unsigned char *myaddr, int len); - - /* Write memory to the inferior process. This should generally be - called through write_inferior_memory, which handles breakpoint shadowing. - - Write LEN bytes from the buffer at MYADDR to MEMADDR. - - Returns 0 on success and errno on failure. */ - - int (*write_memory) (CORE_ADDR memaddr, const unsigned char *myaddr, - int len); - - /* Query GDB for the values of any symbols we're interested in. - This function is called whenever we receive a "qSymbols::" - query, which corresponds to every time more symbols (might) - become available. NULL if we aren't interested in any - symbols. */ - - void (*look_up_symbols) (void); - - /* Send a signal to the inferior process, however is appropriate. */ - void (*send_signal) (int); - - /* Read auxiliary vector data from the inferior process. - - Read LEN bytes at OFFSET into a buffer at MYADDR. */ - - int (*read_auxv) (CORE_ADDR offset, unsigned char *myaddr, - unsigned int len); - - /* Insert and remove a hardware watchpoint. - Returns 0 on success, -1 on failure and 1 on unsupported. - The type is coded as follows: - 2 = write watchpoint - 3 = read watchpoint - 4 = access watchpoint - */ - - int (*insert_watchpoint) (char type, CORE_ADDR addr, int len); - int (*remove_watchpoint) (char type, CORE_ADDR addr, int len); - - /* Returns 1 if target was stopped due to a watchpoint hit, 0 otherwise. */ - - int (*stopped_by_watchpoint) (void); - - /* Returns the address associated with the watchpoint that hit, if any; - returns 0 otherwise. */ - - CORE_ADDR (*stopped_data_address) (void); - - /* Reports the text, data offsets of the executable. This is - needed for uclinux where the executable is relocated during load - time. */ - - int (*read_offsets) (CORE_ADDR *text, CORE_ADDR *data); -}; - -extern struct target_ops *the_target; - -void set_target_ops (struct target_ops *); - -#define create_inferior(program, args) \ - (*the_target->create_inferior) (program, args) - -#define myattach(pid) \ - (*the_target->attach) (pid) - -#define kill_inferior() \ - (*the_target->kill) () - -#define detach_inferior() \ - (*the_target->detach) () - -#define mythread_alive(pid) \ - (*the_target->thread_alive) (pid) - -#define fetch_inferior_registers(regno) \ - (*the_target->fetch_registers) (regno) - -#define store_inferior_registers(regno) \ - (*the_target->store_registers) (regno) - -unsigned char mywait (char *statusp, int connected_wait); - -int read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len); - -int write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr, - int len); - -void set_desired_inferior (int id); - -#endif /* TARGET_H */ diff --git a/gdb/gdbserver/terminal.h b/gdb/gdbserver/terminal.h deleted file mode 100644 index e2ddef4..0000000 --- a/gdb/gdbserver/terminal.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Terminal interface definitions for the GDB remote server. - Copyright (C) 2002, 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#if !defined (TERMINAL_H) -#define TERMINAL_H 1 - -/* Autoconf will have defined HAVE_TERMIOS_H, HAVE_TERMIO_H, - and HAVE_SGTTY_H for us as appropriate. */ - -#if defined(HAVE_TERMIOS_H) -#define HAVE_TERMIOS -#include <termios.h> -#else /* ! HAVE_TERMIOS_H */ -#if defined(HAVE_TERMIO_H) -#define HAVE_TERMIO -#include <termio.h> - -#undef TIOCGETP -#define TIOCGETP TCGETA -#undef TIOCSETN -#define TIOCSETN TCSETA -#undef TIOCSETP -#define TIOCSETP TCSETAF -#define TERMINAL struct termio -#else /* ! HAVE_TERMIO_H; default to SGTTY. */ -#define HAVE_SGTTY -#include <fcntl.h> -#include <sgtty.h> -#include <sys/ioctl.h> -#define TERMINAL struct sgttyb -#endif -#endif - -#endif /* !defined (TERMINAL_H) */ diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c deleted file mode 100644 index 24531bf..0000000 --- a/gdb/gdbserver/thread-db.c +++ /dev/null @@ -1,365 +0,0 @@ -/* Thread management interface, for the remote server for GDB. - Copyright (C) 2002, 2004, 2005, 2006 - Free Software Foundation, Inc. - - Contributed by MontaVista Software. - - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" - -#include "linux-low.h" - -extern int debug_threads; - -#ifdef HAVE_THREAD_DB_H -#include <thread_db.h> -#endif - -#include "gdb_proc_service.h" - -/* Structure that identifies the child process for the - <proc_service.h> interface. */ -static struct ps_prochandle proc_handle; - -/* Connection to the libthread_db library. */ -static td_thragent_t *thread_agent; - -static int find_new_threads_callback (const td_thrhandle_t *th_p, void *data); - -static char * -thread_db_err_str (td_err_e err) -{ - static char buf[64]; - - switch (err) - { - case TD_OK: - return "generic 'call succeeded'"; - case TD_ERR: - return "generic error"; - case TD_NOTHR: - return "no thread to satisfy query"; - case TD_NOSV: - return "no sync handle to satisfy query"; - case TD_NOLWP: - return "no LWP to satisfy query"; - case TD_BADPH: - return "invalid process handle"; - case TD_BADTH: - return "invalid thread handle"; - case TD_BADSH: - return "invalid synchronization handle"; - case TD_BADTA: - return "invalid thread agent"; - case TD_BADKEY: - return "invalid key"; - case TD_NOMSG: - return "no event message for getmsg"; - case TD_NOFPREGS: - return "FPU register set not available"; - case TD_NOLIBTHREAD: - return "application not linked with libthread"; - case TD_NOEVENT: - return "requested event is not supported"; - case TD_NOCAPAB: - return "capability not available"; - case TD_DBERR: - return "debugger service failed"; - case TD_NOAPLIC: - return "operation not applicable to"; - case TD_NOTSD: - return "no thread-specific data for this thread"; - case TD_MALLOC: - return "malloc failed"; - case TD_PARTIALREG: - return "only part of register set was written/read"; - case TD_NOXREGS: - return "X register set not available for this thread"; -#ifdef HAVE_TD_VERSION - case TD_VERSION: - return "version mismatch between libthread_db and libpthread"; -#endif - default: - snprintf (buf, sizeof (buf), "unknown thread_db error '%d'", err); - return buf; - } -} - -#if 0 -static char * -thread_db_state_str (td_thr_state_e state) -{ - static char buf[64]; - - switch (state) - { - case TD_THR_STOPPED: - return "stopped by debugger"; - case TD_THR_RUN: - return "runnable"; - case TD_THR_ACTIVE: - return "active"; - case TD_THR_ZOMBIE: - return "zombie"; - case TD_THR_SLEEP: - return "sleeping"; - case TD_THR_STOPPED_ASLEEP: - return "stopped by debugger AND blocked"; - default: - snprintf (buf, sizeof (buf), "unknown thread_db state %d", state); - return buf; - } -} -#endif - -static void -thread_db_create_event (CORE_ADDR where) -{ - td_event_msg_t msg; - td_err_e err; - struct inferior_linux_data *tdata; - - if (debug_threads) - fprintf (stderr, "Thread creation event.\n"); - - tdata = inferior_target_data (current_inferior); - - /* FIXME: This assumes we don't get another event. - In the LinuxThreads implementation, this is safe, - because all events come from the manager thread - (except for its own creation, of course). */ - err = td_ta_event_getmsg (thread_agent, &msg); - if (err != TD_OK) - fprintf (stderr, "thread getmsg err: %s\n", - thread_db_err_str (err)); - - /* msg.event == TD_EVENT_CREATE */ - - find_new_threads_callback (msg.th_p, NULL); -} - -#if 0 -static void -thread_db_death_event (CORE_ADDR where) -{ - if (debug_threads) - fprintf (stderr, "Thread death event.\n"); -} -#endif - -static int -thread_db_enable_reporting () -{ - td_thr_events_t events; - td_notify_t notify; - td_err_e err; - - /* Set the process wide mask saying which events we're interested in. */ - td_event_emptyset (&events); - td_event_addset (&events, TD_CREATE); - -#if 0 - /* This is reported to be broken in glibc 2.1.3. A different approach - will be necessary to support that. */ - td_event_addset (&events, TD_DEATH); -#endif - - err = td_ta_set_event (thread_agent, &events); - if (err != TD_OK) - { - warning ("Unable to set global thread event mask: %s", - thread_db_err_str (err)); - return 0; - } - - /* Get address for thread creation breakpoint. */ - err = td_ta_event_addr (thread_agent, TD_CREATE, ¬ify); - if (err != TD_OK) - { - warning ("Unable to get location for thread creation breakpoint: %s", - thread_db_err_str (err)); - return 0; - } - set_breakpoint_at ((CORE_ADDR) (unsigned long) notify.u.bptaddr, - thread_db_create_event); - -#if 0 - /* Don't concern ourselves with reported thread deaths, only - with actual thread deaths (via wait). */ - - /* Get address for thread death breakpoint. */ - err = td_ta_event_addr (thread_agent, TD_DEATH, ¬ify); - if (err != TD_OK) - { - warning ("Unable to get location for thread death breakpoint: %s", - thread_db_err_str (err)); - return; - } - set_breakpoint_at ((CORE_ADDR) (unsigned long) notify.u.bptaddr, - thread_db_death_event); -#endif - - return 1; -} - -static void -maybe_attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p) -{ - td_err_e err; - struct thread_info *inferior; - struct process_info *process; - - /* If we are attaching to our first thread, things are a little - different. */ - if (all_threads.head == all_threads.tail) - { - inferior = (struct thread_info *) all_threads.head; - process = get_thread_process (inferior); - if (process->thread_known == 0) - { - /* Switch to indexing the threads list by TID. */ - change_inferior_id (&all_threads, ti_p->ti_tid); - goto found; - } - } - - inferior = (struct thread_info *) find_inferior_id (&all_threads, - ti_p->ti_tid); - if (inferior != NULL) - return; - - if (debug_threads) - fprintf (stderr, "Attaching to thread %ld (LWP %d)\n", - ti_p->ti_tid, ti_p->ti_lid); - linux_attach_lwp (ti_p->ti_lid, ti_p->ti_tid); - inferior = (struct thread_info *) find_inferior_id (&all_threads, - ti_p->ti_tid); - if (inferior == NULL) - { - warning ("Could not attach to thread %ld (LWP %d)\n", - ti_p->ti_tid, ti_p->ti_lid); - return; - } - - process = inferior_target_data (inferior); - -found: - new_thread_notify (ti_p->ti_tid); - - process->tid = ti_p->ti_tid; - process->lwpid = ti_p->ti_lid; - - process->thread_known = 1; - err = td_thr_event_enable (th_p, 1); - if (err != TD_OK) - error ("Cannot enable thread event reporting for %d: %s", - ti_p->ti_lid, thread_db_err_str (err)); -} - -static int -find_new_threads_callback (const td_thrhandle_t *th_p, void *data) -{ - td_thrinfo_t ti; - td_err_e err; - - err = td_thr_get_info (th_p, &ti); - if (err != TD_OK) - error ("Cannot get thread info: %s", thread_db_err_str (err)); - - /* Check for zombies. */ - if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE) - return 0; - - maybe_attach_thread (th_p, &ti); - - return 0; -} - -static void -thread_db_find_new_threads (void) -{ - td_err_e err; - - /* Iterate over all user-space threads to discover new threads. */ - err = td_ta_thr_iter (thread_agent, find_new_threads_callback, NULL, - TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY, - TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); - if (err != TD_OK) - error ("Cannot find new threads: %s", thread_db_err_str (err)); -} - -/* Cache all future symbols that thread_db might request. We can not - request symbols at arbitrary states in the remote protocol, only - when the client tells us that new symbols are available. So when - we load the thread library, make sure to check the entire list. */ - -static void -thread_db_look_up_symbols (void) -{ - const char **sym_list = td_symbol_list (); - CORE_ADDR unused; - - for (sym_list = td_symbol_list (); *sym_list; sym_list++) - look_up_one_symbol (*sym_list, &unused); -} - -int -thread_db_init () -{ - int err; - - /* FIXME drow/2004-10-16: This is the "overall process ID", which - GNU/Linux calls tgid, "thread group ID". When we support - attaching to threads, the original thread may not be the correct - thread. We would have to get the process ID from /proc for NPTL. - For LinuxThreads we could do something similar: follow the chain - of parent processes until we find the highest one we're attached - to, and use its tgid. - - This isn't the only place in gdbserver that assumes that the first - process in the list is the thread group leader. */ - proc_handle.pid = ((struct inferior_list_entry *)current_inferior)->id; - - /* Allow new symbol lookups. */ - all_symbols_looked_up = 0; - - err = td_ta_new (&proc_handle, &thread_agent); - switch (err) - { - case TD_NOLIBTHREAD: - /* No thread library was detected. */ - return 0; - - case TD_OK: - /* The thread library was detected. */ - - if (thread_db_enable_reporting () == 0) - return 0; - thread_db_find_new_threads (); - thread_db_look_up_symbols (); - all_symbols_looked_up = 1; - return 1; - - default: - warning ("error initializing thread_db library: %s", - thread_db_err_str (err)); - } - - return 0; -} diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c deleted file mode 100644 index ec7ed7c..0000000 --- a/gdb/gdbserver/utils.c +++ /dev/null @@ -1,96 +0,0 @@ -/* General utility routines for the remote server for GDB. - Copyright (C) 1986, 1989, 1993, 1995, 1996, 1997, 1999, 2000, 2002, 2003 - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include <stdio.h> -#include <string.h> - -/* Generally useful subroutines used throughout the program. */ - -/* Print the system error message for errno, and also mention STRING - as the file name for which the error was encountered. - Then return to command level. */ - -void -perror_with_name (char *string) -{ -#ifndef STDC_HEADERS - extern int errno; -#endif - const char *err; - char *combined; - - err = strerror (errno); - if (err == NULL) - err = "unknown error"; - - combined = (char *) alloca (strlen (err) + strlen (string) + 3); - strcpy (combined, string); - strcat (combined, ": "); - strcat (combined, err); - - error ("%s.", combined); -} - -/* Print an error message and return to command level. - STRING is the error message, used as a fprintf string, - and ARG is passed as an argument to it. */ - -void -error (const char *string,...) -{ - extern jmp_buf toplevel; - va_list args; - va_start (args, string); - fflush (stdout); - vfprintf (stderr, string, args); - fprintf (stderr, "\n"); - longjmp (toplevel, 1); -} - -/* Print an error message and exit reporting failure. - This is for a error that we cannot continue from. - STRING and ARG are passed to fprintf. */ - -/* VARARGS */ -void -fatal (const char *string,...) -{ - va_list args; - va_start (args, string); - fprintf (stderr, "gdb: "); - vfprintf (stderr, string, args); - fprintf (stderr, "\n"); - va_end (args); - exit (1); -} - -/* VARARGS */ -void -warning (const char *string,...) -{ - va_list args; - va_start (args, string); - fprintf (stderr, "gdb: "); - vfprintf (stderr, string, args); - fprintf (stderr, "\n"); - va_end (args); -} diff --git a/gdb/gdbserver/win32-i386-low.c b/gdb/gdbserver/win32-i386-low.c deleted file mode 100644 index de6ef0b..0000000 --- a/gdb/gdbserver/win32-i386-low.c +++ /dev/null @@ -1,1077 +0,0 @@ -/* Low level interface to Windows debugging, for gdbserver. - Copyright (C) 2006 - Free Software Foundation, Inc. - - Contributed by Leo Zayas. Based on "win32-nat.c" from GDB. - - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -#include "server.h" -#include "regcache.h" -#include "gdb/signals.h" - -#include <windows.h> -#include <imagehlp.h> -#include <psapi.h> -#include <sys/param.h> -#include <malloc.h> -#include <process.h> - -#ifndef USE_WIN32API -#include <sys/cygwin.h> -#endif - -#define LOG 0 - -#define OUTMSG(X) do { printf X; fflush (stdout); } while (0) -#if LOG -#define OUTMSG2(X) do { printf X; fflush (stdout); } while (0) -#else -#define OUTMSG2(X) -#endif - -int debug_threads; -int using_threads = 1; - -/* Globals. */ -static HANDLE current_process_handle = NULL; -static DWORD current_process_id = 0; -static enum target_signal last_sig = TARGET_SIGNAL_0; - -/* The current debug event from WaitForDebugEvent. */ -static DEBUG_EVENT current_event; - -static int debug_registers_changed = 0; -static int debug_registers_used = 0; -static unsigned dr[8]; - -typedef BOOL winapi_DebugActiveProcessStop (DWORD dwProcessId); -typedef BOOL winapi_DebugSetProcessKillOnExit (BOOL KillOnExit); - -#define FLAG_TRACE_BIT 0x100 -#define CONTEXT_DEBUGGER (CONTEXT_FULL | CONTEXT_FLOATING_POINT) -#define CONTEXT_DEBUGGER_DR CONTEXT_DEBUGGER | CONTEXT_DEBUG_REGISTERS \ - | CONTEXT_EXTENDED_REGISTERS - -/* Thread information structure used to track extra information about - each thread. */ -typedef struct thread_info_struct -{ - DWORD tid; - HANDLE h; - int suspend_count; - CONTEXT context; -} thread_info; -static DWORD main_thread_id = 0; - -/* Get the thread ID from the current selected inferior (the current - thread). */ -static DWORD -current_inferior_tid (void) -{ - thread_info *th = inferior_target_data (current_inferior); - return th->tid; -} - -/* Find a thread record given a thread id. If GET_CONTEXT is set then - also retrieve the context for this thread. */ -static thread_info * -thread_rec (DWORD id, int get_context) -{ - struct thread_info *thread; - thread_info *th; - - thread = (struct thread_info *) find_inferior_id (&all_threads, id); - if (thread == NULL) - return NULL; - - th = inferior_target_data (thread); - if (!th->suspend_count && get_context) - { - if (get_context > 0 && id != current_event.dwThreadId) - th->suspend_count = SuspendThread (th->h) + 1; - else if (get_context < 0) - th->suspend_count = -1; - - th->context.ContextFlags = CONTEXT_DEBUGGER_DR; - - GetThreadContext (th->h, &th->context); - - if (id == current_event.dwThreadId) - { - /* Copy dr values from that thread. */ - dr[0] = th->context.Dr0; - dr[1] = th->context.Dr1; - dr[2] = th->context.Dr2; - dr[3] = th->context.Dr3; - dr[6] = th->context.Dr6; - dr[7] = th->context.Dr7; - } - } - - return th; -} - -/* Add a thread to the thread list. */ -static thread_info * -child_add_thread (DWORD tid, HANDLE h) -{ - thread_info *th; - - if ((th = thread_rec (tid, FALSE))) - return th; - - th = (thread_info *) malloc (sizeof (*th)); - memset (th, 0, sizeof (*th)); - th->tid = tid; - th->h = h; - - add_thread (tid, th, (unsigned int) tid); - set_inferior_regcache_data ((struct thread_info *) - find_inferior_id (&all_threads, tid), - new_register_cache ()); - - /* Set the debug registers for the new thread if they are used. */ - if (debug_registers_used) - { - /* Only change the value of the debug registers. */ - th->context.ContextFlags = CONTEXT_DEBUGGER_DR; - - GetThreadContext (th->h, &th->context); - - th->context.Dr0 = dr[0]; - th->context.Dr1 = dr[1]; - th->context.Dr2 = dr[2]; - th->context.Dr3 = dr[3]; - /* th->context.Dr6 = dr[6]; - FIXME: should we set dr6 also ?? */ - th->context.Dr7 = dr[7]; - SetThreadContext (th->h, &th->context); - th->context.ContextFlags = 0; - } - - return th; -} - -/* Delete a thread from the list of threads. */ -static void -delete_thread_info (struct inferior_list_entry *thread) -{ - thread_info *th = inferior_target_data ((struct thread_info *) thread); - - remove_thread ((struct thread_info *) thread); - CloseHandle (th->h); - free (th); -} - -/* Delete a thread from the list of threads. */ -static void -child_delete_thread (DWORD id) -{ - struct inferior_list_entry *thread; - - /* If the last thread is exiting, just return. */ - if (all_threads.head == all_threads.tail) - return; - - thread = find_inferior_id (&all_threads, id); - if (thread == NULL) - return; - - delete_thread_info (thread); -} - -/* Transfer memory from/to the debugged process. */ -static int -child_xfer_memory (CORE_ADDR memaddr, char *our, int len, - int write, struct target_ops *target) -{ - SIZE_T done; - long addr = (long) memaddr; - - if (write) - { - WriteProcessMemory (current_process_handle, (LPVOID) addr, - (LPCVOID) our, len, &done); - FlushInstructionCache (current_process_handle, (LPCVOID) addr, len); - } - else - { - ReadProcessMemory (current_process_handle, (LPCVOID) addr, (LPVOID) our, - len, &done); - } - return done; -} - -/* Generally, what has the program done? */ -enum target_waitkind -{ - /* The program has exited. The exit status is in value.integer. */ - TARGET_WAITKIND_EXITED, - - /* The program has stopped with a signal. Which signal is in - value.sig. */ - TARGET_WAITKIND_STOPPED, - - /* The program is letting us know that it dynamically loaded something - (e.g. it called load(2) on AIX). */ - TARGET_WAITKIND_LOADED, - - /* The program has exec'ed a new executable file. The new file's - pathname is pointed to by value.execd_pathname. */ - - TARGET_WAITKIND_EXECD, - - /* Nothing happened, but we stopped anyway. This perhaps should be handled - within target_wait, but I'm not sure target_wait should be resuming the - inferior. */ - TARGET_WAITKIND_SPURIOUS, -}; - -struct target_waitstatus -{ - enum target_waitkind kind; - - /* Forked child pid, execd pathname, exit status or signal number. */ - union - { - int integer; - enum target_signal sig; - int related_pid; - char *execd_pathname; - int syscall_id; - } - value; -}; - -#define NUM_REGS 41 -#define FCS_REGNUM 27 -#define FOP_REGNUM 31 - -#define context_offset(x) ((int)&(((CONTEXT *)NULL)->x)) -static const int mappings[] = { - context_offset (Eax), - context_offset (Ecx), - context_offset (Edx), - context_offset (Ebx), - context_offset (Esp), - context_offset (Ebp), - context_offset (Esi), - context_offset (Edi), - context_offset (Eip), - context_offset (EFlags), - context_offset (SegCs), - context_offset (SegSs), - context_offset (SegDs), - context_offset (SegEs), - context_offset (SegFs), - context_offset (SegGs), - context_offset (FloatSave.RegisterArea[0 * 10]), - context_offset (FloatSave.RegisterArea[1 * 10]), - context_offset (FloatSave.RegisterArea[2 * 10]), - context_offset (FloatSave.RegisterArea[3 * 10]), - context_offset (FloatSave.RegisterArea[4 * 10]), - context_offset (FloatSave.RegisterArea[5 * 10]), - context_offset (FloatSave.RegisterArea[6 * 10]), - context_offset (FloatSave.RegisterArea[7 * 10]), - context_offset (FloatSave.ControlWord), - context_offset (FloatSave.StatusWord), - context_offset (FloatSave.TagWord), - context_offset (FloatSave.ErrorSelector), - context_offset (FloatSave.ErrorOffset), - context_offset (FloatSave.DataSelector), - context_offset (FloatSave.DataOffset), - context_offset (FloatSave.ErrorSelector), - /* XMM0-7 */ - context_offset (ExtendedRegisters[10 * 16]), - context_offset (ExtendedRegisters[11 * 16]), - context_offset (ExtendedRegisters[12 * 16]), - context_offset (ExtendedRegisters[13 * 16]), - context_offset (ExtendedRegisters[14 * 16]), - context_offset (ExtendedRegisters[15 * 16]), - context_offset (ExtendedRegisters[16 * 16]), - context_offset (ExtendedRegisters[17 * 16]), - /* MXCSR */ - context_offset (ExtendedRegisters[24]) -}; - -#undef context_offset - -/* Clear out any old thread list and reintialize it to a pristine - state. */ -static void -child_init_thread_list (void) -{ - for_each_inferior (&all_threads, delete_thread_info); -} - -static void -do_initial_child_stuff (DWORD pid) -{ - int i; - - last_sig = TARGET_SIGNAL_0; - - debug_registers_changed = 0; - debug_registers_used = 0; - for (i = 0; i < sizeof (dr) / sizeof (dr[0]); i++) - dr[i] = 0; - memset (¤t_event, 0, sizeof (current_event)); - - child_init_thread_list (); -} - -/* Resume all artificially suspended threads if we are continuing - execution. */ -static int -continue_one_thread (struct inferior_list_entry *this_thread, void *id_ptr) -{ - struct thread_info *thread = (struct thread_info *) this_thread; - int thread_id = * (int *) id_ptr; - thread_info *th = inferior_target_data (thread); - int i; - - if ((thread_id == -1 || thread_id == th->tid) - && th->suspend_count) - { - for (i = 0; i < th->suspend_count; i++) - (void) ResumeThread (th->h); - th->suspend_count = 0; - if (debug_registers_changed) - { - /* Only change the value of the debug registers. */ - th->context.ContextFlags = CONTEXT_DEBUG_REGISTERS; - th->context.Dr0 = dr[0]; - th->context.Dr1 = dr[1]; - th->context.Dr2 = dr[2]; - th->context.Dr3 = dr[3]; - /* th->context.Dr6 = dr[6]; - FIXME: should we set dr6 also ?? */ - th->context.Dr7 = dr[7]; - SetThreadContext (th->h, &th->context); - th->context.ContextFlags = 0; - } - } - - return 0; -} - -static BOOL -child_continue (DWORD continue_status, int thread_id) -{ - BOOL res; - - res = ContinueDebugEvent (current_event.dwProcessId, - current_event.dwThreadId, continue_status); - continue_status = 0; - if (res) - find_inferior (&all_threads, continue_one_thread, &thread_id); - - debug_registers_changed = 0; - return res; -} - -/* Fetch register(s) from gdbserver regcache data. */ -static void -do_child_fetch_inferior_registers (thread_info *th, int r) -{ - char *context_offset = ((char *) &th->context) + mappings[r]; - long l; - if (r == FCS_REGNUM) - { - l = *((long *) context_offset) & 0xffff; - supply_register (r, (char *) &l); - } - else if (r == FOP_REGNUM) - { - l = (*((long *) context_offset) >> 16) & ((1 << 11) - 1); - supply_register (r, (char *) &l); - } - else - supply_register (r, context_offset); -} - -/* Fetch register(s) from the current thread context. */ -static void -child_fetch_inferior_registers (int r) -{ - int regno; - thread_info *th = thread_rec (current_inferior_tid (), TRUE); - if (r == -1 || r == 0 || r > NUM_REGS) - child_fetch_inferior_registers (NUM_REGS); - else - for (regno = 0; regno < r; regno++) - do_child_fetch_inferior_registers (th, regno); -} - -/* Get register from gdbserver regcache data. */ -static void -do_child_store_inferior_registers (thread_info *th, int r) -{ - collect_register (r, ((char *) &th->context) + mappings[r]); -} - -/* Store a new register value into the current thread context. We don't - change the program's context until later, when we resume it. */ -static void -child_store_inferior_registers (int r) -{ - int regno; - thread_info *th = thread_rec (current_inferior_tid (), TRUE); - if (r == -1 || r == 0 || r > NUM_REGS) - child_store_inferior_registers (NUM_REGS); - else - for (regno = 0; regno < r; regno++) - do_child_store_inferior_registers (th, regno); -} - -/* Start a new process. - PROGRAM is a path to the program to execute. - ARGS is a standard NULL-terminated array of arguments, - to be passed to the inferior as ``argv''. - Returns the new PID on success, -1 on failure. Registers the new - process with the process list. */ -static int -win32_create_inferior (char *program, char **program_args) -{ -#ifndef USE_WIN32API - char real_path[MAXPATHLEN]; - char *orig_path, *new_path, *path_ptr; -#endif - char *winenv = NULL; - STARTUPINFO si; - PROCESS_INFORMATION pi; - BOOL ret; - DWORD flags; - char *args; - int argslen; - int argc; - - if (!program) - error ("No executable specified, specify executable to debug.\n"); - - memset (&si, 0, sizeof (si)); - si.cb = sizeof (si); - - flags = DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS; - -#ifndef USE_WIN32API - orig_path = NULL; - path_ptr = getenv ("PATH"); - if (path_ptr) - { - orig_path = alloca (strlen (path_ptr) + 1); - new_path = alloca (cygwin_posix_to_win32_path_list_buf_size (path_ptr)); - strcpy (orig_path, path_ptr); - cygwin_posix_to_win32_path_list (path_ptr, new_path); - setenv ("PATH", new_path, 1); - } - cygwin_conv_to_win32_path (program, real_path); - program = real_path; -#endif - - argslen = strlen (program) + 1; - for (argc = 1; program_args[argc]; argc++) - argslen += strlen (program_args[argc]) + 1; - args = alloca (argslen); - strcpy (args, program); - for (argc = 1; program_args[argc]; argc++) - { - /* FIXME: Can we do better about quoting? How does Cygwin - handle this? */ - strcat (args, " "); - strcat (args, program_args[argc]); - } - OUTMSG2 (("Command line is %s\n", args)); - - flags |= CREATE_NEW_PROCESS_GROUP; - - ret = CreateProcess (0, args, /* command line */ - NULL, /* Security */ - NULL, /* thread */ - TRUE, /* inherit handles */ - flags, /* start flags */ - winenv, NULL, /* current directory */ - &si, &pi); - -#ifndef USE_WIN32API - if (orig_path) - setenv ("PATH", orig_path, 1); -#endif - - if (!ret) - { - error ("Error creating process %s, (error %d): %s\n", args, - (int) GetLastError (), strerror (GetLastError ())); - } - else - { - OUTMSG2 (("Process created: %s\n", (char *) args)); - } - - CloseHandle (pi.hThread); - - current_process_handle = pi.hProcess; - current_process_id = pi.dwProcessId; - - do_initial_child_stuff (current_process_id); - - return current_process_id; -} - -/* Attach to a running process. - PID is the process ID to attach to, specified by the user - or a higher layer. */ -static int -win32_attach (unsigned long pid) -{ - int res = 0; - HMODULE kernel32 = LoadLibrary ("KERNEL32.DLL"); - winapi_DebugActiveProcessStop *DebugActiveProcessStop = NULL; - winapi_DebugSetProcessKillOnExit *DebugSetProcessKillOnExit = NULL; - - DebugActiveProcessStop = - (winapi_DebugActiveProcessStop *) GetProcAddress (kernel32, - "DebugActiveProcessStop"); - DebugSetProcessKillOnExit = - (winapi_DebugSetProcessKillOnExit *) GetProcAddress (kernel32, - "DebugSetProcessKillOnExit"); - - res = DebugActiveProcess (pid) ? 1 : 0; - - if (!res) - error ("Attach to process failed."); - - if (DebugSetProcessKillOnExit != NULL) - DebugSetProcessKillOnExit (FALSE); - - current_process_id = pid; - current_process_handle = OpenProcess (PROCESS_ALL_ACCESS, FALSE, pid); - - if (current_process_handle == NULL) - { - res = 0; - if (DebugActiveProcessStop != NULL) - DebugActiveProcessStop (current_process_id); - } - - if (res) - do_initial_child_stuff (pid); - - FreeLibrary (kernel32); - - return res; -} - -/* Kill all inferiors. */ -static void -win32_kill (void) -{ - TerminateProcess (current_process_handle, 0); - for (;;) - { - if (!child_continue (DBG_CONTINUE, -1)) - break; - if (!WaitForDebugEvent (¤t_event, INFINITE)) - break; - if (current_event.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT) - break; - } -} - -/* Detach from all inferiors. */ -static void -win32_detach (void) -{ - HMODULE kernel32 = LoadLibrary ("KERNEL32.DLL"); - winapi_DebugActiveProcessStop *DebugActiveProcessStop = NULL; - winapi_DebugSetProcessKillOnExit *DebugSetProcessKillOnExit = NULL; - - DebugActiveProcessStop = - (winapi_DebugActiveProcessStop *) GetProcAddress (kernel32, - "DebugActiveProcessStop"); - DebugSetProcessKillOnExit = - (winapi_DebugSetProcessKillOnExit *) GetProcAddress (kernel32, - "DebugSetProcessKillOnExit"); - - if (DebugSetProcessKillOnExit != NULL) - DebugSetProcessKillOnExit (FALSE); - - if (DebugActiveProcessStop != NULL) - DebugActiveProcessStop (current_process_id); - else - win32_kill (); - - FreeLibrary (kernel32); -} - -/* Return 1 iff the thread with thread ID TID is alive. */ -static int -win32_thread_alive (unsigned long tid) -{ - int res; - - /* Our thread list is reliable; don't bother to poll target - threads. */ - if (find_inferior_id (&all_threads, tid) != NULL) - res = 1; - else - res = 0; - return res; -} - -/* Resume the inferior process. RESUME_INFO describes how we want - to resume. */ -static void -win32_resume (struct thread_resume *resume_info) -{ - DWORD tid; - enum target_signal sig; - int step; - thread_info *th; - DWORD continue_status = DBG_CONTINUE; - - /* This handles the very limited set of resume packets that GDB can - currently produce. */ - - if (resume_info[0].thread == -1) - tid = -1; - else if (resume_info[1].thread == -1 && !resume_info[1].leave_stopped) - tid = -1; - else - /* Yes, we're ignoring resume_info[0].thread. It'd be tricky to make - the Windows resume code do the right thing for thread switching. */ - tid = current_event.dwThreadId; - - if (resume_info[0].thread != -1) - { - sig = resume_info[0].sig; - step = resume_info[0].step; - } - else - { - sig = 0; - step = 0; - } - - if (sig != TARGET_SIGNAL_0) - { - if (current_event.dwDebugEventCode != EXCEPTION_DEBUG_EVENT) - { - OUTMSG (("Cannot continue with signal %d here.\n", sig)); - } - else if (sig == last_sig) - continue_status = DBG_EXCEPTION_NOT_HANDLED; - else - OUTMSG (("Can only continue with recieved signal %d.\n", last_sig)); - } - - last_sig = TARGET_SIGNAL_0; - - /* Get context for the currently selected thread. */ - th = thread_rec (current_event.dwThreadId, FALSE); - if (th) - { - if (th->context.ContextFlags) - { - if (debug_registers_changed) - { - th->context.Dr0 = dr[0]; - th->context.Dr1 = dr[1]; - th->context.Dr2 = dr[2]; - th->context.Dr3 = dr[3]; - /* th->context.Dr6 = dr[6]; - FIXME: should we set dr6 also ?? */ - th->context.Dr7 = dr[7]; - } - - /* Move register values from the inferior into the thread - context structure. */ - regcache_invalidate (); - - if (step) - th->context.EFlags |= FLAG_TRACE_BIT; - - SetThreadContext (th->h, &th->context); - th->context.ContextFlags = 0; - } - } - - /* Allow continuing with the same signal that interrupted us. - Otherwise complain. */ - - child_continue (continue_status, tid); -} - -static int -handle_exception (struct target_waitstatus *ourstatus) -{ - thread_info *th; - DWORD code = current_event.u.Exception.ExceptionRecord.ExceptionCode; - - ourstatus->kind = TARGET_WAITKIND_STOPPED; - - /* Record the context of the current thread. */ - th = thread_rec (current_event.dwThreadId, -1); - - switch (code) - { - case EXCEPTION_ACCESS_VIOLATION: - OUTMSG2 (("EXCEPTION_ACCESS_VIOLATION")); - ourstatus->value.sig = TARGET_SIGNAL_SEGV; - break; - case STATUS_STACK_OVERFLOW: - OUTMSG2 (("STATUS_STACK_OVERFLOW")); - ourstatus->value.sig = TARGET_SIGNAL_SEGV; - break; - case STATUS_FLOAT_DENORMAL_OPERAND: - OUTMSG2 (("STATUS_FLOAT_DENORMAL_OPERAND")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: - OUTMSG2 (("EXCEPTION_ARRAY_BOUNDS_EXCEEDED")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_INEXACT_RESULT: - OUTMSG2 (("STATUS_FLOAT_INEXACT_RESULT")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_INVALID_OPERATION: - OUTMSG2 (("STATUS_FLOAT_INVALID_OPERATION")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_OVERFLOW: - OUTMSG2 (("STATUS_FLOAT_OVERFLOW")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_STACK_CHECK: - OUTMSG2 (("STATUS_FLOAT_STACK_CHECK")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_UNDERFLOW: - OUTMSG2 (("STATUS_FLOAT_UNDERFLOW")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_FLOAT_DIVIDE_BY_ZERO: - OUTMSG2 (("STATUS_FLOAT_DIVIDE_BY_ZERO")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_INTEGER_DIVIDE_BY_ZERO: - OUTMSG2 (("STATUS_INTEGER_DIVIDE_BY_ZERO")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case STATUS_INTEGER_OVERFLOW: - OUTMSG2 (("STATUS_INTEGER_OVERFLOW")); - ourstatus->value.sig = TARGET_SIGNAL_FPE; - break; - case EXCEPTION_BREAKPOINT: - OUTMSG2 (("EXCEPTION_BREAKPOINT")); - ourstatus->value.sig = TARGET_SIGNAL_TRAP; - break; - case DBG_CONTROL_C: - OUTMSG2 (("DBG_CONTROL_C")); - ourstatus->value.sig = TARGET_SIGNAL_INT; - break; - case DBG_CONTROL_BREAK: - OUTMSG2 (("DBG_CONTROL_BREAK")); - ourstatus->value.sig = TARGET_SIGNAL_INT; - break; - case EXCEPTION_SINGLE_STEP: - OUTMSG2 (("EXCEPTION_SINGLE_STEP")); - ourstatus->value.sig = TARGET_SIGNAL_TRAP; - break; - case EXCEPTION_ILLEGAL_INSTRUCTION: - OUTMSG2 (("EXCEPTION_ILLEGAL_INSTRUCTION")); - ourstatus->value.sig = TARGET_SIGNAL_ILL; - break; - case EXCEPTION_PRIV_INSTRUCTION: - OUTMSG2 (("EXCEPTION_PRIV_INSTRUCTION")); - ourstatus->value.sig = TARGET_SIGNAL_ILL; - break; - case EXCEPTION_NONCONTINUABLE_EXCEPTION: - OUTMSG2 (("EXCEPTION_NONCONTINUABLE_EXCEPTION")); - ourstatus->value.sig = TARGET_SIGNAL_ILL; - break; - default: - if (current_event.u.Exception.dwFirstChance) - return 0; - OUTMSG2 (("gdbserver: unknown target exception 0x%08lx at 0x%08lx", - current_event.u.Exception.ExceptionRecord.ExceptionCode, - (DWORD) current_event.u.Exception.ExceptionRecord. - ExceptionAddress)); - ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN; - break; - } - OUTMSG2 (("\n")); - last_sig = ourstatus->value.sig; - return 1; -} - -/* Get the next event from the child. Return 1 if the event requires - handling. */ -static int -get_child_debug_event (struct target_waitstatus *ourstatus) -{ - BOOL debug_event; - DWORD continue_status, event_code; - thread_info *th = NULL; - static thread_info dummy_thread_info; - int retval = 0; - -in: - - last_sig = TARGET_SIGNAL_0; - ourstatus->kind = TARGET_WAITKIND_SPURIOUS; - - if (!(debug_event = WaitForDebugEvent (¤t_event, 1000))) - goto out; - - current_inferior = - (struct thread_info *) find_inferior_id (&all_threads, - current_event.dwThreadId); - - continue_status = DBG_CONTINUE; - event_code = current_event.dwDebugEventCode; - - switch (event_code) - { - case CREATE_THREAD_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event CREATE_THREAD_DEBUG_EVENT " - "for pid=%d tid=%x)\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - - /* Record the existence of this thread. */ - th = child_add_thread (current_event.dwThreadId, - current_event.u.CreateThread.hThread); - - retval = current_event.dwThreadId; - break; - - case EXIT_THREAD_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event EXIT_THREAD_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - child_delete_thread (current_event.dwThreadId); - th = &dummy_thread_info; - break; - - case CREATE_PROCESS_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event CREATE_PROCESS_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - CloseHandle (current_event.u.CreateProcessInfo.hFile); - - current_process_handle = current_event.u.CreateProcessInfo.hProcess; - main_thread_id = current_event.dwThreadId; - - ourstatus->kind = TARGET_WAITKIND_EXECD; - ourstatus->value.execd_pathname = "Main executable"; - - /* Add the main thread. */ - th = - child_add_thread (main_thread_id, - current_event.u.CreateProcessInfo.hThread); - - retval = ourstatus->value.related_pid = current_event.dwThreadId; - break; - - case EXIT_PROCESS_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event EXIT_PROCESS_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - ourstatus->kind = TARGET_WAITKIND_EXITED; - ourstatus->value.integer = current_event.u.ExitProcess.dwExitCode; - CloseHandle (current_process_handle); - retval = main_thread_id; - break; - - case LOAD_DLL_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event LOAD_DLL_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - CloseHandle (current_event.u.LoadDll.hFile); - - ourstatus->kind = TARGET_WAITKIND_LOADED; - ourstatus->value.integer = 0; - retval = main_thread_id; - break; - - case UNLOAD_DLL_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event UNLOAD_DLL_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - break; - - case EXCEPTION_DEBUG_EVENT: - OUTMSG2 (("gdbserver: kernel event EXCEPTION_DEBUG_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - retval = handle_exception (ourstatus); - break; - - case OUTPUT_DEBUG_STRING_EVENT: - /* A message from the kernel (or Cygwin). */ - OUTMSG2 (("gdbserver: kernel event OUTPUT_DEBUG_STRING_EVENT " - "for pid=%d tid=%x\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId)); - break; - - default: - OUTMSG2 (("gdbserver: kernel event unknown " - "for pid=%d tid=%x code=%ld\n", - (unsigned) current_event.dwProcessId, - (unsigned) current_event.dwThreadId, - current_event.dwDebugEventCode)); - break; - } - - current_inferior = - (struct thread_info *) find_inferior_id (&all_threads, - current_event.dwThreadId); - - if (!retval || (event_code != EXCEPTION_DEBUG_EVENT && event_code != EXIT_PROCESS_DEBUG_EVENT)) - { - child_continue (continue_status, -1); - goto in; - } - - if (th == NULL) - thread_rec (current_event.dwThreadId, TRUE); - -out: - return retval; -} - -/* Wait for the inferior process to change state. - STATUS will be filled in with a response code to send to GDB. - Returns the signal which caused the process to stop. */ -static unsigned char -win32_wait (char *status) -{ - struct target_waitstatus our_status; - - *status = 'T'; - - while (1) - { - get_child_debug_event (&our_status); - - if (our_status.kind == TARGET_WAITKIND_EXITED) - { - OUTMSG2 (("Child exited with retcode = %x\n", - our_status.value.integer)); - - *status = 'W'; - - child_fetch_inferior_registers (-1); - - return our_status.value.integer; - } - else if (our_status.kind == TARGET_WAITKIND_STOPPED) - { - OUTMSG2 (("Child Stopped with signal = %x \n", - WSTOPSIG (our_status.value.sig))); - - *status = 'T'; - - child_fetch_inferior_registers (-1); - - return our_status.value.sig; - } - else - OUTMSG (("Ignoring unknown internal event, %d\n", our_status.kind)); - - { - struct thread_resume resume; - resume.thread = -1; - resume.step = 0; - resume.sig = 0; - resume.leave_stopped = 0; - win32_resume (&resume); - } - } -} - -/* Fetch registers from the inferior process. - If REGNO is -1, fetch all registers; otherwise, fetch at least REGNO. */ -static void -win32_fetch_inferior_registers (int regno) -{ - child_fetch_inferior_registers (regno); -} - -/* Store registers to the inferior process. - If REGNO is -1, store all registers; otherwise, store at least REGNO. */ -static void -win32_store_inferior_registers (int regno) -{ - child_store_inferior_registers (regno); -} - -/* Read memory from the inferior process. This should generally be - called through read_inferior_memory, which handles breakpoint shadowing. - Read LEN bytes at MEMADDR into a buffer at MYADDR. */ -static int -win32_read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len) -{ - return child_xfer_memory (memaddr, myaddr, len, 0, 0) != len; -} - -/* Write memory to the inferior process. This should generally be - called through write_inferior_memory, which handles breakpoint shadowing. - Write LEN bytes from the buffer at MYADDR to MEMADDR. - Returns 0 on success and errno on failure. */ -static int -win32_write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr, - int len) -{ - return child_xfer_memory (memaddr, (char *) myaddr, len, 1, 0) != len; -} - -static struct target_ops win32_target_ops = { - win32_create_inferior, - win32_attach, - win32_kill, - win32_detach, - win32_thread_alive, - win32_resume, - win32_wait, - win32_fetch_inferior_registers, - win32_store_inferior_registers, - win32_read_inferior_memory, - win32_write_inferior_memory, - 0, - 0 -}; - -/* Initialize the Win32 backend. */ -void -initialize_low (void) -{ - set_target_ops (&win32_target_ops); - - init_registers (); -} |