From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gW8XJFKs72m0Lz8AWB0awg (envelope-from ) for ; Mon, 27 Apr 2026 14:34:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1777314898; bh=2BwDWc3Ul1odiltKFQQkIPQhTqoiJM9gvMU4Icw45Cs=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QNSRt0fIFlS6xYR8PeFPIEXFcY1+iOur/ELcPk4IRNOkUhxdJXhfFQzWz92Orvsdd NGIZTpPS1EGFIMjWAjwFU1NHuNpQd9AvmdBsaCm5hdLX+uLz9broTiU1NgnHQScw/J Glu5KUDZ9+GjydHCpO2s4wty0kjooscJhxUXxjls= Received: by simark.ca (Postfix, from userid 112) id 7C0C71E067; Mon, 27 Apr 2026 14:34:58 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED 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=wUoLIPmS; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 456D21E067 for ; Mon, 27 Apr 2026 14:34:57 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id CB14C4B99F57 for ; Mon, 27 Apr 2026 18:34:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB14C4B99F57 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=wUoLIPmS Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id A8A814BA2E1B for ; Mon, 27 Apr 2026 18:34:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A8A814BA2E1B 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 A8A814BA2E1B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777314872; cv=none; b=KNgv/Vd352MR3iuxr9W03Zxb5ko8siXhztMtTLvfGHB4Y1jrf+6zqAZQo1TOGznOlCnyVyMtTbMlSO0aEwjHb5qttniUk6pbVgJ9apMGx3CJG0WjXk4YrBRiL5yGLgXZW1mO0B2Mf8VKbKFmbC/yqkwmQn5Wr4qhMDYuG6LXgWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777314872; c=relaxed/simple; bh=2BwDWc3Ul1odiltKFQQkIPQhTqoiJM9gvMU4Icw45Cs=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=f8fdV2sisJojaobNM+mzXoana7xjOw/T751NahdjJbfZ1yOYlJ6Mqcp5bvuBvnOsS3QH0iUzHWLwsDaUzpK05JdGl5p2kNG+Q5EDG4ucpEU24gbJ7GrtK2hqJfAsbQOGNVJ6/GKgpYg5pQszCeTL3E5LJpWIQdV7k9u3oy/VwwY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8A814BA2E1B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1777314870; bh=2BwDWc3Ul1odiltKFQQkIPQhTqoiJM9gvMU4Icw45Cs=; h=Date:Subject:To:References:From:In-Reply-To:From; b=wUoLIPmSNSYT5YFZ9xMpJev4TSK5DW2Tz6aHlS7/PxWBsXzFZW2hzeb+PmJ+h6KP2 p7itRL60z+2yeSZxmdnqcSLNGPwxiwQD8tA6IrTuVBnZImz+nRcOshmtdgFXSwB9TM L2pzT08zoxNG5SYgDBhtulVrZUZNDkUOg5Wcf5Jg= Received: by simark.ca (Postfix) id 604531E067; Mon, 27 Apr 2026 14:34:30 -0400 (EDT) Message-ID: <57efa500-e317-4c37-9d51-946d09102e48@simark.ca> Date: Mon, 27 Apr 2026 14:34:30 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] [gdb] Support default locations in DWARF5 loclists To: Gregori Mignerot , gdb-patches@sourceware.org References: <20260427175528.1272510-1-gregori.mignerot@laposte.net> Content-Language: fr From: Simon Marchi In-Reply-To: <20260427175528.1272510-1-gregori.mignerot@laposte.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 4/27/26 1:50 PM, Gregori Mignerot wrote: > Add support and a test for default location entries in DWARF5 loclists > (DW_LLE_default_location, section 2.6.2 in the DWARF5 standard) > --- > Applied the review comments from v2 > >> Are you able to mention some producers that produce default locations, >> so we can look? > Problem is, the producers I've found are DWARF linkers or assemblers, > so they don't have a strong opinion on the matter, ex. [1][2]. > Also llvm-dwarfdump --verify doesn't complain about misplaced default > location entries but that's probably because it's not checked at all. Ok, and just out of curiosity (since you don't mention any producers that use DW_LLE_default_location), does the motivation for this change come from a real-world use case? >> If we don't need to support non-conforming implementations, I think we >> could stick to what the spec says, it would make the code a little bit >> simpler: when encountering a DW_LLE_default_location, you can return >> this that expression right away, instead of saving it to a local >> variable to be returned later. > You're right, since there's no precedent that's simpler. > Changed it in v3. git-am complains about these whitespace errors: Applying: Support default locations in DWARF5 loclists /home/smarchi/src/binutils-gdb/.git/rebase-apply/patch:85: trailing whitespace. /home/smarchi/src/binutils-gdb/.git/rebase-apply/patch:113: indent with spaces. addr_size, offset_size, /home/smarchi/src/binutils-gdb/.git/rebase-apply/patch:114: indent with spaces. dlbaton->per_cu, per_objfile); If you configure pre-commit [1], it will also point those out: $ pre-commit run --all-files ... check-whitespace.........................................................Failed - hook id: check-whitespace - exit code: 2 gdb/dwarf2/loc.c:4059: trailing whitespace. + gdb/dwarf2/loc.c:4091: indent with spaces. + addr_size, offset_size, gdb/dwarf2/loc.c:4092: indent with spaces. + dlbaton->per_cu, per_objfile); [1] https://sourceware.org/gdb/wiki/DeveloperTips#Setting_up_pre-commit > @@ -458,6 +466,12 @@ dwarf2_find_location_expression (const dwarf2_loclist_baton *baton, > loc_ptr += bytes_read; > } > > + if (kind == DEBUG_LOC_DEFAULT_LOCATION) > + { > + *locexpr_length = length; > + return loc_ptr; > + } I would just add a comment like this above: /* DW_LLE_default_location can only appear as the last entry (other than the "end of list" entry) of a location list. If we see it, we know we don't have to search further. */ Otherwise, the patch LGTM, we just need to wait for your copyright assignment to be complete, let us know when that is done. Simon