854 Commits

Author SHA1 Message Date
Alex White
ac56fce7c1 covoar: Store address-to-line info outside of DWARF
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
2021-06-17 16:00:08 -05:00
Alex White
a88be93a88 covoar: Store only the file name in ExecutableInfo
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
2021-06-17 16:00:08 -05:00
Gedare Bloom
599b316976 tester: Add a72_lp64_qemu.ini 2021-06-09 10:32:28 -06:00
Ryan Long
74cf39bcfc Explanations.cc: Convert to c++ file handling 2021-06-09 11:01:02 -05:00
Alex White
c17664fb7b covoar: Fix single-byte uncovered ranges
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
2021-06-04 14:24:55 -05:00
Ryan Long
5278060818 ReportsBase.cc: Fix Resource leak
CID 1503711: Resource leak in WriteSummaryReport().

Closes #4422
2021-06-04 12:22:39 -05:00
Ryan Long
9527f6580e DesiredSymbols.cc: Fix resource leak
CID 1503018: Resource leak in load().

Closes #4421
2021-06-04 12:22:39 -05:00
Ryan Long
a0b54f09b9 TraceWriterQEMU.cc: Fix resource leak
CID 1399621: Resource leak in writeFile().

Closes #4420
2021-06-04 12:22:39 -05:00
Ryan Long
08d9f37d52 GcovData.cc: Fix resource leak
CID 1399610: Resource leak in readFrame().

Closes #4418
2021-06-04 12:22:38 -05:00
Ryan Long
dfe012de71 TraceReaderLogQEMU.cc: Fix resource leak
CID 1399615: Resource leak in processFile().

Closes #4419
2021-06-04 12:22:38 -05:00
Ryan Long
9f4887ccaf Explanations.cc: Fix resource leaks
CID 1399608: Resource leak in load().
CID 1399611: Resource leak in load().

Closes #4417
2021-06-04 12:22:38 -05:00
Ryan Long
527848d5cc rtems-bsp-builder: Change to waf build system
Closes #4124
2021-05-25 12:41:13 -05:00
Kinsey Moore
a918844889 tester: Avoid TFTP race condition
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.
2021-05-18 13:58:34 -05:00
Alex White
f18e6d8e15 rtemstoolkit/mailer.py: Fix option ordering for add_arguments
The ordering of keys cannot be guaranteed in a dictionary. This changes
the options iteration to no longer rely on key ordering.

Closes #4402
2021-05-10 10:39:39 -05:00
Alex White
eecde471cc coverage/symbol-sets.ini : Add libuuid 2021-04-28 13:25:46 -05:00
Alex White
0c4884a0d0 covoar/Target_aarch64: Swap QEMU taken/not taken bits
This overrides the `TargetBase` behavior to allow branches to be marked
correctly as either taken or not taken.

Closes #4387
2021-04-16 17:27:40 -05:00
Alex White
29fee42187 Revert "covoar/TargetBase: Fix QEMU branch info"
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.
2021-04-16 17:27:40 -05:00
Alex White
292363de55 covoar/Target_arm: Add cbz and cbnz as branch instructions
This adds `cbz` and `cbnz` as conditional branch instructions for ARM as
they appear to have been missed.

Closes #4386
2021-04-16 17:27:40 -05:00
Alex White
82b752a438 rtemstoolkit/mailer.py: Add --use-gitconfig option
This adds the option to pull mail-related configuration values from the
user's git configuration.

Closes #4384
2021-04-14 09:32:11 -05:00
Alex White
3b1407fb20 rtemstoolkit/mailer.py: Add SMTP login options
This adds more options so that the user can authenticate with the SMTP
server.

Updates #4384
2021-04-13 16:44:42 -05:00
Alex White
92f7f67297 rtemstoolkit: Filter mail options from log output
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
2021-04-13 16:44:42 -05:00
Alex White
1a575af817 rtemstoolkit/mailer.py: Return full smtp-host arg value
This fixes mail.smtp_host() so that it returns the full argument value
rather than just the second character.

Updates #4384
2021-04-13 16:44:42 -05:00
Joel Sherrill
177c7520f4 TraceWriterQEMU.cc: Multiple clean ups
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,
2021-04-13 13:53:44 -05:00
Joel Sherrill
4faf9a6ffc covoar/TargetBase.h: Remove unused member variables
Both flagged by CID #1399638.
2021-04-10 18:54:25 -05:00
Sebastian Huber
0b94fb0e39 linkers: Update due to API changes 2021-04-09 14:30:03 +02:00
Alex White
e84b9f3a94 covoar: Fix NULL check of wrong variable (CID #1399602)
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
2021-04-07 15:33:26 -05:00
Alex White
de185fe1a9 covoar: Use range-based for loops in ReportsBase
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
2021-04-07 10:32:31 -05:00
Joel Sherrill
092bf04cd2 covoar: Eliminate tabs 2021-04-06 15:40:42 -05:00
Joel Sherrill
fcef37b720 covoar: Remove training white spaces 2021-04-06 15:24:08 -05:00
Alex White
b3fcd10685 coverage.py: Call covoar once
Updates #4374
2021-04-06 14:18:55 -05:00
Alex White
b02600a6bb covoar: Split symbols by symbol set
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
2021-04-06 14:18:55 -05:00
Alex White
26538d6eda covoar: Fix off-by-one in Coverage::finalizeSymbol()
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.
2021-04-02 09:31:15 -05:00
Joel Sherrill
c71a836310 trace/wscript: Specify C language version
CentOS 7 has gcc 4.8 which defaults to C90 and this results in warnings
for code that is valid C99 but not C90.
2021-04-02 09:29:57 -05:00
Joel Sherrill
04394f4353 misc/wscript: Specify C language version
CentOS 7 has gcc 4.8 which defaults to C90 and this results in warnings
for code that is valid C99 but not C90.
2021-04-02 09:29:57 -05:00
Joel Sherrill
cebdafe8a6 rtems-bin2c.c: Define _XOPEN_SOURCE to 700 for strnlen() visibility 2021-04-02 09:29:42 -05:00
Hesham Almatary
fe59a1495d rld-cc: Add -target to recognised cflags
-target *-*-* flag is necessary for LLVM/Clang while cross-compiling
2021-04-01 10:59:21 +02:00
Joel Sherrill
49fac039a1 Revert rld-process: Add named tempfile constructor
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.
2021-03-31 10:41:25 -05:00
Alex White
57e7b22faf tester: Limit branch coverage percentage precision 2021-03-30 13:15:59 -05:00
Alex White
8ce2cfc917 coverage: Fix option processing on FreeBSD
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.
2021-03-30 13:15:59 -05:00
Alex White
aca2df5c84 coverage/symbol-sets.ini : Add libtrace 2021-03-30 13:15:59 -05:00
Alex White
0e6c7ec253 covoar/Reports: Fix empty branch report
This makes the branch report more consistent with the other reports when
there is no branch information found.
2021-03-30 13:15:58 -05:00
Alex White
917469b2d3 covoar: Fix overflow of high PC address
This fixes an integer overflow that would occur if a function's high PC
address were zero in the DWARF info.
2021-03-30 13:15:58 -05:00
Alex White
9720218673 covoar: Catch exceptional case 2021-03-30 13:15:58 -05:00
Alex White
ff418df159 covoar: Fix null pointer dereference
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.
2021-03-30 13:15:58 -05:00
Alex White
bfee5507b9 coverage: Give coverage bars red background 2021-03-30 13:15:58 -05:00
Alex White
4d21ff8d60 coverage/reports: Share common JS and CSS in reports
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.
2021-03-30 13:15:58 -05:00
Alex White
04597495e5 coverage/reports: Improve formatting and clarity
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.
2021-03-30 13:15:58 -05:00
Alex White
4aabd9bbf7 covoar/reports: Add new statistics to summary
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.
2021-03-30 13:15:58 -05:00
Alex White
7d14bb83e0 covoar: Handle periods in symbols from objdump
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.
2021-03-30 13:15:58 -05:00
Alex White
a7802e376a covoar: Fix DWARF reading
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.
2021-03-30 13:15:58 -05:00