This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Sort #includes in gdb
- From: Tom Tromey <tom at tromey dot com>
- To: Tom Tromey <tom at tromey dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Fri, 15 Mar 2019 17:13:34 -0600
- Subject: Re: [RFC] Sort #includes in gdb
- References: <87fttfmnpq.fsf@tromey.com> <e132876c-15b3-7c47-f765-5c2db103b38e@redhat.com> <878sygydob.fsf@tromey.com>
Pedro> ISTR that you could point the bot at some branch instead of a patch?
Tom> I don't know but I will ask Sergio when he's back.
I think it can't be done.
Pedro> No firm opinion on comments vs no comments.
Tom> For now at least, I'm sticking with "no comments" because the lack of
Tom> comment-handling in the script means that adding comments makes the
Tom> script non-idempotent. But, idempotency is a good quality to have,
Tom> because it means the script can be re-run at any time to fix any
Tom> "regressions" that have crept in.
I thought about this some more and I went back and implemented limited
comment-scanning, to make this work. I think this is nicer because it
provides an in-source guide to developers saying where to add a new
#include.
I've appended the relevant bits from the rewritten objfiles.c.
Let me know what you think.
Tom
#include "defs.h"
#include "objfiles.h"
/* Standard C includes. */
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
/* Standard C++ includes. */
#include <vector>
/* Local non-gdb includes. */
#include "bfd.h"
#include "hashtab.h"
/* Local subdirectory includes. */
#include "common/pathstuff.h"
/* Local includes. */
#include "addrmap.h"
#include "arch-utils.h"
#include "bcache.h"
#include "block.h"
#include "breakpoint.h"
#include "btrace.h"
#include "complaints.h"
#include "dictionary.h"
#include "exec.h"
#include "expression.h"
#include "gdb-stabs.h"
#include "gdb_bfd.h"
#include "gdb_obstack.h"
#include "observable.h"
#include "parser-defs.h"
#include "psymtab.h"
#include "solist.h"
#include "source.h"
#include "symfile.h"
#include "symtab.h"
#include "target.h"