From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by sourceware.org (Postfix) with ESMTPS id 5E8CD3858C2A for ; Tue, 5 Dec 2023 13:03:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E8CD3858C2A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=canonical.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5E8CD3858C2A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=185.125.188.122 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701781428; cv=none; b=bqz+wE0mm4PLPxSMhy14FfdGJl8r12wUGQOojbvfuyEHbrfvOMcqc/ewLE543s7g2oxv0vank4iRybzEL+ZIYyl8o2qiWuF2Q8fjmVhk5qiXdlNKRL8KzUTHGmVKY+hURKnN9H0LNvylwYWU9lBXqvM8lLBkIfF8VvUAIGoLvyg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701781428; c=relaxed/simple; bh=kWdUVQYuw4GCkPMCtkvbiG4hxydEg/wnPwfxKSmPdwA=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=LYyE4vAnzMHWYRLdtzcESaS0V+UVqHqH6X6utGxZ23UERJbsdmFTg5RDC9SChieSr13S+uDE1oaY9rHryGEpAk8YBSAGrMryIcdmcBAl4BEen1bLgxJL6JlH9YlKq0dnZscfSvQ8E2W7p4IjxpNoh0+vLM1+FUbKDOXVtm1dO+g= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 5A4BE3F116 for ; Tue, 5 Dec 2023 13:03:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1701781418; bh=wnb/uRdYFxom4ilycPNrybV6F6Z0kayOYpRfLT64jFM=; h=MIME-Version:From:Date:Message-ID:Subject:To:Cc:Content-Type; b=IARL9T6KSM9iHBzF5Tsfuauwx8EN2gTs2TcNePF/VjJLzzTojcNSrCfv4RIT+hHk+ mZ+llSHhlaLWaFJF0uyyqPub7z1MMb0ng7lB9d6VRybIoLytV1AlQAt+0x3MV5SPNN UBwMQGl25gjJAj+gZZglky3h5/wLFz72MtucP2FA6/JLnHyoblO6bTqOAs+0QqRhhV xPpcmWUsg5k2L5EZGf9O8Y4ZkmTTBR+2JQekxojHIdmUFLbq3bymba82a7yq/ADXQ6 clQwuKtRzR8g07IcqIwTkMABeDdeqGclou0TxrZeXTzOjUTZbfGH9aDPZMPOr0lKdf kZSl3LY572kvw== Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-33343bb5dc2so1843866f8f.0 for ; Tue, 05 Dec 2023 05:03:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701781418; x=1702386218; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=wnb/uRdYFxom4ilycPNrybV6F6Z0kayOYpRfLT64jFM=; b=QqgAR0YFV1JSz0xc2p147DodBnnVm/DIL3q8ofvBMukBBxIPR7GJ6lTIPlxuLqARiP pPdZq1nbDuHx+xkr4Wkd6Z8ljQf9oJaUuxH3szb9RXGEmi9z9MR5zt5c8FBF6LQEqiOr +lO4E0BrAAbByqQooxCpEU3tZloVnn6QIx4XXjVk7sov7sqR5HEyNFgN5mToDPsuMRd4 Eg4sTzhPvCFRqGE9Dakczdg9yQPjILF92tkgh4e8p+K7720Is0M8KqOXmWaA34DU0sKF z1Dgw3RHW0wAyVeakPzsQ79vt/dZZf1uPpkFPhSQp3S4gOPX8h8dIhYp7jVY1vyrs/8X o1Iw== X-Gm-Message-State: AOJu0YyX97BO0IBXm+gIi6RMYRXxgWlq7YnOkrieWKnOg+nTNd/FnKbM iaXezmfTRRw2LYspEAaWXkexyiIUSUhZ/Xl4OsEKFsUFIXCD5c80EC5gQQoFBzwthyVkH7g1CAr WeJoFODUxkuy39MvOyaRD490EnNuRucwfczmfOEKXWvanCPwDp1UMiSJFzkY= X-Received: by 2002:a5d:6d8b:0:b0:333:5d14:458 with SMTP id l11-20020a5d6d8b000000b003335d140458mr423157wrs.86.1701781417966; Tue, 05 Dec 2023 05:03:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwR8qKiFRJ5j68sXaNAqDWE0Tp4HRHbEcLXXEU+atj8b2+34QhgBeqXF3aGn1HiyAi3IIDFPuSYsBOfYT05HQ= X-Received: by 2002:a5d:6d8b:0:b0:333:5d14:458 with SMTP id l11-20020a5d6d8b000000b003335d140458mr423146wrs.86.1701781417628; Tue, 05 Dec 2023 05:03:37 -0800 (PST) MIME-Version: 1.0 From: Dimitri John Ledkov Date: Tue, 5 Dec 2023 13:03:01 +0000 Message-ID: Subject: Porting pahole from dwarf_next_unit() to dwarf_get_units() To: dwarves@vger.kernel.org, elfutils-devel@sourceware.org Cc: acme@kernel.org, mark@klomp.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Currently pahole warns and does nothing upon hitting DW_TAG_skeleton_unit as implemented at https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=0135ccd632796ab3aff65b7c99b374c4682c2bcf In elfutils, a while back a new API got added that aids with discovery and processing of such tags - https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=79f0e623dcde4b042bb72f636a2211d67d5c0ade It seems to me if pahole is ported from using dwarf_next_unit() to instead use dwarf_get_units() native support can be added for split-dwarf (dwo) files. I am trying to write such a port, but it is proving to be very difficult. I am entirely unfamiliar with neither pahole nor libdw nor the dwarf file format. Thus it is very confusing when both pahole and dwarf library use very similar type names and structs. For example libdw has struct Dwarf_CU and pahole has unrelated dwarf_cu struct. What are the differences between dwarf_nextcu(), dwarf_next_unit(), dwarf_get_units() and when should one use each one of them? (or nest them?) Is a port of https://git.kernel.org/pub/scm/devel/pahole/pahole.git/tree/dwarf_loader.c?id=0135ccd632796ab3aff65b7c99b374c4682c2bcf to use dwarf_get_units() a right approach and would be welcomed? Is anyone else interested in providing any help, or guidance? -- Dimitri