[PATCH 1/1] testsuites: Added tests for sig2str/str2sig methods

2021-08-02 Thread Matt Joyce
Added psxsignal09 in psxtests and compile only test in psxhdrs in order to 
evaluate
newly added POSIX standard methods in Newlib.
---
 spec/build/testsuites/psxtests/grp.yml|   2 +
 spec/build/testsuites/psxtests/libpsxhdrs.yml |   1 +
 .../build/testsuites/psxtests/psxsignal09.yml |  21 ++
 testsuites/psxtests/Makefile.am   |  11 +
 testsuites/psxtests/configure.ac  |   1 +
 testsuites/psxtests/psxhdrs/signal/sig2str.c  |  58 
 testsuites/psxtests/psxsignal09/init.c| 288 ++
 .../psxtests/psxsignal09/psxsignal09.doc  |  35 +++
 .../psxtests/psxsignal09/psxsignal09.scn  |  44 +++
 9 files changed, 461 insertions(+)
 create mode 100644 spec/build/testsuites/psxtests/psxsignal09.yml
 create mode 100644 testsuites/psxtests/psxhdrs/signal/sig2str.c
 create mode 100644 testsuites/psxtests/psxsignal09/init.c
 create mode 100644 testsuites/psxtests/psxsignal09/psxsignal09.doc
 create mode 100644 testsuites/psxtests/psxsignal09/psxsignal09.scn

diff --git a/spec/build/testsuites/psxtests/grp.yml 
b/spec/build/testsuites/psxtests/grp.yml
index fb7ce465ae..f61f45dbe9 100644
--- a/spec/build/testsuites/psxtests/grp.yml
+++ b/spec/build/testsuites/psxtests/grp.yml
@@ -205,6 +205,8 @@ links:
   uid: psxsignal07
 - role: build-dependency
   uid: psxsignal08
+- role: build-dependency
+  uid: psxsignal09
 - role: build-dependency
   uid: psxspin01
 - role: build-dependency
diff --git a/spec/build/testsuites/psxtests/libpsxhdrs.yml 
b/spec/build/testsuites/psxtests/libpsxhdrs.yml
index 6a0ab6d4f7..5767bcdacd 100644
--- a/spec/build/testsuites/psxtests/libpsxhdrs.yml
+++ b/spec/build/testsuites/psxtests/libpsxhdrs.yml
@@ -513,6 +513,7 @@ source:
 - testsuites/psxtests/psxhdrs/signal/sigtimedwait.c
 - testsuites/psxtests/psxhdrs/signal/sigwait.c
 - testsuites/psxtests/psxhdrs/signal/sigwaitinfo.c
+- testsuites/psxtests/psxhdrs/signal/sig2str.c
 - testsuites/psxtests/psxhdrs/stddef/offsetof.c
 - testsuites/psxtests/psxhdrs/stdio/clearerr.c
 - testsuites/psxtests/psxhdrs/stdio/ctermid.c
diff --git a/spec/build/testsuites/psxtests/psxsignal09.yml 
b/spec/build/testsuites/psxtests/psxsignal09.yml
new file mode 100644
index 00..08a29c7c5b
--- /dev/null
+++ b/spec/build/testsuites/psxtests/psxsignal09.yml
@@ -0,0 +1,21 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+build-type: test-program
+cflags: []
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+cppflags: []
+cxxflags: []
+enabled-by:
+- RTEMS_POSIX_API
+features: c cprogram
+includes: []
+ldflags: []
+links: []
+source:
+- testsuites/psxtests/psxsignal09/init.c
+stlib: []
+target: testsuites/psxtests/psxsignal09.exe
+type: build
+use-after: []
+use-before: []
+
diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
index a35f00b665..b62d5cab59 100755
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -924,6 +924,17 @@ psxsignal08_CPPFLAGS = $(AM_CPPFLAGS) 
$(TEST_FLAGS_psxsignal08) \
 endif
 endif
 
+if HAS_POSIX
+if TEST_psxsignal09
+psx_tests += psxsignal09
+psx_screens += psxsignal09/psxsignal09.scn
+psx_docs += psxsignal09/psxsignal09.doc
+psxsignal09_SOURCES = psxsignal09/init.c 
+psxsignal09_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psxsignal09) \
+   $(support_includes) -I$(top_srcdir)/include
+endif
+endif
+
 if TEST_psxspin01
 psx_tests += psxspin01
 psx_screens += psxspin01/psxspin01.scn
diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/configure.ac
index 3f95010cd3..7b9a1027ca 100644
--- a/testsuites/psxtests/configure.ac
+++ b/testsuites/psxtests/configure.ac
@@ -138,6 +138,7 @@ RTEMS_TEST_CHECK([psxsignal05])
 RTEMS_TEST_CHECK([psxsignal06])
 RTEMS_TEST_CHECK([psxsignal07])
 RTEMS_TEST_CHECK([psxsignal08])
+RTEMS_TEST_CHECK([psxsignal09])
 RTEMS_TEST_CHECK([psxspin01])
 RTEMS_TEST_CHECK([psxstack01])
 RTEMS_TEST_CHECK([psxstack02])
