* 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.
This commit is contained in:
Daniel Jacobowitz
2005-06-13 01:59:22 +00:00
parent 2087f04778
commit f450004a28
28 changed files with 287 additions and 138 deletions

View File

@ -1,3 +1,43 @@
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> 2005-05-28 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (SFILES): Add linux-ppc64-low.c. * Makefile.in (SFILES): Add linux-ppc64-low.c.

View File

@ -1,24 +0,0 @@
/* Define if the target supports PTRACE_PEEKUSR for register access. */
#undef HAVE_LINUX_USRREGS
/* Define if the target supports PTRACE_GETREGS for register access. */
#undef HAVE_LINUX_REGSETS
/* Define if the target supports PTRACE_GETFPXREGS for extended
register access. */
#undef HAVE_PTRACE_GETFPXREGS
/* Define if <sys/procfs.h> has prgregset_t. */
#undef HAVE_PRGREGSET_T
/* Define if <sys/procfs.h> has prfpregset_t. */
#undef HAVE_PRFPREGSET_T
/* Define if <sys/procfs.h> has lwpid_t. */
#undef HAVE_LWPID_T
/* Define if <sys/procfs.h> has psaddr_t. */
#undef HAVE_PSADDR_T
/* Define if the prfpregset_t type is broken. */
#undef PRFPREGSET_T_BROKEN

View File

@ -1,69 +1,104 @@
/* config.in. Generated automatically from configure.in by autoheader. */ /* config.in. Generated from configure.ac by autoheader. */
/* Define if you have the ANSI C header files. */ /* Define if <sys/procfs.h> has elf_fpregset_t. */
#undef STDC_HEADERS #undef HAVE_ELF_FPREGSET_T
/* Define if the target supports PTRACE_PEEKUSR for register access. */ /* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_LINUX_USRREGS #undef HAVE_INTTYPES_H
/* Define if the target supports PTRACE_GETREGS for register access. */ /* Define to 1 if you have the <linux/elf.h> header file. */
#undef HAVE_LINUX_REGSETS
/* Define if the target supports PTRACE_GETFPXREGS for extended
register access. */
#undef HAVE_PTRACE_GETFPXREGS
/* Define if the prfpregset_t type is broken. */
#undef PRFPREGSET_T_BROKEN
/* Define if you have the <linux/elf.h> header file. */
#undef HAVE_LINUX_ELF_H #undef HAVE_LINUX_ELF_H
/* Define if you have the <proc_service.h> header file. */ /* Define if the target supports PTRACE_GETREGS for register access. */
#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 if <sys/procfs.h> has prfpregset_t. */
#undef HAVE_PRFPREGSET_T
/* 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 #undef HAVE_PROC_SERVICE_H
/* Define if you have the <sgtty.h> header file. */ /* 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 to 1 if you have the <sgtty.h> header file. */
#undef HAVE_SGTTY_H #undef HAVE_SGTTY_H
/* Define if you have the <stdlib.h> header file. */ /* Define if you have 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 #undef HAVE_STDLIB_H
/* Define if you have the <string.h> header file. */ /* 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 #undef HAVE_STRING_H
/* Define if you have the <sys/procfs.h> header file. */ /* Define to 1 if you have the <sys/procfs.h> header file. */
#undef HAVE_SYS_PROCFS_H #undef HAVE_SYS_PROCFS_H
/* Define if you have the <sys/reg.h> header file. */ /* Define to 1 if you have the <sys/reg.h> header file. */
#undef HAVE_SYS_REG_H #undef HAVE_SYS_REG_H
/* Define if you have the <termio.h> header file. */ /* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_TERMIO_H #undef HAVE_SYS_STAT_H
/* Define if you have the <termios.h> header file. */ /* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H #undef HAVE_TERMIOS_H
/* Define if you have the <thread_db.h> header file. */ /* 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 #undef HAVE_THREAD_DB_H
/* Define if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
/* Define if strerror is not declared in system header files. */ /* Define if strerror is not declared in system header files. */
#undef NEED_DECLARATION_STRERROR #undef NEED_DECLARATION_STRERROR
/* Define if <sys/procfs.h> has lwpid_t. */ /* Define to the address where bug reports for this package should be sent. */
#undef HAVE_LWPID_T #undef PACKAGE_BUGREPORT
/* Define if <sys/procfs.h> has psaddr_t. */ /* Define to the full name of this package. */
#undef HAVE_PSADDR_T #undef PACKAGE_NAME
/* Define if <sys/procfs.h> has prgregset_t. */ /* Define to the full name and version of this package. */
#undef HAVE_PRGREGSET_T #undef PACKAGE_STRING
/* Define if <sys/procfs.h> has prfpregset_t. */ /* Define to the one symbol short name of this package. */
#undef HAVE_PRFPREGSET_T #undef PACKAGE_TARNAME
/* Define if <sys/procfs.h> has elf_fpregset_t. */ /* Define to the version of this package. */
#undef HAVE_ELF_FPREGSET_T #undef PACKAGE_VERSION
/* Define if the prfpregset_t type is broken. */
#undef PRFPREGSET_T_BROKEN
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS

View File

@ -3148,10 +3148,76 @@ _ACEOF
fi 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/socket.h>
int
main ()
{
if ((socklen_t *) 0)
return 0;
if (sizeof (socklen_t))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&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'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&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 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 . ${srcdir}/configure.srv
if test "${srv_linux_usrregs}" = "yes"; then if test "${srv_linux_usrregs}" = "yes"; then
cat >>confdefs.h <<\_ACEOF
cat >>confdefs.h <<\_ACEOF
#define HAVE_LINUX_USRREGS 1 #define HAVE_LINUX_USRREGS 1
_ACEOF _ACEOF
@ -3212,7 +3278,8 @@ fi
echo "$as_me:$LINENO: result: $gdbsrv_cv_have_ptrace_getregs" >&5 echo "$as_me:$LINENO: result: $gdbsrv_cv_have_ptrace_getregs" >&5
echo "${ECHO_T}$gdbsrv_cv_have_ptrace_getregs" >&6 echo "${ECHO_T}$gdbsrv_cv_have_ptrace_getregs" >&6
if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
cat >>confdefs.h <<\_ACEOF
cat >>confdefs.h <<\_ACEOF
#define HAVE_LINUX_REGSETS 1 #define HAVE_LINUX_REGSETS 1
_ACEOF _ACEOF
@ -3272,7 +3339,8 @@ fi
echo "$as_me:$LINENO: result: $gdbsrv_cv_have_ptrace_getfpxregs" >&5 echo "$as_me:$LINENO: result: $gdbsrv_cv_have_ptrace_getfpxregs" >&5
echo "${ECHO_T}$gdbsrv_cv_have_ptrace_getfpxregs" >&6 echo "${ECHO_T}$gdbsrv_cv_have_ptrace_getfpxregs" >&6
if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
cat >>confdefs.h <<\_ACEOF
cat >>confdefs.h <<\_ACEOF
#define HAVE_PTRACE_GETFPXREGS 1 #define HAVE_PTRACE_GETFPXREGS 1
_ACEOF _ACEOF
@ -3589,7 +3657,8 @@ fi
echo "$as_me:$LINENO: result: $gdb_cv_prfpregset_t_broken" >&5 echo "$as_me:$LINENO: result: $gdb_cv_prfpregset_t_broken" >&5
echo "${ECHO_T}$gdb_cv_prfpregset_t_broken" >&6 echo "${ECHO_T}$gdb_cv_prfpregset_t_broken" >&6
if test $gdb_cv_prfpregset_t_broken = yes; then if test $gdb_cv_prfpregset_t_broken = yes; then
cat >>confdefs.h <<\_ACEOF
cat >>confdefs.h <<\_ACEOF
#define PRFPREGSET_T_BROKEN 1 #define PRFPREGSET_T_BROKEN 1
_ACEOF _ACEOF

View File

@ -40,10 +40,16 @@ AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
BFD_NEED_DECLARATION(strerror) BFD_NEED_DECLARATION(strerror)
AC_CHECK_TYPE(socklen_t,
[AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define if you have socklen_t.])],
[], [#include <sys/socket.h>])
. ${srcdir}/configure.srv . ${srcdir}/configure.srv
if test "${srv_linux_usrregs}" = "yes"; then if test "${srv_linux_usrregs}" = "yes"; then
AC_DEFINE(HAVE_LINUX_USRREGS) AC_DEFINE(HAVE_LINUX_USRREGS, 1,
[Define if the target supports PTRACE_PEEKUSR for register ]
[access.])
fi fi
if test "${srv_linux_regsets}" = "yes"; then if test "${srv_linux_regsets}" = "yes"; then
@ -55,7 +61,9 @@ if test "${srv_linux_regsets}" = "yes"; then
[gdbsrv_cv_have_ptrace_getregs=no])]) [gdbsrv_cv_have_ptrace_getregs=no])])
AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs) AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs)
if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
AC_DEFINE(HAVE_LINUX_REGSETS) AC_DEFINE(HAVE_LINUX_REGSETS, 1,
[Define if the target supports PTRACE_GETREGS for register ]
[access.])
fi fi
AC_MSG_CHECKING(for PTRACE_GETFPXREGS) AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
@ -66,7 +74,9 @@ if test "${srv_linux_regsets}" = "yes"; then
[gdbsrv_cv_have_ptrace_getfpxregs=no])]) [gdbsrv_cv_have_ptrace_getfpxregs=no])])
AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs) AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs)
if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
AC_DEFINE(HAVE_PTRACE_GETFPXREGS) AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1,
[Define if the target supports PTRACE_GETFPXREGS for extended ]
[register access.])
fi fi
fi fi
@ -98,7 +108,8 @@ if test "$ac_cv_header_sys_procfs_h" = yes; then
gdb_cv_prfpregset_t_broken=yes)]) gdb_cv_prfpregset_t_broken=yes)])
AC_MSG_RESULT($gdb_cv_prfpregset_t_broken) AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
if test $gdb_cv_prfpregset_t_broken = yes; then if test $gdb_cv_prfpregset_t_broken = yes; then
AC_DEFINE(PRFPREGSET_T_BROKEN) AC_DEFINE(PRFPREGSET_T_BROKEN, 1,
[Define if the prfpregset_t type is broken.])
fi fi
fi fi

