Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: David Carlton <carlton@math.stanford.edu>
Cc: gdb-patches@sources.redhat.com, Jim Blandy <jimb@red-bean.com>,
	Elena Zannoni <ezannoni@redhat.com>
Subject: Re: [rfc] split up symtab.h
Date: Tue, 08 Oct 2002 15:11:00 -0000	[thread overview]
Message-ID: <3DA357B6.B37C5BC7@redhat.com> (raw)
In-Reply-To: <ro1bs64lmcp.fsf@jackfruit.Stanford.EDU>

David Carlton wrote:
> 
> I'm sick of having to recompile half of GDB every time I touch
> symtab.h.  There's lots of different things in that file; it's
> included in 137 different places (counting only the gdb directory, not
> gdb/mi, etc.), but there's no one thing that it defines that is used
> in more than 71 places, and a lot of things that it defines are used
> in a lot fewer places than that.
> 
> Here's what is defined in symtab.h, together with the number of .c
> files that each construct is mentioned in.  (I've produced this
> information with a naive use of grep/cut/uniq, so it could be off: the
> main problem is that, say, every use of 'struct blockvector' counts as
> a use of 'struct block'.  Then again, what file would use 'struct
> blockvector' without using 'struct block'?)
> 
> struct general_symbol_info (1)

Careful.  Struct general_symbol_info is mentioned in LOTS of places...
indirectly, thru uses of the macros SYMBOL_NAME, SYMBOL_TYPE, etc.


> struct minimal_symbol (71)
> struct blockvector (13)
> struct block (38)
> struct range_list (2)
> struct alias_list (2)
> struct symbol (62)
> struct partial_symbol (10)
> struct sourcevector (0)
> struct linetable_entry (6)
> struct linetable (9)
> struct source (0)
> struct section_offsets (20)
> struct symtab (65)
> struct partial_symtab (16)
> struct symtab_and_line (39)
> struct symtabs_and_lines (9)
> enum exception_event_kind (4)
> struct exception_event_record (4)
> struct symbol_search (1)
> 
> There are, of course, many function declarations in there as well.
> 
> Of course, these numbers are still pretty large, but having my
> compilation numbers cut from 137 files to 38 or 62 files or whatever
> would help a lot.  (And yes, I realize that 137 isn't accurate: many
> of the files are target-specific, so I'm not really recompiling 137
> files every time I touch symtab.h.)
> 
> I haven't generated complete correlation data; some of what I have
> generated is pretty interesting, though.  For example, while it's not
> surprising every file that mentions 'struct partial_symbol' also
> mentions 'struct symbol', I was a little surprised to see that 41
> files mention both 'struct symbol' and 'struct minimal_symbol', 21
> files mention only the former, and 30 files mention only the latter.
> 
> Here's one possible way to split things up into new files:
> 
> gensym.h:
> 
> struct general_symbol_info (1)
> 
> minsyms.h:
> 
> struct minimal_symbol (71)
> 
> block.h:
> 
> struct blockvector (13)
> struct block (38)
> 
> symbol.h:
> 
> struct range_list (2)
> struct alias_list (2)
> struct symbol (62)
> namespace_enum (5)
> enum address_class (4)
> 
> psymbol.h:
> 
> struct partial_symbol (10)
> 
> linetable.h:
> 
> struct linetable_entry (6)
> struct linetable (9)
> 
> symtab.h:
> 
> struct symtab (65)
> 
> psymtab.h:
> 
> struct partial_symtab (16)
> 
> sal.h:
> 
> struct symtab_and_line (39)
> struct symtabs_and_lines (9)
> 
> exception.h:
> 
> enum exception_event_kind (4)
> struct exception_event_record (4)
> 
> section.h:
> 
> struct section_offsets (20)
> 
> Move to symtab.c:
> 
> struct symbol_search (1)
> 
> Delete entirely (where are these used?):
> 
> struct sourcevector (0)
> struct source (0)
> 
> I haven't looked at where function declarations go; I expect that, in
> practice, it'll be pretty obvious which ones go where.  (Though there
> are a few weirdos; where does {set_}main_name go?)
> 
> Anyways, if anybody else is similarly annoyed with symtab.h then I'll
> try to split things up and make a more concrete RFA in a bit.
> 
> David Carlton
> carlton@math.stanford.edu


  parent reply	other threads:[~2002-10-08 22:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-08 13:14 David Carlton
2002-10-08 13:54 ` Kevin Buettner
2002-10-08 15:05   ` David Carlton
2002-10-08 15:11 ` Michael Snyder [this message]
2002-10-08 15:22   ` David Carlton
2002-10-18 14:12 ` Elena Zannoni
2002-10-18 14:52   ` David Carlton

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=3DA357B6.B37C5BC7@redhat.com \
    --to=msnyder@redhat.com \
    --cc=carlton@math.stanford.edu \
    --cc=ezannoni@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@red-bean.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