фикс падения при поиске зависимостей
This commit is contained in:
2025-04-30 21:27:47 +03:00
parent 70771dd0ce
commit d2c2f571ff
8 changed files with 90 additions and 22 deletions

6
.idea/workspace.xml generated
View File

@@ -7,10 +7,14 @@
</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_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>
<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:\\SAPFOR\\Tests",
"ProjectsSearchDirectory": "E:\\Tests\\Downloads\\bugreport_1745956769\\composit",
"DocumentsDirectory": "C:\\Users\\misha\\Documents\\_testing_system",
"VisualiserPath": "C:\\Users\\misha\\Downloads",
"Sapfor_FPath": "E:\\_sapfor_x64\\Components\\Sapfor_F",
@@ -32,9 +32,9 @@
"CompleteRunEnvironments": true,
"CreateEthalonTasks": true,
"ErasePackageWorkspace": true,
"lastMachineId": 1,
"lastUserId": 17,
"lastCompilerId": 15,
"lastMachineId": 13,
"lastUserId": 34,
"lastCompilerId": 52,
"RegisterOn": false,
"SpacesOn": false,
"EmptyLinesOn": false,

View File

@@ -3,7 +3,7 @@ import Common.Utils.Vector_;
import java.util.Vector;
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 testingMaxKernels = 64;
//--

View File

@@ -1,11 +1,15 @@
package _VisualDVM.Passes.All;
import Common.Passes.PassState;
import Common.Utils.Utils_;
import Common.Visual.Controls.PassControl;
import Common.Visual.UI;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Passes.Sapfor.SilentSapforPass;
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 {
@Override
public String getIconPath() {
@@ -50,24 +54,44 @@ public class SPF_GetGCovInfo extends SilentSapforPass {
unpack(sapfor.getResult());
}
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("@");
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(" ");
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 (!cur.gcov_info.line_info.containsKey(v_line)) {
cur.gcov_info.add_line(v_line,
if (!projectFile.gcov_info.line_info.containsKey(v_line)) {
projectFile.gcov_info.add_line(v_line,
(execution >= 0) ? execution : 0);
}
}
}
//завешение настроек.
cur.gcov_info.setup();
projectFile.gcov_info.setup();
}
*/
}
@Override
public void Reset() {

View File

@@ -38,26 +38,38 @@ public class SPF_GetIncludeDependencies extends SapforAnalysis {
IncludesJson includesJson = Utils_.gson.fromJson(packed, IncludesJson.class);
update_current = false;
for (FileIncludesJson fileIncludesJson : includesJson.allIncludes) {
//-
fileIncludesJson.file = Utils_.toW(fileIncludesJson.file);
//--
FileInfo fileInfo = new FileInfo(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) {
//--
include.dependencyFileName = Utils_.toW(include.dependencyFileName);
//--
fileInfo.dependencies.add(include);
if (!target.allIncludes.contains(include.file))
target.allIncludes.add(include.file);
//- определение типов языков инклудов по файлу куда они цепляютс.
if (!file.dependencies.contains(include.dependencyFileName)) {
file.dependencies.add(include.dependencyFileName);
//---
DBProjectFile include_file = target.db.files.get(include.dependencyFileName);
include_file.UpdateType(FileType.header);
if (include_file.languageName == LanguageName.n)
include_file.UpdateLanguage(file.languageName);
if (include_file.style == LanguageStyle.none)
include_file.UpdateStyle(file.style);
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(include_file.name))
update_current = true;
if (target.db.files.containsKey(include.dependencyFileName)){
//- определение типов языков инклудов по файлу куда они цепляютс.
if (!file.dependencies.contains(include.dependencyFileName)) {
file.dependencies.add(include.dependencyFileName);
//---
DBProjectFile include_file = target.db.files.get(include.dependencyFileName);
include_file.UpdateType(FileType.header);
if (include_file.languageName == LanguageName.n)
include_file.UpdateLanguage(file.languageName);
if (include_file.style == LanguageStyle.none)
include_file.UpdateStyle(file.style);
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(include_file.name))
update_current = true;
}
}else {
System.out.println(Utils_.Brackets(include.dependencyFileName)+" не существует!");
}
}
//----

View 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<>();
}

View 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<>();
}

View File

@@ -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; //число выполнений
}