++
фикс падения при поиске зависимостей
This commit is contained in:
6
.idea/workspace.xml
generated
6
.idea/workspace.xml
generated
@@ -7,10 +7,14 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<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$/.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$/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/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetFileLineInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetFileLineInfo.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" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"ServerUserPassword": "mprit_2011",
|
"ServerUserPassword": "mprit_2011",
|
||||||
"OfferRegistrationOnStart": true,
|
"OfferRegistrationOnStart": true,
|
||||||
"Workspace": "E:\\Tests",
|
"Workspace": "E:\\Tests",
|
||||||
"ProjectsSearchDirectory": "E:\\SAPFOR\\Tests",
|
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1745956769\\composit",
|
||||||
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
|
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
|
||||||
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
"VisualiserPath": "C:\\Users\\misha\\Downloads",
|
||||||
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
|
||||||
@@ -32,9 +32,9 @@
|
|||||||
"CompleteRunEnvironments": true,
|
"CompleteRunEnvironments": true,
|
||||||
"CreateEthalonTasks": true,
|
"CreateEthalonTasks": true,
|
||||||
"ErasePackageWorkspace": true,
|
"ErasePackageWorkspace": true,
|
||||||
"lastMachineId": 1,
|
"lastMachineId": 13,
|
||||||
"lastUserId": 17,
|
"lastUserId": 34,
|
||||||
"lastCompilerId": 15,
|
"lastCompilerId": 52,
|
||||||
"RegisterOn": false,
|
"RegisterOn": false,
|
||||||
"SpacesOn": false,
|
"SpacesOn": false,
|
||||||
"EmptyLinesOn": false,
|
"EmptyLinesOn": false,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import Common.Utils.Vector_;
|
|||||||
|
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
public class Constants {
|
public class Constants {
|
||||||
public static final int version = 1243;
|
public static final int version = 1244;
|
||||||
public static final int planner_version = 24;
|
public static final int planner_version = 24;
|
||||||
public static final int testingMaxKernels = 64;
|
public static final int testingMaxKernels = 64;
|
||||||
//--
|
//--
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
package _VisualDVM.Passes.All;
|
package _VisualDVM.Passes.All;
|
||||||
import Common.Passes.PassState;
|
import Common.Passes.PassState;
|
||||||
|
import Common.Utils.Utils_;
|
||||||
import Common.Visual.Controls.PassControl;
|
import Common.Visual.Controls.PassControl;
|
||||||
import Common.Visual.UI;
|
import Common.Visual.UI;
|
||||||
import _VisualDVM.Global;
|
import _VisualDVM.Global;
|
||||||
import _VisualDVM.Passes.PassCode;
|
import _VisualDVM.Passes.PassCode;
|
||||||
import _VisualDVM.Passes.Sapfor.SilentSapforPass;
|
import _VisualDVM.Passes.Sapfor.SilentSapforPass;
|
||||||
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
import _VisualDVM.ProjectData.Files.DBProjectFile;
|
||||||
|
import _VisualDVM.ProjectData.SapforData.GCOV.FileGCOVJson;
|
||||||
|
import _VisualDVM.ProjectData.SapforData.GCOV.GCOVJson;
|
||||||
|
import _VisualDVM.ProjectData.SapforData.GCOV.LineGCOVJson;
|
||||||
public class SPF_GetGCovInfo extends SilentSapforPass {
|
public class SPF_GetGCovInfo extends SilentSapforPass {
|
||||||
@Override
|
@Override
|
||||||
public String getIconPath() {
|
public String getIconPath() {
|
||||||
@@ -50,24 +54,44 @@ public class SPF_GetGCovInfo extends SilentSapforPass {
|
|||||||
unpack(sapfor.getResult());
|
unpack(sapfor.getResult());
|
||||||
}
|
}
|
||||||
protected void unpack(String packed) throws Exception {
|
protected void unpack(String packed) throws Exception {
|
||||||
|
GCOVJson allJson = Utils_.gson.fromJson(packed, GCOVJson.class);
|
||||||
|
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;
|
||||||
|
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.setup();
|
||||||
|
}
|
||||||
|
/*
|
||||||
String[] byFiles = packed.split("@");
|
String[] byFiles = packed.split("@");
|
||||||
for (int z = 0; z < byFiles.length; ++z) {
|
for (int z = 0; z < byFiles.length; ++z) {
|
||||||
DBProjectFile cur = target.db.files.get((byFiles[z++]).replace("/", "\\"));
|
DBProjectFile projectFile = target.db.files.get((byFiles[z++]).replace("/", "\\"));
|
||||||
String[] inFile = byFiles[z].split(" ");
|
String[] inFile = byFiles[z].split(" ");
|
||||||
for (int k = 0; k < (inFile.length / 2) * 2; k += 2) {
|
for (int k = 0; k < (inFile.length / 2) * 2; k += 2) {
|
||||||
int line = Integer.parseInt(inFile[k]);
|
int line = Integer.parseInt(inFile[k]);
|
||||||
long execution = Long.parseLong(inFile[k + 1]);
|
long execution = Long.parseLong(inFile[k + 1]);
|
||||||
|
|
||||||
if (line > 0) {
|
if (line > 0) {
|
||||||
int v_line = line - 1;
|
int v_line = line - 1;
|
||||||
if (!cur.gcov_info.line_info.containsKey(v_line)) {
|
if (!projectFile.gcov_info.line_info.containsKey(v_line)) {
|
||||||
cur.gcov_info.add_line(v_line,
|
projectFile.gcov_info.add_line(v_line,
|
||||||
(execution >= 0) ? execution : 0);
|
(execution >= 0) ? execution : 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//завешение настроек.
|
//завешение настроек.
|
||||||
cur.gcov_info.setup();
|
projectFile.gcov_info.setup();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void Reset() {
|
public void Reset() {
|
||||||
|
|||||||
@@ -38,14 +38,22 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
|
|||||||
IncludesJson includesJson = Utils_.gson.fromJson(packed, IncludesJson.class);
|
IncludesJson includesJson = Utils_.gson.fromJson(packed, IncludesJson.class);
|
||||||
update_current = false;
|
update_current = false;
|
||||||
for (FileIncludesJson fileIncludesJson : includesJson.allIncludes) {
|
for (FileIncludesJson fileIncludesJson : includesJson.allIncludes) {
|
||||||
|
//-
|
||||||
fileIncludesJson.file = Utils_.toW(fileIncludesJson.file);
|
fileIncludesJson.file = Utils_.toW(fileIncludesJson.file);
|
||||||
|
//--
|
||||||
FileInfo fileInfo = new FileInfo(fileIncludesJson.file);
|
FileInfo fileInfo = new FileInfo(fileIncludesJson.file);
|
||||||
//---
|
//---
|
||||||
DBProjectFile file = target.db.files.get(fileIncludesJson.file);
|
DBProjectFile file = target.db.files.get(fileIncludesJson.file);
|
||||||
|
System.out.println("addicted file = "+Utils_.Brackets(fileIncludesJson.file));
|
||||||
|
System.out.println("found dependencies :"+fileIncludesJson.includes.size());
|
||||||
for (Include include : fileIncludesJson.includes) {
|
for (Include include : fileIncludesJson.includes) {
|
||||||
|
//--
|
||||||
|
include.dependencyFileName = Utils_.toW(include.dependencyFileName);
|
||||||
|
//--
|
||||||
fileInfo.dependencies.add(include);
|
fileInfo.dependencies.add(include);
|
||||||
if (!target.allIncludes.contains(include.file))
|
if (!target.allIncludes.contains(include.file))
|
||||||
target.allIncludes.add(include.file);
|
target.allIncludes.add(include.file);
|
||||||
|
if (target.db.files.containsKey(include.dependencyFileName)){
|
||||||
//- определение типов языков инклудов по файлу куда они цепляютс.
|
//- определение типов языков инклудов по файлу куда они цепляютс.
|
||||||
if (!file.dependencies.contains(include.dependencyFileName)) {
|
if (!file.dependencies.contains(include.dependencyFileName)) {
|
||||||
file.dependencies.add(include.dependencyFileName);
|
file.dependencies.add(include.dependencyFileName);
|
||||||
@@ -59,6 +67,10 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
|
|||||||
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(include_file.name))
|
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(include_file.name))
|
||||||
update_current = true;
|
update_current = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
System.out.println(Utils_.Brackets(include.dependencyFileName)+" не существует!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//----
|
//----
|
||||||
if (!target.addictedFiles.containsKey(fileInfo.file))
|
if (!target.addictedFiles.containsKey(fileInfo.file))
|
||||||
|
|||||||
11
src/_VisualDVM/ProjectData/SapforData/GCOV/FileGCOVJson.java
Normal file
11
src/_VisualDVM/ProjectData/SapforData/GCOV/FileGCOVJson.java
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package _VisualDVM.ProjectData.SapforData.GCOV;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Vector;
|
||||||
|
public class FileGCOVJson {
|
||||||
|
@Expose
|
||||||
|
public String file; //имя файла.
|
||||||
|
@Expose
|
||||||
|
public List<LineGCOVJson> lines = new Vector<>();
|
||||||
|
}
|
||||||
9
src/_VisualDVM/ProjectData/SapforData/GCOV/GCOVJson.java
Normal file
9
src/_VisualDVM/ProjectData/SapforData/GCOV/GCOVJson.java
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
package _VisualDVM.ProjectData.SapforData.GCOV;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Vector;
|
||||||
|
public class GCOVJson {
|
||||||
|
@Expose
|
||||||
|
public List<FileGCOVJson> allGCOV= new Vector<>();
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package _VisualDVM.ProjectData.SapforData.GCOV;
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
public class LineGCOVJson {
|
||||||
|
@Expose
|
||||||
|
public int line; //строка
|
||||||
|
@Expose
|
||||||
|
public long execution; //число выполнений
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user