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


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

Personally, I would prefer to have a single low-nbsd.c with conditionals,
because the conditionals are actually *host* conditionals, gdbserver
being by nature a native-only program.  Problem with I386_GNULINUX_TARGET
etc is that once they exist, they're easily perverted to illicit uses.
Since NetBSD gdbserver configs are native-only, it seems possible to
use autoconf instead, then no additions to tm.h would be needed.

I would only want to support multiple small low-foo.c files if each
only had arch-specific code, with low-nbsd.c having only common
code.  Historically, replicated code has proved more of a problem
for maintenance than heavily conditionalized code (procfs.c is an
isolated case, while obsolete clones of remote.c are perennial).

Stan

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