From patchwork Fri Nov 12 16:13:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jose E. Marchesi" X-Patchwork-Id: 47539 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B6D9A3858024 for ; Fri, 12 Nov 2021 16:13:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6D9A3858024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1636733632; bh=376zhal066PVf/wU1Aiy5FyKWnWdasyTVgVk3s4/m58=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=sTnjJ2Vj7x9PM8Ke5KCpxYGCYNULMFD+0CXaz7NoT8GOuAAG+itwXMUN6pa3QkkjJ ABEQuDkcDnspcNobO8059fpIgMHOfaJbpUinbHvL8mFmoYuvSxwe+Jbt9768nnbt0o P32mMPpVB7xn2yojZPpsG3svUbByQh2x44IsO+cE= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id A9AA23857C56 for ; Fri, 12 Nov 2021 16:13:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A9AA23857C56 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1ACFsM7l008613 for ; Fri, 12 Nov 2021 16:13:28 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3c9kn529xy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 12 Nov 2021 16:13:27 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1ACG9w5Z099168 for ; Fri, 12 Nov 2021 16:13:26 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2040.outbound.protection.outlook.com [104.47.74.40]) by userp3030.oracle.com with ESMTP id 3c842fbueh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 12 Nov 2021 16:13:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XS+55fiTp8zqfTMtJMhizAnJDroEglYR1aZbFlZqqqYdpoO+sBoG7H0dWTf8YuzqogpBrYAi+NnsBYtMXT0hqrBkKAMj9URO+8tM+c0034og0mx8IT7+s8JTmvN5KeFbVE+2kDbRXhhYuQ/4rTBBcdCxQxgwlokyXERV0GnVBH+fneYZnx2mT3ugL0aZMKtdqcX8Hh3sCJdAFL99Lm1KKbA2HtdchbdYoG+th9kP4O6CovPZ5nVtOGxnb/R2T8ibtTbXPla4BIFzDHSSL7OeIaH6wjHV3Nc4j/VfqpUc7q+a9rOTGPWZSW2e9Kg3BRZbR8AYdnYUlwRxlDkgQnsjAQ== 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=376zhal066PVf/wU1Aiy5FyKWnWdasyTVgVk3s4/m58=; b=SrSOFpxvdMweb7dsVOVHoAlnzpG/C/biSo9RT5x58yct8o0XK5QRJkrhav0sf3nhZgGiE83mdnulcw97Fzxk4UoDdQS0A7HAvudq2sH8AyrmrRMbmgIooLIwpXuF56iuPG4d5RiM9Ilx1CpwQEKByQF8e1onLKQb2W6iFJyC4DUFPA0Hca9l9FcMKpVa74gyKMuUFoUHS7oDHeItXvPXYnRg9tCqc3ONIaM7jWtOhaJ2HF+4i8sk6c7/MYsnUiO1J6GSxlbZgk5pqAhffvS8PCFKpObwHqYmtnoUWgs/XV/MrMq5j9uw6PhmInpT+0j+ncHWsoQX6c1oy5JESKCW9A== 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 Received: from BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) by BY5PR10MB4003.namprd10.prod.outlook.com (2603:10b6:a03:1fc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Fri, 12 Nov 2021 16:13:23 +0000 Received: from BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::48bf:86b4:32e1:6574]) by BYAPR10MB2888.namprd10.prod.outlook.com ([fe80::48bf:86b4:32e1:6574%4]) with mapi id 15.20.4669.021; Fri, 12 Nov 2021 16:13:23 +0000 To: libabigail@sourceware.org Subject: [PATCH] Move dwarf_reader::status facilities to an abigail::elf_reader namespace Date: Fri, 12 Nov 2021 17:13:16 +0100 Message-Id: <20211112161316.22107-1-jose.marchesi@oracle.com> X-Mailer: git-send-email 2.11.0 X-ClientProxiedBy: LO2P265CA0450.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e::30) To BYAPR10MB2888.namprd10.prod.outlook.com (2603:10b6:a03:88::32) MIME-Version: 1.0 Received: from termi.localdomain (141.143.193.72) by LO2P265CA0450.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16 via Frontend Transport; Fri, 12 Nov 2021 16:13:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b62ecb6c-45bf-4344-4143-08d9a5f75985 X-MS-TrafficTypeDiagnostic: BY5PR10MB4003: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R2WH1Az9VXKS1QBziHnAoV4WWlYuQGGgYgMcmTC6Sf5I6mV/VkDBi2TxZmHRDUi8vdGE6f05a3Iz16Zi/XccJQb8njnz0F6LmaKPM+uo6BL32i8cfdQi/zigjq6O0o+GqDYZFom8kmE/D2ZA3HOA2BB4Bu1+beDwM9+9zx/fobTpwXZPZFeUeyF0oRy8S4gf5m44QzV4cCswurIFCy4U9zcSjplW4aq3jgIT4gQPBECnQ1w+Ht1TAsY957dDxWdn8wukY2KwItKEwF/moXx5XroH9VxkJ0u4NbX0NtkO+zq7mtJJ1EIGXoD2qlLWTehyv2zELcxtgB1b9od3db1JuZcaDMnm9zTZEV1kDZJbHHiBhUDAMH4QI7KuFkS2b3Kr2DXpPiwRjTAwxmDTR/Wg6BSxLQg19VsyG/HXRl71Q8Yl0lcRVrbpNYHhY8fuKW8+VQG/guLeOf2E3ndaOPjwfsB53v7D/gCLppTdQImHdgWRit9DEpPUYU/AcqpOupp6NV3SE112Aqfow2hFbGjIBwmlwy/voSYtqMSUpHXXMHJ03F0bxPmOXs/j/wodX1huNzoA9apmPVH+f/ySvs7s4APsp9scEmH9KkSHAFOlkP9lwuoiZwBsqjwm2j5ECNZHaIjOSHIArNxD4vlh6rnKSWRFIpSotuq/qcn1p7y4CfpegXx4C62hmQ6ECjNe4Vf4Qz3MkDt5yy7sQjtuwX1fQg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB2888.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(26005)(66556008)(6506007)(2906002)(36756003)(5660300002)(66476007)(83380400001)(956004)(2616005)(6486002)(186003)(30864003)(6666004)(86362001)(8676002)(52116002)(316002)(66946007)(38350700002)(1076003)(508600001)(6512007)(38100700002)(6916009)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OF1VeA/q30w3l+xanHqsBBVJH8ZWrUijx9azN/6VA/7jZERGKyu2xFop7oTpaHHwTvab/mIPR8FK5R/AHL4tjPl2pZ1F6cHgppztY37f7Wt2sSdCVGMhOkNln+l+72CgJ4mjssyY4ymxZfDmIqut+fiarQu0qScvcobQ/Xo4CrK0OI1ca+bbuvxqhdG+4/EOIgXJ0m0xAJuii6ULiY9+8L4Tsk+IjGxCBgqBzJQld4Myy1OZtQsUd1yI2+zWZaCua/1zD823rmJbRjiZfylF/HDfiH4LCmWltu76JEsNXW+hLOGTGCdO7BTbH5unLvZ0LDOAp021Oe9ediAataGgYXXeREeTL3na8v21PWTQkCbh6RMkqErb1JTRrITkbUW8s4FQRoNgk9OLTM6y7+JnLcgDrQ9Vy8wsdORiV2AbS5JFL3w2tRnQYmMucsbsPQJxC/fhIhx65waqNt2fmCHbIxK7MD1fsdgnxxNIBNPKTucRdQhUk3p9qcnIK31l0nDrsirenKoHYXTsPnOOkh9OdawOK5ekscthv1CcWRjH7sswFvAF6HJhKU4Hp4fva4n47gnK7ie/8gkqdnVYQsTWckxd2KmFGjelD9W0GWF202w1F/iq2stLCdtEkfaR0P6g3qVmad4a2Q7mjuicJ7uJW8/t5SFHJH7p4t/1Eb84fYOvbcTDYiMSKwa+HMcBdj6fV590LcZTfRjqvm2U/9yxV5eg7cnSNTC4+Lv22AGufEaWbviBtKo1LWKxWfr6aJsmwGQV+LoB93zXS3AEeyFRvTQ4wpG1CYnk2Il8N5H/q7T9qWuUDaicElYNMlm8N8GtTA1C8AOIH7li/RRibHkfeBu2N7tNRPgWiW55qTR8V5TW8kaAbHhQc30esrXK7JzUroFgT4uIqg0aRo8z5IJWcY92nOYrUeyZAJAnVdR+dumO6jhspl/ig/urmNirKxZZH6rvt7ZU3fTTgVwuP1JdwRZ7nY1zmES5LW36ocYLJ9uuK6w88r5aHt+032Wuh7qgra6hmefANMAJTEiMAa2pFXyS8qp/+2FmkmPNfyBWTHWAgEBnBetqDlxOomUAjKH/XBqNohNFyErSavkHh/CNCy+hhLMPn+TL+z/+DEZ54uZi9kSef471z2EHyvXyS5doNLUohcNY8rHXkDaqm2egenj2m2EoUGIqXLfgXNqjaaC6xhLHQ1DlkNhrINBKMFKGMhsdaGHHpiDFF/NiDlcw+MCzUu+88q8E8kPTwDMAusaVwuB2K3OwfaF+MZj2YBwj2HEfJv1LqsYoy5SAocuoplWyDbVna+PGdKHFFjwpiJm7h0Ih50uQigKgT3sCnXEUiW/vFkhP+C4ROVFj1OEFiPWwfbGAbzE6O1h7NoMU9BAWd59C0lyK1XRt8180kbsxXwLgTXbkfS4W7bvIzfRF8KLbm7052BhawWcDllj4KHda6uxqNpvdfmuQ0HoRqmSSZakdBr/y4YN9vkMZDR8tHvLX9gMzwZzJfH5jCNXBiUXe0LPSf2tgJ9SXmVUrKFodVrkghP7Qs+kp7TlwaNiLTV153TCoM7DxmiiEf3ws917m4NBAaAA2j18d4DL2t/2nfLugn3scVHXo5aUsI0DoJ0AD7G6U6trLr+D/ybZ3amWvYd2LxnenTw7q/5J75G5VmGIseCrKEmxEwpkthxi75g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b62ecb6c-45bf-4344-4143-08d9a5f75985 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB2888.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2021 16:13:23.1673 (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: SDKJLW/dRHN6eiXEGtD92IJarFlVX1Xcg4SA6lIL32JT2js4iTGQ56vVP+41WGZSyT+pCqVkucmXQtoE0W6tOdW7F7EJyEoCC5IlIgbXe0o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4003 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10166 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111120093 X-Proofpoint-ORIG-GUID: HIU0IP5nNDUbrsTWA0tvpw9E_7RaStOC X-Proofpoint-GUID: HIU0IP5nNDUbrsTWA0tvpw9E_7RaStOC X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Jose E. Marchesi via Libabigail" From: "Jose E. Marchesi" Reply-To: "Jose E. Marchesi" Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" The DWARF reader is no longer the only ELF-based reader in libabigail: the CTF reader also operates on ELF files. Other ELF-based formats (such as BTF) may also join in the future. These readers share a lot of similarities: they all operate on object files, they fetch debugging information from certain sections, they rely on the symtab of the read object, the debugging info may be in a separated file (for certain formats) and so on. It follows that a lot of logic can be shared among all the ELF-based readers. This patch is oriented to that direction. A new namespace, abigail::elf_reader, is introduced with the goal of holding features and definitions useful for any ELF-based abigail reader. Then all the definitions related to the status resulting from extracting a corpus from an object file (the dwarf_reader::status) are moved to abigail::elf_reader. The utilities and tests are adjusted accordingly. Tested in x86_64. No regressions observed. Signed-off-by: Jose E. Marchesi * include/abg-reader-status.h: New file. * include/abg-dwarf-reader.h (enum status): Move to abg-reader-status.h. (status_to_diagnostic_string): Likewise. (operator|): Likewise. (operator&): Likewise. (operator|=): Likewise. (operator&=): Likewise. Include abg-reader-status.h. * include/Makefile.am (pkginclude_HEADERS): Add abg-elf-reader-status.h. * src/abg-elf-reader-status.cc: New file. * src/abg-dwarf-reader.cc (operator|): Move to abg-elf-reader-status.cc. (operator&): Likewise. (operator|): Likewise. (operator|=): Likewise. (operator&=): Likewise. (status_to_diagnostic_string): Likewise. * src/Makefile.am (libabigail_la_SOURCES): Add elf-reader-status.cc. * src/abg-tools-utils.cc: Use abigail::elf_reader instead of abigail::dwarf_reader for the status definitions. * tools/abicompat.cc: Likewise. * tools/abidiff.cc: Likewise. * tools/abidw.cc: Likewise. * tools/abilint.cc: Likewise. * tools/abipkgdiff.cc: Likewise. * tests/print-diff-tree.cc: Likewise. * tests/test-diff-dwarf.cc: Likewise. * tests/test-read-dwarf.cc: Likewise. * tests/test-symtab.cc: Likewise. * tests/test-ir-walker.cc: Likewise. --- include/Makefile.am | 1 + include/abg-dwarf-reader.h | 47 +++------------------- include/abg-elf-reader-status.h | 66 +++++++++++++++++++++++++++++++ src/Makefile.am | 1 + src/abg-dwarf-reader.cc | 55 +------------------------- src/abg-elf-reader-status.cc | 87 +++++++++++++++++++++++++++++++++++++++++ src/abg-tools-utils.cc | 2 +- tests/print-diff-tree.cc | 6 +-- tests/test-diff-dwarf.cc | 4 +- tests/test-ir-walker.cc | 2 +- tests/test-read-dwarf.cc | 4 +- tests/test-symtab.cc | 24 ++++++------ tools/abicompat.cc | 20 +++++----- tools/abidiff.cc | 17 ++++---- tools/abidw.cc | 10 ++--- tools/abilint.cc | 8 ++-- tools/abipkgdiff.cc | 38 +++++++++--------- 17 files changed, 230 insertions(+), 162 deletions(-) create mode 100644 include/abg-elf-reader-status.h create mode 100644 src/abg-elf-reader-status.cc diff --git a/include/Makefile.am b/include/Makefile.am index 9e5e037b..0f316878 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -5,6 +5,7 @@ abg-interned-str.h \ abg-ir.h \ abg-corpus.h \ abg-reader.h \ +abg-elf-reader-status.h \ abg-dwarf-reader.h \ abg-writer.h \ abg-comparison.h \ diff --git a/include/abg-dwarf-reader.h b/include/abg-dwarf-reader.h index a328fb0e..f7ad4564 100644 --- a/include/abg-dwarf-reader.h +++ b/include/abg-dwarf-reader.h @@ -18,6 +18,7 @@ #include #include "abg-corpus.h" #include "abg-suppression.h" +#include "abg-elf-reader-status.h" namespace abigail { @@ -28,42 +29,6 @@ namespace dwarf_reader using namespace abigail::ir; -/// The status of the @ref read_corpus_from_elf() call. -enum status -{ - /// The status is in an unknown state - STATUS_UNKNOWN = 0, - - /// This status is for when the call went OK. - STATUS_OK = 1, - - /// This status is for when the debug info could not be read. - STATUS_DEBUG_INFO_NOT_FOUND = 1 << 1, - - /// This status is for when the alternate debug info could not be - /// found. - STATUS_ALT_DEBUG_INFO_NOT_FOUND = 1 << 2, - - /// This status is for when the symbols of the ELF binaries could - /// not be read. - STATUS_NO_SYMBOLS_FOUND = 1 << 3, -}; - -string -status_to_diagnostic_string(status s); - -status -operator|(status, status); - -status -operator&(status, status); - -status& -operator|=(status&, status); - -status& -operator&=(status&, status); - /// The kind of ELF file we are looking at. enum elf_type { @@ -111,17 +76,17 @@ void set_read_context_corpus_group(read_context& ctxt, corpus_group_sptr& group); corpus_sptr -read_corpus_from_elf(read_context& ctxt, status& stat); +read_corpus_from_elf(read_context& ctxt, elf_reader::status& stat); corpus_sptr read_corpus_from_elf(const std::string& elf_path, const vector& debug_info_root_paths, ir::environment* environment, bool load_all_types, - status&); + elf_reader::status&); corpus_sptr -read_and_add_corpus_to_group_from_elf(read_context&, corpus_group&, status&); +read_and_add_corpus_to_group_from_elf(read_context&, corpus_group&, elf_reader::status&); bool lookup_symbol_from_elf(const environment* env, @@ -140,12 +105,12 @@ bool refers_to_alt_debug_info(const read_context& ctxt, string& alt_di_path); -status +elf_reader::status has_alt_debug_info(read_context& ctxt, bool& has_alt_di, string& alt_debug_info_path); -status +elf_reader::status has_alt_debug_info(const string& elf_path, char** debug_info_root_path, bool& has_alt_di, diff --git a/include/abg-elf-reader-status.h b/include/abg-elf-reader-status.h new file mode 100644 index 00000000..b18f3d9b --- /dev/null +++ b/include/abg-elf-reader-status.h @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// -*- Mode: C++ -*- +// +// Copyright (C) 2013-2020 Red Hat, Inc. +// +// Author: Dodji Seketeli + +/// @file +/// +/// This file contains declarations implementing the different status +/// in which a corpus read from an ELF file can result. It is used by +/// the readers based on ELF files, such as DWARF and CTF. + +#ifndef __ABG_ELF_READER_STATUS__ +#define __ABG_ELF_READER_STATUS__ + +#include + +namespace abigail +{ + +/// The namespace for an ELF based reader. +namespace elf_reader +{ + +/// The status of the @ref read_corpus_from_elf() call. +enum status +{ + /// The status is in an unknown state + STATUS_UNKNOWN = 0, + + /// This status is for when the call went OK. + STATUS_OK = 1, + + /// This status is for when the debug info could not be read. + STATUS_DEBUG_INFO_NOT_FOUND = 1 << 1, + + /// This status is for when the alternate debug info could not be + /// found. + STATUS_ALT_DEBUG_INFO_NOT_FOUND = 1 << 2, + + /// This status is for when the symbols of the ELF binaries could + /// not be read. + STATUS_NO_SYMBOLS_FOUND = 1 << 3, +}; + +std::string +status_to_diagnostic_string(status s); + +status +operator|(status, status); + +status +operator&(status, status); + +status& +operator|=(status&, status); + +status& +operator&=(status&, status); + +}// end namespace elf_reader + +}// end namespace abigail + +#endif //__ABG_ELF_READER_STATUS__ diff --git a/src/Makefile.am b/src/Makefile.am index b60d74cb..6b92f2c9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,6 +26,7 @@ abg-suppression-priv.h \ abg-suppression.cc \ abg-comp-filter.cc \ abg-reader.cc \ +abg-elf-reader-status.cc \ abg-dwarf-reader.cc \ abg-libxml-utils.cc \ abg-hash.cc \ diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 74ab95f3..e5d54fa1 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -56,6 +56,7 @@ ABG_END_EXPORT_DECLARATIONS #endif using std::string; +using namespace abigail::elf_reader; namespace abigail { @@ -15394,60 +15395,6 @@ build_ir_node_from_die(read_context& ctxt, true); } -status -operator|(status l, status r) -{ - return static_cast(static_cast(l) - | static_cast(r)); -} - -status -operator&(status l, status r) -{ - return static_cast(static_cast(l) - & static_cast(r)); -} - -status& -operator|=(status& l, status r) -{ - l = l | r; - return l; -} - -status& -operator&=(status& l, status r) -{ - l = l & r; - return l; -} - -/// Emit a diagnostic status with english sentences to describe the -/// problems encoded in a given abigail::dwarf_reader::status, if -/// there is an error. -/// -/// @param status the status to diagnose -/// -/// @return a string containing sentences that describe the possible -/// errors encoded in @p s. If there is no error to encode, then the -/// empty string is returned. -string -status_to_diagnostic_string(status s) -{ - string str; - - if (s & STATUS_DEBUG_INFO_NOT_FOUND) - str += "could not find debug info\n"; - - if (s & STATUS_ALT_DEBUG_INFO_NOT_FOUND) - str += "could not find alternate debug info\n"; - - if (s & STATUS_NO_SYMBOLS_FOUND) - str += "could not load ELF symbols\n"; - - return str; -} - /// Create a dwarf_reader::read_context. /// /// @param elf_path the path to the elf file the context is to be used for. diff --git a/src/abg-elf-reader-status.cc b/src/abg-elf-reader-status.cc new file mode 100644 index 00000000..c42667e8 --- /dev/null +++ b/src/abg-elf-reader-status.cc @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// -*- Mode: C++ -*- +// +// Copyright (C) 2013-2020 Red Hat, Inc. +// +// Author: Dodji Seketeli + +/// @file +/// +/// This file contains the implementation of facilities to deal with +/// status codes related to ELF based readers. + +#include "config.h" + +#include "abg-internal.h" + +// +ABG_BEGIN_EXPORT_DECLARATIONS + +#include "abg-elf-reader-status.h" + +ABG_END_EXPORT_DECLARATIONS +// + +namespace abigail +{ + +namespace elf_reader +{ + +status +operator|(status l, status r) +{ + return static_cast(static_cast(l) + | static_cast(r)); +} + +status +operator&(status l, status r) +{ + return static_cast(static_cast(l) + & static_cast(r)); +} + +status& +operator|=(status& l, status r) +{ + l = l | r; + return l; +} + +status& +operator&=(status& l, status r) +{ + l = l & r; + return l; +} + +/// Return a diagnostic status with english sentences to describe the +/// problems encoded in a given abigail::elf_reader::status, if +/// there is an error. +/// +/// @param status the status to diagnose +/// +/// @return a string containing sentences that describe the possible +/// errors encoded in @p s. If there is no error to encode, then the +/// empty string is returned. +std::string +status_to_diagnostic_string(status s) +{ + std::string str; + + if (s & STATUS_DEBUG_INFO_NOT_FOUND) + str += "could not find debug info\n"; + + if (s & STATUS_ALT_DEBUG_INFO_NOT_FOUND) + str += "could not find alternate debug info\n"; + + if (s & STATUS_NO_SYMBOLS_FOUND) + str += "could not load ELF symbols\n"; + + return str; +} + +}// end namespace elf_reader + +}// end namespace abigail diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index 2fb20c6e..cccf5316 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -2544,7 +2544,7 @@ build_corpus_group_from_kernel_dist_under(const string& root, char *di_root_ptr = di_root.get(); vector di_roots; di_roots.push_back(&di_root_ptr); - abigail::dwarf_reader::status status = abigail::dwarf_reader::STATUS_OK; + abigail::elf_reader::status status = abigail::elf_reader::STATUS_OK; corpus_group_sptr group; if (!vmlinux.empty()) { diff --git a/tests/print-diff-tree.cc b/tests/print-diff-tree.cc index 12390962..6d5ec6b2 100644 --- a/tests/print-diff-tree.cc +++ b/tests/print-diff-tree.cc @@ -101,7 +101,7 @@ main(int argc, char* argv[]) if (!opts.elf1.empty() && !opts.elf2.empty()) { - dwarf_reader::status c1_status, c2_status; + elf_reader::status c1_status, c2_status; corpus_sptr c1, c2; environment_sptr env(new environment); @@ -109,7 +109,7 @@ main(int argc, char* argv[]) c1 = dwarf_reader::read_corpus_from_elf(opts.elf1, di_roots, env.get(), /*load_all_types=*/false, c1_status); - if (c1_status != dwarf_reader::STATUS_OK) + if (c1_status != elf_reader::STATUS_OK) { cerr << "Failed to read elf file " << opts.elf1 << "\n"; return 1; @@ -118,7 +118,7 @@ main(int argc, char* argv[]) c2 = dwarf_reader::read_corpus_from_elf(opts.elf2, di_roots, env.get(), /*load_all_types=*/false, c2_status); - if (c2_status != dwarf_reader::STATUS_OK) + if (c2_status != elf_reader::STATUS_OK) { cerr << "Failed to read elf file " << opts.elf2 << "\n"; return 1; diff --git a/tests/test-diff-dwarf.cc b/tests/test-diff-dwarf.cc index 02ec393d..5eaf0e21 100644 --- a/tests/test-diff-dwarf.cc +++ b/tests/test-diff-dwarf.cc @@ -380,8 +380,8 @@ main() continue; } - abigail::dwarf_reader::status status = - abigail::dwarf_reader::STATUS_UNKNOWN; + abigail::elf_reader::status status = + abigail::elf_reader::STATUS_UNKNOWN; environment_sptr env(new environment); std::vector di_roots; diff --git a/tests/test-ir-walker.cc b/tests/test-ir-walker.cc index ea93380f..e4247619 100644 --- a/tests/test-ir-walker.cc +++ b/tests/test-ir-walker.cc @@ -157,7 +157,7 @@ main(int argc, char **argv) abigail::ir::environment_sptr env(new abigail::ir::environment); abigail::corpus_sptr c; - abigail::dwarf_reader::status status = abigail::dwarf_reader::STATUS_OK; + abigail::elf_reader::status status = abigail::elf_reader::STATUS_OK; std::vector di_roots; if (!(c = abigail::dwarf_reader::read_corpus_from_elf(file_name, di_roots, env.get(), diff --git a/tests/test-read-dwarf.cc b/tests/test-read-dwarf.cc index 509bc11a..726786a1 100644 --- a/tests/test-read-dwarf.cc +++ b/tests/test-read-dwarf.cc @@ -589,8 +589,8 @@ struct test_task : public abigail::workers::task in_public_headers_path = in_elf_base + spec.in_public_headers_path; env.reset(new abigail::ir::environment); - abigail::dwarf_reader::status status = - abigail::dwarf_reader::STATUS_UNKNOWN; + abigail::elf_reader::status status = + abigail::elf_reader::STATUS_UNKNOWN; vector di_roots; ABG_ASSERT(abigail::tools_utils::file_exists(in_elf_path)); read_context_sptr ctxt = create_read_context(in_elf_path, diff --git a/tests/test-symtab.cc b/tests/test-symtab.cc index fd0fdd44..7d7a2df0 100644 --- a/tests/test-symtab.cc +++ b/tests/test-symtab.cc @@ -34,7 +34,7 @@ using suppr::suppressions_type; static const std::string test_data_dir = std::string(abigail::tests::get_src_dir()) + "/tests/data/test-symtab/"; -dwarf_reader::status +elf_reader::status read_corpus(const std::string& path, corpus_sptr& result, const std::vector& whitelist_paths = @@ -58,10 +58,10 @@ read_corpus(const std::string& path, dwarf_reader::add_read_context_suppressions(*ctxt, wl_suppr); } - dwarf_reader::status status = dwarf_reader::STATUS_UNKNOWN; + elf_reader::status status = elf_reader::STATUS_UNKNOWN; result = read_corpus_from_elf(*ctxt, status); - REQUIRE(status != dwarf_reader::STATUS_UNKNOWN); + REQUIRE(status != elf_reader::STATUS_UNKNOWN); return status; } @@ -69,22 +69,22 @@ TEST_CASE("Symtab::Empty", "[symtab, basic]") { const std::string binary = "basic/empty.so"; corpus_sptr corpus_ptr; - const dwarf_reader::status status = read_corpus(binary, corpus_ptr); + const elf_reader::status status = read_corpus(binary, corpus_ptr); REQUIRE(!corpus_ptr); - REQUIRE((status & dwarf_reader::STATUS_NO_SYMBOLS_FOUND)); + REQUIRE((status & elf_reader::STATUS_NO_SYMBOLS_FOUND)); } TEST_CASE("Symtab::NoDebugInfo", "[symtab, basic]") { const std::string binary = "basic/no_debug_info.so"; corpus_sptr corpus_ptr; - const dwarf_reader::status status = read_corpus(binary, corpus_ptr); + const elf_reader::status status = read_corpus(binary, corpus_ptr); REQUIRE(corpus_ptr); REQUIRE(status - == (dwarf_reader::STATUS_OK - | dwarf_reader::STATUS_DEBUG_INFO_NOT_FOUND)); + == (elf_reader::STATUS_OK + | elf_reader::STATUS_DEBUG_INFO_NOT_FOUND)); } // this value indicates in the following helper method, that we do not want to @@ -102,11 +102,11 @@ assert_symbol_count(const std::string& path, std::vector()) { corpus_sptr corpus_ptr; - const dwarf_reader::status status = + const elf_reader::status status = read_corpus(path, corpus_ptr, whitelist_paths); REQUIRE(corpus_ptr); - REQUIRE((status & dwarf_reader::STATUS_OK)); + REQUIRE((status & elf_reader::STATUS_OK)); const corpus& corpus = *corpus_ptr; size_t total_symbols = 0; @@ -244,10 +244,10 @@ TEST_CASE("Symtab::SymtabWithWhitelist", "[symtab, whitelist]") + "basic/one_function_one_variable_irrelevant.whitelist"); corpus_sptr corpus_ptr; - const dwarf_reader::status status = + const elf_reader::status status = read_corpus(binary, corpus_ptr, whitelists); REQUIRE(!corpus_ptr); - REQUIRE((status & dwarf_reader::STATUS_NO_SYMBOLS_FOUND)); + REQUIRE((status & elf_reader::STATUS_NO_SYMBOLS_FOUND)); } GIVEN("we read the binary with only the function whitelisted") diff --git a/tools/abicompat.cc b/tools/abicompat.cc index addd03a9..a7f701fc 100644 --- a/tools/abicompat.cc +++ b/tools/abicompat.cc @@ -246,7 +246,7 @@ using abigail::ir::type_base_sptr; using abigail::ir::function_type_sptr; using abigail::ir::function_decl; using abigail::ir::var_decl; -using abigail::dwarf_reader::status; +using abigail::elf_reader::status; using abigail::dwarf_reader::read_corpus_from_elf; using abigail::comparison::diff_context_sptr; using abigail::comparison::diff_context; @@ -696,7 +696,7 @@ main(int argc, char* argv[]) char * app_di_root = opts.app_di_root_path.get(); vector app_di_roots; app_di_roots.push_back(&app_di_root); - status status = abigail::dwarf_reader::STATUS_UNKNOWN; + status status = abigail::elf_reader::STATUS_UNKNOWN; environment_sptr env(new environment); corpus_sptr app_corpus= read_corpus_from_elf(opts.app_path, @@ -704,13 +704,13 @@ main(int argc, char* argv[]) /*load_all_types=*/opts.weak_mode, status); - if (status & abigail::dwarf_reader::STATUS_NO_SYMBOLS_FOUND) + if (status & abigail::elf_reader::STATUS_NO_SYMBOLS_FOUND) { emit_prefix(argv[0], cerr) << "could not read symbols from " << opts.app_path << "\n"; return abigail::tools_utils::ABIDIFF_ERROR; } - if (!(status & abigail::dwarf_reader::STATUS_OK)) + if (!(status & abigail::elf_reader::STATUS_OK)) { emit_prefix(argv[0], cerr) << "could not read file " << opts.app_path << "\n"; @@ -753,15 +753,15 @@ main(int argc, char* argv[]) lib1_di_roots, env.get(), /*load_all_types=*/false, status); - if (status & abigail::dwarf_reader::STATUS_DEBUG_INFO_NOT_FOUND) + if (status & abigail::elf_reader::STATUS_DEBUG_INFO_NOT_FOUND) emit_prefix(argv[0], cerr) << "could not read debug info for " << opts.lib1_path << "\n"; - if (status & abigail::dwarf_reader::STATUS_NO_SYMBOLS_FOUND) + if (status & abigail::elf_reader::STATUS_NO_SYMBOLS_FOUND) { cerr << "could not read symbols from " << opts.lib1_path << "\n"; return abigail::tools_utils::ABIDIFF_ERROR; } - if (!(status & abigail::dwarf_reader::STATUS_OK)) + if (!(status & abigail::elf_reader::STATUS_OK)) { emit_prefix(argv[0], cerr) << "could not read file " << opts.lib1_path << "\n"; @@ -780,16 +780,16 @@ main(int argc, char* argv[]) lib2_di_roots, env.get(), /*load_all_types=*/false, status); - if (status & abigail::dwarf_reader::STATUS_DEBUG_INFO_NOT_FOUND) + if (status & abigail::elf_reader::STATUS_DEBUG_INFO_NOT_FOUND) emit_prefix(argv[0], cerr) << "could not read debug info for " << opts.lib2_path << "\n"; - if (status & abigail::dwarf_reader::STATUS_NO_SYMBOLS_FOUND) + if (status & abigail::elf_reader::STATUS_NO_SYMBOLS_FOUND) { emit_prefix(argv[0], cerr) << "could not read symbols from " << opts.lib2_path << "\n"; return abigail::tools_utils::ABIDIFF_ERROR; } - if (!(status & abigail::dwarf_reader::STATUS_OK)) + if (!(status & abigail::elf_reader::STATUS_OK)) { emit_prefix(argv[0], cerr) << "could not read file " << opts.lib2_path << "\n"; diff --git a/tools/abidiff.cc b/tools/abidiff.cc index 56f57448..157d192f 100644 --- a/tools/abidiff.cc +++ b/tools/abidiff.cc @@ -45,6 +45,7 @@ using abigail::suppr::suppression_sptr; using abigail::suppr::suppressions_type; using abigail::suppr::read_suppressions; using namespace abigail::dwarf_reader; +using namespace abigail::elf_reader; using abigail::tools_utils::emit_prefix; using abigail::tools_utils::check_file; using abigail::tools_utils::guess_file_type; @@ -945,17 +946,17 @@ prepare_di_root_paths(options& o) /// @return abigail::tools_utils::ABIDIFF_ERROR if an error was /// detected, abigail::tools_utils::ABIDIFF_OK otherwise. static abigail::tools_utils::abidiff_status -handle_error(abigail::dwarf_reader::status status_code, +handle_error(abigail::elf_reader::status status_code, const abigail::dwarf_reader::read_context* ctxt, const string& prog_name, const options& opts) { - if (!(status_code & abigail::dwarf_reader::STATUS_OK)) + if (!(status_code & abigail::elf_reader::STATUS_OK)) { emit_prefix(prog_name, cerr) << "failed to read input file " << opts.file1 << "\n"; - if (status_code & abigail::dwarf_reader::STATUS_DEBUG_INFO_NOT_FOUND) + if (status_code & abigail::elf_reader::STATUS_DEBUG_INFO_NOT_FOUND) { emit_prefix(prog_name, cerr) << "could not find the debug info\n"; @@ -1008,7 +1009,7 @@ handle_error(abigail::dwarf_reader::status status_code, } } - if (status_code & abigail::dwarf_reader::STATUS_ALT_DEBUG_INFO_NOT_FOUND) + if (status_code & abigail::elf_reader::STATUS_ALT_DEBUG_INFO_NOT_FOUND) { emit_prefix(prog_name, cerr) << "could not find the alternate debug info file"; @@ -1023,7 +1024,7 @@ handle_error(abigail::dwarf_reader::status status_code, cerr << "\n"; } - if (status_code & abigail::dwarf_reader::STATUS_NO_SYMBOLS_FOUND) + if (status_code & abigail::elf_reader::STATUS_NO_SYMBOLS_FOUND) emit_prefix(prog_name, cerr) << "could not find the ELF symbols in the file '" << opts.file1 @@ -1132,9 +1133,9 @@ main(int argc, char* argv[]) env->self_comparison_debug_is_on(true); #endif translation_unit_sptr t1, t2; - abigail::dwarf_reader::status c1_status = - abigail::dwarf_reader::STATUS_OK, - c2_status = abigail::dwarf_reader::STATUS_OK; + abigail::elf_reader::status c1_status = + abigail::elf_reader::STATUS_OK, + c2_status = abigail::elf_reader::STATUS_OK; corpus_sptr c1, c2; corpus_group_sptr g1, g2; bool files_suppressed = false; diff --git a/tools/abidw.cc b/tools/abidw.cc index 240ed095..beb2fa0f 100644 --- a/tools/abidw.cc +++ b/tools/abidw.cc @@ -519,7 +519,7 @@ load_corpus_and_write_abixml(char* argv[], read_context& ctxt = *context; corpus_sptr corp; - dwarf_reader::status s = dwarf_reader::STATUS_UNKNOWN; + elf_reader::status s = elf_reader::STATUS_UNKNOWN; t.start(); corp = read_corpus_from_elf(ctxt, s); t.stop(); @@ -537,7 +537,7 @@ load_corpus_and_write_abixml(char* argv[], if (!corp) { - if (s == dwarf_reader::STATUS_DEBUG_INFO_NOT_FOUND) + if (s == elf_reader::STATUS_DEBUG_INFO_NOT_FOUND) { if (opts.di_root_paths.empty()) { @@ -567,7 +567,7 @@ load_corpus_and_write_abixml(char* argv[], } } } - else if (s == dwarf_reader::STATUS_NO_SYMBOLS_FOUND) + else if (s == elf_reader::STATUS_NO_SYMBOLS_FOUND) emit_prefix(argv[0], cerr) << "Could not read ELF symbol information from " << opts.in_file_path << "\n"; @@ -885,11 +885,11 @@ main(int argc, char* argv[]) { bool has_alt_di = false; string alt_di_path; - abigail::dwarf_reader::status status = + abigail::elf_reader::status status = abigail::dwarf_reader::has_alt_debug_info(ctxt, has_alt_di, alt_di_path); - if (status & abigail::dwarf_reader::STATUS_OK) + if (status & abigail::elf_reader::STATUS_OK) { if (alt_di_path.empty()) ; diff --git a/tools/abilint.cc b/tools/abilint.cc index 01308eb4..d8c44f82 100644 --- a/tools/abilint.cc +++ b/tools/abilint.cc @@ -346,7 +346,7 @@ main(int argc, char* argv[]) abigail::translation_unit_sptr tu; abigail::corpus_sptr corp; abigail::corpus_group_sptr group; - abigail::dwarf_reader::status s = abigail::dwarf_reader::STATUS_OK; + abigail::elf_reader::status s = abigail::elf_reader::STATUS_OK; char* di_root_path = 0; file_type type = guess_file_type(opts.file_path); @@ -426,9 +426,9 @@ main(int argc, char* argv[]) { emit_prefix(argv[0], cerr) << "failed to read " << opts.file_path << "\n"; - if (!(s & abigail::dwarf_reader::STATUS_OK)) + if (!(s & abigail::elf_reader::STATUS_OK)) { - if (s & abigail::dwarf_reader::STATUS_DEBUG_INFO_NOT_FOUND) + if (s & abigail::elf_reader::STATUS_DEBUG_INFO_NOT_FOUND) { cerr << "could not find the debug info"; if(di_root_path == 0) @@ -442,7 +442,7 @@ main(int argc, char* argv[]) << "Maybe the root path to the debug " "information is wrong?\n"; } - if (s & abigail::dwarf_reader::STATUS_NO_SYMBOLS_FOUND) + if (s & abigail::elf_reader::STATUS_NO_SYMBOLS_FOUND) emit_prefix(argv[0], cerr) << "could not find the ELF symbols in the file " << opts.file_path diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc index f90d5cb0..33efa23a 100644 --- a/tools/abipkgdiff.cc +++ b/tools/abipkgdiff.cc @@ -1231,7 +1231,7 @@ set_diff_context_from_opts(diff_context_sptr ctxt, /// /// @param detailed_error_status is this pointer is non-null and if /// the function returns ABIDIFF_ERROR, then the function sets the -/// pointed-to parameter to the abigail::dwarf_reader::status value +/// pointed-to parameter to the abigail::elf_reader::status value /// that gives details about the rror. /// /// @return the status of the comparison. @@ -1246,7 +1246,7 @@ compare(const elf_file& elf1, abigail::ir::environment_sptr &env, corpus_diff_sptr &diff, diff_context_sptr &ctxt, - abigail::dwarf_reader::status *detailed_error_status = 0) + abigail::elf_reader::status *detailed_error_status = 0) { char *di_dir1 = (char*) debug_dir1.c_str(), *di_dir2 = (char*) debug_dir2.c_str(); @@ -1263,8 +1263,8 @@ compare(const elf_file& elf1, << elf2.path << "...\n"; - abigail::dwarf_reader::status c1_status = abigail::dwarf_reader::STATUS_OK, - c2_status = abigail::dwarf_reader::STATUS_OK; + abigail::elf_reader::status c1_status = abigail::elf_reader::STATUS_OK, + c2_status = abigail::elf_reader::STATUS_OK; ctxt.reset(new diff_context); set_diff_context_from_opts(ctxt, opts); @@ -1315,7 +1315,7 @@ compare(const elf_file& elf1, corpus1 = read_corpus_from_elf(*c, c1_status); bool bail_out = false; - if (!(c1_status & abigail::dwarf_reader::STATUS_OK)) + if (!(c1_status & abigail::elf_reader::STATUS_OK)) { if (opts.verbose) emit_prefix("abipkgdiff", cerr) @@ -1332,7 +1332,7 @@ compare(const elf_file& elf1, if (opts.fail_if_no_debug_info) { bool debug_info_error = false; - if (c1_status & abigail::dwarf_reader::STATUS_DEBUG_INFO_NOT_FOUND) + if (c1_status & abigail::elf_reader::STATUS_DEBUG_INFO_NOT_FOUND) { if (opts.verbose) emit_prefix("abipkgdiff", cerr) @@ -1349,7 +1349,7 @@ compare(const elf_file& elf1, debug_info_error = true; } - if (c1_status & abigail::dwarf_reader::STATUS_ALT_DEBUG_INFO_NOT_FOUND) + if (c1_status & abigail::elf_reader::STATUS_ALT_DEBUG_INFO_NOT_FOUND) { if (opts.verbose) emit_prefix("abipkgdiff", cerr) @@ -1402,7 +1402,7 @@ compare(const elf_file& elf1, corpus2 = read_corpus_from_elf(*c, c2_status); bool bail_out = false; - if (!(c2_status & abigail::dwarf_reader::STATUS_OK)) + if (!(c2_status & abigail::elf_reader::STATUS_OK)) { if (opts.verbose) emit_prefix("abipkgdiff", cerr) @@ -1419,7 +1419,7 @@ compare(const elf_file& elf1, if (opts.fail_if_no_debug_info) { bool debug_info_error = false; - if (c2_status & abigail::dwarf_reader::STATUS_DEBUG_INFO_NOT_FOUND) + if (c2_status & abigail::elf_reader::STATUS_DEBUG_INFO_NOT_FOUND) { if (opts.verbose) emit_prefix("abipkgdiff", cerr) @@ -1436,7 +1436,7 @@ compare(const elf_file& elf1, debug_info_error = true; } - if (c2_status & abigail::dwarf_reader::STATUS_ALT_DEBUG_INFO_NOT_FOUND) + if (c2_status & abigail::elf_reader::STATUS_ALT_DEBUG_INFO_NOT_FOUND) { if (opts.verbose) emit_prefix("abipkgdiff", cerr) @@ -1520,14 +1520,14 @@ compare_to_self(const elf_file& elf, abigail::ir::environment_sptr &env, corpus_diff_sptr &diff, diff_context_sptr &ctxt, - abigail::dwarf_reader::status *detailed_error_status = 0) + abigail::elf_reader::status *detailed_error_status = 0) { char *di_dir = (char*) debug_dir.c_str(); vector di_dirs; di_dirs.push_back(&di_dir); - abigail::dwarf_reader::status c_status = abigail::dwarf_reader::STATUS_OK; + abigail::elf_reader::status c_status = abigail::elf_reader::STATUS_OK; if (opts.verbose) emit_prefix("abipkgdiff", cerr) @@ -1549,7 +1549,7 @@ compare_to_self(const elf_file& elf, corp = read_corpus_from_elf(*c, c_status); - if (!(c_status & abigail::dwarf_reader::STATUS_OK)) + if (!(c_status & abigail::elf_reader::STATUS_OK)) { if (opts.verbose) emit_prefix("abipkgdiff", cerr) @@ -2000,8 +2000,8 @@ public: diff_context_sptr ctxt; corpus_diff_sptr diff; - abigail::dwarf_reader::status detailed_status = - abigail::dwarf_reader::STATUS_UNKNOWN; + abigail::elf_reader::status detailed_status = + abigail::elf_reader::STATUS_UNKNOWN; status |= compare(args->elf1, args->debug_dir1, args->private_types_suppr1, args->elf2, args->debug_dir2, args->private_types_suppr2, @@ -2031,7 +2031,7 @@ public: if (status & abigail::tools_utils::ABIDIFF_ERROR) { string diagnostic = - abigail::dwarf_reader::status_to_diagnostic_string(detailed_status); + abigail::elf_reader::status_to_diagnostic_string(detailed_status); if (diagnostic.empty()) diagnostic = "Unknown error. Please run the tool again with --verbose\n"; @@ -2069,8 +2069,8 @@ public: diff_context_sptr ctxt; corpus_diff_sptr diff; - abigail::dwarf_reader::status detailed_status = - abigail::dwarf_reader::STATUS_UNKNOWN; + abigail::elf_reader::status detailed_status = + abigail::elf_reader::STATUS_UNKNOWN; status |= compare_to_self(args->elf1, args->debug_dir1, args->opts, env, diff, ctxt, @@ -2097,7 +2097,7 @@ public: if (status & abigail::tools_utils::ABIDIFF_ERROR) { string diagnostic = - abigail::dwarf_reader::status_to_diagnostic_string(detailed_status); + abigail::elf_reader::status_to_diagnostic_string(detailed_status); if (diagnostic.empty()) diagnostic =