From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 0DA213858D32 for ; Mon, 28 Nov 2022 21:59:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0DA213858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ASLh3o0023271; Mon, 28 Nov 2022 21:59:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=KPvKET8+BY1kwcyXOU9c0Hq8sj+ulIyCWu4J1OpXSXs=; b=bwX1SWWscHPt7y9nRJr6CKDnDsZd2FVhqQiMwc5y1tRYh6EG5Xi0wycefZI13SPc7V6f doh8Ga1zHMJ2C7KS4O9fwDu3FMtXX1Xf001fvElnbQAl3/IabioTv6V32N1BR5VBqWR+ oI89oDpOW2d8ZdVYR5a1HoPJVqUJcVmyg/Kjz8YtNeCXT7/iM+IC/UBU/J6G8JMC3XRa MJrhybvxmwcVxhh+EAEa4PyOlX/avXqfd/6Puf4TEU5fGgVSpIdVuVUxwINtl/DumoxQ YbFjxKAEDqeti7XfZ6FsCbeRANC+nZgSm3C1B7xRwRnsfEW5sK3KJPK1ZbxDFLlkMn/Q pA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3m3adt50cd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Nov 2022 21:59:18 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2ASLPCiJ011468; Mon, 28 Nov 2022 21:59:17 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2047.outbound.protection.outlook.com [104.47.73.47]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3m398c8n2x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Nov 2022 21:59:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oauhz2HSK0Y+lnyTIdm7f5lSJ7fBa2KKvvaIfVAXrCEY+LWna398r3p+ox8dGVBLGDS7x7WwMZUSR+Mr9LDCixPBKNNPNrlVpFSKqSe67onr4xghnYFpJcIajeBZAju6JJJZgV5rW9JoMWYuB4j/TMsJBdFt9yNAd1H/2+xW55eVXN9bVf0KhMVI1ocCBhoEPqZHBiFnGNeaaCPDJXUUWT0BUCpnx9sHZNENW0/gF9RyU1XjTa9Y+jaGM8rB5OHpTVkoe9m5cXBzk4RcYroOaLNI3mXeMa33zDMwI6rSzXHDKtlErutirzD2+WSCRu4MyacdzG/dApRNwrkOfpzzNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KPvKET8+BY1kwcyXOU9c0Hq8sj+ulIyCWu4J1OpXSXs=; b=OzALFiuItapONlmtb2EQlbnBDbWQamVrg0Os1AiJH1x1WdjjYz0YkGkCYpeBOWhzQlboc9rjed11hJZKIxg5eKQ495KgsfkI/R/vGwMnY+DutUeYCvhDZlEo6DDHHcMHE1NdcRwhJSySTjsTIjEGiuhFzCKd0L9eUMy9KRPH6tRa7j9s8tSwNhlOhg15NlQ0XXdiwxjvFdPle9W/pM8FZYr6T2ofWK4uynOi75N+uoBIs3LpLMyacotmVkhkse5w06GxdjiZ1xGJBUvhqnCx5JjIl2SxojXR+p+vxj+81L4tfa0ZFGh4gJBbHXNY+A11UUlv2Af/pVDmZJY4xwY1rA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KPvKET8+BY1kwcyXOU9c0Hq8sj+ulIyCWu4J1OpXSXs=; b=eEZaGp3xrjN8cSmDzIpiULTwQgj2DXT+GLOWsbC3ddensz4kqedXtmm9UZKNicLl6P15lCRQdOnjARjYihgcZsbTSP0ejAyukGddJoQtfk76YC0U1cxdIsGmippq1RmhFVT3JJjB6FCe2ynl6UB6r91D4ev2l9NyhdquQFFhO/Q= Received: from MWHPR10MB1407.namprd10.prod.outlook.com (2603:10b6:300:23::20) by MN2PR10MB4301.namprd10.prod.outlook.com (2603:10b6:208:1d9::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.23; Mon, 28 Nov 2022 21:59:14 +0000 Received: from MWHPR10MB1407.namprd10.prod.outlook.com ([fe80::931c:1fd0:72a2:dfd2]) by MWHPR10MB1407.namprd10.prod.outlook.com ([fe80::931c:1fd0:72a2:dfd2%10]) with mapi id 15.20.5857.023; Mon, 28 Nov 2022 21:59:14 +0000 Message-ID: <522c1be2-4ea0-aaa4-b512-f16b6de13e01@oracle.com> Date: Mon, 28 Nov 2022 15:59:11 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v4] ELF based front-end readers fallback feature Content-Language: en-US To: Dodji Seketeli , "Guillermo E. Martinez via Libabigail" References: <20221121185102.1163007-1-guillermo.e.martinez@oracle.com> <20221122160050.2031623-1-guillermo.e.martinez@oracle.com> <87fse3oywm.fsf@seketeli.org> From: "Guillermo E. Martinez" In-Reply-To: <87fse3oywm.fsf@seketeli.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SN4PR0501CA0131.namprd05.prod.outlook.com (2603:10b6:803:42::48) To MWHPR10MB1407.namprd10.prod.outlook.com (2603:10b6:300:23::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR10MB1407:EE_|MN2PR10MB4301:EE_ X-MS-Office365-Filtering-Correlation-Id: e5207871-8bb5-4983-2a67-08dad18bc9da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 00sOPq/7RGLpU1gj7Mp7EWejVeJSJJEe5N1rZssKY5qmBI2bnmT//KU9TVXv9pbynmQYu12JNueGeeLRt9ZNR47bgekckuigKHRGlpTKwep5qxuo9KI2QbArg5ATNw3HHHftadO2Znx2hGOJBwC+mBseXO9cagDkULA2wBXA75cVBalHoBhhuDQrcHQIAgaaSlCm6lGJZwMAdMwnrLaP+1Z9SEzHGcttgjGUoAUj47nqMogloOlH5zmDUT5VSmePchkGkbI43rfyr+nG0P0kraSlkK9gnTau39ehZJCcSQUgHjhPGS0GKoVMsPbdFfPnK2MqP/RjdEB4RBV6UgW9L9TDGSRXC+vy3OiBGlfqHMGYOoUJD8FzZSAa5wD65BCDsM3nuY9nT9N9X5K9xZFDsAj9VR3ku9sfiP/gB5JUYukuwGOWFcmvsBs9/PIdXwwx0N4iGSTW1MJLcbUzDhqcYZcL58UUzHRSO55CXLWSqE+bPwD+5CTLhfw/BV/j1DzmBPC+UyoNfACiKM7owCRX+JbhaVLQUrrzby/OlAYPGrCR/H4aJ+gYXisbxsIn7q1SmYTpkEmvSoh/YoJEg95RjqnumU2D5xHllX0NXXM1GGiOS8O6mqH/vJ7LykqQo+BhS/1uJjyY/56yX2vqu4MCJlNifmi3PobZnPygpCuJwDXkaXnIDVakdoXbOJr8jWUwdKQxmvwPrvyLlHKWOFwiP1chKKMUoJ1nQVn35Q+RGrI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR10MB1407.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(376002)(396003)(39860400002)(136003)(366004)(451199015)(31686004)(66899015)(86362001)(31696002)(6666004)(478600001)(6486002)(2906002)(36756003)(6512007)(186003)(83380400001)(2616005)(38100700002)(66946007)(41300700001)(6506007)(53546011)(316002)(30864003)(110136005)(66556008)(8676002)(8936002)(5660300002)(66476007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UXhlRWtybXRLRFpxWkJCZTlaZzRTZ0E1Tysva243b0dJSFQ3Y1JiTWFVeTJD?= =?utf-8?B?ZktvV0xPbzVwYms3Mnl1U0FMQUFxM1U5T1dMdFVnSFMzdHozOUQrd1FPVXdO?= =?utf-8?B?UmNWc213ZTNtS0JQOW5pMWFZdmJySUp4dU9YUUhMcy9DNHQ5ZmplY3JSTjls?= =?utf-8?B?VHhUQzYxd1VtQmROc0cvemZCL0RUaFFtUEtGa0oreUZXTWJUUHZFUWRZWGxi?= =?utf-8?B?a2hUN2RKYVNYL1VPT29DK25nWlA3WVFPMjdqdGcyaUE1SUFEL1ZCb2o2Y3pN?= =?utf-8?B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8QPVC8EOw8XVgPkckiw7ZbI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5207871-8bb5-4983-2a67-08dad18bc9da X-MS-Exchange-CrossTenant-AuthSource: MWHPR10MB1407.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2022 21:59:14.6336 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: S3LjW3Ez0maNa42ldc4ML1Z56tQOBvGB7KkbrZ4aKmIawtmljBjukfgdx0roA6gpT5BVNdXJa67u5Fl7Pwx9qsWniioAVeyZzJlnXlMYZZ0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4301 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-28_17,2022-11-28_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211280158 X-Proofpoint-ORIG-GUID: gU3gvb_xx1VEsURIgeIXytWC96R-myCo X-Proofpoint-GUID: gU3gvb_xx1VEsURIgeIXytWC96R-myCo X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_ASCII_DIVIDERS,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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: On 28/11/22 9:56, Dodji Seketeli wrote: > Hello Guillermo, > Hello Dodji, > Many thanks for the update! The patch looks good to me. > Your welcome!. > I have amended it somewhat and applied the result to the master branch. > > Please find below my comments. > > "Guillermo E. Martinez via Libabigail" a > écrit: > >> By default, `abidw', `abidiff', `abipkgdiff' and `kmidiff' tools use >> debug information in `DWARF` format, if present, otherwise now >> automatically the tools try to extract and build the IR using >> debug information in `CTF` format without use of `--ctf' option, if >> present, finally, if neither is found, they use only `ELF` symbols to >> extract, build, compare and report the binary IR. To force the use of >> CTF front-end the `--ctf' option should be pass to command line. >> >> It works for libraries and Linux kernel. The `--ctf' option is >> preserved to explicitly indicate to those tools that we want to use >> CTF support. By other hand, if tools use `--ctf' but binary doesn't >> have CTF debug information it looks for DWARF automatically. > > I have slightly amended this part of the commit log. You'll see the > resulting patch at the very end of this message. > OK. > [...] > >> diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc >> index 5fde94f3..fdefd3a6 100644 >> --- a/src/abg-ctf-reader.cc >> +++ b/src/abg-ctf-reader.cc > > [...] > > >> /// Getter of the environment of the current CTF reader. >> /// >> /// @return the environment of the current CTF reader. >> @@ -349,27 +355,24 @@ public: >> // Read the ELF-specific parts of the corpus. >> elf::reader::read_corpus(status); >> >> - if ((status & STATUS_NO_SYMBOLS_FOUND) >> - || !(status & STATUS_OK)) >> - // Either we couldn't find ELF symbols or something went badly >> - // wrong. There is nothing we can do with this ELF file. Bail >> - // out. >> - return; >> - >> corpus_sptr corp = corpus(); >> if ((corp->get_origin() & corpus::LINUX_KERNEL_BINARY_ORIGIN) >> && corpus_group()) >> { >> - status |= fe_iface::STATUS_OK; >> + // Is expected not find debug information when we're building >> + // a kABI. > > I have slightly amended the comment here to make it read like this: > > + // Not finding any debug info so far is expected if we are > + // building a kABI. > >> + status &= static_cast >> + (~STATUS_DEBUG_INFO_NOT_FOUND); >> return; >> } >> >> - /* Get the raw ELF section contents for libctf. */ >> - if (!find_ctf_section()) >> - { >> - status |= fe_iface::STATUS_DEBUG_INFO_NOT_FOUND; >> - return; >> - } >> + if ((status & (STATUS_NO_SYMBOLS_FOUND | >> + STATUS_DEBUG_INFO_NOT_FOUND)) >> + || !(status & STATUS_OK)) > > the STATUS_DEBUG_INFO_NOT_FOUND bit cannot be set here because you have > unset it above by doing: > >> + status &= static_cast >> + (~STATUS_DEBUG_INFO_NOT_FOUND); > > So I have changed that condition to make it read: > OK. > + if ((status & STATUS_NO_SYMBOLS_FOUND) > + || !(status & STATUS_OK)) > > [...] > > >> diff --git a/src/abg-elf-reader.cc b/src/abg-elf-reader.cc >> index eedeaf8e..3f191bda 100644 >> --- a/src/abg-elf-reader.cc >> +++ b/src/abg-elf-reader.cc > > [...] > > >> >> +bool >> +reader::has_dwarf_debug_info() const > > I have added a doxygen comment to this function. > >> +{return ((priv_->dwarf_handle != nullptr) >> + || (priv_->alt_dwarf_handle != nullptr));} >> + >> +bool >> +reader::has_ctf_debug_info() const > > Likewise. > >> +{return (priv_->ctf_section != nullptr);} >> + > > [...] > >> diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc >> index 8898ef97..0a523b87 100644 > > [...] > >> diff --git a/include/abg-tools-utils.h b/include/abg-tools-utils.h >> index 9dc9b8d3..13d6ad75 100644 >> --- a/include/abg-tools-utils.h >> +++ b/include/abg-tools-utils.h >> @@ -322,7 +322,10 @@ build_corpus_group_from_kernel_dist_under(const string& root, >> elf_based_reader_sptr >> create_best_elf_based_reader(const string& elf_file_path, >> const vector& debug_info_root_paths, >> - environment& env); >> + environment& env, >> + bool use_ctf, > > Rather than adding a boolean here, I have added a parameter > 'corpus::origin requested_fe_kind'. This is basically the kind of > front-end requested by the user when invoking the tool. For instance, > if --ctf is provided on the command line, requested_fe_kind should be > set to corpus::CTF_ORIGIN. If nothing is provided on the command line, > either requested_fe_kind could be set to either > corpus::ARTIFICIAL_ORIGIN or corpus::DWARF_ORIGIN. When we have another > kind of front-end tomorrow, requested_fe_kind will still be able to be > used because that new front-end is likely to be for a new kind > corpus::origin. So, I think that doing this is a more generic solution. > Oh, much better to be ready for adding new frond-ends. >> + bool show_all_types, >> + bool linux_kernel_mode = false); >> >> }// end namespace tools_utils >> > >> --- a/src/abg-tools-utils.cc >> +++ b/src/abg-tools-utils.cc >> @@ -405,6 +405,23 @@ is_regular_file(const string& path) >> return false; >> } > > [...] > >> @@ -2853,13 +2807,16 @@ build_corpus_group_from_kernel_dist_under(const string& root, >> /// Create the best elf based reader (or front-end), given an ELF file. >> /// >> /// This function looks into the ELF file. If it contains DWARF debug >> -/// info, then a DWARF Reader front-end is created and returned. >> -/// Otherwise, if it contains CTF debug info, then a CTF Reader >> -/// front-end is created and returned. >> +/// info, then a DWARF Reader front-end is created and returned, unless >> +/// that @ref use_ctf be true. Otherwise, if it contains CTF debug info, >> +/// then a CTF Reader front-end is created and returned. >> +/// >> +/// By other hand, it selects the DWARF front-end when @ref use_ctf is >> +/// true but ELF file doesn't have CTF debug information. >> /// >> /// Otherwise, if the file contains no debug info or if the king of >> -/// debug info is not yet recognized, a DWARF Reader front-end is >> -/// created and returned. >> +/// debug info is not yet recognized, a DWARF or CTF Reader front-end is >> +/// created and returned depending of @ref use_ctf parameter. >> /// >> /// @param elf_file_path a path to the ELF file to consider >> /// >> @@ -2868,32 +2825,62 @@ build_corpus_group_from_kernel_dist_under(const string& root, >> /// >> /// @param env the environment to use for the front-end. >> /// >> +/// @param use_ctf set to true if it's going to use CTF front-end. >> +/// >> +/// @param show_all_types option to be passed to elf based readers. >> +/// >> +/// @param linux_kernel_mode option to bed passed to elf based readers, >> +/// >> /// @return the ELF based Reader that is better adapted for the binary >> /// designated by @p elf_file_path. >> elf_based_reader_sptr >> create_best_elf_based_reader(const string& elf_file_path, >> const vector& debug_info_root_paths, >> - environment& env) >> + environment& env, >> + bool use_ctf, >> + bool show_all_types, >> + bool linux_kernel_mode) > > Following my comment above about the declaration of this function, I > have updated its definition here. > > Near the end of this message, I'll paste my changes against the tree > containing your patch, so that you can see clearly the changes I've made > to create_best_elf_based_reader and to all the other related parts of > the patch. But right now, please find the hunk I have come up with > about this specific location of the source code: OK. > > -/// Create the best elf based reader (or front-end), given an ELF file. > +/// Create the best elf based reader (or front-end), given an ELF > +/// file. > +/// > +/// This function looks into the ELF file; depending on the kind of > +/// debug info it contains and on the request of the user, the "best" > +/// front-end is created. > /// > -/// This function looks into the ELF file. If it contains DWARF debug > -/// info, then a DWARF Reader front-end is created and returned, unless > -/// that @ref use_ctf be true. Otherwise, if it contains CTF debug info, > -/// then a CTF Reader front-end is created and returned. > +/// If the user requested the use of the CTF front-end, then, if the > +/// file contains CTF debug info, the CTF front-end is created, > +/// assuming libabigail is built with CTF support. > /// > -/// By other hand, it selects the DWARF front-end when @ref use_ctf is > -/// true but ELF file doesn't have CTF debug information. > +/// If the binary ONLY has CTF debug info, then CTF front-end is > +/// created, even if the user hasn't explicitly requested the creation > +/// of the CTF front-end. > /// > -/// Otherwise, if the file contains no debug info or if the king of > -/// debug info is not yet recognized, a DWARF or CTF Reader front-end is > -/// created and returned depending of @ref use_ctf parameter. > +/// Otherwise, by default, the DWARF front-end is created. > /// > /// @param elf_file_path a path to the ELF file to consider > /// > @@ -2825,7 +2824,10 @@ build_corpus_group_from_kernel_dist_under(const string& root, > /// > /// @param env the environment to use for the front-end. > /// > -/// @param use_ctf set to true if it's going to use CTF front-end. > +/// @param requested_fe_kind the kind of front-end specifically > +/// requested by the user. At the moment, only the CTF front-end can > +/// be requested, using the "--ctf" command line option on some tools > +/// using the library. > /// > /// @param show_all_types option to be passed to elf based readers. > /// > @@ -2837,7 +2839,7 @@ elf_based_reader_sptr > create_best_elf_based_reader(const string& elf_file_path, > const vector& debug_info_root_paths, > environment& env, > - bool use_ctf, > + corpus::origin requested_fe_kind, > bool show_all_types, > bool linux_kernel_mode) > { > @@ -2845,41 +2847,36 @@ create_best_elf_based_reader(const string& elf_file_path, > if (guess_file_type(elf_file_path) != FILE_TYPE_ELF) > return result; > > + if (requested_fe_kind & corpus::CTF_ORIGIN) > + { > #ifdef WITH_CTF > - if (!use_ctf) > + if (file_has_ctf_debug_info(elf_file_path, debug_info_root_paths)) > + result = ctf::create_reader(elf_file_path, debug_info_root_paths, env); > +#endif > + } > + else > { > + // The user hasn't formally requested the use of the CTF front-end. > +#ifdef WITH_CTF > + if (!file_has_dwarf_debug_info(elf_file_path, debug_info_root_paths) > + && file_has_ctf_debug_info(elf_file_path, debug_info_root_paths)) > + // The file has CTF debug info and no DWARF, let's use the CTF > + // front end even if it wasn't formally requested by the user. > + result = ctf::create_reader(elf_file_path, debug_info_root_paths, env); > #endif > + } > + > + if (!result) > + { > + // This is the default case. At worst, the DWARF reader knows > + // how to handle just ELF data for the case where there is no > + // DWARF debug info present. > result = dwarf::create_reader(elf_file_path, > debug_info_root_paths, > env, > show_all_types, > linux_kernel_mode); > -#ifdef WITH_CTF > - if (!file_has_dwarf_debug_info(elf_file_path, > - debug_info_root_paths) > - && file_has_ctf_debug_info(elf_file_path, > - debug_info_root_paths)) > - result = ctf::create_reader(elf_file_path, > - debug_info_root_paths, > - env); > } > - else > - { > - result = ctf::create_reader(elf_file_path, > - debug_info_root_paths, > - env); > - > - if (!file_has_ctf_debug_info(elf_file_path, > - debug_info_root_paths) > - && file_has_dwarf_debug_info(elf_file_path, > - debug_info_root_paths)) > - result = dwarf::create_reader(elf_file_path, > - debug_info_root_paths, > - env, > - show_all_types, > - linux_kernel_mode); > - } > -#endif > > return result; > } > > [...] > > I have adjusted the rest of the code accordingly. > > Please find below the diff of my changed related to > create_best_elf_based_reader and to other related parts. > > --------------------------->8<------------------------------------------ > diff --git a/include/abg-tools-utils.h b/include/abg-tools-utils.h > index 13d6ad75..3d7f0d23 100644 > --- a/include/abg-tools-utils.h > +++ b/include/abg-tools-utils.h > @@ -317,13 +317,13 @@ build_corpus_group_from_kernel_dist_under(const string& root, > suppr::suppressions_type& supprs, > bool verbose, > environment& env, > - corpus::origin origin = corpus::DWARF_ORIGIN); > + corpus::origin requested_fe_kind = corpus::DWARF_ORIGIN); > > elf_based_reader_sptr > create_best_elf_based_reader(const string& elf_file_path, > const vector& debug_info_root_paths, > environment& env, > - bool use_ctf, > + corpus::origin requested_debug_info_kind, > bool show_all_types, > bool linux_kernel_mode = false); > > diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc > index 0a523b87..b089b69c 100644 > --- a/src/abg-tools-utils.cc > +++ b/src/abg-tools-utils.cc > @@ -2755,7 +2755,7 @@ build_corpus_group_from_kernel_dist_under(const string& root, > suppressions_type& supprs, > bool verbose, > environment& env, > - corpus::origin origin) > + corpus::origin requested_fe_kind) > { > string vmlinux = vmlinux_path; > corpus_group_sptr group; > @@ -2787,11 +2787,7 @@ build_corpus_group_from_kernel_dist_under(const string& root, > create_best_elf_based_reader(vmlinux, > di_roots, > env, > -#ifdef WITH_CTF > - origin & corpus::CTF_ORIGIN, > -#else > - false, > -#endif > + requested_fe_kind, > /*read_all_types=*/false, > /*linux_kernel_mode=*/true); > ABG_ASSERT(reader); > @@ -2804,19 +2800,22 @@ build_corpus_group_from_kernel_dist_under(const string& root, > return group; > } > > -/// Create the best elf based reader (or front-end), given an ELF file. > +/// Create the best elf based reader (or front-end), given an ELF > +/// file. > +/// > +/// This function looks into the ELF file; depending on the kind of > +/// debug info it contains and on the request of the user, the "best" > +/// front-end is created. > /// > -/// This function looks into the ELF file. If it contains DWARF debug > -/// info, then a DWARF Reader front-end is created and returned, unless > -/// that @ref use_ctf be true. Otherwise, if it contains CTF debug info, > -/// then a CTF Reader front-end is created and returned. > +/// If the user requested the use of the CTF front-end, then, if the > +/// file contains CTF debug info, the CTF front-end is created, > +/// assuming libabigail is built with CTF support. > /// > -/// By other hand, it selects the DWARF front-end when @ref use_ctf is > -/// true but ELF file doesn't have CTF debug information. > +/// If the binary ONLY has CTF debug info, then CTF front-end is > +/// created, even if the user hasn't explicitly requested the creation > +/// of the CTF front-end. > /// > -/// Otherwise, if the file contains no debug info or if the king of > -/// debug info is not yet recognized, a DWARF or CTF Reader front-end is > -/// created and returned depending of @ref use_ctf parameter. > +/// Otherwise, by default, the DWARF front-end is created. > /// > /// @param elf_file_path a path to the ELF file to consider > /// > @@ -2825,7 +2824,10 @@ build_corpus_group_from_kernel_dist_under(const string& root, > /// > /// @param env the environment to use for the front-end. > /// > -/// @param use_ctf set to true if it's going to use CTF front-end. > +/// @param requested_fe_kind the kind of front-end specifically > +/// requested by the user. At the moment, only the CTF front-end can > +/// be requested, using the "--ctf" command line option on some tools > +/// using the library. > /// > /// @param show_all_types option to be passed to elf based readers. > /// > @@ -2837,7 +2839,7 @@ elf_based_reader_sptr > create_best_elf_based_reader(const string& elf_file_path, > const vector& debug_info_root_paths, > environment& env, > - bool use_ctf, > + corpus::origin requested_fe_kind, > bool show_all_types, > bool linux_kernel_mode) > { > @@ -2845,41 +2847,36 @@ create_best_elf_based_reader(const string& elf_file_path, > if (guess_file_type(elf_file_path) != FILE_TYPE_ELF) > return result; > > + if (requested_fe_kind & corpus::CTF_ORIGIN) > + { > #ifdef WITH_CTF > - if (!use_ctf) > + if (file_has_ctf_debug_info(elf_file_path, debug_info_root_paths)) > + result = ctf::create_reader(elf_file_path, debug_info_root_paths, env); > +#endif > + } > + else > { > + // The user hasn't formally requested the use of the CTF front-end. > +#ifdef WITH_CTF > + if (!file_has_dwarf_debug_info(elf_file_path, debug_info_root_paths) > + && file_has_ctf_debug_info(elf_file_path, debug_info_root_paths)) > + // The file has CTF debug info and no DWARF, let's use the CTF > + // front end even if it wasn't formally requested by the user. > + result = ctf::create_reader(elf_file_path, debug_info_root_paths, env); > #endif > + } > + > + if (!result) > + { > + // This is the default case. At worst, the DWARF reader knows > + // how to handle just ELF data for the case where there is no > + // DWARF debug info present. > result = dwarf::create_reader(elf_file_path, > debug_info_root_paths, > env, > show_all_types, > linux_kernel_mode); > -#ifdef WITH_CTF > - if (!file_has_dwarf_debug_info(elf_file_path, > - debug_info_root_paths) > - && file_has_ctf_debug_info(elf_file_path, > - debug_info_root_paths)) > - result = ctf::create_reader(elf_file_path, > - debug_info_root_paths, > - env); > } > - else > - { > - result = ctf::create_reader(elf_file_path, > - debug_info_root_paths, > - env); > - > - if (!file_has_ctf_debug_info(elf_file_path, > - debug_info_root_paths) > - && file_has_dwarf_debug_info(elf_file_path, > - debug_info_root_paths)) > - result = dwarf::create_reader(elf_file_path, > - debug_info_root_paths, > - env, > - show_all_types, > - linux_kernel_mode); > - } > -#endif > > return result; > } > diff --git a/tools/abidiff.cc b/tools/abidiff.cc > index 6cd948bf..5ffe47a3 100644 > --- a/tools/abidiff.cc > +++ b/tools/abidiff.cc > @@ -1197,15 +1197,15 @@ main(int argc, char* argv[]) > case abigail::tools_utils::FILE_TYPE_ELF: // fall through > case abigail::tools_utils::FILE_TYPE_AR: > { > + corpus::origin requested_fe_kind = corpus::DWARF_ORIGIN; > +#ifdef WITH_CTF > + if (opts.use_ctf) > + requested_fe_kind = corpus::CTF_ORIGIN; > +#endif > abigail::elf_based_reader_sptr rdr = > create_best_elf_based_reader(opts.file1, > opts.prepared_di_root_paths1, > - env, > -#ifdef WITH_CTF > - opts.use_ctf, > -#else > - false, > -#endif > + env, requested_fe_kind, > opts.show_all_types); > ABG_ASSERT(rdr); > > @@ -1271,15 +1271,15 @@ main(int argc, char* argv[]) > case abigail::tools_utils::FILE_TYPE_ELF: // Fall through > case abigail::tools_utils::FILE_TYPE_AR: > { > + corpus::origin requested_fe_kind = corpus::DWARF_ORIGIN; > +#ifdef WITH_CTF > + if (opts.use_ctf) > + requested_fe_kind = corpus::CTF_ORIGIN; > +#endif > abigail::elf_based_reader_sptr rdr = > create_best_elf_based_reader(opts.file2, > opts.prepared_di_root_paths2, > - env, > -#ifdef WITH_CTF > - opts.use_ctf, > -#else > - false, > -#endif > + env, requested_fe_kind, > opts.show_all_types); > ABG_ASSERT(rdr); > > diff --git a/tools/abidw.cc b/tools/abidw.cc > index d711751f..3b1a1bd5 100644 > --- a/tools/abidw.cc > +++ b/tools/abidw.cc > @@ -553,17 +553,18 @@ load_corpus_and_write_abixml(char* argv[], > > corpus_sptr corp; > fe_iface::status s = fe_iface::STATUS_UNKNOWN; > + corpus::origin requested_fe_kind = corpus::DWARF_ORIGIN; > +#ifdef WITH_CTF > + if (opts.use_ctf) > + requested_fe_kind = corpus::CTF_ORIGIN; > +#endif > + > // First of all, create a reader to read the ABI from the file > // specfied in opts ... > abigail::elf_based_reader_sptr reader = > create_best_elf_based_reader(opts.in_file_path, > opts.prepared_di_root_paths, > - env, > -#ifdef WITH_CTF > - opts.use_ctf, > -#else > - false, > -#endif > + env, requested_fe_kind, > opts.load_all_types, > opts.linux_kernel_mode); > ABG_ASSERT(reader); > @@ -819,7 +820,7 @@ load_kernel_corpus_group_and_write_abixml(char* argv[], > > global_timer.start(); > t.start(); > - corpus::origin origin = > + corpus::origin requested_fe_kind = > #ifdef WITH_CTF > opts.use_ctf ? corpus::CTF_ORIGIN : > #endif > @@ -830,7 +831,8 @@ load_kernel_corpus_group_and_write_abixml(char* argv[], > opts.vmlinux, > opts.suppression_paths, > opts.kabi_whitelist_paths, > - supprs, opts.do_log, env, origin); > + supprs, opts.do_log, env, > + requested_fe_kind); > t.stop(); > > if (opts.do_log) > diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc > index ecdfb45f..1feb3d9e 100644 > --- a/tools/abipkgdiff.cc > +++ b/tools/abipkgdiff.cc > @@ -1323,15 +1323,15 @@ compare(const elf_file& elf1, > abigail::elf_based_reader_sptr reader; > corpus_sptr corpus1; > { > + corpus::origin requested_fe_kind = corpus::DWARF_ORIGIN; > +#ifdef WITH_CTF > + if (opts.use_ctf) > + requested_fe_kind = corpus::CTF_ORIGIN; > +#endif > abigail::elf_based_reader_sptr reader = > create_best_elf_based_reader(elf1.path, > di_dirs1, > - env, > -#ifdef WITH_CTF > - opts.use_ctf, > -#else > - false, > -#endif > + env, requested_fe_kind, > opts.show_all_types); > ABG_ASSERT(reader); > > @@ -1423,15 +1423,15 @@ compare(const elf_file& elf1, > > corpus_sptr corpus2; > { > + corpus::origin requested_fe_kind = corpus::DWARF_ORIGIN; > +#ifdef WITH_CTF > + if (opts.use_ctf) > + requested_fe_kind = corpus::CTF_ORIGIN; > +#endif > abigail::elf_based_reader_sptr reader = > create_best_elf_based_reader(elf2.path, > di_dirs2, > - env, > -#ifdef WITH_CTF > - opts.use_ctf, > -#else > - false, > -#endif > + env, requested_fe_kind, > opts.show_all_types); > ABG_ASSERT(reader); > > @@ -1589,15 +1589,15 @@ compare_to_self(const elf_file& elf, > corpus_sptr corp; > abigail::elf_based_reader_sptr reader; > { > + corpus::origin requested_fe_kind = corpus::DWARF_ORIGIN; > +#ifdef WITH_CTF > + if (opts.use_ctf) > + requested_fe_kind = corpus::CTF_ORIGIN; > +#endif > abigail::elf_based_reader_sptr reader = > create_best_elf_based_reader(elf.path, > di_dirs, > - env, > -#ifdef WITH_CTF > - opts.use_ctf, > -#else > - false, > -#endif > + env, requested_fe_kind, > opts.show_all_types); > ABG_ASSERT(reader); > > diff --git a/tools/kmidiff.cc b/tools/kmidiff.cc > index 391677ca..728392e3 100644 > --- a/tools/kmidiff.cc > +++ b/tools/kmidiff.cc > @@ -421,7 +421,7 @@ main(int argc, char* argv[]) > > corpus_group_sptr group1, group2; > string debug_info_root_dir; > - corpus::origin origin = > + corpus::origin requested_fe_kind = > #ifdef WITH_CTF > opts.use_ctf ? corpus::CTF_ORIGIN : > #endif > @@ -443,8 +443,8 @@ main(int argc, char* argv[]) > opts.suppression_paths, > opts.kabi_whitelist_paths, > opts.read_time_supprs, > - opts.verbose, > - env, origin); > + opts.verbose, env, > + requested_fe_kind); > print_kernel_dist_binary_paths_under(opts.kernel_dist_root1, opts); > } > else if (ftype == FILE_TYPE_XML_CORPUS_GROUP) > @@ -469,8 +469,8 @@ main(int argc, char* argv[]) > opts.suppression_paths, > opts.kabi_whitelist_paths, > opts.read_time_supprs, > - opts.verbose, > - env, origin); > + opts.verbose, env, > + requested_fe_kind); > print_kernel_dist_binary_paths_under(opts.kernel_dist_root2, opts); > } > else if (ftype == FILE_TYPE_XML_CORPUS_GROUP) > > --------------------------->8<------------------------------------------ > > > So, in the end, please find below the whole final patch that I have applied to the > master branch. > > Many thanks! > Thanks to you for comments and review! > Cheers, > > [...] Best regards, guillermo