+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.
+++ /dev/null
-/* 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
-/* 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. */
-#undef STDC_HEADERS
+/* Define if <sys/procfs.h> has elf_fpregset_t. */
+#undef HAVE_ELF_FPREGSET_T
-/* Define if the target supports PTRACE_PEEKUSR for register access. */
-#undef HAVE_LINUX_USRREGS
+/* 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 PTRACE_GETREGS for register access. */
+/* 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 the target supports PTRACE_PEEKUSR for register access. */
+#undef HAVE_LINUX_USRREGS
-/* Define if the prfpregset_t type is broken. */
-#undef PRFPREGSET_T_BROKEN
+/* Define if <sys/procfs.h> has lwpid_t. */
+#undef HAVE_LWPID_T
-/* Define if you have the <linux/elf.h> header file. */
-#undef HAVE_LINUX_ELF_H
+/* 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 you have the <proc_service.h> header file. */
+/* 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 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
-/* 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
-/* 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
-/* 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
-/* 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
-/* Define if you have the <termio.h> header file. */
-#undef HAVE_TERMIO_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 if you have the <termios.h> header file. */
+/* Define to 1 if you have the <termios.h> header file. */
#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
-/* Define if you have the <unistd.h> header file. */
+/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if strerror is not declared in system header files. */
#undef NEED_DECLARATION_STRERROR
-/* Define if <sys/procfs.h> has lwpid_t. */
-#undef HAVE_LWPID_T
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
-/* Define if <sys/procfs.h> has psaddr_t. */
-#undef HAVE_PSADDR_T
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
-/* Define if <sys/procfs.h> has prgregset_t. */
-#undef HAVE_PRGREGSET_T
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
-/* Define if <sys/procfs.h> has prfpregset_t. */
-#undef HAVE_PRFPREGSET_T
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
-/* Define if <sys/procfs.h> has elf_fpregset_t. */
-#undef HAVE_ELF_FPREGSET_T
+/* Define to the version of this package. */
+#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
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
if test "${srv_linux_usrregs}" = "yes"; then
- cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_LINUX_USRREGS 1
_ACEOF
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
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_LINUX_REGSETS 1
_ACEOF
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
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_PTRACE_GETFPXREGS 1
_ACEOF
echo "$as_me:$LINENO: result: $gdb_cv_prfpregset_t_broken" >&5
echo "${ECHO_T}$gdb_cv_prfpregset_t_broken" >&6
if test $gdb_cv_prfpregset_t_broken = yes; then
- cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
#define PRFPREGSET_T_BROKEN 1
_ACEOF
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
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
if test "${srv_linux_regsets}" = "yes"; then
[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_LINUX_REGSETS)
+ AC_DEFINE(HAVE_LINUX_REGSETS, 1,
+ [Define if the target supports PTRACE_GETREGS for register ]
+ [access.])
fi
AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
[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)
+ AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1,
+ [Define if the target supports PTRACE_GETFPXREGS for extended ]
+ [register access.])
fi
fi
gdb_cv_prfpregset_t_broken=yes)])
AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
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
/* 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.
This file is part of GDB.
#include <unistd.h>
#endif
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
/* Sort of a hack... */
#define EOL (EOF - 1)
char *port_str;
int port;
struct sockaddr_in sockaddr;
- int tmp;
+ socklen_t tmp;
int tmp_desc;
port_str = strchr (name, ':');
/* i387-specific utility functions, for the remote server for GDB.
- Copyright 2000, 2001, 2002
+ Copyright 2000, 2001, 2002, 2005
Free Software Foundation, Inc.
This file is part of GDB.
unsigned int foseg;
/* Space for eight 80-bit FP values. */
- char st_space[80];
+ unsigned char st_space[80];
};
struct i387_fxsave {
unsigned int _pad1;
/* 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. */
- char xmm_space[256];
+ unsigned char xmm_space[256];
};
void
/* 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.
This file is part of GDB.
{
unsigned long insn;
- (*the_target->read_memory) (where, (char *) &insn, 4);
+ (*the_target->read_memory) (where, (unsigned char *) &insn, 4);
if (insn == arm_breakpoint)
return 1;
arm_cannot_store_register,
arm_get_pc,
arm_set_pc,
- (const char *) &arm_breakpoint,
+ (const unsigned char *) &arm_breakpoint,
arm_breakpoint_len,
arm_reinsert_addr,
0,
{
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)
return 1;
cris_cannot_store_register,
cris_get_pc,
cris_set_pc,
- (const char *) &cris_breakpoint,
+ (const unsigned char *) &cris_breakpoint,
cris_breakpoint_len,
cris_reinsert_addr,
0,
{
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)
return 1;
NULL,
cris_get_pc,
cris_set_pc,
- (const char *) &cris_breakpoint,
+ (const unsigned char *) &cris_breakpoint,
cris_breakpoint_len,
cris_reinsert_addr,
0,
/* 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.
This file is part of GDB.
#endif /* HAVE_LINUX_REGSETS */
-static const char i386_breakpoint[] = { 0xCC };
+static const unsigned char i386_breakpoint[] = { 0xCC };
#define i386_breakpoint_len 1
extern int debug_threads;
to debugger memory starting at MYADDR. */
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;
/* Round starting address down to longword boundary. */
returns the value of errno. */
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;
/* Round starting address down to longword boundary. */
to debugger memory starting at MYADDR. */
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];
int fd, n;
int (*cannot_store_register) (int);
CORE_ADDR (*get_pc) (void);
void (*set_pc) (CORE_ADDR newpc);
- const char *breakpoint;
+ const unsigned char *breakpoint;
int breakpoint_len;
CORE_ADDR (*breakpoint_reinsert_addr) (void);
{
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)
return 1;
m32r_cannot_store_register,
m32r_get_pc,
m32r_set_pc,
- (const char *) &m32r_breakpoint,
+ (const unsigned char *) &m32r_breakpoint,
m32r_breakpoint_len,
NULL,
0,
/* 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.
This file is part of GDB.
#endif /* HAVE_LINUX_REGSETS */
-static const char m68k_breakpoint[] = { 0x4E, 0x4F };
+static const unsigned char m68k_breakpoint[] = { 0x4E, 0x4F };
#define m68k_breakpoint_len 2
static CORE_ADDR
/* 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.
This file is part of GDB.
{
unsigned long insn;
- (*the_target->read_memory) (where, (char *) &insn, 4);
+ (*the_target->read_memory) (where, (unsigned char *) &insn, 4);
if (insn == mips_breakpoint)
return 1;
mips_cannot_store_register,
mips_get_pc,
mips_set_pc,
- (const char *) &mips_breakpoint,
+ (const unsigned char *) &mips_breakpoint,
mips_breakpoint_len,
mips_reinsert_addr,
0,
/* GNU/Linux/PowerPC 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.
This file is part of GDB.
{
unsigned long insn;
- (*the_target->read_memory) (where, (char *) &insn, 4);
+ (*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
ppc_cannot_store_register,
ppc_get_pc,
ppc_set_pc,
- (const char *) &ppc_breakpoint,
+ (const unsigned char *) &ppc_breakpoint,
ppc_breakpoint_len,
NULL,
0,
{
unsigned int insn;
- (*the_target->read_memory) (where, (char *) &insn, 4);
+ (*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
ppc_cannot_store_register,
ppc_get_pc,
ppc_set_pc,
- (const char *) &ppc_breakpoint,
+ (const unsigned char *) &ppc_breakpoint,
ppc_breakpoint_len,
NULL,
0,
}
-static const char s390_breakpoint[] = { 0, 1 };
+static const unsigned char s390_breakpoint[] = { 0, 1 };
#define s390_breakpoint_len 2
static CORE_ADDR
/* 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.
This file is part of GDB.
{
unsigned short insn;
- (*the_target->read_memory) (where, (char *) &insn, 2);
+ (*the_target->read_memory) (where, (unsigned char *) &insn, 2);
if (insn == sh_breakpoint)
return 1;
sh_cannot_store_register,
sh_get_pc,
sh_set_pc,
- (const char *) &sh_breakpoint,
+ (const unsigned char *) &sh_breakpoint,
sh_breakpoint_len,
NULL,
0,
/* Memory breakpoint operations for the remote server for GDB.
- Copyright 2002
+ Copyright 2002, 2003, 2005
Free Software Foundation, Inc.
Contributed by MontaVista Software.
#include "server.h"
-const char *breakpoint_data;
+const unsigned char *breakpoint_data;
int breakpoint_len;
#define MAX_BREAKPOINT_LEN 8
}
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_len = bp_len;
}
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;
CORE_ADDR mem_end = mem_addr + mem_len;
}
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;
CORE_ADDR mem_end = mem_addr + mem_len;
/* Memory breakpoint interfaces for the remote server for GDB.
- Copyright 2002
+ Copyright 2002, 2005
Free Software Foundation, Inc.
Contributed by MontaVista Software.
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, 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
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, 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
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 */
/* Register support routines for the remote server for GDB.
- Copyright 2001, 2002, 2004
+ Copyright 2001, 2002, 2004, 2005
Free Software Foundation, Inc.
This file is part of GDB.
struct inferior_regcache_data
{
int registers_valid;
- char *registers;
+ unsigned char *registers;
};
static int register_bytes;
void
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);
}
registers_from_string (char *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)
{
return reg_defs[n].size / 8;
}
-static char *
+static unsigned char *
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);
}
#include <unistd.h>
#include <arpa/inet.h>
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
/* A cache entry for a successfully looked-up symbol. */
struct sym_cache
{
char *port_str;
int port;
struct sockaddr_in sockaddr;
- int tmp;
+ socklen_t tmp;
int tmp_desc;
port_str = strchr (name, ':');
}
void
-convert_int_to_ascii (char *from, char *to, int n)
+convert_int_to_ascii (unsigned char *from, char *to, int n)
{
int nib;
- char ch;
+ int ch;
while (n--)
{
ch = *from++;
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;
while (n--)
void
decode_M_packet (char *from, CORE_ADDR *mem_addr_ptr, unsigned int *len_ptr,
- char *to)
+ unsigned char *to)
{
int i = 0;
char ch;
if (the_target->read_auxv != NULL
&& strncmp ("qPart:auxv:read::", own_buf, 17) == 0)
{
- char data[(PBUFSIZ - 1) / 2];
+ unsigned char data[(PBUFSIZ - 1) / 2];
CORE_ADDR ofs;
unsigned int len;
int n;
int
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 signal;
unsigned int len;
void disable_async_io (void);
void unblock_async_io (void);
void block_async_io (void);
-void convert_ascii_to_int (char *from, char *to, int n);
-void convert_int_to_ascii (char *from, char *to, int n);
+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, char *to);
+ 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);
/* Target operations for the remote server for GDB.
- Copyright 2002, 2004
+ Copyright 2002, 2004, 2005
Free Software Foundation, Inc.
Contributed by MontaVista Software.
}
int
-read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len)
+read_inferior_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
{
int res;
res = (*the_target->read_memory) (memaddr, myaddr, len);
}
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
write fails and we go through error(). Make sure that no more than
one buffer is ever pending by making BUFFER static. */
- static char *buffer = 0;
+ static unsigned char *buffer = 0;
int res;
if (buffer != NULL)
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
called through write_inferior_memory, which handles breakpoint shadowing.
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.
This function is called whenever we receive a "qSymbols::"
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.
Returns 0 on success, -1 on failure and 1 on unsupported.
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);