diff --git a/testsuites/psxtests/psxhdrs/signal/sig2str.c 
b/testsuites/psxtests/psxhdrs/signal/sig2str.c
new file mode 100644
index 00..d4932c1961
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/signal/sig2str.c
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ * @brief Header File Conformance Test
+ *
+ * This test file is used to verify that the header files associated with
+ * invoking this function are correct.
+ */
+
+/*
+ * Copyright (C) 2021 Matthew Joyce
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PR

[PATCH 0/1] Edited Tests for sig2str/str2sig

2021-08-02 Thread Matt Joyce
Hello,

I would like to submit the following updated version of the
tests for the sig2str/str2sig methods based on Newlib's
requested changes to the source.

Thank you very much for your time!

Sincerely,

Matt

Matt Joyce (1):
  testsuites: Added tests for sig2str/str2sig methods

 spec/build/testsuites/psxtests/grp.yml|   2 +
 spec/build/testsuites/psxtests/libpsxhdrs.yml |   1 +
 .../build/testsuites/psxtests/psxsignal09.yml |  21 ++
 testsuites/psxtests/Makefile.am   |  11 +
 testsuites/psxtests/configure.ac  |   1 +
 testsuites/psxtests/psxhdrs/signal/sig2str.c  |  58 
 testsuites/psxtests/psxsignal09/init.c| 288 ++
 .../psxtests/psxsignal09/psxsignal09.doc  |  35 +++
 .../psxtests/psxsignal09/psxsignal09.scn  |  44 +++
 9 files changed, 461 insertions(+)
 create mode 100644 spec/build/testsuites/psxtests/psxsignal09.yml
 create mode 100644 testsuites/psxtests/psxhdrs/signal/sig2str.c
 create mode 100644 testsuites/psxtests/psxsignal09/init.c
 create mode 100644 testsuites/psxtests/psxsignal09/psxsignal09.doc
 create mode 100644 testsuites/psxtests/psxsignal09/psxsignal09.scn

-- 
2.31.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH v2 00/13] Remove app_common

2021-08-02 Thread Chris Johns
OK to push.

Chris

On 3/8/21 6:44 am, Ryan Long wrote:
> Hi,
> 
> In this iteration I:
> 
> - Removed the typedef in ObjdumpProcessor.h
> - Changed targetInfo to be a shared pointer
> - Got rid of some of the get & set methods for targetInfo_m
> - Added lastState_m to initialization list in ReportsHtml.cc
> 
> Thanks,
> Ryan
> 
> Ryan Long (13):
>   Remove AllExplanations global variable
>   ReportsHtml.cc: Initialize lastState_m
>   Remove objdumpProcessor global variable
>   Remove Verbose global variable
>   Remove dynamicLibrary global variable
>   Remove projectName global variable
>   Remove outputDirectory global variable
>   Remove input buffer global variables
>   Remove SymbolsToAnalyze global variable
>   Remove BranchInfoAvailable global variable
>   Remove TargetInfo global variable
>   app_common: Remove functions and macros
>   Remove app_common and all references to it
> 
>  tester/covoar/CoverageReaderBase.cc |   5 ++
>  tester/covoar/CoverageReaderBase.h  |  15 
>  tester/covoar/CoverageReaderQEMU.cc |   7 +-
>  tester/covoar/CoverageReaderTSIM.cc |   5 +-
>  tester/covoar/DesiredSymbols.cc |  28 +++---
>  tester/covoar/DesiredSymbols.h  |  27 --
>  tester/covoar/ExecutableInfo.cc |  23 ++---
>  tester/covoar/ExecutableInfo.h  |  17 +++-
>  tester/covoar/Explanations.cc   |  21 ++---
>  tester/covoar/GcovData.cc   |   7 +-
>  tester/covoar/GcovData.h|  12 ++-
>  tester/covoar/GcovFunctionData.cc   |  15 ++--
>  tester/covoar/GcovFunctionData.h|   6 +-
>  tester/covoar/Makefile  |   6 +-
>  tester/covoar/ObjdumpProcessor.cc   |  68 ++-
>  tester/covoar/ObjdumpProcessor.h| 113 +++-
>  tester/covoar/ReportsBase.cc| 166 
> +++-
>  tester/covoar/ReportsBase.h |  69 +--
>  tester/covoar/ReportsHtml.cc|  64 +-
>  tester/covoar/ReportsHtml.h |  10 ++-
>  tester/covoar/ReportsText.cc|  28 --
>  tester/covoar/ReportsText.h |  10 ++-
>  tester/covoar/SymbolTable.cc|   1 -
>  tester/covoar/TraceConverter.cc |  39 ++---
>  tester/covoar/TraceReaderBase.h |   7 +-
>  tester/covoar/TraceReaderLogQEMU.cc |  25 +-
>  tester/covoar/TraceReaderLogQEMU.h  |   6 +-
>  tester/covoar/TraceWriterBase.h |   9 +-
>  tester/covoar/TraceWriterQEMU.cc|  12 +--
>  tester/covoar/TraceWriterQEMU.h |   4 +-
>  tester/covoar/app_common.cc | 118 -
>  tester/covoar/app_common.h  |  34 
>  tester/covoar/coverage_converter.cc |   1 -
>  tester/covoar/covmerge.cc   |   8 +-
>  tester/covoar/covoar.cc | 125 ++-
>  tester/covoar/wscript   |   3 +-
>  36 files changed, 659 insertions(+), 455 deletions(-)
>  delete mode 100644 tester/covoar/app_common.cc
>  delete mode 100644 tester/covoar/app_common.h
> 
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 1/2] rsb: Add MicroBlaze tools

2021-08-02 Thread Alex White
---
 rtems/config/6/rtems-microblaze.bset  | 23 ++-
 .../tools/rtems-binutils-xilinx-2.36.cfg  | 52 ++
 .../tools/rtems-gcc-xilinx-10-newlib-head.cfg | 68 +++
 3 files changed, 142 insertions(+), 1 deletion(-)
 create mode 100644 rtems/config/tools/rtems-binutils-xilinx-2.36.cfg
 create mode 100644 rtems/config/tools/rtems-gcc-xilinx-10-newlib-head.cfg

diff --git a/rtems/config/6/rtems-microblaze.bset 
b/rtems/config/6/rtems-microblaze.bset
index 0e35a65..8c9784b 100644
--- a/rtems/config/6/rtems-microblaze.bset
+++ b/rtems/config/6/rtems-microblaze.bset
@@ -1,3 +1,24 @@
 %define release 1
 %define rtems_arch microblaze
-%include 6/rtems-default.bset
+
+#
+# Default tools configuration.
+#
+%include 6/rtems-base.bset
+
+6/rtems-autotools
+
+devel/dtc-1.6.0-1
+
+#
+# Build gdb first to raise the Python install error as early as possible.
+# GDB needs expat so it needs to be built before.
+#
+
+devel/expat-2.1.0-1
+devel/gmp-6.1.0
+tools/rtems-gdb-10
+
+tools/rtems-binutils-xilinx-2.36
+tools/rtems-gcc-xilinx-10-newlib-head
+tools/rtems-tools-6
diff --git a/rtems/config/tools/rtems-binutils-xilinx-2.36.cfg 
b/rtems/config/tools/rtems-binutils-xilinx-2.36.cfg
new file mode 100644
index 000..317d688
--- /dev/null
+++ b/rtems/config/tools/rtems-binutils-xilinx-2.36.cfg
@@ -0,0 +1,52 @@
+%include %{_configdir}/checks.cfg
+%include %{_configdir}/base.cfg
+
+%define binutils_version 7af075d
+%define binutils_external 1
+%define binutils_expand_name sourceware-mirror-binutils-gdb-%{binutils_version}
+%source set binutils --rsb-file=%{binutils_expand_name}.tar.gz 
https://codeload.github.com/RTEMS/sourceware-mirror-binutils-gdb/tar.gz/%{binutils_version}
+%hash sha512 %{binutils_expand_name}.tar.gz 
9f0fd9f439e026155300b507f288443ee7bbdcdd809663be88e9ca0a8b0ca2fc81bf36964abe5f66af53a23ff91d84b06035d52d68b3b166778d5145c4db7ea4
+
+%patch add binutils -p1 
https://raw.githubusercontent.com/Xilinx/meta-xilinx/rel-v2021.1/meta-microblaze/recipes-devtools/binutils/binutils/0001-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch
+%hash sha512 0001-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch 
56971b06821d7ab36b068016dde6086941121fca40d661056fe03f17507dafab075b306fe91d191c3fa0ec3617cd8649fe3023e0e5230e3fd5b4c2a648c23a94
+
+%patch add binutils -p1 
https://raw.githubusercontent.com/Xilinx/meta-xilinx/rel-v2021.1/meta-microblaze/recipes-devtools/binutils/binutils/0002-Add-mlittle-endian-and-mbig-endian-flags.patch
+%hash sha512 0002-Add-mlittle-endian-and-mbig-endian-flags.patch 
e6240d8d5eebb36b161b77348522cd59dad008017ce7579b66310719faa8bdba9d0f0466f4d81bf8c1d79ed2a3a2d777924a404da1010fc4dd866fcae2bde322
+
+%patch add binutils -p1 
https://raw.githubusercontent.com/Xilinx/meta-xilinx/rel-v2021.1/meta-microblaze/recipes-devtools/binutils/binutils/0003-Disable-the-warning-message-for-eh_frame_hdr.patch
+%hash sha512 0003-Disable-the-warning-message-for-eh-frame-hdr.patch 
2d90ef568bb649bc79b09ec3e745a25b5f177dc49f6b6bf7e9143685e5206bb7aee7a3fd3d013d64d82e2865e90a9cfeb7103aeb29189b1330613c562597a2fc
+
+%patch add binutils -p1 
https://raw.githubusercontent.com/Xilinx/meta-xilinx/rel-v2021.1/meta-microblaze/recipes-devtools/binutils/binutils/0004-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch
+%hash sha512 0004-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch 
76780fc9e410739320f07dd2fc517631f0bb4a8484d56ed96f0f8089acf1f8958dbc4045bfe67289086a63b3374a63e8fb2e09f7e7d52579b04d1114022d7214
+
+%patch add binutils -p1 
https://raw.githubusercontent.com/Xilinx/meta-xilinx/rel-v2021.1/meta-microblaze/recipes-devtools/binutils/binutils/0005-upstream-change-to-garbage-collection-sweep-causes-m.patch
+%hash sha512 0005-upstream-change-to-garbage-collection-sweep-causes-m.patch 
76a76edd26dc9bd72b0330791d14362933f5bbbc5bef0f9a9e6ee307958a4f6791ceabdaadae3c969ac3f4c786b13784f473fde6fe8ddcbf3370ccfc8761d7ab
+
+%patch add binutils -p1 
https://raw.githubusercontent.com/Xilinx/meta-xilinx/rel-v2021.1/meta-microblaze/recipes-devtools/binutils/binutils/0006-Fix-bug-in-TLSTPREL-Relocation.patch
+%hash sha512 0006-Fix-bug-in-TLSTPREL-Relocation.patch 
deed94f04fa91e993043f3e2f5e7c86a7ffce83e959980daebc255247ba51d991d6289e682fa4dff1758f085e661f5c2888b078dcaf2e790873c96520928
+
+%patch add binutils -p1 
https://raw.githubusercontent.com/Xilinx/meta-xilinx/rel-v2021.1/meta-microblaze/recipes-devtools/binutils/binutils/0007-Added-Address-extension-instructions.patch
+%hash sha512 0007-Added-Address-extension-instructions.patch 
8fb1c588eeae2356001d2d79e06c0a6dcd37be6411c11856b064973860139d1b87d490133fd98b5d70bea24f275bdbd5114e11a41141c0be05f23317b187e705
+
+%patch add binutils -p1 
https://raw.githubusercontent.com/Xilinx/meta-xilinx/rel-v2021.1/meta-microblaze/recipes-devtools/binutils/binutils/0008-fixing-the-MAX_OPCODES-to-correct-value.patch
+%hash sha512 0008-fixing-the-MAX-OPCODES-to-correct-value.patch 
e8227eb42b87de038430ddf79bf9f7e58deee0ed263ce521512b0568456f36aab16

[PATCH v2 2/2] rsb: Add Xilinx QEMU

2021-08-02 Thread Alex White
---
 bare/config/devel/qemu-xilinx-v2020.2-1.cfg | 23 
 bare/config/devel/qemu-xilinx.bset  | 24 +
 2 files changed, 47 insertions(+)
 create mode 100644 bare/config/devel/qemu-xilinx-v2020.2-1.cfg
 create mode 100644 bare/config/devel/qemu-xilinx.bset

diff --git a/bare/config/devel/qemu-xilinx-v2020.2-1.cfg 
b/bare/config/devel/qemu-xilinx-v2020.2-1.cfg
new file mode 100644
index 000..94b14ef
--- /dev/null
+++ b/bare/config/devel/qemu-xilinx-v2020.2-1.cfg
@@ -0,0 +1,23 @@
+#
+# Xilinx Qemu from git
+#
+
+%if %{release} == %{nil}
+ %define release 1
+%endif
+
+%include %{_configdir}/base.cfg
+
+%include %{_configdir}/bare-config.cfg
+
+%define qemu_version xilinx-v2020.2
+
+#
+# Checkout the version tag and initialize all submodules.
+#
+%source set qemu 
git://github.com/Xilinx/qemu.git?checkout=%{qemu_version}?submodule=dtc?submodule=slirp?submodule=ui/keycodemapdb?submodule=tests/fp/berkeley-softfloat-3?submodule=tests/fp/berkeley-testfloat-3
+
+#
+# The Qemu build instructions. We use 5.x.x Release 1.
+#
+%include %{_configdir}/qemu-5-1.cfg
diff --git a/bare/config/devel/qemu-xilinx.bset 
b/bare/config/devel/qemu-xilinx.bset
new file mode 100644
index 000..91b07e8
--- /dev/null
+++ b/bare/config/devel/qemu-xilinx.bset
@@ -0,0 +1,24 @@
+#
+# Build set for Xilinx QEMU
+#
+
+%define release 1
+
+#
+# Name of the package.
+#
+package: qemu-%{qemu_version}-%{_host}-%{release}
+
+#
+# A magic internal path that would break if changes in the defaults.mc
+# macro file are made.
+#
+%define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN}
+
+devel/autotools-internal
+devel/libiconv-1.14-1
+devel/gettext-0.18.3.1-1
+devel/libffi-3.0.13-1
+devel/pixman-0.40.0-1
+devel/glib-2.48.2-1
+devel/qemu-xilinx-v2020.2-1
-- 
2.27.0

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 0/2] Add MicroBlaze tools to RSB

2021-08-02 Thread Alex White
Hi,

v2:
  - Add Xilinx QEMU version to .cfg filename
  - Exclude GDB configuration with unneeded Xilinx patches

This patch set adds the MicroBlaze tools to rtems-source-builder.

Thanks,

Alex

Alex White (2):
  rsb: Add MicroBlaze tools
  rsb: Add Xilinx QEMU

 bare/config/devel/qemu-xilinx-v2020.2-1.cfg   | 23 +++
 bare/config/devel/qemu-xilinx.bset| 24 +++
 rtems/config/6/rtems-microblaze.bset  | 23 ++-
 .../tools/rtems-binutils-xilinx-2.36.cfg  | 52 ++
 .../tools/rtems-gcc-xilinx-10-newlib-head.cfg | 68 +++
 5 files changed, 189 insertions(+), 1 deletion(-)
 create mode 100644 bare/config/devel/qemu-xilinx-v2020.2-1.cfg
 create mode 100644 bare/config/devel/qemu-xilinx.bset
 create mode 100644 rtems/config/tools/rtems-binutils-xilinx-2.36.cfg
 create mode 100644 rtems/config/tools/rtems-gcc-xilinx-10-newlib-head.cfg

-- 
2.27.0

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH rtems-libbsd 0/5] RTEMS LibBSD Documentation

2021-08-02 Thread Chris Johns
On 3/8/21 3:24 am, Sebastian Huber wrote:
> On 02/08/2021 18:37, Vijay Kumar Banerjee wrote:
>> I think there should be a high-level user manual subsection for
>> networking that describes how the selection of the network stack
>> works. We can then add another subsection about lwip since legacy
>> already has one, and libbsd is getting added now.
> 
> This sounds like a good approach.
> 

I agree.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Restore ostream format after setpreicision() call

2021-08-02 Thread Ryan Long
Hi,

Does anyone know a better approach to restore the precision value after using 
setprecision()?

I found something online that recommended

std::streamsize prec = std::ios_base::precision();
std::setprecision(2);
.
.
.
std::setprecision(prec);

This makes sense and would work, but I don't know if Coverity will recognize 
this as the correct way to restore the stream's format.

Thanks,
Ryan
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH v2 13/13] Remove app_common and all references to it

2021-08-02 Thread Ryan Long
- Removed the includes of app_common.h
- Removed app_common references in build infrastructure
- Removed app_common.cc and app_common.h
---
 tester/covoar/CoverageReaderQEMU.cc |  1 -
 tester/covoar/CoverageReaderTSIM.cc |  1 -
 tester/covoar/DesiredSymbols.cc |  1 -
 tester/covoar/ExecutableInfo.cc |  1 -
 tester/covoar/Explanations.cc   |  1 -
 tester/covoar/GcovFunctionData.cc   |  1 -
 tester/covoar/Makefile  |  6 +
 tester/covoar/ObjdumpProcessor.cc   |  1 -
 tester/covoar/ReportsBase.cc|  1 -
 tester/covoar/ReportsHtml.cc|  1 -
 tester/covoar/ReportsText.cc|  1 -
 tester/covoar/SymbolTable.cc|  1 -
 tester/covoar/TraceConverter.cc |  1 -
 tester/covoar/TraceReaderLogQEMU.cc |  1 -
 tester/covoar/TraceWriterQEMU.cc|  1 -
 tester/covoar/app_common.cc | 49 -
 tester/covoar/app_common.h  | 18 --
 tester/covoar/coverage_converter.cc |  1 -
 tester/covoar/covmerge.cc   |  1 -
 tester/covoar/covoar.cc |  1 -
 tester/covoar/wscript   |  3 +--
 21 files changed, 2 insertions(+), 91 deletions(-)
 delete mode 100644 tester/covoar/app_common.cc
 delete mode 100644 tester/covoar/app_common.h

diff --git a/tester/covoar/CoverageReaderQEMU.cc 
b/tester/covoar/CoverageReaderQEMU.cc
index a3d9d02..a44097d 100644
--- a/tester/covoar/CoverageReaderQEMU.cc
+++ b/tester/covoar/CoverageReaderQEMU.cc
@@ -14,7 +14,6 @@
 
 #include 
 
-#include "app_common.h"
 #include "CoverageReaderQEMU.h"
 #include "CoverageMap.h"
 #include "ExecutableInfo.h"
diff --git a/tester/covoar/CoverageReaderTSIM.cc 
b/tester/covoar/CoverageReaderTSIM.cc
index 32e3aa7..d4b037d 100644
--- a/tester/covoar/CoverageReaderTSIM.cc
+++ b/tester/covoar/CoverageReaderTSIM.cc
@@ -14,7 +14,6 @@
 
 #include 
 
-#include "app_common.h"
 #include "CoverageReaderTSIM.h"
 #include "CoverageMap.h"
 #include "ExecutableInfo.h"
diff --git a/tester/covoar/DesiredSymbols.cc b/tester/covoar/DesiredSymbols.cc
index d76c5af..54776ee 100644
--- a/tester/covoar/DesiredSymbols.cc
+++ b/tester/covoar/DesiredSymbols.cc
@@ -23,7 +23,6 @@
 #include "rld-files.h"
 
 #include "DesiredSymbols.h"
-#include "app_common.h"
 #include "CoverageMap.h"
 
 namespace Coverage {
diff --git a/tester/covoar/ExecutableInfo.cc b/tester/covoar/ExecutableInfo.cc
index 328f970..418a7f4 100644
--- a/tester/covoar/ExecutableInfo.cc
+++ b/tester/covoar/ExecutableInfo.cc
@@ -11,7 +11,6 @@
 
 #include "ExecutableInfo.h"
 #include "ObjdumpProcessor.h"
-#include "app_common.h"
 #include "CoverageMap.h"
 #include "SymbolTable.h"
 
diff --git a/tester/covoar/Explanations.cc b/tester/covoar/Explanations.cc
index 0371666..4142418 100644
--- a/tester/covoar/Explanations.cc
+++ b/tester/covoar/Explanations.cc
@@ -15,7 +15,6 @@
 #include 
 
 #include "Explanations.h"
-#include "app_common.h"
 
 namespace Coverage {
 
diff --git a/tester/covoar/GcovFunctionData.cc 
b/tester/covoar/GcovFunctionData.cc
index 1767f18..ff0e515 100644
--- a/tester/covoar/GcovFunctionData.cc
+++ b/tester/covoar/GcovFunctionData.cc
@@ -9,7 +9,6 @@
 #include 
 #include 
 
-#include "app_common.h"
 #include "GcovFunctionData.h"
 #include "ObjdumpProcessor.h"
 #include "CoverageMapBase.h"
diff --git a/tester/covoar/Makefile b/tester/covoar/Makefile
index 694e4e1..bc493d8 100644
--- a/tester/covoar/Makefile
+++ b/tester/covoar/Makefile
@@ -2,8 +2,7 @@ INSTALL_DIR=../bin
 CXXFLAGS=-g -Wall -O3
 PROGRAMS=covoar qemu-dump-trace trace-converter configfile-test
 
-COMMON_OBJS= app_common.o \
-  ConfigFile.o \
+COMMON_OBJS= ConfigFile.o \
   CoverageFactory.o \
   CoverageMap.o \
   CoverageMapBase.o \
@@ -90,9 +89,6 @@ trace-converter: $(TRACECONVERTER_OBJS)
 configfile-test: $(CONFIGFILE_TEST_OBJS)
$(CXX) $(CXXFLAGS) -o $(@) $(CONFIGFILE_TEST_OBJS)
 
-#  DEPENDENCIES ON SINGLE OBJECTS
-app_common.o: app_common.h app_common.cc
-
 covoar.o: covoar.cc CoverageFactory.h CoverageMap.h DesiredSymbols.h \
   ExecutableInfo.h Explanations.h ObjdumpProcessor.h ReportsBase.h
 
diff --git a/tester/covoar/ObjdumpProcessor.cc 
b/tester/covoar/ObjdumpProcessor.cc
index 90620aa..4d1e306 100644
--- a/tester/covoar/ObjdumpProcessor.cc
+++ b/tester/covoar/ObjdumpProcessor.cc
@@ -14,7 +14,6 @@
 #include 
 #include 
 
-#include "app_common.h"
 #include "ObjdumpProcessor.h"
 #include "CoverageMap.h"
 #include "ExecutableInfo.h"
diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc
index f4df64c..bc05037 100644
--- a/tester/covoar/ReportsBase.cc
+++ b/tester/covoar/ReportsBase.cc
@@ -8,7 +8,6 @@
 #include 
 
 #include "ReportsBase.h"
-#include "app_common.h"
 #include "CoverageRanges.h"
 #include "DesiredSymbols.h"
 #include "Explanations.h"
diff --git a/tester/covoar/ReportsHtml.cc b/tester/covoar/ReportsHtml.cc
index 1b75eb0..2ba3463 100644
--- a/tester/covoar/ReportsHtml.cc
+++ b/tester/covoar/ReportsHtml.cc
@@ -9,7 +9,6 @@
 #include 
 
 #include "ReportsHtml.h"
-#include "a

[PATCH v2 12/13] app_common: Remove functions and macros

2021-08-02 Thread Ryan Long
- Moved functions from app_common to the file they are used
- Got rid of FileIsNewer() since it's not being used
- Removed macros
---
 tester/covoar/TraceReaderLogQEMU.cc | 14 +
 tester/covoar/app_common.cc | 58 -
 tester/covoar/app_common.h  |  3 --
 tester/covoar/covoar.cc | 20 +
 4 files changed, 34 insertions(+), 61 deletions(-)

diff --git a/tester/covoar/TraceReaderLogQEMU.cc 
b/tester/covoar/TraceReaderLogQEMU.cc
index 37952a3..e65628e 100644
--- a/tester/covoar/TraceReaderLogQEMU.cc
+++ b/tester/covoar/TraceReaderLogQEMU.cc
@@ -63,6 +63,20 @@
 
 #define MAX_LINE_LENGTH 512
 
+bool ReadUntilFound( FILE *file, const char *line )
+{
+  char discardBuff[100];
+  size_t  len = strlen( line );
+
+  do {
+if ( !fgets( discardBuff, 99, file ) )
+  return false;
+
+if ( strncmp( discardBuff, line, len ) == 0 )
+  return true;
+  } while (1);
+}
+
 namespace Trace {
 
   TraceReaderLogQEMU::TraceReaderLogQEMU()
diff --git a/tester/covoar/app_common.cc b/tester/covoar/app_common.cc
index 568d108..9fece7b 100644
--- a/tester/covoar/app_common.cc
+++ b/tester/covoar/app_common.cc
@@ -40,68 +40,10 @@
 #include "app_common.h"
 #include "DesiredSymbols.h"
 #include "Explanations.h"
-
-#if HAVE_STAT64
-#define STAT stat64
-#else
-#define STAT stat
-#endif
-
-#if HAVE_OPEN64
-#define OPEN fopen64
-#else
-#define OPEN fopen
-#endif
-
 /*
  *  Global variables for the program
  */
 
 
