* gdbserver/linux-low.c (usr_store_inferior_registers): Support
registers which are allowed to fail to store.
* gdbserver/linux-low.h (linux_target_ops): Likewise.
* gdbserver/linux-ppc-low.c (ppc_regmap): Support FPSCR.
(ppc_cannot_store_register): FPSCR may not be storable.
* regformats/reg-ppc.dat: Support FPSCR.
* 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.
* gdbserver/server.c (main): Call target_signal_to_host_p
and target_signal_to_host on signals received from the remote.
* gdbserver/remote-utils.c (prepare_resume_reply): Call
target_signal_from_host on signals sent to the remote.
* gdbserver/server.h: Add prototypes. Include "gdb/signals.h".
* gdbserver/Makefile.in: Add signals.o. Add -I${INCLUDE_DIR}.
* gdbserver/remote-utils.c (remote_open): Don't call
getprotobyname, we're all using TCP here so just use
IPPROTO_TCP.
* gdbserver/gdbreplay.c (remote_open): Ditto.
* gdbserver/acconfig.h: New file.
* gdbserver/i387-fp.c: New file.
* gdbserver/i387-fp.h: New file.
* gdbserver/linux-x86-64.c: New file.
* regformats/reg-x86-64.dat: New file.
* configure.tgt: Add x86_64-*-linux* gdbserver support.
& gdbserver/configure.srv: Add x86_64-*-linux* and regset support.
* gdbserver/configure.in: Add support for regsets.
* gdbserver/config.in: Regenerate.
* gdbserver/configure: Regenerate.
* gdbserver/Makefile.in: Likewise. Add $(linux_low_h).
* gdbserver/linux-low.h: New file.
* gdbserver/linux-low.c: Include "linux-low.h". Add support
for regsets.
* gdbserver/linux-arm-low.c: Include "linux-low.h".
* gdbserver/linux-ia64-low.c: Include "linux-low.h".
* gdbserver/linux-m68k-low.c: Include "linux-low.h".
* gdbserver/linux-mips-low.c: Include "linux-low.h".
* gdbserver/linux-ppc-low.c: Include "linux-low.h".
* gdbserver/linux-sh-low.c: Include "linux-low.h".
* gdbserver/linux-i386-low.c: Include "linux-low.h". Include
"i387-fp.h". Add PTRACE_GETREGS and friends.
* gdbserver/regcache.c (supply_register): New function.
(supply_register_by_name): New function.
(collect_register): New function.
(collect_register_by_name): New function.
* regformats/reg-i386-linux.dat: New file, with $orig_eax.
* gdbserver/Makefile.in: Add rules for reg-i386-linux.o.
* gdbserver/configure.srv: Change i386-*-linux* to use
reg-i386-linux.o.
* gdbserver/configure.srv: New file.
* gdbserver/configure.in: Use configure.srv instead
of the host/target makefile fragments. Set GDBSERVER_DEPFILES
from it.
* gdbserver/configure: Regenerated.
* gdbserver/terminal.h: New file.
* gdbserver/Makefile.in: Update for configure changes. Remove
more unneeded include paths.
* gdbserver/Makefile.in: Add regformats directory to INCLUDE_CFLAGS,
and remove unused $(INCLUDE_DIR).
Add regcache.c to OBS.
Add generated register protocol files to clean target.
Update dependencies for new objects, obsolete old target code.
* gdbserver/linux-low.c: Remove all platform-specific code to
new files. Remove various dead code. Update to use regcache
functionality.
* gdbserver/remote-utils.c (fromhex): Add return statement
to quiet warning.
(putpkt): Dynamically allocate buf2 because PBUFSIZ is no longer
constant.
(input_interrupt): Add integer parameter to match prototype
of a signal handler.
(outreg): Use register_data ().
(prepare_resume_reply): Use gdbserver_expedite_regs.
* gdbserver/server.c (main): Dynamically allocate own_buf because
PBUFSIZ is no longer constant. Use registers_to_string () and
registers_from_string ().
* gdbserver/server.h: No longer include "defs.h". Add prototypes
for error (), fatal (), and warning (). Update definition of
PBUFSIZ to use regcache functionality. Add include guard.
* gdbserver/utils.c (fatal): Add missing ``const''.
(warning): New function.
* regformats/regdat.sh: Include "regcache.h" in generated files.
Provide init_registers () function.
* regformats/regdef.h: Add prototype for set_register_cache ().
Add include guard.
* gdbserver/linux-arm-low.c: New file.
* gdbserver/linux-i386-low.c: New file.
* gdbserver/linux-ia64-low.c: New file.
* gdbserver/linux-m68k-low.c: New file.
* gdbserver/linux-mips-low.c: New file.
* gdbserver/linux-ppc-low.c: New file.
* gdbserver/linux-sh-low.c: New file.
* gdbserver/regcache.c: New file.
* gdbserver/regcache.h: New file.
* gdbserver/low-linux.c: Removed obsolete file.
of SIGIO.
(input_interrupt): Don't block on read, in case we got redundant
SIGIO. Don't gripe about redundant SIGIO.
* gdbserver/low-hppabsd.c (mywait): Use waitpid(). Enable SIGIO
handler while waiting.
* gdbserver/low-linux.c (mywait): Likewise.
* gdbserver/low-nbsd.c (mywait): Likewise.
* gdbserver/low-sparc.c (mywait): Likewise.
make it work again.
(NUM_FREGS): Redefine to 0.
(NUM_REGS): Redefine as NUM_GREGS.
(i386_register_byte, i386_register_raw_size): Update from
i386-tdep.c. Add comment about their origin.
(regmap, register_u_addr): Take these from i386-linux-nat.c.
(i386_register_u_addr): Removed.
store_inferior_registers): Support older NetBSD/powerpc systems
from before fp reg support was added. Adapt to register number
changes caused when powerpc target was multi-arched.
* config/m68k/tm-m68k.h (NUM_FREGS): m68k-linux patch.
Added NUM_FREGS macro.
* config/m68k/xm-linux.h: m68k-linux patch. New file.
* config/m68k/tm-linux.h: m68k-linux patch. New file.
* config/m68k/nm-linux.h: m68k-linux patch. New file.
* config/m68k/linux.mt: m68k-linux patch. New file.
* config/m68k/linux.mh: m68k-linux patch. New file.
* gdbserver/low-linux.c: m68k-linux patch. Added an ifdef
that checks the value of __GLIBC to decide whether or
not to include sys/reg.h.
* m68klinux-nat.c: m68k-linux patch. New file. Note
both m68k-tdep.c and m68klinux-nat.c contain definitions
for supply_gregset and supply_fpregset. The definitions
in m68k-tdep.c are valid is USE_PROC_FS is defined. Otherwise,
the definitions in m68klinux-nat.c will be used. This is a
bit of a hack. The supply_* routines do not belong in
*_tdep.c files. But, there are several lynx ports that currently
depend on these definitions.
* configure.tgt: m68k-linux patch. Added m68*-*-linux*
gdb_target.
* configure.host: m68k-linux patch. Added m68*-*-linux*
gdb_host.
* Makefile.in: m68k-linux patch. Added compile line for
m68klinux-nat.o
* gdbserver/Makefile.in: add dependency on XM_CLIBS.
* gdbserver/low-sim.c (registers) force into alignment.
(create_inferior): Fix typo on new_argv; add abfd arg to
sim_open, sim_create_inferior. Add reg_size arg to
sim_fetch_register, sim_store_register. Make simulator
take a single-step to get into a known running state.
* gdbserver/gdbreplay.c: include fcntl.h for def'n of F_SETFL.
* gdbserver/server.c: Add remote_debug variable to control
debug output.
* gdbserver/server.h: Add prototypes for enable/disable_async_io.
* gdbserver/remote-utils.c: add verbose debugging output controlled
by "remote_debug" variable. Add call to "disable_async_io()"
to avoid being killed by async SIGIO signals.
* config/m32r/m32r.mt: define GDBSERVER_(LIBS and DEPFILES),
so that gdbserver can be built with the m32r simulator.
* config/tic80/tic80.mt:
(GDBSERVER-DEPFILES, GDBSERVER_LIBS): Define for gdbserver.
(SIM): Remove -lm to prevent make errors.
* configure.tgt: add gdbserver to configdirs for tic80.
end-sanitize-tic80
* gdbserver/utils.c (error): Change prototype to match defs.h.
* gdbserver/low-sim.c: Change simulator calls to use new interface.
* remote.c (remote_write_bytes): Include '$' at start of packet
and checksum at end of packet in overhead calculation.
* configure, configure.in: Allow gdbserver to be configured
for cross-target environments.
* gdbserver/Makefile.in: Add simulator support.
* gdbserver/configure.in: Eliminate assumption that host == target.
Simplify using gdb/configure.tgt and gdb/configure.host.
Fix other minor configuration errors.
* gdbserver/low-sparc.c: Fix compile error.
* gdbserver/remote-utils.c: Eliminate assumption that registers
and addresses are four bytes. Fix minor compile errors and warnings.
* gdbserver/server.c: Rewrite numerous instances of identical code
for starting inferior processes to call new function start_inferior.
Eliminate assumption that registers and addresses are four bytes.
* gdbserver/server.h: Add missing prototypes to eliminate compiler
warnings.
* gdbserver/low-sim.c: New file to mate gdbserver with simulators.
* config/mips/vr5000.mt: Add Vr5000 simulator support to gdbserver.
* config/i386/linux.mh: Eliminate gdbserver support as a first step
in moving such support from host to target makefile fragments.
* config/i386/linux.mt: Move gdbserver support here from linux.mh.
* gdbserver/low-linux.c: New file.
* remote.c (remote_read_bytes): Fix aborts on larger packets.
* config/i386/linux.mh (GDBSERVER_DEPFILES, GDBSERVER_LIBS):
Define.
* stabsread.c (define_symbol): If register value is too large,
tell what it is and what max is.
* gdbserver/Makefile.in (SFILES): Add low-hppabsd.c.
* config/hppabsd.mh (XDEPFILES): Add ser-tcp.o
(GDBSERVER_DEPFILES): Add low-hppabsd.o
* config/hppaosf.mh: LIkewise.
Needed this for the gdbserver framework development. Trying to avoid doing
development work on lynx for the obvious reasons.
match stubs and protocol spec.
* gdbserver/remote-utils.c (remote_open): Cast to struct sockaddr
when passing to function which expects that.
The following changes aren't quite enough to make things work with
LynxOS (apprently kernel problems).
* infrun.c (wait_for_inferior): When resuming new thread, pass pid
not -1 for remote case.
* thread.c (info_threads_command): Give error if !target_has_stack.
* infrun.c (start_remote): Call init_thread_list.
* thread.c (info_threads_command): Don't call kill for remote
debugging target.
* target.c (normal_pid_to_str): Print "thread" not "process" for
remote.
* remote.c, gdbserver/*: Add 'H', 'S', and 'C' requests, 'X'
response, and `thread' part of 'T' response.
* gdbserver/*: If program exits, send packet to GDB before
exiting. Handle termination with a signal the same as exiting
with an exitstatus.
* remote.c: Don't try to kill program after getting an 'X'
response.
* infrun.c (wait_for_inferior): Add comment about kill versus mourn.
* m68k-tdep.c (m68k_saved_pc_after_call): Get rid of
GDB_TARGET_IS_SUN3. Use more general SYSCALL_TRAP macro.
* config/m68k/m68klynx.mh (NATDEPFILES): Remove exec.o (it's
already in TDEPFILES).
* config/m68k/tm-m68k.h (SAVED_PC_AFTER_CALL): Use
m68k_saved_pc_after_call.
* Remove all Sun3 specific stuff.
* (FIX_CALL_DUMMY): Cast arg to bfd_putb32 to unsigned char *.
* config/m68k/tm-m68klynx.h: Define SYSCALL_TRAP as trap #10.
Disable REMOTE_BREAKPOINT mechanism.
* config/m68k/tm-sun3.h: Get rid of GDB_TARGET_IS_SUN3.
* Protect from multiple includion.
* Move Sun3 specific stuff from tm-m68k.h to here.
* Define SYSCALL_TRAP as trap #0.
* Remove def of SAVED_PC_AFTER_CALL (now in tm-m68k.h).
* gdbserver/low-lynx.c: Redo all register store/fetch stuff to
make it portable for 386 and 68k.