This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: adding support for NetBSD architectures to gdbserver
- To: jtc at redback dot com
- Subject: Re: adding support for NetBSD architectures to gdbserver
- From: Stan Shebs <shebs at apple dot com>
- Date: Mon, 03 Apr 2000 16:34:14 -0800
- CC: gdb at sourceware dot cygnus dot com
- Organization: Core Tools, Apple Computer
- References: <5m66tysuqa.fsf@jtc.redback.com>
- Reply-To: shebs at apple dot com
"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