From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by sourceware.org (Postfix) with ESMTPS id 34CEC385E825 for ; Mon, 20 Apr 2020 15:35:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 34CEC385E825 Received: by mail-io1-xd44.google.com with SMTP id e9so3848380iok.9 for ; Mon, 20 Apr 2020 08:35:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NItZNN9rtKSD51e5x7AVgNTVmzMJUvCN/cP5yYGEIlw=; b=N2yfrTm505sIRRYoBEQzNsbKTQpgL5W/GTwH4B6p/lIE1ZM/ktpELGUAIjpxSBNukB L+cZaD5qJU1zPYYM7C/AFChswnTSBr93pwzPT91qxXRzlZ4G9iOuVnMKy4oEN9o6lYC7 QDsd0BWZ4/MY6LIrN6FikCRHs9IQcuVGk645vU4JB1Eng20WGZZGzXY6vhsRAB4zcHDt tFoGoYHgI1E7P0Z1gdI/F70ITniNeBh3i6Tka28rrlsSp3G8V0WoabGX37RBsEDeiTC9 /0U5Y3L0UqiMlBG227+gWvQ9qbnbbG4Vb9aMFQmQF1votp+Zj6RPYp0qt+BnNIuN8kCy 2ZRg== X-Gm-Message-State: AGi0PubjpftLZHzmhDVKl2gXqoqEIWZom3icembjHY62KiBEOXODPg+w Y4FZewa1UDziCwzj4pm2ZcLd2vD19gYcPmMFHvlD+Q== X-Google-Smtp-Source: APiQypKmkKc67XXQTwVQ3nM0iezvx/he4OkkCPdRf8Vdiab9XmK3u2fbSqfBoz9dUjhseyglF1JrwuiR6J6rlgxDZSY= X-Received: by 2002:a5d:8045:: with SMTP id b5mr8510487ior.16.1587396918289; Mon, 20 Apr 2020 08:35:18 -0700 (PDT) MIME-Version: 1.0 References: <20200420110846.218792-1-maennich@google.com> <20200420110846.218792-2-maennich@google.com> In-Reply-To: <20200420110846.218792-2-maennich@google.com> From: Giuliano Procida Date: Mon, 20 Apr 2020 16:35:02 +0100 Message-ID: Subject: Re: [PATCH 1/8] abg-dwarf-reader split: create abg-elf-helpers.{h, cc} and test case To: Matthias Maennich Cc: libabigail@sourceware.org, Dodji Seketeli , kernel-team@android.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-39.0 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libabigail mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2020 15:35:21 -0000 Looks good. Reviewed-by: Giuliano Procida On Mon, 20 Apr 2020 at 12:09, Matthias Maennich wrote: > > abg-elf-helpers.{h,cc} shall contain the ELF related parts of the > abg-dwarf-reader. Create the stub files, an empty unit test and hook > everything up in the make system. > > * src/Makefile.am: Add new source files abg-elf-helpers.{h,cc}. > * src/abg-elf-helpers.cc: New source file. > * src/abg-elf-helpers.h: New header file. > * tests/.gitignore: Exclude runtestelfhelpers from being committed. > * tests/Makefile.am: Add new test case runtestelfhelpers. > * tests/test-elf-helpers.cc: New test source file. > > Signed-off-by: Matthias Maennich > --- > src/Makefile.am | 2 ++ > src/abg-elf-helpers.cc | 34 ++++++++++++++++++++++++++++++++++ > src/abg-elf-helpers.h | 37 +++++++++++++++++++++++++++++++++++++ > tests/.gitignore | 1 + > tests/Makefile.am | 6 +++++- > tests/test-elf-helpers.cc | 30 ++++++++++++++++++++++++++++++ > 6 files changed, 109 insertions(+), 1 deletion(-) > create mode 100644 src/abg-elf-helpers.cc > create mode 100644 src/abg-elf-helpers.h > create mode 100644 tests/test-elf-helpers.cc > > diff --git a/src/Makefile.am b/src/Makefile.am > index 1d0e2dcecdee..fafab853b520 100644 > --- a/src/Makefile.am > +++ b/src/Makefile.am > @@ -39,6 +39,8 @@ abg-config.cc \ > abg-ini.cc \ > abg-workers.cc \ > abg-tools-utils.cc \ > +abg-elf-helpers.h \ > +abg-elf-helpers.cc \ > $(CXX11_SOURCES) > > libabigail_la_LIBADD = $(DEPS_LIBS) > diff --git a/src/abg-elf-helpers.cc b/src/abg-elf-helpers.cc > new file mode 100644 > index 000000000000..e99fe4a5c306 > --- /dev/null > +++ b/src/abg-elf-helpers.cc > @@ -0,0 +1,34 @@ > +// -*- Mode: C++ -*- > +// > +// Copyright (C) 2020 Google, Inc. > +// > +// This file is part of the GNU Application Binary Interface Generic > +// Analysis and Instrumentation Library (libabigail). This library is > +// free software; you can redistribute it and/or modify it under the > +// terms of the GNU Lesser General Public License as published by the > +// Free Software Foundation; either version 3, or (at your option) any > +// later version. > + > +// This library is distributed in the hope that it will be useful, but > +// WITHOUT ANY WARRANTY; without even the implied warranty of > +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +// General Lesser Public License for more details. > + > +// You should have received a copy of the GNU Lesser General Public > +// License along with this program; see the file COPYING-LGPLV3. If > +// not, see . > + > +/// @file > +/// > +/// This contains the definitions of the ELF utilities for the dwarf reader. > + > +#include "abg-elf-helpers.h" > + > +namespace abigail > +{ > + > +namespace elf_helpers > +{ > + > +} // end namespace elf_helpers > +} // end namespace abigail > diff --git a/src/abg-elf-helpers.h b/src/abg-elf-helpers.h > new file mode 100644 > index 000000000000..bffa46cc3c2d > --- /dev/null > +++ b/src/abg-elf-helpers.h > @@ -0,0 +1,37 @@ > +// -*- Mode: C++ -*- > +// > +// Copyright (C) 2020 Google, Inc. > +// > +// This file is part of the GNU Application Binary Interface Generic > +// Analysis and Instrumentation Library (libabigail). This library is > +// free software; you can redistribute it and/or modify it under the > +// terms of the GNU Lesser General Public License as published by the > +// Free Software Foundation; either version 3, or (at your option) any > +// later version. > + > +// This library is distributed in the hope that it will be useful, but > +// WITHOUT ANY WARRANTY; without even the implied warranty of > +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +// General Lesser Public License for more details. > + > +// You should have received a copy of the GNU Lesser General Public > +// License along with this program; see the file COPYING-LGPLV3. If > +// not, see . > + > +/// @file > +/// > +/// This contains a set of ELF utilities used by the dwarf reader. > + > +#ifndef __ABG_ELF_HELPERS_H__ > +#define __ABG_ELF_HELPERS_H__ > + > +namespace abigail > +{ > + > +namespace elf_helpers > +{ > + > +} // end namespace elf_helpers > +} // end namespace abigail > + > +#endif // __ABG_ELF_HELPERS_H__ > diff --git a/tests/.gitignore b/tests/.gitignore > index f05e295db260..ebe7b9cc9e13 100644 > --- a/tests/.gitignore > +++ b/tests/.gitignore > @@ -22,6 +22,7 @@ runtestdiffdwarfabixml > runtestdifffilter > runtestdiffpkg > runtestdiffsuppr > +runtestelfhelpers > runtestini > runtestkmiwhitelist > runtestlookupsyms > diff --git a/tests/Makefile.am b/tests/Makefile.am > index 823e0db50c37..c1b187051377 100644 > --- a/tests/Makefile.am > +++ b/tests/Makefile.am > @@ -46,6 +46,7 @@ runtestabidiffexit \ > runtestini \ > runtesttoolsutils \ > runtestkmiwhitelist \ > +runtestelfhelpers \ > $(CXX11_TESTS) > > if ENABLE_RUNNING_TESTS_WITH_PY3 > @@ -142,6 +143,9 @@ runtesttoolsutils_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la > runtestkmiwhitelist_SOURCES = test-kmi-whitelist.cc > runtestkmiwhitelist_LDADD = libtestutils.la libcatch.la $(top_builddir)/src/libabigail.la > > +runtestelfhelpers_SOURCES = test-elf-helpers.cc > +runtestelfhelpers_LDADD = libcatch.la $(top_builddir)/src/libabigail.la > + > runtestsvg_SOURCES=test-svg.cc > runtestsvg_LDADD=$(top_builddir)/src/libabigail.la > > @@ -172,7 +176,7 @@ runtestfedabipkgdiffpy3.sh$(EXEEXT): > runtestdefaultsupprspy3_sh_SOURCES = > runtestdefaultsupprspy3.sh$(EXEEXT): > > -AM_CPPFLAGS=-I${abs_top_srcdir}/include \ > +AM_CPPFLAGS=-I${abs_top_srcdir}/include -I${abs_top_srcdir}/src \ > -I${abs_top_builddir}/include -I${abs_top_srcdir}/tools -fPIC > > clean-local: clean-local-check > diff --git a/tests/test-elf-helpers.cc b/tests/test-elf-helpers.cc > new file mode 100644 > index 000000000000..1b36ee2f122a > --- /dev/null > +++ b/tests/test-elf-helpers.cc > @@ -0,0 +1,30 @@ > +// -*- Mode: C++ -*- > +// > +// Copyright (C) 2020 Google, Inc. > +// > +// This file is part of the GNU Application Binary Interface Generic > +// Analysis and Instrumentation Library (libabigail). This library is > +// free software; you can redistribute it and/or modify it under the > +// terms of the GNU Lesser General Public License as published by the > +// Free Software Foundation; either version 3, or (at your option) any > +// later version. > + > +// This library is distributed in the hope that it will be useful, but > +// WITHOUT ANY WARRANTY; without even the implied warranty of > +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > +// General Lesser Public License for more details. > + > +// You should have received a copy of the GNU Lesser General Public > +// License along with this program; see the file COPYING-LGPLV3. If > +// not, see . > + > +// Author: Matthias Maennich > + > +/// @file > +/// > +/// This program tests libabigail's ELF helpers. > + > +#include "lib/catch.hpp" > + > +#include "abg-elf-helpers.h" > + > -- > 2.26.1.301.g55bc3eb7cb9-goog >