This is the mail archive of the gdb@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: adding support for NetBSD architectures to gdbserver


On Apr 3,  3:08pm, J.T. Conklin wrote:

> What is the suggested way to add support for all the different NetBSD
> architectures to gdbserver?  Should there be a single low-nbsd.c with
> conditional sections, or should there be multiple low-*.c files? 
> 
> The former approach is used for both the i386 & ia64 gnulinux targets,
> but this requires I386_GNULINUX_TARGET and IA64_GNULINUX_TARGET to be
> defined in their respective target header files.  I've been lead to
> believe that such macros are generally frowned upon.  
> 
> The latter approach would add a dozen or so almost identical low-*.c
> files once support for all NetBSD targets has been integrated.
> 
> Short of the idea of sharing code between a target's -nat.c file and
> gdbserver, what's the best way to go?

Since the new low-netbsd-*.c files will be almost identical, I think
maintenance will be easier if you use a single file (low-netbsd.c or
somesuch) with ifdefs controlling the architecture specific parts.

I do think it's important though to limit (ban?) the use of things like
I386_GNULINUX_TARGET in the rest of the gdb sources however.  It might
be a good idea to put a comment next to these defines indicating that
they are intended to be used only in gdbserver.

(Of course, if you could figure out a way to share the *-nat.c files,
that would be even better still.)

Kevin

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