This adds the AddressToLineMapper class and supporting classes to
assume responsibility of tracking address-to-line information.
This allows the DWARF library to properly cleanup all of its resources
and leads to significant memory savings.
Closes#4383
This changes the ExecutableInfo class to only store the executable
file's name rather than an entire instance of rld::files::object. This
allows the rld::files::object to be cleaned up in the ExecutableInfo
constructor.
Updates #4383
This fixes a bug where covoar reports uncovered ranges of size 1. When a
NOP instruction is encountered at the end of a function, the remaining
non-instruction bytes are marked as executed. The loop that marks the
remaining bytes as executed was not considering the last address of the
function.
Closes#4448
The u-boot TFTP client will fail a fully completed file retrieval if the
final ACK gets an ICMP response that the port is unavailable which can
occur if the port is closed before the ACK arrives from the client. This
change causes the TFTP server to wait for the final ACK before closing
the socket and prevents transfers from failing due to the race
condition.
This reverts commit e80fd3e75b25627b6b2be2c1c820895319a91f34. The
change was originally made to correct the taken/not taken analysis of
AArch64. This broke taken/not taken analysis on other architectures
where the behavior was not overridden in the appropriate Target_*
class.
This filters mail-related options out before logging the command line
options. This is needed to prevent leaking potentially sensitive
information via logs and emails.
Updates #4384
Change sprintf() to strncpy() to avoid buffer overwrite CID 1399603,
Switch to auto pointer for iterator.
Initialize _pad field of entry CID 1399603,
fclose file on error patch CID 1399621,
CID 1399602: Dereference null return value in
Explanations::writeNotFound().
In Explanations::writeNotFound() there were two NULL checks of the
`fileName` variable where only one is needed. The second check has been
changed to a NULL check of `notFoundFile` to match the original intent.
Closes#4377
Some of the loops in the ReportsBase::Write* methods contained both
regular and range-based for loops. This changes them to use only range-
based for loops.
Closes#4374
This changes the way covoar organizes the symbols. Instead of treating
all symbols as one set, covoar is now aware of multiple symbol sets and
tracks statistics for each set. It now also generates reports for each
symbol set.
This change relieves the caller of covoar of the reponsibility of
managing the symbol sets. As a result, covoar can minimize the work
done for each symbol set, yielding a significant speedup.
Updates #4374
The `rangeIndex` variable is 1 higher than the index at which the first
instruction address was found. This fixes the loop to set `rangeIndex`
correctly.
This patch reflected a temporary workaround which avoided regenerating
the temporary files for each symbol set. The need for redundant processing
is being eliminated in an upcoming patch series.
Hash: 420d7a13672991a1480d06ac02190f2976b9253b
From 420d7a13672991a1480d06ac02190f2976b9253b Mon Sep 17 00:00:00 2001
From: Alex White <alex.white@oarcorp.com>
Date: Wed, 3 Mar 2021 09:48:00 -0600
Subject: rld-process: Add named tempfile constructor
This adds a new tempfile constructor for creating a named tempfile
rather than generating the name.
Covoar uses getopt() to process the command line options. If getopt() is
POSIX-compliant, it will return -1 when it encounters the first
non-option command line argument. It appears that it behaves this way on
FreeBSD, but on Linux getopt() continues to process arguments while
skipping any non-options. This changes the order of arguments passed to
covoar by coverage.py to group all options at the beginning. This allows
hosts with POSIX-compliant getopt() implementations to correctly process
all command line options.
A null pointer dereference happens later in the program execution if
the files are cleaned up at the end of the ExecutableInfo constructor.
This change fixes the null pointer dereference.
This moves all of the javascript and CSS files that are shared by the
symbol set HTML reports to the shared parent directory. It also includes
the javascript and CSS in the top-level index file.
The coverage reports contain places where they display incorrect or
vague information particularly when some statistic is unavailable. This
has been fixed. The formatting and wording of various things has been
improved as well.
The following new statistics have been added to the summary report:
number of unreferenced symbols, total branch paths found, number of
branch paths not executed, and percentage of branch paths covered.
Occasionally the compiler will generate symbols that look similar to
symbols defined in RTEMS code except that they contain some suffix.
These symbol suffixes are only found in the ELF symbol table; the
symbols appear to be normal in the DWARF info. This appears to be
happening on all architectures.
For example, the function _Message_queue_Create from rtems appears as
"_Message_queue_Create.part.0". Other suffixes include ".isra.0",
".constprop.0", and ".0".
This looks to be related to compiler optimizations. Symbols with
suffixes were being treated as unique. For our purposes, they should be
mapped to the equivalent symbols in the DWARF info. This has been
fixed.
There were a couple of issues with the way the DWARF info was being
read. The first issue was that it inefficiently included all symbols,
even symbols that were not desired. The second issue is that it did
not handle inline functions correctly. These have been fixed.