Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Simon Marchi <simark@simark.ca>,
	Simon Marchi <simon.marchi@efficios.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] gdb, gdbserver, gdbsupport: include config.h files with -include
Date: Thu, 21 Mar 2024 13:02:09 +0000	[thread overview]
Message-ID: <c5347338-b5dc-4cda-90dd-91663d8a1421@palves.net> (raw)
In-Reply-To: <c3005cf2-b6a4-4712-9df0-2019d5e8d1fc@palves.net>

On 2024-03-21 12:50, Pedro Alves wrote:
> And at each step of the way, editing a header file always sees the exact
>  same set of pre-included files/symbols as when the same header
> is compiled normally.

Let me clarify this.  Here I was generally referring to the rule that source files should include their
module header right after defs.h.  Like:

 foo.c:
 #include "defs.h"
 #include "foo.h"
 * other includes *

So with that, there's one compilation unit that compiles "foo.h" exactly the same as what clangd sees when editing foo.h.

That even enforces "include what you need" in foo.h (other than the things defs.h already includes, of course).

We don't do that presently in many places, but we should do it throughout.  IIRC, Tromey even had a series to
normalize that throughout the tree a few years ago.  I don't recall why it didn't land.

  reply	other threads:[~2024-03-21 13:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 20:01 [PATCH 1/3] gdb, gdbserver, gdbsupport: reformat some Makefile variables, one entry per line Simon Marchi
2024-03-18 20:01 ` [PATCH 2/3] gdb, gdbserver, gdbsupport: include config.h files with -include Simon Marchi
2024-03-19 11:18   ` Hannes Domani
2024-03-19 12:22     ` Simon Marchi
2024-03-20 20:32   ` Pedro Alves
2024-03-21  2:11     ` Simon Marchi
2024-03-21 12:50       ` Pedro Alves
2024-03-21 13:02         ` Pedro Alves [this message]
2024-03-22 14:55         ` Simon Marchi
2024-03-22 15:08           ` Simon Marchi
2024-03-22 15:43             ` Pedro Alves
2024-03-18 20:01 ` [PATCH 3/3] gdbsupport: move more things to gdbsupport.inc.h Simon Marchi

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=c5347338-b5dc-4cda-90dd-91663d8a1421@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=simon.marchi@efficios.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