Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2018-06-06 14:47:39 +0000
committerJeff Johnston2018-06-08 18:59:20 +0000
commit4c761a5bfdc88c231bcf0706fc6b6b3d40785485 (patch)
tree6b4f561d7906ed6bb6360537a3a56176c08f9260
parent714a5769d84497a8f26061313d8be1abb853710f (diff)
downloadorg.eclipse.linuxtools-4c761a5bfdc88c231bcf0706fc6b6b3d40785485.tar.gz
org.eclipse.linuxtools-4c761a5bfdc88c231bcf0706fc6b6b3d40785485.tar.xz
org.eclipse.linuxtools-4c761a5bfdc88c231bcf0706fc6b6b3d40785485.zip
Bug 535611 - Fix GCov plugin to work with GCC 8.1.0.
8.1.0 Release gets converted to 'A81R' as defined in the version specification. Each character gets converted to its hex value and appended, forming 0x41383152. This value is expressed as 1094201682, the base 10 representation. Consulting the gcov parsing files (gcov.c or gcov-dump.c is necessary to discover parts of the GCNO format not mentioned in the gcov-io.h file) Change-Id: I1f021b98444dac006a0039695096d3f42944cd09 Reviewed-on: https://git.eclipse.org/r/124135 Tested-by: CI Bot Reviewed-by: Roland Grunberg <rgrunber@redhat.com> (cherry picked from commit 659c57b57b925421d8b5d86a296588fc79412f12) Reviewed-on: https://git.eclipse.org/r/124281 Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcnoRecordsParser.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcnoRecordsParser.java b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcnoRecordsParser.java
index 035c84c8a0..f137bfdb09 100644
--- a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcnoRecordsParser.java
+++ b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/parser/GcnoRecordsParser.java
@@ -37,6 +37,9 @@ public class GcnoRecordsParser {
private static final int GCOV_TAG_ARCS = 0x01430000;
private static final int GCOV_TAG_LINES = 0x01450000;
+ private static final int GCC_VER_810R = 1094201682; // GCC 8.1.0 Release
+ private static final int GCC_VER_407 = 875575082; // GCC 4.0.7
+
private GcnoFunction fnctn = null;
private final ArrayList<GcnoFunction> fnctns = new ArrayList<>();
private final ArrayList<SourceFile> currentAllSrcs;
@@ -117,13 +120,23 @@ public class GcnoRecordsParser {
* announce_function: header int32:ident int32:lineno_checksum int32:cfg_checksum TL;DR Need to
* consume the extra long value.
*/
- if (version >= 875575082) {
+ if (version >= GCC_VER_407) {
// long cfgChksm = (stream.readInt()&MasksGenerator.UNSIGNED_INT_MASK);
stream.readInt();
}
String fnctnName = GcovStringReader.readString(stream);
+ if (version >= GCC_VER_810R) {
+ // long artificial = (stream.readInt() & MasksGenerator.UNSIGNED_INT_MASK);
+ stream.readInt();
+ }
String fnctnSrcFle = GcovStringReader.readString(stream);
long fnctnFrstLnNmbr = (stream.readInt() & MasksGenerator.UNSIGNED_INT_MASK);
+ if (version >= GCC_VER_810R) {
+ // long fnctnFrstColumnLnNmbr = (stream.readInt() & MasksGenerator.UNSIGNED_INT_MASK);
+ stream.readInt();
+ // long fnctnLastLnNmbr = (stream.readInt() & MasksGenerator.UNSIGNED_INT_MASK);
+ stream.readInt();
+ }
fnctn = new GcnoFunction(fnctnIdent, fnctnChksm, fnctnName, fnctnSrcFle, fnctnFrstLnNmbr);
SourceFile srcFle2 = findOrAdd(fnctn.getSrcFile());
@@ -136,10 +149,18 @@ public class GcnoRecordsParser {
}
else if (tag == GCOV_TAG_BLOCKS) {
+ if (version >= GCC_VER_810R) {
+ length = stream.readInt();
+ }
blocks = new ArrayList<>();
+ Block blck;
for (int i = 0; i < length; i++) {
- long BlckFlag = stream.readInt() & MasksGenerator.UNSIGNED_INT_MASK;
- Block blck = new Block(BlckFlag);
+ if (version >= GCC_VER_810R) {
+ blck = new Block(0); // value not used anywhere
+ } else {
+ long BlckFlag = stream.readInt() & MasksGenerator.UNSIGNED_INT_MASK;
+ blck = new Block(BlckFlag);
+ }
blocks.add(blck);
}
fnctn.setNumBlocks(length);

Back to the top