гков на джсон. добавлена проверка на отрицательный код инфы по джсон
This commit is contained in:
2025-05-02 22:41:56 +03:00
parent d2c2f571ff
commit b46f86bebb
5 changed files with 15 additions and 32 deletions

6
.idea/workspace.xml generated
View File

@@ -7,14 +7,10 @@
</component>
<component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/GCOV/FileGCOVJson.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/GCOV/GCOVJson.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/GCOV/LineGCOVJson.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetGCovInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetGCovInfo.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetIncludeDependencies.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetIncludeDependencies.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/GCOV/GCOVJson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/GCOV/GCOVJson.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@@ -4,7 +4,7 @@
"ServerUserPassword": "mprit_2011",
"OfferRegistrationOnStart": true,
"Workspace": "E:\\Tests",
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1745956769\\composit",
"ProjectsSearchDirectory": "E:\\BUG",
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
"VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",

View File

@@ -3,7 +3,7 @@ import Common.Utils.Vector_;
import java.util.Vector;
public class Constants {
public static final int version = 1244;
public static final int version = 1245;
public static final int planner_version = 24;
public static final int testingMaxKernels = 64;
//--

View File

@@ -55,43 +55,26 @@ public class SPF_GetGCovInfo extends SilentSapforPass {
}
protected void unpack(String packed) throws Exception {
GCOVJson allJson = Utils_.gson.fromJson(packed, GCOVJson.class);
for (FileGCOVJson fileJson: allJson.allGCOV){
// System.out.println("packed="+ Utils_.Brackets(packed));
// System.out.println(allJson.allGCov.size());
for (FileGCOVJson fileJson: allJson.allGCov){
fileJson.file = Utils_.toW(fileJson.file);
//--
DBProjectFile projectFile = target.db.files.get(fileJson.file);
for (LineGCOVJson lineJson: fileJson.lines){
if (lineJson.line > 0) {
int v_line = lineJson.line - 1;
long v_execution = (lineJson.execution >= 0) ? lineJson.execution : 0;
// System.out.println("line="+v_line+"/"+v_execution);
if (!projectFile.gcov_info.line_info.containsKey(v_line)) {
projectFile.gcov_info.add_line(v_line,
(lineJson.execution >= 0) ? lineJson.execution : 0);
projectFile.gcov_info.add_line(v_line, v_execution);
// System.out.println("+");
}
}
}
//завешение настроек.
projectFile.gcov_info.setup();
}
/*
String[] byFiles = packed.split("@");
for (int z = 0; z < byFiles.length; ++z) {
DBProjectFile projectFile = target.db.files.get((byFiles[z++]).replace("/", "\\"));
String[] inFile = byFiles[z].split(" ");
for (int k = 0; k < (inFile.length / 2) * 2; k += 2) {
int line = Integer.parseInt(inFile[k]);
long execution = Long.parseLong(inFile[k + 1]);
if (line > 0) {
int v_line = line - 1;
if (!projectFile.gcov_info.line_info.containsKey(v_line)) {
projectFile.gcov_info.add_line(v_line,
(execution >= 0) ? execution : 0);
}
}
}
//завешение настроек.
projectFile.gcov_info.setup();
}
*/
}
@Override
public void Reset() {
@@ -113,4 +96,8 @@ public class SPF_GetGCovInfo extends SilentSapforPass {
if (Global.mainModule.HasFile())
Global.mainModule.getFile().form.FocusGCOVLog();
}
@Override
protected boolean isGoodCode() {
return sapfor.getErrorCode() > 0;
}
}

View File

@@ -5,5 +5,5 @@ import java.util.List;
import java.util.Vector;
public class GCOVJson {
@Expose
public List<FileGCOVJson> allGCOV= new Vector<>();
public List<FileGCOVJson> allGCov= new Vector<>();
}