View File

@ -1,5 +1,6 @@
/* Replay a remote debug session logfile for GDB. /* Replay a remote debug session logfile for GDB.
Copyright 1996, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. Copyright 1996, 1998, 1999, 2000, 2002, 2003, 2005
Free Software Foundation, Inc.
Written by Fred Fish (fnf@cygnus.com) from pieces of gdbserver. Written by Fred Fish (fnf@cygnus.com) from pieces of gdbserver.
This file is part of GDB. This file is part of GDB.
@ -41,6 +42,10 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
/* Sort of a hack... */ /* Sort of a hack... */
#define EOL (EOF - 1) #define EOL (EOF - 1)
@ -105,7 +110,7 @@ remote_open (char *name)
char *port_str; char *port_str;
int port; int port;
struct sockaddr_in sockaddr; struct sockaddr_in sockaddr;
int tmp; socklen_t tmp;
int tmp_desc; int tmp_desc;
port_str = strchr (name, ':'); port_str = strchr (name, ':');

View File

@ -1,5 +1,5 @@
/* i387-specific utility functions, for the remote server for GDB. /* i387-specific utility functions, for the remote server for GDB.
Copyright 2000, 2001, 2002 Copyright 2000, 2001, 2002, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -43,7 +43,7 @@ struct i387_fsave {
unsigned int foseg; unsigned int foseg;
/* Space for eight 80-bit FP values. */ /* Space for eight 80-bit FP values. */
char st_space[80]; unsigned char st_space[80];
}; };
struct i387_fxsave { struct i387_fxsave {
@ -63,10 +63,10 @@ struct i387_fxsave {
unsigned int _pad1; unsigned int _pad1;
/* Space for eight 80-bit FP values in 128-bit spaces. */ /* Space for eight 80-bit FP values in 128-bit spaces. */
char st_space[128]; unsigned char st_space[128];
/* Space for eight 128-bit XMM values, or 16 on x86-64. */ /* Space for eight 128-bit XMM values, or 16 on x86-64. */
char xmm_space[256]; unsigned char xmm_space[256];
}; };
void void

View File

@ -1,5 +1,5 @@
/* GNU/Linux/ARM specific low level interface, for the remote server for GDB. /* GNU/Linux/ARM specific low level interface, for the remote server for GDB.
Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -75,7 +75,7 @@ arm_breakpoint_at (CORE_ADDR where)
{ {
unsigned long insn; unsigned long insn;
(*the_target->read_memory) (where, (char *) &insn, 4); (*the_target->read_memory) (where, (unsigned char *) &insn, 4);
if (insn == arm_breakpoint) if (insn == arm_breakpoint)
return 1; return 1;
@ -102,7 +102,7 @@ struct linux_target_ops the_low_target = {
arm_cannot_store_register, arm_cannot_store_register,
arm_get_pc, arm_get_pc,
arm_set_pc, arm_set_pc,
(const char *) &arm_breakpoint, (const unsigned char *) &arm_breakpoint,
arm_breakpoint_len, arm_breakpoint_len,
arm_reinsert_addr, arm_reinsert_addr,
0, 0,

View File

@ -85,7 +85,8 @@ cris_breakpoint_at (CORE_ADDR where)
{ {
unsigned short insn; unsigned short insn;
(*the_target->read_memory) (where, (char *) &insn, cris_breakpoint_len); (*the_target->read_memory) (where, (unsigned char *) &insn,
cris_breakpoint_len);
if (insn == cris_breakpoint) if (insn == cris_breakpoint)
return 1; return 1;
@ -112,7 +113,7 @@ struct linux_target_ops the_low_target = {
cris_cannot_store_register, cris_cannot_store_register,
cris_get_pc, cris_get_pc,
cris_set_pc, cris_set_pc,
(const char *) &cris_breakpoint, (const unsigned char *) &cris_breakpoint,
cris_breakpoint_len, cris_breakpoint_len,
cris_reinsert_addr, cris_reinsert_addr,
0, 0,

View File

@ -77,7 +77,8 @@ cris_breakpoint_at (CORE_ADDR where)
{ {
unsigned short insn; unsigned short insn;
(*the_target->read_memory) (where, (char *) &insn, cris_breakpoint_len); (*the_target->read_memory) (where, (unsigned char *) &insn,
cris_breakpoint_len);
if (insn == cris_breakpoint) if (insn == cris_breakpoint)
return 1; return 1;
@ -367,7 +368,7 @@ struct linux_target_ops the_low_target = {
NULL, NULL,
cris_get_pc, cris_get_pc,
cris_set_pc, cris_set_pc,
(const char *) &cris_breakpoint, (const unsigned char *) &cris_breakpoint,
cris_breakpoint_len, cris_breakpoint_len,
cris_reinsert_addr, cris_reinsert_addr,
0, 0,

View File

@ -1,5 +1,5 @@
/* GNU/Linux/i386 specific low level interface, for the remote server for GDB. /* GNU/Linux/i386 specific low level interface, for the remote server for GDB.
Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004 Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -160,7 +160,7 @@ struct regset_info target_regsets[] = {
#endif /* HAVE_LINUX_REGSETS */ #endif /* HAVE_LINUX_REGSETS */
static const char i386_breakpoint[] = { 0xCC }; static const unsigned char i386_breakpoint[] = { 0xCC };
#define i386_breakpoint_len 1 #define i386_breakpoint_len 1
extern int debug_threads; extern int debug_threads;

View File

@ -1337,7 +1337,7 @@ linux_store_registers (int regno)
to debugger memory starting at MYADDR. */ to debugger memory starting at MYADDR. */
static int static int
linux_read_memory (CORE_ADDR memaddr, char *myaddr, int len) linux_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
{ {
register int i; register int i;
/* Round starting address down to longword boundary. */ /* Round starting address down to longword boundary. */
@ -1371,7 +1371,7 @@ linux_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
returns the value of errno. */ returns the value of errno. */
static int static int
linux_write_memory (CORE_ADDR memaddr, const char *myaddr, int len) linux_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
{ {
register int i; register int i;
/* Round starting address down to longword boundary. */ /* Round starting address down to longword boundary. */
@ -1450,7 +1450,7 @@ linux_send_signal (int signum)
to debugger memory starting at MYADDR. */ to debugger memory starting at MYADDR. */
static int static int
linux_read_auxv (CORE_ADDR offset, char *myaddr, unsigned int len) linux_read_auxv (CORE_ADDR offset, unsigned char *myaddr, unsigned int len)
{ {
char filename[PATH_MAX]; char filename[PATH_MAX];
int fd, n; int fd, n;

View File

@ -50,7 +50,7 @@ struct linux_target_ops
int (*cannot_store_register) (int); int (*cannot_store_register) (int);
CORE_ADDR (*get_pc) (void); CORE_ADDR (*get_pc) (void);
void (*set_pc) (CORE_ADDR newpc); void (*set_pc) (CORE_ADDR newpc);
const char *breakpoint; const unsigned char *breakpoint;
int breakpoint_len; int breakpoint_len;
CORE_ADDR (*breakpoint_reinsert_addr) (void); CORE_ADDR (*breakpoint_reinsert_addr) (void);

View File

@ -74,7 +74,8 @@ m32r_breakpoint_at (CORE_ADDR where)
{ {
unsigned short insn; unsigned short insn;
(*the_target->read_memory) (where, (char *) &insn, m32r_breakpoint_len); (*the_target->read_memory) (where, (unsigned char *) &insn,
m32r_breakpoint_len);
if (insn == m32r_breakpoint) if (insn == m32r_breakpoint)
return 1; return 1;
@ -90,7 +91,7 @@ struct linux_target_ops the_low_target = {
m32r_cannot_store_register, m32r_cannot_store_register,
m32r_get_pc, m32r_get_pc,
m32r_set_pc, m32r_set_pc,
(const char *) &m32r_breakpoint, (const unsigned char *) &m32r_breakpoint,
m32r_breakpoint_len, m32r_breakpoint_len,
NULL, NULL,
0, 0,

View File

@ -1,5 +1,5 @@
/* GNU/Linux/m68k specific low level interface, for the remote server for GDB. /* GNU/Linux/m68k specific low level interface, for the remote server for GDB.
Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -120,7 +120,7 @@ struct regset_info target_regsets[] = {
#endif /* HAVE_LINUX_REGSETS */ #endif /* HAVE_LINUX_REGSETS */
static const char m68k_breakpoint[] = { 0x4E, 0x4F }; static const unsigned char m68k_breakpoint[] = { 0x4E, 0x4F };
#define m68k_breakpoint_len 2 #define m68k_breakpoint_len 2
static CORE_ADDR static CORE_ADDR

View File

@ -1,5 +1,5 @@
/* GNU/Linux/MIPS specific low level interface, for the remote server for GDB. /* GNU/Linux/MIPS specific low level interface, for the remote server for GDB.
Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002 Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -131,7 +131,7 @@ mips_breakpoint_at (CORE_ADDR where)
{ {
unsigned long insn; unsigned long insn;
(*the_target->read_memory) (where, (char *) &insn, 4); (*the_target->read_memory) (where, (unsigned char *) &insn, 4);
if (insn == mips_breakpoint) if (insn == mips_breakpoint)
return 1; return 1;
@ -147,7 +147,7 @@ struct linux_target_ops the_low_target = {
mips_cannot_store_register, mips_cannot_store_register,
mips_get_pc, mips_get_pc,
mips_set_pc, mips_set_pc,
(const char *) &mips_breakpoint, (const unsigned char *) &mips_breakpoint,
mips_breakpoint_len, mips_breakpoint_len,
mips_reinsert_addr, mips_reinsert_addr,
0, 0,

View File

@ -1,6 +1,6 @@
/* GNU/Linux/PowerPC specific low level interface, for the remote server for /* GNU/Linux/PowerPC specific low level interface, for the remote server for
GDB. GDB.
Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002 Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -93,7 +93,7 @@ ppc_breakpoint_at (CORE_ADDR where)
{ {
unsigned long insn; unsigned long insn;
(*the_target->read_memory) (where, (char *) &insn, 4); (*the_target->read_memory) (where, (unsigned char *) &insn, 4);
if (insn == ppc_breakpoint) if (insn == ppc_breakpoint)
return 1; return 1;
/* If necessary, recognize more trap instructions here. GDB only uses the /* If necessary, recognize more trap instructions here. GDB only uses the
@ -108,7 +108,7 @@ struct linux_target_ops the_low_target = {
ppc_cannot_store_register, ppc_cannot_store_register,
ppc_get_pc, ppc_get_pc,
ppc_set_pc, ppc_set_pc,
(const char *) &ppc_breakpoint, (const unsigned char *) &ppc_breakpoint,
ppc_breakpoint_len, ppc_breakpoint_len,
NULL, NULL,
0, 0,

View File

@ -89,7 +89,7 @@ ppc_breakpoint_at (CORE_ADDR where)
{ {
unsigned int insn; unsigned int insn;
(*the_target->read_memory) (where, (char *) &insn, 4); (*the_target->read_memory) (where, (unsigned char *) &insn, 4);
if (insn == ppc_breakpoint) if (insn == ppc_breakpoint)
return 1; return 1;
/* If necessary, recognize more trap instructions here. GDB only uses the /* If necessary, recognize more trap instructions here. GDB only uses the
@ -104,7 +104,7 @@ struct linux_target_ops the_low_target = {
ppc_cannot_store_register, ppc_cannot_store_register,
ppc_get_pc, ppc_get_pc,
ppc_set_pc, ppc_set_pc,
(const char *) &ppc_breakpoint, (const unsigned char *) &ppc_breakpoint,
ppc_breakpoint_len, ppc_breakpoint_len,
NULL, NULL,
0, 0,

View File

@ -76,7 +76,7 @@ s390_cannot_store_register (int regno)
} }
static const char s390_breakpoint[] = { 0, 1 }; static const unsigned char s390_breakpoint[] = { 0, 1 };
#define s390_breakpoint_len 2 #define s390_breakpoint_len 2
static CORE_ADDR static CORE_ADDR

View File

@ -1,5 +1,5 @@
/* GNU/Linux/SH specific low level interface, for the remote server for GDB. /* GNU/Linux/SH specific low level interface, for the remote server for GDB.
Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003 Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -81,7 +81,7 @@ sh_breakpoint_at (CORE_ADDR where)
{ {
unsigned short insn; unsigned short insn;
(*the_target->read_memory) (where, (char *) &insn, 2); (*the_target->read_memory) (where, (unsigned char *) &insn, 2);
if (insn == sh_breakpoint) if (insn == sh_breakpoint)
return 1; return 1;
@ -97,7 +97,7 @@ struct linux_target_ops the_low_target = {
sh_cannot_store_register, sh_cannot_store_register,
sh_get_pc, sh_get_pc,
sh_set_pc, sh_set_pc,
(const char *) &sh_breakpoint, (const unsigned char *) &sh_breakpoint,
sh_breakpoint_len, sh_breakpoint_len,
NULL, NULL,
0, 0,

View File

@ -1,5 +1,5 @@
/* Memory breakpoint operations for the remote server for GDB. /* Memory breakpoint operations for the remote server for GDB.
Copyright 2002 Copyright 2002, 2003, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by MontaVista Software. Contributed by MontaVista Software.
@ -23,7 +23,7 @@
#include "server.h" #include "server.h"
const char *breakpoint_data; const unsigned char *breakpoint_data;
int breakpoint_len; int breakpoint_len;
#define MAX_BREAKPOINT_LEN 8 #define MAX_BREAKPOINT_LEN 8
@ -203,14 +203,14 @@ check_breakpoints (CORE_ADDR stop_pc)
} }
void void
set_breakpoint_data (const char *bp_data, int bp_len) set_breakpoint_data (const unsigned char *bp_data, int bp_len)
{ {
breakpoint_data = bp_data; breakpoint_data = bp_data;
breakpoint_len = bp_len; breakpoint_len = bp_len;
} }
void void
check_mem_read (CORE_ADDR mem_addr, char *buf, int mem_len) check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len)
{ {
struct breakpoint *bp = breakpoints; struct breakpoint *bp = breakpoints;
CORE_ADDR mem_end = mem_addr + mem_len; CORE_ADDR mem_end = mem_addr + mem_len;
@ -243,7 +243,7 @@ check_mem_read (CORE_ADDR mem_addr, char *buf, int mem_len)
} }
void void
check_mem_write (CORE_ADDR mem_addr, char *buf, int mem_len) check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len)
{ {
struct breakpoint *bp = breakpoints; struct breakpoint *bp = breakpoints;
CORE_ADDR mem_end = mem_addr + mem_len; CORE_ADDR mem_end = mem_addr + mem_len;

View File

@ -1,5 +1,5 @@
/* Memory breakpoint interfaces for the remote server for GDB. /* Memory breakpoint interfaces for the remote server for GDB.
Copyright 2002 Copyright 2002, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by MontaVista Software. Contributed by MontaVista Software.
@ -55,17 +55,17 @@ int check_breakpoints (CORE_ADDR stop_pc);
to MEM_ADDR + MEM_LEN. Update the data already read from the target to MEM_ADDR + MEM_LEN. Update the data already read from the target
(in BUF) if necessary. */ (in BUF) if necessary. */
void check_mem_read (CORE_ADDR mem_addr, char *buf, int mem_len); 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 /* 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 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. */ (in BUF) if necessary, as well as the original data for any breakpoints. */
void check_mem_write (CORE_ADDR mem_addr, char *buf, int mem_len); 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 /* Set the byte pattern to insert for memory breakpoints. This function
must be called before any breakpoints are set. */ must be called before any breakpoints are set. */
void set_breakpoint_data (const char *bp_data, int bp_len); void set_breakpoint_data (const unsigned char *bp_data, int bp_len);
#endif /* MEM_BREAK_H */ #endif /* MEM_BREAK_H */

View File

@ -1,5 +1,5 @@
/* Register support routines for the remote server for GDB. /* Register support routines for the remote server for GDB.
Copyright 2001, 2002, 2004 Copyright 2001, 2002, 2004, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -32,7 +32,7 @@
struct inferior_regcache_data struct inferior_regcache_data
{ {
int registers_valid; int registers_valid;
char *registers; unsigned char *registers;
}; };
static int register_bytes; static int register_bytes;
@ -144,7 +144,7 @@ set_register_cache (struct reg *regs, int n)
void void
registers_to_string (char *buf) registers_to_string (char *buf)
{ {
char *registers = get_regcache (current_inferior, 1)->registers; unsigned char *registers = get_regcache (current_inferior, 1)->registers;
convert_int_to_ascii (registers, buf, register_bytes); convert_int_to_ascii (registers, buf, register_bytes);
} }
@ -153,7 +153,7 @@ void
registers_from_string (char *buf) registers_from_string (char *buf)
{ {
int len = strlen (buf); int len = strlen (buf);
char *registers = get_regcache (current_inferior, 1)->registers; unsigned char *registers = get_regcache (current_inferior, 1)->registers;
if (len != register_bytes * 2) if (len != register_bytes * 2)
{ {
@ -200,10 +200,11 @@ register_size (int n)
return reg_defs[n].size / 8; return reg_defs[n].size / 8;
} }
static char * static unsigned char *
register_data (int n, int fetch) register_data (int n, int fetch)
{ {
char *registers = get_regcache (current_inferior, fetch)->registers; unsigned char *registers
= get_regcache (current_inferior, fetch)->registers;
return registers + (reg_defs[n].offset / 8); return registers + (reg_defs[n].offset / 8);
} }

View File

@ -37,6 +37,10 @@
#include <unistd.h> #include <unistd.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
/* A cache entry for a successfully looked-up symbol. */ /* A cache entry for a successfully looked-up symbol. */
struct sym_cache struct sym_cache
{ {
@ -122,7 +126,7 @@ remote_open (char *name)
char *port_str; char *port_str;
int port; int port;
struct sockaddr_in sockaddr; struct sockaddr_in sockaddr;
int tmp; socklen_t tmp;
int tmp_desc; int tmp_desc;
port_str = strchr (name, ':'); port_str = strchr (name, ':');
@ -544,10 +548,10 @@ write_enn (char *buf)
} }
void void
convert_int_to_ascii (char *from, char *to, int n) convert_int_to_ascii (unsigned char *from, char *to, int n)
{ {
int nib; int nib;
char ch; int ch;
while (n--) while (n--)
{ {
ch = *from++; ch = *from++;
@ -561,7 +565,7 @@ convert_int_to_ascii (char *from, char *to, int n)
void void
convert_ascii_to_int (char *from, char *to, int n) convert_ascii_to_int (char *from, unsigned char *to, int n)
{ {
int nib1, nib2; int nib1, nib2;
while (n--) while (n--)
@ -722,7 +726,7 @@ decode_m_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr)
void void
decode_M_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr, decode_M_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr,
char *to) unsigned char *to)
{ {
int i = 0; int i = 0;
char ch; char ch;

View File

@ -126,7 +126,7 @@ handle_query (char *own_buf)
if (the_target->read_auxv != NULL if (the_target->read_auxv != NULL
&& strncmp ("qPart:auxv:read::", own_buf, 17) == 0) && strncmp ("qPart:auxv:read::", own_buf, 17) == 0)
{ {
char data[(PBUFSIZ - 1) / 2]; unsigned char data[(PBUFSIZ - 1) / 2];
CORE_ADDR ofs; CORE_ADDR ofs;
unsigned int len; unsigned int len;
int n; int n;
@ -313,7 +313,8 @@ gdbserver_usage (void)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
char ch, status, *own_buf, mem_buf[2000]; char ch, status, *own_buf;
unsigned char mem_buf[2000];
int i = 0; int i = 0;
int signal; int signal;
unsigned int len; unsigned int len;

View File

@ -136,8 +136,8 @@ void enable_async_io (void);
void disable_async_io (void); void disable_async_io (void);
void unblock_async_io (void); void unblock_async_io (void);
void block_async_io (void); void block_async_io (void);
void convert_ascii_to_int (char *from, char *to, int n); void convert_ascii_to_int (char *from, unsigned char *to, int n);
void convert_int_to_ascii (char *from, char *to, int n); void convert_int_to_ascii (unsigned char *from, char *to, int n);
void new_thread_notify (int id); void new_thread_notify (int id);
void dead_thread_notify (int id); void dead_thread_notify (int id);
void prepare_resume_reply (char *buf, char status, unsigned char sig); void prepare_resume_reply (char *buf, char status, unsigned char sig);
@ -145,7 +145,7 @@ void prepare_resume_reply (char *buf, char status, unsigned char sig);
void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr, void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr,
unsigned int *len_ptr); unsigned int *len_ptr);
void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr, void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr,
unsigned int *len_ptr, char *to); unsigned int *len_ptr, unsigned char *to);
int unhexify (char *bin, const char *hex, int count); int unhexify (char *bin, const char *hex, int count);
int hexify (char *hex, const char *bin, int count); int hexify (char *hex, const char *bin, int count);

View File

@ -1,5 +1,5 @@
/* Target operations for the remote server for GDB. /* Target operations for the remote server for GDB.
Copyright 2002, 2004 Copyright 2002, 2004, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by MontaVista Software. Contributed by MontaVista Software.
@ -58,7 +58,7 @@ set_desired_inferior (int use_general)
} }
int int
read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
{ {
int res; int res;
res = (*the_target->read_memory) (memaddr, myaddr, len); res = (*the_target->read_memory) (memaddr, myaddr, len);
@ -67,12 +67,13 @@ read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
} }
int int
write_inferior_memory (CORE_ADDR memaddr, const char *myaddr, int len) write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr,
int len)
{ {
/* Lacking cleanups, there is some potential for a memory leak if the /* 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 write fails and we go through error(). Make sure that no more than
one buffer is ever pending by making BUFFER static. */ one buffer is ever pending by making BUFFER static. */
static char *buffer = 0; static unsigned char *buffer = 0;
int res; int res;
if (buffer != NULL) if (buffer != NULL)

View File

@ -106,7 +106,7 @@ struct target_ops
Returns 0 on success and errno on failure. */ Returns 0 on success and errno on failure. */
int (*read_memory) (CORE_ADDR memaddr, char *myaddr, int len); int (*read_memory) (CORE_ADDR memaddr, unsigned char *myaddr, int len);
/* Write memory to the inferior process. This should generally be /* Write memory to the inferior process. This should generally be
called through write_inferior_memory, which handles breakpoint shadowing. called through write_inferior_memory, which handles breakpoint shadowing.
@ -115,7 +115,8 @@ struct target_ops
Returns 0 on success and errno on failure. */ Returns 0 on success and errno on failure. */
int (*write_memory) (CORE_ADDR memaddr, const char *myaddr, int len); int (*write_memory) (CORE_ADDR memaddr, const unsigned char *myaddr,
int len);
/* Query GDB for the values of any symbols we're interested in. /* Query GDB for the values of any symbols we're interested in.
This function is called whenever we receive a "qSymbols::" This function is called whenever we receive a "qSymbols::"
@ -132,7 +133,8 @@ struct target_ops
Read LEN bytes at OFFSET into a buffer at MYADDR. */ Read LEN bytes at OFFSET into a buffer at MYADDR. */
int (*read_auxv) (CORE_ADDR offset, char *myaddr, unsigned int len); int (*read_auxv) (CORE_ADDR offset, unsigned char *myaddr,
unsigned int len);
/* Insert and remove a hardware watchpoint. /* Insert and remove a hardware watchpoint.
Returns 0 on success, -1 on failure and 1 on unsupported. Returns 0 on success, -1 on failure and 1 on unsupported.
@ -183,9 +185,10 @@ void set_target_ops (struct target_ops *);
unsigned char mywait (char *statusp, int connected_wait); unsigned char mywait (char *statusp, int connected_wait);
int read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len); int read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len);
int write_inferior_memory (CORE_ADDR memaddr, const char *myaddr, int len); int write_inferior_memory (CORE_ADDR memaddr, const unsigned char *myaddr,
int len);
void set_desired_inferior (int id); void set_desired_inferior (int id);