-bool FileIsNewer(
-  const char *f1,
-  const char *f2
-)
-{
-  struct STAT buf1, buf2;
-
-   if (STAT( f2, &buf2 ) == -1)
-return true;
-
-  if (STAT( f1, &buf1 ) == -1)
-exit (1);
-
-  if (buf1.st_mtime > buf2.st_mtime)
-return true;
-
-  return false;
-}
-
-bool FileIsReadable( const char *f1 )
-{
-  struct STAT buf1;
-
-  if (STAT( f1, &buf1 ) == -1)
-return false;
-
-  if (buf1.st_size == 0)
-return false;
-
-  // XXX check permission ??
-  return true;
-}
-
-bool ReadUntilFound( FILE *file, const char *line )
-{
-  char discardBuff[100];
-  size_t  len = strlen( line );
-
-  do {
-if ( !fgets( discardBuff, 99, file ) )
-  return false;
 
-if ( strncmp( discardBuff, line, len ) == 0 )
-  return true;
-  } while (1);
-}
 
diff --git a/tester/covoar/app_common.h b/tester/covoar/app_common.h
index 454d389..5da4bb3 100644
--- a/tester/covoar/app_common.h
+++ b/tester/covoar/app_common.h
@@ -14,8 +14,5 @@
 
 
 
-bool FileIsNewer( const char *f1, const char *f2 );
-bool FileIsReadable( const char *f1 );
-bool ReadUntilFound( FILE *file, const char *line );
 
 #endif
diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
index e0dc341..25724b5 100644
--- a/tester/covoar/covoar.cc
+++ b/tester/covoar/covoar.cc
@@ -30,6 +30,12 @@
 #include "TargetFactory.h"
 #include "GcovData.h"
 
+#if HAVE_STAT64
+#define STAT stat64
+#else
+#define STAT stat
+#endif
+
 #if defined(_WIN32) || defined(__CYGWIN__)
   #define kill(p,s) raise(s)
 #endif
@@ -40,6 +46,20 @@ typedef std::list CoverageNames;
 typedef std::list Executables;
 typedef std::string option_error;
 
+bool FileIsReadable( const char *f1 )
+{
+  struct STAT buf1;
+
+  if (STAT( f1, &buf1 ) == -1)
+return false;
+
+  if (buf1.st_size == 0)
+return false;
+
+  // XXX check permission ??
+  return true;
+}
+
 /*
  * Create a build path from the executable paths. Also extract the build prefix
  * and BSP names.
-- 
1.8.3.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 11/13] Remove TargetInfo global variable

2021-08-02 Thread Ryan Long
- Remove TargetInfo from app_common
- Created the targetInfo_m  member variable in CoverageReaderBase,
  TraceWriterBase, and ObjdumpProcessor
- Made functions to set the value of targetInfo_m
---
 tester/covoar/CoverageReaderBase.h  |  5 +
 tester/covoar/CoverageReaderQEMU.cc |  4 ++--
 tester/covoar/ObjdumpProcessor.cc   | 31 ---
 tester/covoar/ObjdumpProcessor.h| 20 +++-
 tester/covoar/TraceConverter.cc |  6 --
 tester/covoar/TraceWriterBase.h |  5 +
 tester/covoar/TraceWriterQEMU.cc|  4 ++--
 tester/covoar/app_common.cc |  1 -
 tester/covoar/app_common.h  |  1 -
 tester/covoar/covmerge.cc   |  7 ++-
 tester/covoar/covoar.cc |  9 +++--
 11 files changed, 70 insertions(+), 23 deletions(-)

diff --git a/tester/covoar/CoverageReaderBase.h 
b/tester/covoar/CoverageReaderBase.h
index ba909e6..332fc4d 100644
--- a/tester/covoar/CoverageReaderBase.h
+++ b/tester/covoar/CoverageReaderBase.h
@@ -52,6 +52,11 @@ namespace Coverage {
* This member variable tells whether the branch info is available.
*/
   bool branchInfoAvailable_m = false;
+
+  /*!
+   * This member variable points to the target's info
+   */
+  std::shared_ptr targetInfo_m = nullptr;
   };
 
 }
diff --git a/tester/covoar/CoverageReaderQEMU.cc 
b/tester/covoar/CoverageReaderQEMU.cc
index 802d862..a3d9d02 100644
--- a/tester/covoar/CoverageReaderQEMU.cc
+++ b/tester/covoar/CoverageReaderQEMU.cc
@@ -51,8 +51,8 @@ namespace Coverage {
 uint8_t notTaken;
 uint8_t branchInfo;
 
-taken  = TargetInfo->qemuTakenBit();
-notTaken   = TargetInfo->qemuNotTakenBit();
+taken  = targetInfo_m->qemuTakenBit();
+notTaken   = targetInfo_m->qemuNotTakenBit();
 branchInfo = taken | notTaken;
 
 //
diff --git a/tester/covoar/ObjdumpProcessor.cc 
b/tester/covoar/ObjdumpProcessor.cc
index f590ece..90620aa 100644
--- a/tester/covoar/ObjdumpProcessor.cc
+++ b/tester/covoar/ObjdumpProcessor.cc
@@ -124,8 +124,10 @@ namespace Coverage {
   }
 
   ObjdumpProcessor::ObjdumpProcessor(
-DesiredSymbols& symbolsToAnalyze
-  ): symbolsToAnalyze_m( symbolsToAnalyze )
+DesiredSymbols& symbolsToAnalyze,
+std::shared_ptr& targetInfo
+  ): symbolsToAnalyze_m( symbolsToAnalyze ),
+ targetInfo_m( targetInfo )
   {
   }
 
