This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
small patch to gdbserver to make it compile under linux 2.2.5
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: small patch to gdbserver to make it compile under linux 2.2.5
- From: Marco Molteni <molter at csl dot sri dot com>
- Date: Wed, 22 Dec 1999 11:29:41 -0800
Hi,
I'd like to contribute a small patch I did to the gdbserver source
(from the gdb-4.18.tar.gz distribution) in order to make it compile
under Linux.
The Linux kernel version I used is:2.2.5-15smp
The compiler is egcs-2.91.66
If you like, I can also contribute a patch to make gdbserver to
control the remote host IP address before accepting the connection
(now gdbserver happily accepts the first connection request).
I hereby give the copyright of my humble patch to the FSF or to who is
needed to make you accept the patch.
Best regards
Marco
--
Marco Molteni
SRI International, System Design Laboratory
333 Ravenswood Avenue, Menlo Park, CA 94025, USA.
diff -u gdbserver/gdbreplay.c gdbserver-fixed/gdbreplay.c
--- gdbserver/gdbreplay.c Fri Mar 20 15:33:24 1998
+++ gdbserver-fixed/gdbreplay.c Wed Dec 22 11:01:34 1999
@@ -42,7 +42,7 @@
char *string;
{
extern int sys_nerr;
- extern char *sys_errlist[];
+ extern const char *const sys_errlist[];
extern int errno;
char *err;
char *combined;
diff -u gdbserver/low-linux.c gdbserver-fixed/low-linux.c
--- gdbserver/low-linux.c Tue Dec 8 12:41:18 1998
+++ gdbserver-fixed/low-linux.c Wed Dec 22 11:01:12 1999
@@ -265,7 +265,7 @@
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
{
errno = 0;
- *(int *) ®isters[ regno * 4 + i] = ptrace (PTRACE_PEEKUSR, inferior_pid,
+ *(int *) ®isters[ regno * 4 + i] = ptrace (PTRACE_PEEKUSER, inferior_pid,
(PTRACE_ARG3_TYPE) regaddr, 0);
regaddr += sizeof (int);
if (errno != 0)
@@ -334,7 +334,7 @@
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof(int))
{
errno = 0;
- ptrace (PTRACE_POKEUSR, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
+ ptrace (PTRACE_POKEUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
*(int *) ®isters[REGISTER_BYTE (regno) + i]);
if (errno != 0)
{
diff -u gdbserver/utils.c gdbserver-fixed/utils.c
--- gdbserver/utils.c Fri Aug 8 21:49:48 1997
+++ gdbserver-fixed/utils.c Wed Dec 22 10:54:36 1999
@@ -32,7 +32,7 @@
char *string;
{
extern int sys_nerr;
- extern char *sys_errlist[];
+ extern const char *const sys_errlist[];
extern int errno;
char *err;
char *combined;