This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: small patch to gdbserver to make it compile under linux 2.2.5


On Dec 22, 11:29am, Marco Molteni wrote:

> 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.

Thanks!

However...

If you check a recent snapshot from sourceware.cygnus.com, I think
you'll find that your concerns are alread addressed by these changes:


1999-10-28  Kevin Buettner  <kevinb@cygnus.com>

	* gdbserver/gdbreplay.c (config.h, errno.h): Include.
	(perror_with_name): Don't declare sys_nerr, sys_errlist, or errno
	when STDC_HEADERS is defined.
	* gdbserver/utils.c (STDC_HEADERS): Likewise.

	* gdbserver/low-hppabsd.c, gdbserver/low-linux.c,
	gdbserver/low-lynx.c, gdbserver/low-sim.c, gdbserver/low-sparc.c,
	gdbserver/low-sun3.c (my_registers): Declare.
	(registers): Changed from array type to pointer type in order
	to match declaration in inferior.h in main gdb sources.
	* gdbserver/server.h (registers): Likewise.
	* gdbserver/remote-utils.c (outreg): Removed declaration of
	registers[].

	* gdbserver/low-linux.c (fetch_register): Changed PTRACE_PEEKUSR to
	PTRACE_PEEKUSER.  [Note the missing 'E'.]
	(store_inferior_registers): Likewise for PTRACE_POKEUSER.

	* gdbserver/low-linux.c (sys/ptrace.h): Move include to
	avoid conflict with #defines coming from <sys/user.h>.
	(sys/reg.h): Only include when HAVE_SYS_REG_H is defined.
	(PTRACE_XFER_TYPE): Provide a default type in case
	the target doesn't define it.
	(fetch_register, read_inferior_memory, write_inferior_memory):
	Use PTRACE_XFER_TYPE instead of int for ptrace() transfers.
	(I386_GNULINUX_TARGET): Use #ifdef with this symbol instead
	of assuming it's an x86 target when it's not a m68k target.
	(i386_register_raw_size, i386_register_byte): Define these arrays
	to match other changes that've been occuring to the x86 target
	in the main gdb sources.
	(initialize_arch): New (static) function for doing target arch
	specific initializations.

	[... and still more changes too; see ChangeLog for the rest of 'em]


> 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).

That does sound like a useful thing to have in certain situations. 
I'd be willing to take a look at it.  (I.e, send it my way.)

> I hereby give the copyright of my humble patch to the FSF or to who
> is needed to make you accept the patch.

If only it were this easy...  When you send us your patch for
controlling which IP addresses are permitted to talk to gdbserver,
we'll need a bit more than this if the changes are more than several
lines long.  See

    http://sourceware.cygnus.com/gdb/submit.html

for the details.  I know from personal experience that this can
be an incredible hassle, particularly if your employer doesn't
see the value in it.  (Even if they do, it can sometimes be quite
a challenge.)  But I assure you that it is necessary.

Thanks again,

Kevin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]