Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: jtc@redback.com (J.T. Conklin)
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [RFA]: Remove unused header files.
Date: Fri, 02 Mar 2001 16:34:00 -0000	[thread overview]
Message-ID: <5mpufzlmg5.fsf@jtc.redback.com> (raw)
In-Reply-To: <3A9FC8E8.F1B486C5@cygnus.com>

>>>>> " Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
Andrew> GDB currently has some really obscure and effectivly hidden include
Andrew> dependencies.  For instance, given the target mn10200-elf you find:
Andrew>
Andrew> 	values.c uses EXTRACT_RETURN_VALUE
Andrew>
Andrew> 	config/mn10200/tm-mn10200.h's definition
Andrew> 		refers to something declared in regcache.h
Andrew>
Andrew> values.c includes "tm.h" to get at EXTRACT_RETURN_VALUE and
Andrew> consequently needs a declaration for regcache.h.
Andrew>
Andrew> Does your lint handle this?

Yes and no.  If I was linting GDB configured for the mn10200, it
regcache.h would be considered necessary, but for other cases it
would not.  Since I'm not planning on linting every possible config
before deciding whether a header is unnecessary, it's not up to the
job.  

However, I question whether it has to be.  Why should GDB have obscure
and effectively hidden include dependencies?  We can eliminate them so
that *.c files include the headers that are required by all configs,
and have tm-, nm-, or xm- headers that require extra headers due to
macro definitions to include them themselves.  Alternatively, we can
include all the headers in defs.h to ensure that all such headers have
access to the declarations.  I'm not fond of the latter --- I'm trying
to decrease the number of headers being processed for each module, not
increase them.

I think requiring the tm-, nm-, and xm- headers to include dependent
headers is desirable.  While it will add some compilation overhead to
some configs, it should be only until they are multi-arched.  That can
be addressed even before multi-arch, since the macros can be converted
to functions and moved to the appropriate -tdep.c or -nat.c file.

        --jtc

-- 
J.T. Conklin
RedBack Networks


  reply	other threads:[~2001-03-02 16:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-01 17:44 J.T. Conklin
2001-03-02  8:25 ` Andrew Cagney
2001-03-02 16:34   ` J.T. Conklin [this message]
2001-03-05  8:11     ` Andrew Cagney
2001-03-06 13:08       ` J.T. Conklin
2001-03-05  8:11 ` Andrew Cagney
2001-03-06 13:10   ` J.T. Conklin
2001-03-05  8:11 ` Andrew Cagney
2001-03-06 12:38   ` J.T. Conklin
2001-03-05  8:11 ` Andrew Cagney
2001-03-06 13:02   ` J.T. Conklin
2001-03-05  8:11 ` Andrew Cagney
2001-03-06  9:20   ` Fernando Nasser
2001-03-06 11:32     ` J.T. Conklin
2001-03-06 13:27   ` J.T. Conklin
2001-03-06 15:06     ` Andrew Cagney
2001-03-05  8:11 ` Andrew Cagney
2001-03-06 12:41   ` J.T. Conklin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5mpufzlmg5.fsf@jtc.redback.com \
    --to=jtc@redback.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb-patches@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox