From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Sa1CEIng8Wq9RDoAWB0awg (envelope-from ) for ; Mon, 09 Nov 2026 10:02:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1794236553; bh=dwxFFJ5xUODDWxLobgFOu+dFLRn6ncXgx/E+8LILdXI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=v4CYk7/npnBMmyyqZVUKpnP/YRV0tGO2HeEch8drDG0CmEcVbAOxKDzHapyi5ZA1Y fMPSBJQqj++WJX2E2UZk/AMxq4vPISSFktmbQQpWaMW9416C1j0dSSrkOB90oPokCq yLOemubeLmYpy1V5mGiHc5Rwr+5lx3NLgVb3woDs= Received: by simark.ca (Postfix, from userid 112) id 0C1631E023; Mon, 09 Nov 2026 10:02:33 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=hyBe8gKE; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 222601E023 for ; Mon, 09 Nov 2026 10:02:31 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BA8CB4BA7985 for ; Mon, 9 Nov 2026 15:02:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA8CB4BA7985 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=hyBe8gKE Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id E99354BA23E4 for ; Mon, 9 Nov 2026 15:02:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E99354BA23E4 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E99354BA23E4 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794236526; cv=none; b=Kk/1WZ5SYqnbBgn5hSGWTW4X0WgZGXGE1QZ1lpzdJ/x278/L4HYENAPGiLfdBZfbbD2n6gLy7uv2QFmmP7ON3lPgqYzHbO6S9dK1wAl5gf8nRio0zEW3bI0ptr1gnDpdeE/eXZJ9mnU7wFHZZ5TW21oPR6OeHe5zpknc9EDbZ5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794236526; c=relaxed/simple; bh=dwxFFJ5xUODDWxLobgFOu+dFLRn6ncXgx/E+8LILdXI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=DJOW3x3HfdI4aHG8WBp//Z219aiQTBApp2WPdWEYoy30NHbP49I2sZUqRGCiiDLWMKKixKnh9ttHI7vvAkSTy3l9G9ETGjvsZHRP+l5yzjeIpN8e3Tn0r8RkneHoyDk1G7JSYqL7KgQTmBONyAH3UW/O0uRNANCTZ/mBjeDcDCc= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=hyBe8gKE DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E99354BA23E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1794236524; bh=dwxFFJ5xUODDWxLobgFOu+dFLRn6ncXgx/E+8LILdXI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hyBe8gKE/0b8uF3sQVMJ/mMwl4qLJZbHs15a5z2YzLmX6QcD9JlBX/EhNUdVyUg4C wMppYdd4pwOsZOFwBdMzFD6mgK7aUFLVnqCn3Ju2rN5tcAvXvXpLcwDaKO1uk6KkwI bsTSqLyw8+wU/iRZdJmiKgmGQ/CRziXpKqlLZ5ZI= Received: by simark.ca (Postfix) id E6D981E023; Mon, 09 Nov 2026 10:02:03 -0500 (EST) Message-ID: Date: Mon, 9 Nov 2026 10:02:03 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/2] gdb: Introduce ada-tasks.h for functions defined in ada-tasks.c To: =?UTF-8?Q?K=C3=A9vin_Le_Gouguec?= Cc: gdb-patches@sourceware.org References: <20230127165337.1832937-1-legouguec@adacore.com> <7561007673151647213c12316b34961b5ee9f657.1793983731.git.legouguec@adacore.com> <87bj7ys6wy.fsf@adacore.com> Content-Language: fr From: Simon Marchi In-Reply-To: <87bj7ys6wy.fsf@adacore.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 11/9/26 4:14 AM, Kévin Le Gouguec wrote: > Simon Marchi writes: > >> On 11/6/26 11:51 AM, Kévin Le Gouguec wrote: >>> Also move the documentation for these functions to the new header, instead >>> of at the top of their definition, to align with our current practice. >>> >>> I tried to honor our guideline that .c files should not rely on indirect >>> inclusion, hence I only removed #include "ada-lang.h" directives in .c files >>> that, as far as I could tell, only rely on symbols declared in ada-tasks.h. >> >> Tom can perhaps more formally approve, but I like this patch. > > (Thanks for taking a look!) > >> I check that by opening the file in my VSCode+clangd, if there is any >> error reported it means something is missing. > > Thanks for mentioning; decided to give clangd a try and after some > .clangd fiddling¹, I do get a warning-free ada-tasks.h with your > amendments. I'm curious whether & how you configure it tho, since I get > more spurious-looking diagnoses if I venture into other files²; I'm > assuming I'm missing more compilation flags, and wondering how best to > get an "authoritative" list & keep it up-to-date. > > (Searched gdb-patches because I'm sure you've mentioned your clangd > setup before, but could not find my answers) > > (FWIW, I think that's the first language server I try with Eglot that > defaults to enabling inlay hints & semantic tokens. Thanks for the > hearty fruit salad 😀) > > > ¹ Current state of affairs: > > If: > PathMatch: gdb.*/.*.[ch] > CompileFlags: > Add: > - -I/ABSOLUTE/PATH/TO/binutils-gdb/include > - -I/ABSOLUTE/PATH/TO/binutils-gdb/gdb > - -I/ABSOLUTE/PATH/TO/binutils-gdb/gnulib/import > - -I/ABSOLUTE/PATH/TO/binutils-gdb > - -I/ABSOLUTE/PATH/TO/binutils-gdb/bfd > - -include > - /ABSOLUTE/PATH/TO/binutils-gdb/gdbsupport/common-defs.h I would not try to do it by hand, use a generated compile_commands.json isntead. Do a clang build somewhere (if you don't have one already), you can start with this and adjust to your liking: $ ../path/to/configure CC="ccache clang" CXX="ccache clang++" --enable-targets=all --with-python=python3 --with-guile --enable-sim --disable-werror Then build with "bear" to generate compile_commands.json: $ bear -- make -j $(nproc) If the build fails in a middle and you have to tweak something, do a "make clean" and start over, because bear by default replaces the entire compile_commands.json, so you could be missing what was previously successfully compiled (or you could use "bear -a" I guess, but I prefer starting from scratch). The reason I am using a clang build for this is that if you build with gcc, then compile_commands.json will contain some flags unknown to clang, and at least a long time ago clangd would warn about them. Maybe that improved in the recent years. You can disable the directories you don't care about (e.g. "--disable-ld"). Then, make a symlink from your source dir to the compile_commands.json: $ cd path/to/source $ ln -s path/to/clang/build/compile_commands.json Now, clangd should be mostly error-free when opening anything. > Curious if the file can be kept "relocatable", i.e. free of absolute > paths. From the doc & open GH issues, unsure whether compilation > commands are relative to the project root, or if some placeholder exists > that will be expanded to the project root. I don't think it's worth maintaining something like that. There are also some include paths that point into the actual build you are using, so that would be quite complicated. > ² E.g. all members of gdb/ada-tasks.c:struct ada_tasks_pspace_data are > flagged with > >> clang [expected_semi_decl_list]: Expected ';' at end of declaration list It's not expected, let's see if that goes away once you have a compile_commands.json. Simon