@@ -191,7 +193,7 @@ namespace Coverage {
 const char *instruction
   )
   {
-if ( !TargetInfo ) {
+if ( !targetInfo_m ) {
   fprintf(
 stderr,
 "ERROR: ObjdumpProcessor::IsBranch - unknown architecture\n"
@@ -200,14 +202,14 @@ namespace Coverage {
   return false;
 }
 
-return TargetInfo->isBranch( instruction );
+return targetInfo_m->isBranch( instruction );
   }
 
   bool ObjdumpProcessor::isBranchLine(
 const char* const line
   )
   {
-if ( !TargetInfo ) {
+if ( !targetInfo_m ) {
   fprintf(
 stderr,
 "ERROR: ObjdumpProcessor::isBranchLine - unknown architecture\n"
@@ -216,7 +218,7 @@ namespace Coverage {
   return false;
 }
 
-return  TargetInfo->isBranchLine( line );
+return  targetInfo_m->isBranchLine( line );
   }
 
   bool ObjdumpProcessor::isNop(
@@ -224,7 +226,7 @@ namespace Coverage {
 int&  size
   )
   {
-if ( !TargetInfo ){
+if ( !targetInfo_m ){
   fprintf(
 stderr,
 "ERROR: ObjdumpProcessor::isNop - unknown architecture\n"
@@ -233,7 +235,7 @@ namespace Coverage {
   return false;
 }
 
-return TargetInfo->isNopLine( line, size );
+return targetInfo_m->isNopLine( line, size );
   }
 
   void ObjdumpProcessor::getFile(
@@ -243,12 +245,12 @@ namespace Coverage {
 )
   {
 rld::process::statusstatus;
-rld::process::arg_container args = { TargetInfo->getObjdump(),
+rld::process::arg_container args = { targetInfo_m->getObjdump(),
  "-Cda", "--section=.text", "--source",
  fileName };
 try
 {
-  status = rld::process::execute( TargetInfo->getObjdump(),
+  status = rld::process::execute( targetInfo_m->getObjdump(),
   args, objdumpFile.name(), err.name() );
   if ( (status.type != rld::process::status::normal)
|| (status.code != 0) ) {
@@ -256,7 +258,7 @@ namespace Coverage {
   }
 } catch( rld::error& err )
   {
-std::cout << "Error while running " << TargetInfo->getObjdump()
+std::cout << "Error while running " << targetInfo_m->getObjdump()
   << " on " << fileName << std::endl;
 std::cout << err.what << " in " << err.where << std::endl;
 return;
@@ -497,4 +499,11 @@ namespace Coverage {
   }
 }
   }
+
+  void ObjdumpProcessor::setTargetInfo(
+std::shared_ptr& targetInfo
+  )
+  {
+targetInfo_m = targetInfo;
+  }
 }
diff --git a/tester/covoar/ObjdumpProcessor.h b/

[PATCH v2 10/13] Remove BranchInfoAvailable global variable

2021-08-02 Thread Ryan Long
- Removed BranchInfoAvailable from app_common
- Created member variable in CoverageReaderBase and ReportsBase and a function
  to get the value of the member variable
---
 tester/covoar/CoverageReaderBase.cc |  5 +
 tester/covoar/CoverageReaderBase.h  | 10 ++
 tester/covoar/CoverageReaderQEMU.cc |  2 +-
 tester/covoar/CoverageReaderTSIM.cc |  4 ++--
 tester/covoar/ReportsBase.cc| 27 +--
 tester/covoar/ReportsBase.h | 15 ---
 tester/covoar/ReportsHtml.cc|  8 +---
 tester/covoar/ReportsHtml.h |  3 ++-
 tester/covoar/ReportsText.cc|  8 +---
 tester/covoar/ReportsText.h |  3 ++-
 tester/covoar/app_common.cc |  1 -
 tester/covoar/app_common.h  |  1 -
 tester/covoar/covoar.cc |  6 +-
 13 files changed, 66 insertions(+), 27 deletions(-)

diff --git a/tester/covoar/CoverageReaderBase.cc 
b/tester/covoar/CoverageReaderBase.cc
index 3ebcc8d..e226964 100644
--- a/tester/covoar/CoverageReaderBase.cc
+++ b/tester/covoar/CoverageReaderBase.cc
@@ -16,4 +16,9 @@ namespace Coverage {
   CoverageReaderBase::~CoverageReaderBase()
   {
   }
+
+  bool CoverageReaderBase::getBranchInfoAvailable() const
+  {
+return branchInfoAvailable_m;
+  }
 }
diff --git a/tester/covoar/CoverageReaderBase.h 
b/tester/covoar/CoverageReaderBase.h
index 81090c0..ba909e6 100644
--- a/tester/covoar/CoverageReaderBase.h
+++ b/tester/covoar/CoverageReaderBase.h
@@ -42,6 +42,16 @@ namespace Coverage {
   const char* const file,
   ExecutableInfo* const executableInformation
 ) = 0;
+
+  /*!
+   *  This method retrieves the branchInfoAvailable_m variable
+   */
+  bool getBranchInfoAvailable() const;
+
+  /*!
+   * This member variable tells whether the branch info is available.
+   */
+  bool branchInfoAvailable_m = false;
   };
 
 }
diff --git a/tester/covoar/CoverageReaderQEMU.cc 
b/tester/covoar/CoverageReaderQEMU.cc
index d3c6abe..802d862 100644
--- a/tester/covoar/CoverageReaderQEMU.cc
+++ b/tester/covoar/CoverageReaderQEMU.cc
@@ -31,7 +31,7 @@ namespace Coverage {
 
   CoverageReaderQEMU::CoverageReaderQEMU()
   {
-BranchInfoAvailable = true;
+branchInfoAvailable_m = true;
   }
 
   CoverageReaderQEMU::~CoverageReaderQEMU()
diff --git a/tester/covoar/CoverageReaderTSIM.cc 
b/tester/covoar/CoverageReaderTSIM.cc
index 03bf7a8..32e3aa7 100644
--- a/tester/covoar/CoverageReaderTSIM.cc
+++ b/tester/covoar/CoverageReaderTSIM.cc
@@ -90,11 +90,11 @@ namespace Coverage {
   aCoverageMap->setWasExecuted( a + 3 );
   if ( cover & 0x08 ) {
 aCoverageMap->setWasTaken( a );
-BranchInfoAvailable = true;
+branchInfoAvailable_m = true;
   }
   if ( cover & 0x10 ) {
 aCoverageMap->setWasNotTaken( a );
-BranchInfoAvailable = true;
+branchInfoAvailable_m = true;
   }
 }
   }
diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc
index 11c22c9..f4df64c 100644
--- a/tester/covoar/ReportsBase.cc
+++ b/tester/covoar/ReportsBase.cc
@@ -29,14 +29,16 @@ ReportsBase::ReportsBase(
   Coverage::Explanations& allExplanations,
   const std::string&  projectName,
   const std::string&  outputDirectory,
-  const DesiredSymbols&   symbolsToAnalyze
+  const DesiredSymbols&   symbolsToAnalyze,
+  boolbranchInfoAvailable
 ): reportExtension_m( "" ),
symbolSetName_m( symbolSetName ),
timestamp_m( timestamp ),
allExplanations_m( allExplanations ),
projectName_m( projectName ),
outputDirectory_m( outputDirectory ),
-   symbolsToAnalyze_m( symbolsToAnalyze )
+   symbolsToAnalyze_m( symbolsToAnalyze ),
+   branchInfoAvailable_m( branchInfoAvailable )
 {
 }
 
@@ -311,7 +313,7 @@ void ReportsBase::WriteBranchReport( const std::string& 
fileName )
 
   if (
 ( symbolsToAnalyze_m.getNumberBranchesFound( symbolSetName_m ) == 0 ) ||
-( BranchInfoAvailable == false )
+( branchInfoAvailable_m == false )
   ) {
  hasBranches = false;
   }
@@ -325,7 +327,7 @@ void ReportsBase::WriteBranchReport( const std::string& 
fileName )
   // If no branches were found then branch coverage is not supported
   if (
 ( symbolsToAnalyze_m.getNumberBranchesFound( symbolSetName_m ) != 0 ) &&
-( BranchInfoAvailable == true )
+( branchInfoAvailable_m == true )
   ) {
 // Process uncovered branches for each symbol in the set.
 const std::vector& symbols =
@@ -476,7 +478,8 @@ void  ReportsBase::WriteSummaryReport(
   const std::string&  fileName,
   const std::string&  symbolSetName,
   const std::string&  outputDirectory,
-  const Coverage::DesiredSymbols& symbolsToAnalyze
+  const Coverage::DesiredSymbols& symbolsToAnalyze,
+  boolbranchInfoAvailable
 )
 {
 // Calculate coverage statistics and output results.
@@ -546,7 +549,7 @@ void  ReportsBase::WriteSummaryReport

[PATCH v2 09/13] Remove SymbolsToAnalyze global variable

2021-08-02 Thread Ryan Long
- Removed SymbolsToAnalyze from app_common and replaced it with the
  symbolsToAnalyze_m member variable in DesiredSymbols, GcovData, and
  ObjdumpProcessor
- Added a parameter to constructors to initialize symbolsToAnalyze_m
- Moved the definition of objdumpLine_t out of ObjdumpProcessor to make
  it work with DesiredSymbols
---
 tester/covoar/DesiredSymbols.cc   | 12 +++--
 tester/covoar/DesiredSymbols.h| 16 +--
 tester/covoar/ExecutableInfo.cc   | 14 +++---
 tester/covoar/ExecutableInfo.h| 14 +-
 tester/covoar/GcovData.cc |  7 +--
 tester/covoar/GcovData.h  | 12 -
 tester/covoar/GcovFunctionData.cc | 14 --
 tester/covoar/GcovFunctionData.h  |  6 ++-
 tester/covoar/ObjdumpProcessor.cc | 22 +
 tester/covoar/ObjdumpProcessor.h  | 90 +++
 tester/covoar/ReportsBase.cc  | 98 +--
 tester/covoar/ReportsBase.h   | 33 +
 tester/covoar/ReportsHtml.cc  | 16 ---
 tester/covoar/ReportsHtml.h   | 11 +++--
 tester/covoar/ReportsText.cc  |  8 ++--
 tester/covoar/ReportsText.h   |  3 +-
 tester/covoar/TraceConverter.cc   | 17 +--
 tester/covoar/app_common.cc   |  1 -
 tester/covoar/app_common.h|  1 -
 tester/covoar/covoar.cc   | 40 +---
 20 files changed, 270 insertions(+), 165 deletions(-)

diff --git a/tester/covoar/DesiredSymbols.cc b/tester/covoar/DesiredSymbols.cc
index 5d5e637..d76c5af 100644
--- a/tester/covoar/DesiredSymbols.cc
+++ b/tester/covoar/DesiredSymbols.cc
@@ -25,7 +25,6 @@
 #include "DesiredSymbols.h"
 #include "app_common.h"
 #include "CoverageMap.h"
-#include "ObjdumpProcessor.h"
 
 namespace Coverage {
 
@@ -116,10 +115,10 @@ namespace Coverage {
 }
   }
 
-  void DesiredSymbols::preprocess( void )
+  void DesiredSymbols::preprocess( const DesiredSymbols& symbolsToAnalyze )
   {
 // Look at each symbol.
-for (auto& s : SymbolsToAnalyze->set) {
+for (auto& s : symbolsToAnalyze.set) {
   // If the unified coverage map does not exist, the symbol was
   // never referenced by any executable.  Just skip it.
   CoverageMapBase* theCoverageMap = s.second.unifiedCoverageMap;
@@ -441,10 +440,13 @@ namespace Coverage {
   return &set[ symbolName ];
   }
 
-  void DesiredSymbols::findSourceForUncovered( bool verbose )
+  void DesiredSymbols::findSourceForUncovered(
+bool  verbose,
+const DesiredSymbols& symbolsToAnalyze
+  )
   {
 // Process uncovered ranges and/or branches for each symbol.
-for (auto& d : SymbolsToAnalyze->set) {
+for (auto& d : symbolsToAnalyze.set) {
   // First the unexecuted ranges, ...
   CoverageRanges* theRanges = d.second.uncoveredRanges;
   if (theRanges != nullptr) {
diff --git a/tester/covoar/DesiredSymbols.h b/tester/covoar/DesiredSymbols.h
index 791b4ea..7ea3a9a 100644
--- a/tester/covoar/DesiredSymbols.h
+++ b/tester/covoar/DesiredSymbols.h
@@ -19,6 +19,10 @@
 
 namespace Coverage {
 
+  class ObjdumpProcessor;
+  struct objdumpLine_t;
+  class ExecutableInfo;
+
 
   /*!
*
@@ -139,7 +143,7 @@ namespace Coverage {
 /*!
  *  This member contains the disassembly associated with a symbol.
  */
-std::list instructions;
+std::list instructions;
 
 /*!
  *  This member contains the executable that was used to
@@ -263,8 +267,12 @@ namespace Coverage {
  *  uncovered ranges or branches.
  *
  *  @param[in] verbose specifies whether to be verbose with output
+ *  @param[in] symbolsToAnalyze the symbols to be analyzed
  */
-void findSourceForUncovered( bool verbose );
+void findSourceForUncovered(
+  bool verbose,
+  const DesiredSymbols& symbolsToAnalyze
+);
 
 /*!
  *  This method returns the total number of branches always taken
@@ -398,8 +406,10 @@ namespace Coverage {
 /*!
  *  This method preprocesses each symbol's coverage map to mark nop
  *  and branch information.
+ *
+ *  @param[in] symbolsToAnalyze the symbols to be analyzed
  */
-void preprocess( void );
+void preprocess( const DesiredSymbols& symbolsToAnalyze );
 
   private:
 
diff --git a/tester/covoar/ExecutableInfo.cc b/tester/covoar/ExecutableInfo.cc
index 9c3031e..328f970 100644
--- a/tester/covoar/ExecutableInfo.cc
+++ b/tester/covoar/ExecutableInfo.cc
@@ -10,9 +10,9 @@
 #include 
 
 #include "ExecutableInfo.h"
+#include "ObjdumpProcessor.h"
 #include "app_common.h"
 #include "CoverageMap.h"
-#include "DesiredSymbols.h"
 #include "SymbolTable.h"
 
 namespace Coverage {
@@ -20,9 +20,11 @@ namespace Coverage {
   ExecutableInfo::ExecutableInfo(
 const char* const  theExecutableName,
 const std::string& theLibraryName,
-bool   verbose
+bool   verbose,
+DesiredSymbols&symbolsToAnalyze
 ) : fileName(theExecutableName),
-loadAddress(0)
+loadAddress(0),
+symbolsToAnalyze_m(sy

[PATCH v2 08/13] Remove input buffer global variables

2021-08-02 Thread Ryan Long
- Removed input buffers from app_common and added them as a local variable
  to functions where inputBuffer was being used
  - Added #define for MAX_LINE_LENGTH in files where it is used
- Changed Explanations::load to use a string instead of a C-string
---
 tester/covoar/Explanations.cc   | 20 +---
 tester/covoar/ObjdumpProcessor.cc   |  3 +++
 tester/covoar/TraceReaderLogQEMU.cc |  3 +++
 tester/covoar/app_common.cc |  2 --
 tester/covoar/app_common.h  |  4 
 tester/covoar/covoar.cc |  3 +++
 6 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/tester/covoar/Explanations.cc b/tester/covoar/Explanations.cc
index 681ffd6..0371666 100644
--- a/tester/covoar/Explanations.cc
+++ b/tester/covoar/Explanations.cc
@@ -31,7 +31,6 @@ namespace Coverage {
 const char* const explanations
   )
   {
-#define MAX_LINE_LENGTH 512
 std::ifstream  explain;
 Explanatione;
 intline = 1;
@@ -46,44 +45,44 @@ namespace Coverage {
   throw rld::error( what, "Explanations::load" );
 }
 
+std::string input_line;
 while ( 1 ) {
   // Read the starting line of this explanation and
   // skip blank lines between
   do {
-inputBuffer[0] = '\0';
-explain.getline( inputBuffer, MAX_LINE_LENGTH );
+std::getline( explain, input_line );
 if (explain.fail()) {
   return;
 }
 line++;
-  } while ( inputBuffer[0] == '\0' );
+  } while ( input_line.empty() );
 
   // Have we already seen this one?
-  if (set.find( inputBuffer ) != set.end()) {
+  if (set.find( input_line ) != set.end()) {
 std::ostringstream what;
 what << "line " << line
  << "contains a duplicate explanation ("
- << inputBuffer << ")";
+ << input_line << ")";
 throw rld::error( what, "Explanations::load" );
   }
 
   // Add the starting line and file
-  e.startingPoint = std::string(inputBuffer);
+  e.startingPoint = input_line;
   e.found = false;
 
   // Get the classification
-  explain.getline( inputBuffer, MAX_LINE_LENGTH );
+  std::getline( explain, input_line );
   if (explain.fail()) {
 std::ostringstream what;
 what << "line " << line
  << "out of sync at the classification";
 throw rld::error( what, "Explanations::load" );
   }
-  e.classification = inputBuffer;
+  e.classification = input_line;
   line++;
 
   // Get the explanation
-  for (std::string input_line; std::getline( explain, input_line ); ) {
+  while ( std::getline( explain, input_line ) ) {
 line++;
 
 const std::string delimiter = "+++";
@@ -105,7 +104,6 @@ namespace Coverage {
   set[ e.startingPoint ] = e;
 }
 
-#undef MAX_LINE_LENGTH
   }
 
   const Explanation *Explanations::lookupExplanation(
diff --git a/tester/covoar/ObjdumpProcessor.cc 
b/tester/covoar/ObjdumpProcessor.cc
index 2bf1685..d324440 100644
--- a/tester/covoar/ObjdumpProcessor.cc
+++ b/tester/covoar/ObjdumpProcessor.cc
@@ -24,6 +24,8 @@
 #include "rld.h"
 #include "rld-process.h"
 
+#define MAX_LINE_LENGTH 512
+
 namespace Coverage {
 
   void finalizeSymbol(
@@ -136,6 +138,7 @@ namespace Coverage {
 FILE*loadAddressFile = NULL;
 char*cStatus;
 uint32_t offset;
+char inputBuffer[MAX_LINE_LENGTH];
 
 // This method should only be call for a dynamic library.
 if (!theExecutable->hasDynamicLibrary())
diff --git a/tester/covoar/TraceReaderLogQEMU.cc 
b/tester/covoar/TraceReaderLogQEMU.cc
index 0a61ea5..37952a3 100644
--- a/tester/covoar/TraceReaderLogQEMU.cc
+++ b/tester/covoar/TraceReaderLogQEMU.cc
@@ -61,6 +61,8 @@
 #define OPEN fopen
 #endif
 
+#define MAX_LINE_LENGTH 512
+
 namespace Trace {
 
   TraceReaderLogQEMU::TraceReaderLogQEMU()
@@ -85,6 +87,7 @@ namespace Trace {
 int status;
 FILE*   logFile;
 int result;
+charinputBuffer[MAX_LINE_LENGTH];
 
 //
 // Verify that the log file has a non-zero size.
diff --git a/tester/covoar/app_common.cc b/tester/covoar/app_common.cc
index 6f88f4b..53b5284 100644
--- a/tester/covoar/app_common.cc
+++ b/tester/covoar/app_common.cc
@@ -59,8 +59,6 @@
 Coverage::DesiredSymbols*   SymbolsToAnalyze= NULL;
 boolBranchInfoAvailable = false;
 Target::TargetBase* TargetInfo  = NULL;
-charinputBuffer[MAX_LINE_LENGTH];
-charinputBuffer2[MAX_LINE_LENGTH];
 
 
 bool FileIsNewer(
diff --git a/tester/covoar/app_common.h b/tester/covoar/app_common.h
index 473d259..4f3b798 100644
--- a/tester/covoar/app_common.h
+++ b/tester/covoar/app_common.h
@@ -16,10 +16,6 @@ extern Coverage::DesiredSymbols*SymbolsToAnalyze;
 extern bool BranchInfoAvailable;
 extern Target::TargetBase*  

[PATCH v2 07/13] Remove outputDirectory global variable

2021-08-02 Thread Ryan Long
- Replaced outputDirectory in app_common with a local variable in
  covoar()
- Created the outputDirectory_m member variable
- Added parameters to Reports* constructors to initialize
  outputDirectory_m and non member functions
---
 tester/covoar/ReportsBase.cc | 41 ++---
 tester/covoar/ReportsBase.h  | 19 +++
 tester/covoar/ReportsHtml.cc | 18 +++---
 tester/covoar/ReportsHtml.h  |  3 ++-
 tester/covoar/ReportsText.cc | 11 +--
 tester/covoar/ReportsText.h  |  3 ++-
 tester/covoar/app_common.cc  |  1 -
 tester/covoar/app_common.h   |  1 -
 tester/covoar/covoar.cc  |  4 +++-
 9 files changed, 72 insertions(+), 29 deletions(-)

diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc
index b2da71a..266a6ea 100644
--- a/tester/covoar/ReportsBase.cc
+++ b/tester/covoar/ReportsBase.cc
@@ -27,12 +27,14 @@ ReportsBase::ReportsBase(
   time_t  timestamp,
   const std::string&  symbolSetName,
   Coverage::Explanations& allExplanations,
-  const std::string&  projectName
+  const std::string&  projectName,
+  const std::string&  outputDirectory
 ): reportExtension_m( "" ),
symbolSetName_m( symbolSetName ),
timestamp_m( timestamp ),
allExplanations_m( allExplanations ),
-   projectName_m( projectName )
+   projectName_m( projectName ),
+   outputDirectory_m( outputDirectory )
 {
 }
 
@@ -43,7 +45,8 @@ ReportsBase::~ReportsBase()
 void ReportsBase::OpenFile(
   const std::string& fileName,
   const std::string& symbolSetName,
-  std::ofstream& aFile
+  std::ofstream& aFile,
+  const std::string& outputDirectory
 )
 {
   int sc;
@@ -89,7 +92,7 @@ void ReportsBase::OpenAnnotatedFile(
   std::ofstream& aFile
 )
 {
-  OpenFile(fileName, symbolSetName_m, aFile);
+  OpenFile( fileName, symbolSetName_m, aFile, outputDirectory_m );
 }
 
 void ReportsBase::OpenBranchFile(
@@ -98,7 +101,7 @@ void ReportsBase::OpenBranchFile(
   std::ofstream& aFile
 )
 {
-  OpenFile(fileName, symbolSetName_m, aFile);
+  OpenFile( fileName, symbolSetName_m, aFile, outputDirectory_m );
 }
 
 void ReportsBase::OpenCoverageFile(
@@ -106,7 +109,7 @@ void ReportsBase::OpenCoverageFile(
   std::ofstream& aFile
 )
 {
-  OpenFile(fileName, symbolSetName_m, aFile);
+  OpenFile( fileName, symbolSetName_m, aFile, outputDirectory_m );
 }
 
 void ReportsBase::OpenNoRangeFile(
@@ -114,7 +117,7 @@ void ReportsBase::OpenNoRangeFile(
   std::ofstream& aFile
 )
 {
-  OpenFile(fileName, symbolSetName_m, aFile);
+  OpenFile( fileName, symbolSetName_m, aFile, outputDirectory_m );
 }
 
 
@@ -123,7 +126,7 @@ void ReportsBase::OpenSizeFile(
   std::ofstream& aFile
 )
 {
-  OpenFile(fileName, symbolSetName_m, aFile);
+  OpenFile( fileName, symbolSetName_m, aFile, outputDirectory_m );
 }
 
 void ReportsBase::OpenSymbolSummaryFile(
@@ -131,7 +134,7 @@ void ReportsBase::OpenSymbolSummaryFile(
   std::ofstream& aFile
 )
 {
-  OpenFile(fileName, symbolSetName_m, aFile);
+  OpenFile( fileName, symbolSetName_m, aFile, outputDirectory_m );
 }
 
 void ReportsBase::CloseFile( std::ofstream& aFile )
@@ -466,7 +469,8 @@ void ReportsBase::WriteSymbolSummaryReport( const 
std::string& fileName )
 
 void  ReportsBase::WriteSummaryReport(
   const std::string& fileName,
-  const std::string& symbolSetName
+  const std::string& symbolSetName,
+  const std::string& outputDirectory
 )
 {
 // Calculate coverage statistics and output results.
@@ -480,7 +484,7 @@ void  ReportsBase::WriteSummaryReport(
   std::ofstream  report;
 
   // Open the report file.
-  OpenFile( fileName, symbolSetName, report );
+  OpenFile( fileName, symbolSetName, report, outputDirectory );
   if ( !report.is_open() ) {
 return;
   }
@@ -568,7 +572,8 @@ void GenerateReports(
   const std::string&  symbolSetName,
   Coverage::Explanations& allExplanations,
   boolverbose,
-  const std::string&  projectName
+  const std::string&  projectName,
+  const std::string&  outputDirectory
 )
 {
   typedef std::list reportList_t;
@@ -585,14 +590,16 @@ void GenerateReports(
 timestamp,
 symbolSetName,
 allExplanations,
-projectName
+projectName,
+outputDirectory
   );
   reportList.push_back( reports );
   reports = new ReportsHtml(
 timestamp,
 symbolSetName,
 allExplanations,
-projectName
+projectName,
+outputDirectory
   );
   reportList.push_back( reports );
 
@@ -641,7 +648,11 @@ void GenerateReports(
 delete reports;
   }
 
-  ReportsBase::WriteSummaryReport( "summary.txt", symbolSetName );
+  ReportsBase::WriteSummaryReport(
+"summary.txt",
+symbolSetName,
+outputDirectory
+  );
 }
 
 }
diff --git a/tester/covoar/ReportsBase.h b/tester/covoar/ReportsBase.h
index 38b7c29..a0c6a32 100644
--- a/tester/covoar/ReportsBase.h
+++ b/tester/covoar/ReportsBase.h
@@ -31,7 +31,8 @@ class ReportsBase {
   time_t  timestamp

[PATCH v2 06/13] Remove projectName global variable

2021-08-02 Thread Ryan Long
- Replaced projectName in app_common with a local variable in covoar()
- Changed datatype to string
  - Changed conditionals to reflect this
- Created projectName_m member variable for ReportsBase
- Added parameter to Reports* constructors to initialize projectName_m
---
 tester/covoar/ReportsBase.cc | 23 ++-
 tester/covoar/ReportsBase.h  | 12 ++--
 tester/covoar/ReportsHtml.cc | 33 +
 tester/covoar/ReportsHtml.h  |  3 ++-
 tester/covoar/ReportsText.cc |  5 +++--
 tester/covoar/ReportsText.h  |  3 ++-
 tester/covoar/app_common.cc  |  1 -
 tester/covoar/app_common.h   |  1 -
 tester/covoar/covoar.cc  | 10 --
 9 files changed, 60 insertions(+), 31 deletions(-)

diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc
index 8947f58..b2da71a 100644
--- a/tester/covoar/ReportsBase.cc
+++ b/tester/covoar/ReportsBase.cc
@@ -26,11 +26,13 @@ namespace Coverage {
 ReportsBase::ReportsBase(
   time_t  timestamp,
   const std::string&  symbolSetName,
-  Coverage::Explanations& allExplanations
+  Coverage::Explanations& allExplanations,
+  const std::string&  projectName
 ): reportExtension_m( "" ),
symbolSetName_m( symbolSetName ),
timestamp_m( timestamp ),
-   allExplanations_m( allExplanations )
+   allExplanations_m( allExplanations ),
+   projectName_m( projectName )
 {
 }
 
@@ -565,7 +567,8 @@ void  ReportsBase::WriteSummaryReport(
 void GenerateReports(
   const std::string&  symbolSetName,
   Coverage::Explanations& allExplanations,
-  boolverbose
+  boolverbose,
+  const std::string&  projectName
 )
 {
   typedef std::list reportList_t;
@@ -578,9 +581,19 @@ void GenerateReports(
 
 
   timestamp = time( NULL ); /* get current cal time */
-  reports = new ReportsText( timestamp, symbolSetName, allExplanations );
+  reports = new ReportsText(
+timestamp,
+symbolSetName,
+allExplanations,
+projectName
+  );
   reportList.push_back( reports );
-  reports = new ReportsHtml( timestamp, symbolSetName, allExplanations );
+  reports = new ReportsHtml(
+timestamp,
+symbolSetName,
+allExplanations,
+projectName
+  );
   reportList.push_back( reports );
 
   for ( ritr = reportList.begin(); ritr != reportList.end(); ritr++ ) {
diff --git a/tester/covoar/ReportsBase.h b/tester/covoar/ReportsBase.h
index 41ac7ef..38b7c29 100644
--- a/tester/covoar/ReportsBase.h
+++ b/tester/covoar/ReportsBase.h
@@ -30,7 +30,8 @@ class ReportsBase {
 ReportsBase(
   time_t  timestamp,
   const std::string&  symbolSetName,
-  Coverage::Explanations& allExplanations
+  Coverage::Explanations& allExplanations,
+  const std::string&  projectName
 );
 virtual ~ReportsBase();
 
@@ -130,6 +131,11 @@ class ReportsBase {
 Coverage::Explanations& allExplanations_m;
 
 /*!
+ *  This variable stores the name of the project.
+ */
+std::string projectName_m;
+
+/*!
  *  This method Opens a report file and verifies that it opened
  *  correctly.  Upon failure NULL is returned.
  *
@@ -401,11 +407,13 @@ class ReportsBase {
  *  @param[in] symbolSetName is the name of the symbol set to report on.
  *  @param[in] allExplanations is the explanations to report on.
  *  @param[in] verbose specifies whether to be verbose with output
+ *  @param[in] projectName specifies the name of the project
  */
 void GenerateReports(
   const std::string&  symbolSetName,
   Coverage::Explanations& allExplanations,
-  boolverbose
+  boolverbose,
+  const std::string&  projectName
 );
 
 }
diff --git a/tester/covoar/ReportsHtml.cc b/tester/covoar/ReportsHtml.cc
index 83fc52f..2c210b5 100644
--- a/tester/covoar/ReportsHtml.cc
+++ b/tester/covoar/ReportsHtml.cc
@@ -40,8 +40,9 @@ namespace Coverage {
   ReportsHtml::ReportsHtml(
 time_t  timestamp,
 const std::string&  symbolSetName,
-Coverage::Explanations& allExplanations
-  ): ReportsBase( timestamp, symbolSetName, allExplanations ),
+Coverage::Explanations& allExplanations,
+const std::string&  projectName
+  ): ReportsBase( timestamp, symbolSetName, allExplanations, projectName ),
  lastState_m( A_SOURCE )
   {
 reportExtension_m = ".html";
@@ -71,8 +72,8 @@ namespace Coverage {
 aFile << "Index" << std::endl
   << "";
 
-if ( projectName ) {
-  aFile << projectName << "";
+if ( !projectName_m.empty() ) {
+  aFile << projectName_m << "";
 }
 
 aFile << "Coverage Analysis Reports" << std::endl
@@ -129,8 +130,8 @@ namespace Coverage {
 aFile << "Annotated Report" << std::endl
   << "";
 
-if ( projectName ) {
-  aFile << projectName << "";
+if ( !projectName_m.empty() ) {
+  aFile << projectName_m << "";
 }
 
 aFile << "Annotated Report" << std::endl
@@ -153,8 +154,8 @@ na

[PATCH v2 05/13] Remove dynamicLibrary global variable

2021-08-02 Thread Ryan Long
- Replaced dynamicLibrary in app_common with local variables
- Changed data type to string
  - Changed conditionals to reflect this
---
 tester/covoar/ExecutableInfo.cc | 10 +-
 tester/covoar/ExecutableInfo.h  |  6 +++---
 tester/covoar/TraceConverter.cc |  5 +++--
 tester/covoar/app_common.cc |  1 -
 tester/covoar/app_common.h  |  1 -
 tester/covoar/covoar.cc |  9 +
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/tester/covoar/ExecutableInfo.cc b/tester/covoar/ExecutableInfo.cc
index a6184e7..9c3031e 100644
--- a/tester/covoar/ExecutableInfo.cc
+++ b/tester/covoar/ExecutableInfo.cc
@@ -18,18 +18,18 @@
 namespace Coverage {
 
   ExecutableInfo::ExecutableInfo(
-const char* const theExecutableName,
-const char* const theLibraryName,
-bool  verbose
+const char* const  theExecutableName,
+const std::string& theLibraryName,
+bool   verbose
 ) : fileName(theExecutableName),
 loadAddress(0)
   {
-if (theLibraryName != nullptr)
+if ( !theLibraryName.empty() )
   libraryName = theLibraryName;
 
 if (verbose) {
   std::cerr << "Loading executable " << theExecutableName;
-  if (theLibraryName != nullptr)
+  if ( !theLibraryName.empty() )
 std::cerr << " (" << theLibraryName << ')';
   std::cerr << std::endl;
 }
diff --git a/tester/covoar/ExecutableInfo.h b/tester/covoar/ExecutableInfo.h
index 1f977a0..851a59d 100644
--- a/tester/covoar/ExecutableInfo.h
+++ b/tester/covoar/ExecutableInfo.h
@@ -43,9 +43,9 @@ namespace Coverage {
  *  @param[in] verbose specifies whether to be verbose with output
  */
 ExecutableInfo(
-  const char* const theExecutableName,
-  const char* const theLibraryName = NULL,
-  bool  verbose = false
+  const char* const  theExecutableName,
+  const std::string& theLibraryName = "",
+  bool   verbose = false
 );
 
 /*!
diff --git a/tester/covoar/TraceConverter.cc b/tester/covoar/TraceConverter.cc
index 89e0736..c997702 100644
--- a/tester/covoar/TraceConverter.cc
+++ b/tester/covoar/TraceConverter.cc
@@ -91,6 +91,7 @@ int main(
   rld::process::tempfile   err( ".err" );
   Coverage::ObjdumpProcessor   objdumpProcessor;
   bool verbose = false;
+  std::string  dynamicLibrary;
 
   setup_signals();
 
@@ -130,13 +131,13 @@ int main(
   // Create toolnames.
   TargetInfo = Target::TargetFactory( cpuname );
 
-  if (dynamicLibrary)
+  if ( !dynamicLibrary.empty() )
 executableInfo = new Coverage::ExecutableInfo( executable, dynamicLibrary 
);
   else
 executableInfo = new Coverage::ExecutableInfo( executable );
 
   // If a dynamic library was specified, determine the load address.
-  if (dynamicLibrary)
+  if ( !dynamicLibrary.empty() )
 executableInfo->setLoadAddress(
   objdumpProcessor.determineLoadAddress( executableInfo )
 );
diff --git a/tester/covoar/app_common.cc b/tester/covoar/app_common.cc
index 9dfe81e..587af1a 100644
--- a/tester/covoar/app_common.cc
+++ b/tester/covoar/app_common.cc
@@ -60,7 +60,6 @@ Coverage::DesiredSymbols*   SymbolsToAnalyze= NULL;
 const char* outputDirectory = ".";
 boolBranchInfoAvailable = false;
 Target::TargetBase* TargetInfo  = NULL;
-const char* dynamicLibrary  = NULL;
 const char* projectName = NULL;
 charinputBuffer[MAX_LINE_LENGTH];
 charinputBuffer2[MAX_LINE_LENGTH];
diff --git a/tester/covoar/app_common.h b/tester/covoar/app_common.h
index ac66eda..6cb8577 100644
--- a/tester/covoar/app_common.h
+++ b/tester/covoar/app_common.h
@@ -16,7 +16,6 @@ extern Coverage::DesiredSymbols*SymbolsToAnalyze;
 extern const char*  outputDirectory;
 extern bool BranchInfoAvailable;
 extern Target::TargetBase*  TargetInfo;
-extern const char*  dynamicLibrary;
 extern const char*  projectName;
 
 #define MAX_LINE_LENGTH 512
diff --git a/tester/covoar/covoar.cc b/tester/covoar/covoar.cc
index 9c88b00..3894867 100644
--- a/tester/covoar/covoar.cc
+++ b/tester/covoar/covoar.cc
@@ -177,6 +177,7 @@ int covoar(
   Coverage::ExplanationsallExplanations;
   Coverage::ObjdumpProcessorobjdumpProcessor;
   bool  verbose = false;
+  std::string   dynamicLibrary;
 
   //
   // Process command line options.
@@ -303,13 +304,13 @@ int covoar(
   // If there was at least one coverage file, create the
   // executable information.
   if (!coverageFileNames.empty()) {
-if (dynamicLibrary) {
+if ( !dynamicLibrary.empty() ) {
   executableInfo = new Coverage::ExecutableInfo(
 singleExecutable, dynamicLibrary, verbose
   );
 } else {
   execut

[PATCH v2 03/13] Remove objdumpProcessor global variable

2021-08-02 Thread Ryan Long
- Replaced objdumpProcessor in app_common with a local variable in
  TraceConverter.cc and covoar.cc
- Added objdumpProcessor as a parameter for GenerateReports() and
  the processFile() member function of TraceReaderBase and its derived
  classes
- Changed previous objdumpProcessor member functions calls from pointer
  to direct call syntax
---
 tester/covoar/ReportsBase.h | 2 +-
 tester/covoar/TraceConverter.cc | 9 -
 tester/covoar/TraceReaderBase.h | 7 ---
 tester/covoar/TraceReaderLogQEMU.cc | 7 ---
 tester/covoar/TraceReaderLogQEMU.h  | 6 +++---
 tester/covoar/app_common.cc | 1 -
 tester/covoar/app_common.h  | 1 -
 tester/covoar/covoar.cc | 8 +++-
 8 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/tester/covoar/ReportsBase.h b/tester/covoar/ReportsBase.h
index a2856e3..efc110d 100644
--- a/tester/covoar/ReportsBase.h
+++ b/tester/covoar/ReportsBase.h
@@ -402,7 +402,7 @@ class ReportsBase {
  *  @param[in] allExplanations is the explanations to report on.
  */
 void GenerateReports(
-  const std::string& symbolSetName,
+  const std::string&  symbolSetName,
   Coverage::Explanations& allExplanations
 );
 
diff --git a/tester/covoar/TraceConverter.cc b/tester/covoar/TraceConverter.cc
index 7015e28..cd64faf 100644
--- a/tester/covoar/TraceConverter.cc
+++ b/tester/covoar/TraceConverter.cc
@@ -89,6 +89,7 @@ int main(
   Coverage::ExecutableInfo*executableInfo;
   rld::process::tempfile   objdumpFile( ".dmp" );
   rld::process::tempfile   err( ".err" );
+  Coverage::ObjdumpProcessor   objdumpProcessor;
 
   setup_signals();
 
@@ -133,14 +134,12 @@ int main(
   else
 executableInfo = new Coverage::ExecutableInfo( executable );
 
-  objdumpProcessor = new Coverage::ObjdumpProcessor();
-
   // If a dynamic library was specified, determine the load address.
   if (dynamicLibrary)
 executableInfo->setLoadAddress(
-  objdumpProcessor->determineLoadAddress( executableInfo )
+  objdumpProcessor.determineLoadAddress( executableInfo )
 );
-  objdumpProcessor->loadAddressTable( executableInfo, objdumpFile, err );
-  log.processFile( logname );
+  objdumpProcessor.loadAddressTable( executableInfo, objdumpFile, err );
+  log.processFile( logname, objdumpProcessor );
   trace.writeFile( tracefile, &log );
 }
diff --git a/tester/covoar/TraceReaderBase.h b/tester/covoar/TraceReaderBase.h
index 6ad488e..3005c62 100644
--- a/tester/covoar/TraceReaderBase.h
+++ b/tester/covoar/TraceReaderBase.h
@@ -8,6 +8,7 @@
 #define __TRACE_READER_BASE_H__
 
 #include "TraceList.h"
+#include "ObjdumpProcessor.h"
 
 namespace Trace {
 
@@ -41,13 +42,13 @@ namespace Trace {
  *  @a file and adds it to the specified @a executableInformation.
  *
  *  @param[in] file is the coverage file to process
- *  @param[in] executableInformation is the information for an
- * associated executable
+ *  @param[in] objdumpProcessor the processor for the object dump
  *
  *  @return Returns TRUE if the method succeeded and FALSE if it failed.
  */
 virtual bool processFile(
-  const char* const file
+  const char* const   file,
+  Coverage::ObjdumpProcessor& objdumpProcessor
 ) = 0;
   };
 
diff --git a/tester/covoar/TraceReaderLogQEMU.cc 
b/tester/covoar/TraceReaderLogQEMU.cc
index b64a149..0a61ea5 100644
--- a/tester/covoar/TraceReaderLogQEMU.cc
+++ b/tester/covoar/TraceReaderLogQEMU.cc
@@ -72,7 +72,8 @@ namespace Trace {
   }
 
   bool TraceReaderLogQEMU::processFile(
-const char* const file
+const char* const   file,
+Coverage::ObjdumpProcessor& objdumpProcessor
   )
   {
 booldone  = false;
@@ -160,7 +161,7 @@ namespace Trace {
 );
   } while( result > 1);
 
-  nextlogical = objdumpProcessor->getAddressAfter(last.address);
+  nextlogical = objdumpProcessor.getAddressAfter(last.address);
 
   if (! ReadUntilFound( logFile, QEMU_LOG_IN_KEY )) {
 done = true;
@@ -185,7 +186,7 @@ namespace Trace {
   if (nextlogical != 0) {
 TraceList::exitReason_t reason = TraceList::EXIT_REASON_OTHER;
 
-if ( objdumpProcessor->IsBranch( last.instruction ) ) {
+if ( objdumpProcessor.IsBranch( last.instruction ) ) {
   if ( nextExecuted.address == nextlogical ) {
 reason = TraceList::EXIT_REASON_BRANCH_NOT_TAKEN;
   }  else {
diff --git a/tester/covoar/TraceReaderLogQEMU.h 
b/tester/covoar/TraceReaderLogQEMU.h
index fb1d020..8ee5651 100644
--- a/tester/covoar/TraceReaderLogQEMU.h
+++ b/tester/covoar/TraceReaderLogQEMU.h
@@ -38,13 +38,13 @@ namespace Trace {
  *  @a file and adds it to the specified @a executableInformation.
  *
  *  @param[in] file is the coverage file to process
- *  @param[in] executableInformation is the information for an
- * associated executable
+ *  @param[in] objdumpProcessor the proc

[PATCH v2 04/13] Remove Verbose global variable

2021-08-02 Thread Ryan Long
Replaced Verbose in app_common with local variables that are passed
as a parameter into numerous functions
---
 tester/covoar/DesiredSymbols.cc   | 17 
 tester/covoar/DesiredSymbols.h| 13 +---
 tester/covoar/ExecutableInfo.h|  1 +
 tester/covoar/ObjdumpProcessor.cc | 23 ++---
 tester/covoar/ObjdumpProcessor.h  |  5 +++--
 tester/covoar/ReportsBase.cc  | 15 +++---
 tester/covoar/ReportsBase.h   |  4 +++-
 tester/covoar/TraceConverter.cc   |  5 +++--
 tester/covoar/TraceWriterBase.h   |  4 +++-
 tester/covoar/TraceWriterQEMU.cc  |  7 ---
 tester/covoar/TraceWriterQEMU.h   |  4 +++-
 tester/covoar/app_common.cc   |  1 -
 tester/covoar/app_common.h|  1 -
 tester/covoar/covoar.cc   | 43 ---
 14 files changed, 85 insertions(+), 58 deletions(-)

diff --git a/tester/covoar/DesiredSymbols.cc b/tester/covoar/DesiredSymbols.cc
index caa6acd..5d5e637 100644
--- a/tester/covoar/DesiredSymbols.cc
+++ b/tester/covoar/DesiredSymbols.cc
@@ -189,7 +189,7 @@ namespace Coverage {
   }
 
 
-  void DesiredSymbols::computeUncovered( void )
+  void DesiredSymbols::computeUncovered( bool verbose )
   {
 // Look at each symbol set.
 for (const auto& kv : setNamesToSymbols) {
@@ -308,7 +308,7 @@ namespace Coverage {
   CoverageRanges::UNCOVERED_REASON_BRANCH_ALWAYS_TAKEN,
   1
 );
-if (Verbose)
+if (verbose)
   std::cerr << "Branch always taken found in" << symbol
 << std::hex
 << " (0x" << info.baseAddress + la
@@ -326,7 +326,7 @@ namespace Coverage {
   CoverageRanges::UNCOVERED_REASON_BRANCH_NEVER_TAKEN,
   1
   );
-if (Verbose)
+if (verbose)
   std::cerr << "Branch never taken found in " << symbol
 << std::hex
 << " (0x" << info.baseAddress + la
@@ -350,7 +350,8 @@ namespace Coverage {
 const std::string& exefileName,
 const std::string& symbolName,
 uint32_t   size,
-uint32_t   sizeWithoutNops
+uint32_t   sizeWithoutNops,
+bool   verbose
   )
   {
 CoverageMapBase* aCoverageMap;
@@ -403,7 +404,7 @@ namespace Coverage {
 
   aCoverageMap = new CoverageMap( exefileName, 0, highAddress );
 
-  if ( Verbose )
+  if ( verbose )
 fprintf(
   stderr,
   "Created unified coverage map for %s (0x%x - 0x%x)\n",
@@ -440,7 +441,7 @@ namespace Coverage {
   return &set[ symbolName ];
   }
 
-  void DesiredSymbols::findSourceForUncovered( void )
+  void DesiredSymbols::findSourceForUncovered( bool verbose )
   {
 // Process uncovered ranges and/or branches for each symbol.
 for (auto& d : SymbolsToAnalyze->set) {
@@ -448,7 +449,7 @@ namespace Coverage {
   CoverageRanges* theRanges = d.second.uncoveredRanges;
   if (theRanges != nullptr) {
 if (!theRanges->set.empty()) {
-  if (Verbose)
+  if (verbose)
 std::cerr << "Looking up source lines for uncovered ranges in "
   << d.first
   << std::endl;
@@ -459,7 +460,7 @@ namespace Coverage {
 CoverageRanges* theBranches = d.second.uncoveredBranches;
 if (theBranches != nullptr) {
   if (!theBranches->set.empty()) {
-if (Verbose)
+if (verbose)
   std::cerr << "Looking up source lines for uncovered branches in "
 << d.first
 << std::endl;
diff --git a/tester/covoar/DesiredSymbols.h b/tester/covoar/DesiredSymbols.h
index 411b818..791b4ea 100644
--- a/tester/covoar/DesiredSymbols.h
+++ b/tester/covoar/DesiredSymbols.h
@@ -222,8 +222,10 @@ namespace Coverage {
 /*!
  *  This method analyzes each symbols coverage map to determine any
  *  uncovered ranges or branches.
+ *
+ *  @param[in] verbose specifies whether to be verbose with output
  */
-void computeUncovered( void );
+void computeUncovered( bool verbose );
 
 /*!
  *  This method creates a coverage map for the specified symbol
@@ -234,12 +236,15 @@ namespace Coverage {
  *  @param[in] symbolName specifies the symbol for which to create
  * a coverage map
  *  @param[in] size specifies the size of the coverage map to create
+ *  @param[in] sizeWithoutNops specifies the size without no ops
+ *  @param[in] verbose specifies whether to be verbose with output
  */
 void createCoverageMap(
   const std::string& exefileName,
   const std::string& symbolName,
   uint32_t   size,
-  uint32_t   sizeWithoutNops
+  uint32_t   sizeWithoutNops,
+  bool   verbose
 );
 
 /*!
@@ -256,8 +261,

[PATCH v2 02/13] ReportsHtml.cc: Initialize lastState_m

2021-08-02 Thread Ryan Long
When not initialized, an extra code segment would be added to
annotated.html
---
 tester/covoar/ReportsHtml.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tester/covoar/ReportsHtml.cc b/tester/covoar/ReportsHtml.cc
index 88ea25b..83fc52f 100644
--- a/tester/covoar/ReportsHtml.cc
+++ b/tester/covoar/ReportsHtml.cc
@@ -41,7 +41,8 @@ namespace Coverage {
 time_t  timestamp,
 const std::string&  symbolSetName,
 Coverage::Explanations& allExplanations
-  ): ReportsBase( timestamp, symbolSetName, allExplanations )
+  ): ReportsBase( timestamp, symbolSetName, allExplanations ),
+ lastState_m( A_SOURCE )
   {
 reportExtension_m = ".html";
   }
-- 
1.8.3.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 00/13] Remove app_common

2021-08-02 Thread Ryan Long
Hi,

In this iteration I:

- Removed the typedef in ObjdumpProcessor.h
- Changed targetInfo to be a shared pointer
- Got rid of some of the get & set methods for targetInfo_m
- Added lastState_m to initialization list in ReportsHtml.cc

Thanks,
Ryan

Ryan Long (13):
  Remove AllExplanations global variable
  ReportsHtml.cc: Initialize lastState_m
  Remove objdumpProcessor global variable
  Remove Verbose global variable
  Remove dynamicLibrary global variable
  Remove projectName global variable
  Remove outputDirectory global variable
  Remove input buffer global variables
  Remove SymbolsToAnalyze global variable
  Remove BranchInfoAvailable global variable
  Remove TargetInfo global variable
  app_common: Remove functions and macros
  Remove app_common and all references to it

 tester/covoar/CoverageReaderBase.cc |   5 ++
 tester/covoar/CoverageReaderBase.h  |  15 
 tester/covoar/CoverageReaderQEMU.cc |   7 +-
 tester/covoar/CoverageReaderTSIM.cc |   5 +-
 tester/covoar/DesiredSymbols.cc |  28 +++---
 tester/covoar/DesiredSymbols.h  |  27 --
 tester/covoar/ExecutableInfo.cc |  23 ++---
 tester/covoar/ExecutableInfo.h  |  17 +++-
 tester/covoar/Explanations.cc   |  21 ++---
 tester/covoar/GcovData.cc   |   7 +-
 tester/covoar/GcovData.h|  12 ++-
 tester/covoar/GcovFunctionData.cc   |  15 ++--
 tester/covoar/GcovFunctionData.h|   6 +-
 tester/covoar/Makefile  |   6 +-
 tester/covoar/ObjdumpProcessor.cc   |  68 ++-
 tester/covoar/ObjdumpProcessor.h| 113 +++-
 tester/covoar/ReportsBase.cc| 166 +++-
 tester/covoar/ReportsBase.h |  69 +--
 tester/covoar/ReportsHtml.cc|  64 +-
 tester/covoar/ReportsHtml.h |  10 ++-
 tester/covoar/ReportsText.cc|  28 --
 tester/covoar/ReportsText.h |  10 ++-
 tester/covoar/SymbolTable.cc|   1 -
 tester/covoar/TraceConverter.cc |  39 ++---
 tester/covoar/TraceReaderBase.h |   7 +-
 tester/covoar/TraceReaderLogQEMU.cc |  25 +-
 tester/covoar/TraceReaderLogQEMU.h  |   6 +-
 tester/covoar/TraceWriterBase.h |   9 +-
 tester/covoar/TraceWriterQEMU.cc|  12 +--
 tester/covoar/TraceWriterQEMU.h |   4 +-
 tester/covoar/app_common.cc | 118 -
 tester/covoar/app_common.h  |  34 
 tester/covoar/coverage_converter.cc |   1 -
 tester/covoar/covmerge.cc   |   8 +-
 tester/covoar/covoar.cc | 125 ++-
 tester/covoar/wscript   |   3 +-
 36 files changed, 659 insertions(+), 455 deletions(-)
 delete mode 100644 tester/covoar/app_common.cc
 delete mode 100644 tester/covoar/app_common.h

-- 
1.8.3.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v2 01/13] Remove AllExplanations global variable

2021-08-02 Thread Ryan Long
- Replaced AllExplanations in app_common with a local variable in covoar()
- Added the allExplanations_m member variable to ReportsBase
- Added a parameter to ReportsBase and its derived classes' constructors
  to initialize allExplanations_m
- Added parameter to GenerateReports() to pass the variable from
  covoar() to the constructors for Reports*
---
 tester/covoar/ReportsBase.cc | 21 ++---
 tester/covoar/ReportsBase.h  | 18 --
 tester/covoar/ReportsHtml.cc | 11 ++-
 tester/covoar/ReportsHtml.h  |  6 +-
 tester/covoar/ReportsText.cc | 11 +++
 tester/covoar/ReportsText.h  |  6 +-
 tester/covoar/app_common.cc  |  1 -
 tester/covoar/app_common.h   |  1 -
 tester/covoar/covoar.cc  |  8 
 9 files changed, 57 insertions(+), 26 deletions(-)

diff --git a/tester/covoar/ReportsBase.cc b/tester/covoar/ReportsBase.cc
index cd65c53..62229c0 100644
--- a/tester/covoar/ReportsBase.cc
+++ b/tester/covoar/ReportsBase.cc
@@ -23,10 +23,14 @@
 
 namespace Coverage {
 
-ReportsBase::ReportsBase( time_t timestamp, const std::string& symbolSetName ):
-  reportExtension_m( "" ),
-  symbolSetName_m( symbolSetName ),
-  timestamp_m( timestamp )
+ReportsBase::ReportsBase(
+  time_t  timestamp,
+  const std::string&  symbolSetName,
+  Coverage::Explanations& allExplanations
+): reportExtension_m( "" ),
+   symbolSetName_m( symbolSetName ),
+   timestamp_m( timestamp ),
+   allExplanations_m( allExplanations )
 {
 }
 
@@ -558,7 +562,10 @@ void  ReportsBase::WriteSummaryReport(
   CloseFile( report );
 }
 
-void GenerateReports( const std::string& symbolSetName )
+void GenerateReports(
+  const std::string&  symbolSetName,
+  Coverage::Explanations& allExplanations
+)
 {
   typedef std::list reportList_t;
 
@@ -570,9 +577,9 @@ void GenerateReports( const std::string& symbolSetName )
 
 
   timestamp = time( NULL ); /* get current cal time */
-  reports = new ReportsText( timestamp, symbolSetName );
+  reports = new ReportsText( timestamp, symbolSetName, allExplanations );
   reportList.push_back( reports );
-  reports = new ReportsHtml( timestamp, symbolSetName );
+  reports = new ReportsHtml( timestamp, symbolSetName, allExplanations );
   reportList.push_back( reports );
 
   for ( ritr = reportList.begin(); ritr != reportList.end(); ritr++ ) {
diff --git a/tester/covoar/ReportsBase.h b/tester/covoar/ReportsBase.h
index 41add8e..a2856e3 100644
--- a/tester/covoar/ReportsBase.h
+++ b/tester/covoar/ReportsBase.h
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include "DesiredSymbols.h"
+#include "Explanations.h"
 
 namespace Coverage {
 
@@ -26,7 +27,11 @@ namespace Coverage {
 class ReportsBase {
 
   public:
-ReportsBase( time_t timestamp, const std::string& symbolSetName );
+ReportsBase(
+  time_t  timestamp,
+  const std::string&  symbolSetName,
+  Coverage::Explanations& allExplanations
+);
 virtual ~ReportsBase();
 
 /*!
@@ -120,6 +125,11 @@ class ReportsBase {
 time_t timestamp_m;
 
 /*!
+ *  This member variable contains the explanations to report on.
+ */
+Coverage::Explanations& allExplanations_m;
+
+/*!
  *  This method Opens a report file and verifies that it opened
  *  correctly.  Upon failure NULL is returned.
  *
@@ -389,8 +399,12 @@ class ReportsBase {
  *  all reports.
  *
  *  @param[in] symbolSetName is the name of the symbol set to report on.
+ *  @param[in] allExplanations is the explanations to report on.
  */
-void GenerateReports( const std::string& symbolSetName );
+void GenerateReports(
+  const std::string& symbolSetName,
+  Coverage::Explanations& allExplanations
+);
 
 }
 
diff --git a/tester/covoar/ReportsHtml.cc b/tester/covoar/ReportsHtml.cc
index e276732..88ea25b 100644
--- a/tester/covoar/ReportsHtml.cc
+++ b/tester/covoar/ReportsHtml.cc
@@ -38,9 +38,10 @@ typedef rtems::utils::ostream_guard ostream_guard;
 namespace Coverage {
 
   ReportsHtml::ReportsHtml(
-   time_t  timestamp,
-const std::string& symbolSetName
-  ): ReportsBase( timestamp, symbolSetName )
+time_t  timestamp,
+const std::string&  symbolSetName,
+Coverage::Explanations& allExplanations
+  ): ReportsBase( timestamp, symbolSetName, allExplanations )
   {
 reportExtension_m = ".html";
   }
@@ -506,7 +507,7 @@ namespace Coverage {
 
 // See if an explanation is available and write the Classification and
 // the Explination Columns.
-explanation = AllExplanations->lookupExplanation( range.lowSourceLine );
+explanation = allExplanations_m.lookupExplanation( range.lowSourceLine );
 if ( !explanation ) {
   // Write Classificationditr->second.baseAddress
   report << "NONE"
@@ -654,7 +655,7 @@ namespace Coverage {
<< range.instructionCount << "" << std::endl;
 
 // See if an explanation is available
-explanation = AllExplanations->lookupExplanation( range.lowSourceLin

[PATCH] Turn off executable permissions for a number of source files

2021-08-02 Thread Joel Sherrill
Cloning under Cygwin turned off executable permission on these
files. This shows them as modified even though they have not
explicitly been touched. Executable permission should not have
been on for these files so this is just a minor clean up.
---
 cpukit/score/cpu/aarch64/include/rtems/score/aarch64-system-registers.h | 0
 testsuites/psxtests/psxhdrs/errno/errno.c   | 0
 testsuites/psxtests/psxhdrs/iconv/iconv.c   | 0
 testsuites/psxtests/psxhdrs/iconv/iconv_close.c | 0
 testsuites/psxtests/psxhdrs/iconv/iconv_open.c  | 0
 testsuites/psxtests/psxhdrs/monetary/strfmon.c  | 0
 testsuites/psxtests/psxhdrs/monetary/strfmon_l.c| 0
 testsuites/psxtests/psxhdrs/stdlib/_Exit.c  | 0
 testsuites/psxtests/psxhdrs/stdlib/a64l.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/abort.c  | 0
 testsuites/psxtests/psxhdrs/stdlib/abs.c| 0
 testsuites/psxtests/psxhdrs/stdlib/atexit.c | 0
 testsuites/psxtests/psxhdrs/stdlib/atof.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/atoi.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/atol.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/atoll.c  | 0
 testsuites/psxtests/psxhdrs/stdlib/bsearch.c| 0
 testsuites/psxtests/psxhdrs/stdlib/calloc.c | 0
 testsuites/psxtests/psxhdrs/stdlib/div.c| 0
 testsuites/psxtests/psxhdrs/stdlib/drand48.c| 0
 testsuites/psxtests/psxhdrs/stdlib/erand48.c| 0
 testsuites/psxtests/psxhdrs/stdlib/exit.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/free.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/getenv.c | 0
 testsuites/psxtests/psxhdrs/stdlib/getsubopt.c  | 0
 testsuites/psxtests/psxhdrs/stdlib/grantpt.c| 0
 testsuites/psxtests/psxhdrs/stdlib/initstate.c  | 0
 testsuites/psxtests/psxhdrs/stdlib/jrand48.c| 0
 testsuites/psxtests/psxhdrs/stdlib/l64a.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/labs.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/lcong48.c| 0
 testsuites/psxtests/psxhdrs/stdlib/ldiv.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/llabs.c  | 0
 testsuites/psxtests/psxhdrs/stdlib/lldiv.c  | 0
 testsuites/psxtests/psxhdrs/stdlib/lrand48.c| 0
 testsuites/psxtests/psxhdrs/stdlib/malloc.c | 0
 testsuites/psxtests/psxhdrs/stdlib/mblen.c  | 0
 testsuites/psxtests/psxhdrs/stdlib/mbstowcs.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/mbtowc.c | 0
 testsuites/psxtests/psxhdrs/stdlib/mkdtemp.c| 0
 testsuites/psxtests/psxhdrs/stdlib/mkstemp.c| 0
 testsuites/psxtests/psxhdrs/stdlib/mrand48.c| 0
 testsuites/psxtests/psxhdrs/stdlib/nrand48.c| 0
 testsuites/psxtests/psxhdrs/stdlib/posix_memalign.c | 0
 testsuites/psxtests/psxhdrs/stdlib/posix_openpt.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/ptsname.c| 0
 testsuites/psxtests/psxhdrs/stdlib/putenv.c | 0
 testsuites/psxtests/psxhdrs/stdlib/qsort.c  | 0
 testsuites/psxtests/psxhdrs/stdlib/rand.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/rand_r.c | 0
 testsuites/psxtests/psxhdrs/stdlib/random.c | 0
 testsuites/psxtests/psxhdrs/stdlib/realloc.c| 0
 testsuites/psxtests/psxhdrs/stdlib/realpath.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/seed48.c | 0
 testsuites/psxtests/psxhdrs/stdlib/setenv.c | 0
 testsuites/psxtests/psxhdrs/stdlib/setkey.c | 0
 testsuites/psxtests/psxhdrs/stdlib/setstate.c   | 0
 testsuites/psxtests/psxhdrs/stdlib/srand.c  | 0
 testsuites/psxtests/psxhdrs/stdlib/srand48.c| 0
 testsuites/psxtests/psxhdrs/stdlib/srandom.c| 0
 testsuites/psxtests/psxhdrs/stdlib/strtod.c | 0
 testsuites/psxtests/psxhdrs/stdlib/strtof.c 

Re: [PATCH rtems-libbsd 0/5] RTEMS LibBSD Documentation

2021-08-02 Thread Sebastian Huber

On 02/08/2021 18:37, Vijay Kumar Banerjee wrote:

I think there should be a high-level user manual subsection for
networking that describes how the selection of the network stack
works. We can then add another subsection about lwip since legacy
already has one, and libbsd is getting added now.


This sounds like a good approach.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH rtems-libbsd 0/5] RTEMS LibBSD Documentation

2021-08-02 Thread Vijay Kumar Banerjee
On Mon, Aug 2, 2021 at 10:11 AM Gedare Bloom  wrote:
>
> On Mon, Aug 2, 2021 at 7:03 AM Christian MAUDERER
>  wrote:
> >
> > Am 02.08.21 um 10:38 schrieb Chris Johns:
> > > On 2/8/21 4:58 pm, Christian MAUDERER wrote:
> > >> Hello Husni,
> > >>
> > >> thanks for the patches. I'm sure that this will start a discussion about 
> > >> the
> > >> right place for that documentation. libbsd documentation is a long 
> > >> overdue topic
> > >> that has been neglected by all of us (including myself) so I think it's 
> > >> good to
> > >> start that discussion.
> > >
> > > I suggest the user manual.
> > >
> > > Chris
> > >
> >
> > Hello Chris,
> >
> > thanks for the suggestion. So that would be a new libbsd chapter in the
> > user manual and not some extra manual like the "Legacy Networking User
> > Manual"?
> >
> @Vijay Kumar Banerjee would you anticipate a new networking manual, or
> just a networking subsection in the user manual? Libbsd encompasses
> more than just networking, so it might be sensible to give libbsd its
> own entire subsection. Then, lwIP could also get a subsection in the
> future?
>
I think there should be a high-level user manual subsection for
networking that describes how the selection of the network stack
works. We can then add another subsection about lwip since legacy
already has one, and libbsd is getting added now.

> > Sooner or later most of the user facing documentation we already have in
> > libbsd most likely would be moved there too. That would be mainly:
> >
> > https://git.rtems.org/rtems-libbsd/tree/README.md
> > https://git.rtems.org/rtems-libbsd/tree/libbsd.txt
> >
> > The CONTRIBUTING.md is more developer facing. Would we move that in the
> > user manual too or would that be something that should move to either
> > "BSP and Driver Guide" or the "Software Engineering" manual:
> >
> Developer-facing would be moved probably to both BSP and SwE manuals,
> depending on the content. BSP manual requires a refresh itself, but is
> the right place to add guidance how to port/implement the libbsd
> drivers. SwE manual is the right place to document the rules to
> contribute to libbsd.
>
> > https://git.rtems.org/rtems-libbsd/tree/CONTRIBUTING.md
> >
> > Note that I don't want to push that work to anyone. I asked Husni that
> > he adds his work to a new manual at the moment so that we have a basis
> > for discussion. The alternative would be to continue adding information
> > like that to the text documents in libbsd. But the text files start to
> > get convoluted and I think a better organized manual is long overdue. I
> > thought that Husnis work would be a great chance to trigger finding the
> > right place so that we can add or move more documentation to that place
> > slowly. I'm sure that I should do quite some of that too because I have
> > added a lot of stuff to libbsd over the time.
> >
> > Best regards
> >
> > Christian
> > --
> > 
> > embedded brains GmbH
> > Herr Christian MAUDERER
> > Dornierstr. 4
> > 82178 Puchheim
> > Germany
> > email: christian.maude...@embedded-brains.de
> > phone: +49-89-18 94 741 - 18
> > fax:   +49-89-18 94 741 - 08
> >
> > Registergericht: Amtsgericht München
> > Registernummer: HRB 157899
> > Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> > Unsere Datenschutzerklärung finden Sie hier:
> > https://embedded-brains.de/datenschutzerklaerung/
> > ___
> > devel mailing list
> > devel@rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH rtems-libbsd 0/5] RTEMS LibBSD Documentation

2021-08-02 Thread Gedare Bloom
On Mon, Aug 2, 2021 at 7:03 AM Christian MAUDERER
 wrote:
>
> Am 02.08.21 um 10:38 schrieb Chris Johns:
> > On 2/8/21 4:58 pm, Christian MAUDERER wrote:
> >> Hello Husni,
> >>
> >> thanks for the patches. I'm sure that this will start a discussion about 
> >> the
> >> right place for that documentation. libbsd documentation is a long overdue 
> >> topic
> >> that has been neglected by all of us (including myself) so I think it's 
> >> good to
> >> start that discussion.
> >
> > I suggest the user manual.
> >
> > Chris
> >
>
> Hello Chris,
>
> thanks for the suggestion. So that would be a new libbsd chapter in the
> user manual and not some extra manual like the "Legacy Networking User
> Manual"?
>
@Vijay Kumar Banerjee would you anticipate a new networking manual, or
just a networking subsection in the user manual? Libbsd encompasses
more than just networking, so it might be sensible to give libbsd its
own entire subsection. Then, lwIP could also get a subsection in the
future?

> Sooner or later most of the user facing documentation we already have in
> libbsd most likely would be moved there too. That would be mainly:
>
> https://git.rtems.org/rtems-libbsd/tree/README.md
> https://git.rtems.org/rtems-libbsd/tree/libbsd.txt
>
> The CONTRIBUTING.md is more developer facing. Would we move that in the
> user manual too or would that be something that should move to either
> "BSP and Driver Guide" or the "Software Engineering" manual:
>
Developer-facing would be moved probably to both BSP and SwE manuals,
depending on the content. BSP manual requires a refresh itself, but is
the right place to add guidance how to port/implement the libbsd
drivers. SwE manual is the right place to document the rules to
contribute to libbsd.

> https://git.rtems.org/rtems-libbsd/tree/CONTRIBUTING.md
>
> Note that I don't want to push that work to anyone. I asked Husni that
> he adds his work to a new manual at the moment so that we have a basis
> for discussion. The alternative would be to continue adding information
> like that to the text documents in libbsd. But the text files start to
> get convoluted and I think a better organized manual is long overdue. I
> thought that Husnis work would be a great chance to trigger finding the
> right place so that we can add or move more documentation to that place
> slowly. I'm sure that I should do quite some of that too because I have
> added a lot of stuff to libbsd over the time.
>
> Best regards
>
> Christian
> --
> 
> embedded brains GmbH
> Herr Christian MAUDERER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: christian.maude...@embedded-brains.de
> phone: +49-89-18 94 741 - 18
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

RE: [PATCH v1 09/13] Remove SymbolsToAnalyze global variable

2021-08-02 Thread Ryan Long
On master, the struct is defined as objdumpLine_t. I'll go back and remove the 
"_t" from the end of the variables in another patch since that's unrelated to 
this one, and I'll remove that typedef.

-Original Message-
From: Chris Johns  
Sent: Sunday, August 1, 2021 10:23 PM
To: j...@rtems.org
Cc: Ryan Long ; rtems-de...@rtems.org 
Subject: Re: [PATCH v1 09/13] Remove SymbolsToAnalyze global variable



On 2/8/21 1:20 pm, Joel Sherrill wrote:
> 
> 
> On Sun, Aug 1, 2021, 10:11 PM Chris Johns  > wrote:
> 
> On 2/8/21 9:23 am, Ryan Long wrote:
> > - Removed SymbolsToAnalyze from app_common and replaced it with the
> >   symbolsToAnalyze_m member variable in DesiredSymbols, GcovData, and
> >   ObjdumpProcessor
> > - Added a parameter to constructors to initialize symbolsToAnalyze_m
> > - Moved the definition of objdumpLine_t out of ObjdumpProcessor to make
> >   it work with DesiredSymbols
> > ---
> >  tester/covoar/DesiredSymbols.cc   | 12 +++--
> >  tester/covoar/DesiredSymbols.h    | 17 +--
> >  tester/covoar/ExecutableInfo.cc   | 14 +++---
> >  tester/covoar/ExecutableInfo.h    | 14 +-
> >  tester/covoar/GcovData.cc         |  7 +--
> >  tester/covoar/GcovData.h          | 12 -
> >  tester/covoar/GcovFunctionData.cc | 14 --
> >  tester/covoar/GcovFunctionData.h  |  6 ++-
> >  tester/covoar/ObjdumpProcessor.cc | 22 +
> >  tester/covoar/ObjdumpProcessor.h  | 90 
> +++
> >  tester/covoar/ReportsBase.cc      | 98
> +--
> >  tester/covoar/ReportsBase.h       | 33 +
> >  tester/covoar/ReportsHtml.cc      | 16 ---
> >  tester/covoar/ReportsHtml.h       | 11 +++--
> >  tester/covoar/ReportsText.cc      |  8 ++--
> >  tester/covoar/ReportsText.h       |  3 +-
> >  tester/covoar/TraceConverter.cc   | 17 +--
> >  tester/covoar/app_common.cc       |  1 -
> >  tester/covoar/app_common.h        |  1 -
> >  tester/covoar/covoar.cc           | 40 +---
> >  20 files changed, 271 insertions(+), 165 deletions(-)
> >
> > diff --git a/tester/covoar/DesiredSymbols.cc 
> b/tester/covoar/DesiredSymbols.cc
> > index 5d5e637..d76c5af 100644
> > --- a/tester/covoar/DesiredSymbols.cc
> > +++ b/tester/covoar/DesiredSymbols.cc
> > @@ -25,7 +25,6 @@
> >  #include "DesiredSymbols.h"
> >  #include "app_common.h"
> >  #include "CoverageMap.h"
> > -#include "ObjdumpProcessor.h"
> > 
> >  namespace Coverage {
> > 
> > @@ -116,10 +115,10 @@ namespace Coverage {
> >      }
> >    }
> > 
> > -  void DesiredSymbols::preprocess( void )
> > +  void DesiredSymbols::preprocess( const DesiredSymbols& 
> symbolsToAnalyze )
> >    {
> >      // Look at each symbol.
> > -    for (auto& s : SymbolsToAnalyze->set) {
> > +    for (auto& s : symbolsToAnalyze.set) {
> >        // If the unified coverage map does not exist, the symbol was
> >        // never referenced by any executable.  Just skip it.
> >        CoverageMapBase* theCoverageMap = s.second.unifiedCoverageMap;
> > @@ -441,10 +440,13 @@ namespace Coverage {
> >        return &set[ symbolName ];
> >    }
> > 
> > -  void DesiredSymbols::findSourceForUncovered( bool verbose )
> > +  void DesiredSymbols::findSourceForUncovered(
> > +    bool                  verbose,
> > +    const DesiredSymbols& symbolsToAnalyze
> > +  )
> >    {
> >      // Process uncovered ranges and/or branches for each symbol.
> > -    for (auto& d : SymbolsToAnalyze->set) {
> > +    for (auto& d : symbolsToAnalyze.set) {
> >        // First the unexecuted ranges, ...
> >        CoverageRanges* theRanges = d.second.uncoveredRanges;
> >        if (theRanges != nullptr) {
> > diff --git a/tester/covoar/DesiredSymbols.h 
> b/tester/covoar/DesiredSymbols.h
> > index 791b4ea..70bc39b 100644
> > --- a/tester/covoar/DesiredSymbols.h
> > +++ b/tester/covoar/DesiredSymbols.h
> > @@ -19,6 +19,11 @@
> > 
> >  namespace Coverage {
> > 
> > +  class ObjdumpProcessor;
> > +  struct objdumpLine;
> > +  using objdumpLine_t = objdumpLine;
> > +  class ExecutableInfo;
> > +
> > 
> >    /*!
> >     *
> > @@ -139,7 +144,7 @@ namespace Coverage {
> >      /*!
> >       *  This member contains the disassembly associated with a symbol.
> >       */
> > -    std::list instructions;
> > +    std::list instructions;
> > 
> >      /*!
> >       *  This member contains the executable that was used to
> > @@ -263,8 +268,12 @@ namespace Coverage {
> >       *  uncovered ranges or branches.
> >       *
> >       *  @param[in] verbose specifies whether to be verbose with output
> > +     *  @param[in

Re: [PATCH rtems-libbsd 0/5] RTEMS LibBSD Documentation

2021-08-02 Thread Christian MAUDERER

Am 02.08.21 um 10:38 schrieb Chris Johns:

On 2/8/21 4:58 pm, Christian MAUDERER wrote:

Hello Husni,

thanks for the patches. I'm sure that this will start a discussion about the
right place for that documentation. libbsd documentation is a long overdue topic
that has been neglected by all of us (including myself) so I think it's good to
start that discussion.


I suggest the user manual.

Chris



Hello Chris,

thanks for the suggestion. So that would be a new libbsd chapter in the 
user manual and not some extra manual like the "Legacy Networking User 
Manual"?


Sooner or later most of the user facing documentation we already have in 
libbsd most likely would be moved there too. That would be mainly:


https://git.rtems.org/rtems-libbsd/tree/README.md
https://git.rtems.org/rtems-libbsd/tree/libbsd.txt

The CONTRIBUTING.md is more developer facing. Would we move that in the 
user manual too or would that be something that should move to either 
"BSP and Driver Guide" or the "Software Engineering" manual:


https://git.rtems.org/rtems-libbsd/tree/CONTRIBUTING.md

Note that I don't want to push that work to anyone. I asked Husni that 
he adds his work to a new manual at the moment so that we have a basis 
for discussion. The alternative would be to continue adding information 
like that to the text documents in libbsd. But the text files start to 
get convoluted and I think a better organized manual is long overdue. I 
thought that Husnis work would be a great chance to trigger finding the 
right place so that we can add or move more documentation to that place 
slowly. I'm sure that I should do quite some of that too because I have 
added a lot of stuff to libbsd over the time.


Best regards

Christian
--

embedded brains GmbH
Herr Christian MAUDERER
Dornierstr. 4
82178 Puchheim
Germany
email: christian.maude...@embedded-brains.de
phone: +49-89-18 94 741 - 18
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH rtems-libbsd 0/5] RTEMS LibBSD Documentation

2021-08-02 Thread Chris Johns
On 2/8/21 4:58 pm, Christian MAUDERER wrote:
> Hello Husni,
> 
> thanks for the patches. I'm sure that this will start a discussion about the
> right place for that documentation. libbsd documentation is a long overdue 
> topic
> that has been neglected by all of us (including myself) so I think it's good 
> to
> start that discussion.

I suggest the user manual.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH rtems-libbsd 1/7] rtemsbsd: Catch timeout overflows

2021-08-02 Thread Chris Johns
On 29/7/21 8:44 am, Chris Johns wrote:
> On 28/7/21 4:44 pm, Sebastian Huber wrote:
>> On 28/07/2021 08:43, Chris Johns wrote:
 Why don't we use the FreeBSD implementation one-to-one:

 freebsd-org/sys/kern/kern_clock.c

>>> I am fixing the code that exists. I have no idea why kern_clock.c was not 
>>> ported
>>> in the first place. I will not be porting the clock code at this point in 
>>> time,
>>> that is out of scope for my current work.
>>
>> What I meant was to copy the tvtohz() from kern_clock.c to this file.
> 
> Ah ok, sure I can take a look.

The only difference is some extra checks and if there is value in having those
checks they should be added to the cpukit.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel