An automatic debugging method based on hardware virtualization
Through the automatic debugging method based on hardware virtualization, hardware features are analyzed and modified to solve the problem of abnormal application operation caused by differences between hardware platforms, and realize the normal operation of the application on the target platform and the automatic acquisition of feature sets.
Patent Information
- Application Number
- CN202410979914.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-07-22
AI Technical Summary
Differences in hardware characteristics between different hardware platforms lead to abnormal application operation, which is difficult to efficiently analyze and solve with existing technologies, increasing the difficulty and time of testing.
An automatic debugging method based on hardware virtualization is adopted to determine missing and redundant feature sets by forming standard feature sets and abnormal feature sets. The lightweight hypervisor and dynamic instruction conversion engine are used to load applications on the test platform and dynamically modify hardware features. Step by step determine the maximum set of CPU features required for your application to run properly on the target hardware platform.
It realizes automated application anomaly analysis, improves testing efficiency, ensures that the application runs normally on the target hardware platform, and obtains the maximum CPU feature set required by the application.
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer software development, and in particular relates to an automatic debugging method based on hardware virtualization. Background Art
[0002] Generally speaking, different hardware platforms have different hardware features, including CPU features, CPU identification information, I / O port status, etc., among which CPU features include VMX (Virtual Machine Extensions) features related to virtualization, PAE (Physical Address Extension) features related to memory management, and MSR (Model Specific Registers) features, etc. The normal operation of an application usually depends on one or more specific hardware features. Therefore, when using some Windows applications on a Linux system, there are often abnormal application operations caused by differences in hardware features between hardware platforms. Therefore, how to analyze and determine the hardware features that cause abnormal application operations becomes a very critical issue.
[0003] On the x86 platform, applications can obtain the hardware features of the platform by analyzing the register values returned by executing related instructions, while on the ARM platform, applications can obtain the hardware features by reading specific registers. Therefore, to analyze and determine the hardware features that cause the application to run abnormally, it is necessary to traverse all the hardware features of the platform itself and set them one by one or in combination before testing the application. However, when there are large differences in the hardware features of the two hardware platforms, the number of tests required will increase rapidly, increasing the difficulty of testing and reducing the efficiency of testing. Summary of the invention
[0004] In view of this, the present invention provides an automatic debugging method based on hardware virtualization, realizes application anomaly analysis based on automatic traversal and modification of CPU feature combinations, and constructs a maximum CPU feature set to ensure the normal operation of the application on the target hardware platform.
[0005] The present invention provides an automatic debugging method based on hardware virtualization, which specifically comprises the following steps:
[0006] Step 1: forming a standard feature set from the hardware features that make the application to be tested work normally; forming an abnormal platform feature set from the hardware features of the target hardware platform where the application to be tested works abnormally, and saving the abnormal information as the first abnormal information; forming a missing feature set with the hardware features that exist in the standard feature set and do not exist in the abnormal platform feature set as missing features, and forming a redundant feature set with the hardware features that do not exist in the standard feature set and exist in the abnormal platform feature set as redundant features;
[0007] Step 2: Select a hardware feature from the missing feature set as the first missing feature, and delete the first missing feature from the standard feature set to obtain a first preset feature set;
[0008] Step 3: Create and load a Hypervisor based on hardware virtualization on the test platform, and execute the application to be tested; in the kernel state, when it is detected that the application to be tested executes an operation of reading hardware features, record the instruction pointer of the operation as a first read instruction pointer, and set the register according to the first preset feature set; in the user state, when the application to be tested executes an exception and the exception information is the same as the first exception information, save the first missing feature into the missing exception feature set;
[0009] Step 4, delete the first missing feature from the missing feature set. If the missing feature set is not empty, execute step 2. Otherwise, if the missing abnormal feature set is empty, restore the missing feature set, restart the test platform, and do not load the Hypervisor again, then execute step 5. If the missing abnormal feature set is not empty, execute step 7.
[0010] Step 5: Select a hardware feature from the missing feature set as a second missing feature, and delete the second missing feature from the standard feature set to obtain a second preset feature set;
[0011] Step 6: Use a dynamic instruction conversion engine to load and execute the application to be tested and add an interception event of the read operation at the first read instruction pointer. When the read operation is intercepted, set the register according to the second preset feature set; when the application to be tested executes abnormally and the abnormal information is the same as the first abnormal information, save the second missing feature to the missing abnormal feature set; delete the second missing feature from the missing feature set, if the missing feature set is not empty, execute step 5, otherwise execute step 7;
[0012] Step 7: Select a hardware feature from the redundant feature set as a first redundant feature, and add the first redundant feature to the standard feature set to obtain a third preset feature set;
[0013] Step 8, loading the Hypervisor on the test platform and executing the application to be tested; in the kernel state, when it is detected that the application to be tested executes an operation of reading hardware features, setting the register according to the third preset feature set; in the user state, when the application to be tested executes an exception and the exception information is the same as the first exception information, saving the first redundant feature into the redundant exception feature set;
[0014] Step 9, delete the first redundant feature from the redundant feature set. If the redundant feature set is not empty, execute step 7. Otherwise, if the redundant abnormal feature set is empty, restore the redundant feature set, restart the test platform, and do not load the Hypervisor again, then execute step 10. If the redundant abnormal feature set is not empty, execute step 12.
[0015] Step 10: Select hardware features from the redundant feature set as second redundant features, and add the second redundant features to the standard feature set to obtain a fourth preset feature set;
[0016] Step 11, using a dynamic instruction conversion engine to load and execute the application to be tested and add an interception event of the read operation at the first read instruction pointer, and when the read operation is intercepted, setting the register according to the fourth preset feature set; when the application to be tested executes abnormally and the abnormal information is the same as the first abnormal information, saving the second redundant feature to the redundant abnormal feature set; deleting the second redundant feature from the redundant feature set, if the redundant feature set is not empty, executing step 10, otherwise executing step 12;
[0017] Step 12: Remove redundant abnormal feature sets from the abnormal platform feature set, and then merge the missing abnormal feature sets to obtain the hardware feature set required for the normal operation of the application to be tested on the target hardware platform.
[0018] Further, the step 4 is: deleting the first missing feature from the missing feature set, and if the missing feature set is not empty, executing step 2, otherwise, restoring the missing feature set, restarting the test platform, and no longer loading the Hypervisor before executing step 5;
[0019] Step 5: Select a hardware feature from the missing feature set as a second missing feature, and delete the second missing feature from the standard feature set to obtain a second preset feature set;
[0020] Step 6: Use a dynamic instruction conversion engine to load and execute the application to be tested and add an interception event of the read operation at the first read instruction pointer. When the read operation is intercepted, the register is set according to the second preset feature set. When the application to be tested executes abnormally and the exception information is the same as the first exception information, the second missing feature is saved in the missing exception feature set. The second missing feature is deleted from the missing feature set. If the missing feature set is not empty, execute step 5. Otherwise, the intersection of the missing exception feature set obtained in step 3 and the missing exception feature set obtained in step 6 is taken as the final missing exception feature set, and then execute step 7.
[0021] Further, the step 9 is: deleting the first redundant feature from the redundant feature set, and if the redundant feature set is not empty, executing step 7, otherwise, restoring the redundant feature set, restarting the test platform, and not loading the Hypervisor again, and then executing step 10;
[0022] Step 10: Select hardware features from the redundant feature set as second redundant features, and add the second redundant features to the standard feature set to obtain a fourth preset feature set;
[0023] Step 11, use the dynamic instruction conversion engine to load and execute the application to be tested and add an interception event of the read operation at the first read instruction pointer, and when the read operation is intercepted, set the register according to the fourth preset feature set; when the application to be tested executes abnormally and the exception information is the same as the first exception information, save the second redundant feature into the redundant exception feature set; delete the second redundant feature from the redundant feature set, if the redundant feature set is not empty, execute step 10, otherwise use the intersection of the redundant exception feature set obtained in step 8 and the redundant exception feature set obtained in step 11 as the final redundant exception feature set, and then execute step 12.
[0024] Furthermore, the hardware characteristics include CPU characteristics, CPU identification and I / O port status.
[0025] Furthermore, the exception information includes an exception type, an exception instruction address and an exception module.
[0026] Furthermore, the abnormal instruction address is a relative address relative to a loading base address of the executable file of the application to be tested.
[0027] Furthermore, the dynamic instruction conversion engine is DynamoRIO. Beneficial Effects
[0028] The present invention obtains a standard feature set that makes the application to be tested work normally and an abnormal platform feature set of the target hardware platform that makes it work abnormally, determines the missing feature set and the redundant feature set by comparing the difference between the two feature sets, determines the preset feature set based on the standard feature set, the missing feature set and the redundant feature set, loads and runs the application to be tested on the test platform using a lightweight Hypervisor and a dynamic instruction conversion engine, and then determines the maximum set of hardware features that can make the application to be tested work normally on the target hardware platform based on the monitored abnormal information of the application to be tested, thereby realizing application abnormality analysis and judgment based on automatic and effective modification of CPU features and various combinations. DETAILED DESCRIPTION
[0029] The present invention is described in detail with reference to the following embodiments.
[0030] The present invention provides an automatic debugging method based on hardware virtualization, the core idea of which is: obtaining a standard feature set that makes the application to be tested work normally and an abnormal platform feature set of the target hardware platform that makes it work abnormally, determining a missing feature set and a redundant feature set by comparing the difference between the two feature sets, determining a preset feature set based on the standard feature set, the missing feature set and the redundant feature set, using a lightweight Hypervisor and a dynamic instruction conversion engine to load and run the application to be tested on a test platform, and then determining the maximum set of hardware features that can make the application to be tested work normally on the target hardware platform based on the monitored abnormal information of the application to be tested.
[0031] The present invention provides an automatic debugging method based on hardware virtualization, which specifically comprises the following steps:
[0032] Step 1, obtain the hardware features of the hardware platform that makes the application to be tested work normally to form a standard feature set; obtain the hardware features of the target hardware platform that makes the application to be tested work abnormally to form an abnormal platform feature set, and at the same time save the abnormal information of the application to be tested as the first abnormal information, the abnormal information includes the abnormal type, the abnormal instruction address and the abnormal module, etc.; the hardware features that exist in the standard feature set but not in the abnormal platform feature set are taken as missing features to form a missing feature set, and the hardware features that do not exist in the standard feature set but exist in the abnormal platform feature set are taken as redundant features to form a redundant feature set.
[0033] Among them, hardware features include CPU features, CPU identification, I / O port status, etc. For CPU features, they can be obtained by reading / proc / cpuinfo on the Linux platform. In addition, on the Linux platform or Windows platform, for x86 / x86_64 architecture processors, the cpuid instruction can be called and the returned register value can be parsed and obtained. For ARM architecture, it can be obtained by reading registers such as ISAR0, PFR0, PFR1, PFR2, ISAR1, ISAR5, DFR0, DFR1, MMFR0, MMFR1, MMFR2, MMFR4, and MMFR5.
[0034] Step 2: Select a hardware feature from the missing feature set as the first missing feature, and delete the first missing feature from the standard feature set to obtain a first preset feature set.
[0035] Step 3. On the test platform, create and load a lightweight Hypervisor based on hardware virtualization, and execute the application to be tested; in kernel state, when the Hypervisor detects that the application to be tested executes an operation to read hardware features, the instruction pointer of the operation is recorded as a first read instruction pointer, and the registers of the test platform are set according to the first preset feature set, so that the application to be tested can read the hardware features set by the first preset feature set; in user state, monitor the execution of the application to be tested, and when the application to be tested executes abnormally and the exception information is the same as the first exception information, save the first missing feature into the missing exception feature set.
[0036] Step 4. Delete the first missing feature from the missing feature set. If the missing feature set is not empty, execute step 2. Otherwise, if the missing abnormal feature set is empty, restore the missing feature set, restart the test platform, and no longer load the lightweight Hypervisor, then execute step 5. If the missing abnormal feature set is not empty, execute step 8.
[0037] In order to further improve the accuracy of the missing exception feature set, after loading the lightweight Hypervisor to execute the application to be tested, the present invention continues to use the dynamic instruction conversion engine to load and execute the application to be tested to re-acquire the missing exception feature set, and the intersection of the missing exception feature sets obtained twice is the final missing exception feature set.
[0038] Step 5: Select a hardware feature from the missing feature set as a second missing feature, and delete the second missing feature from the standard feature set to obtain a second preset feature set.
[0039] Step 6: Use a dynamic instruction conversion engine to load and execute the application to be tested and add an interception event of the read operation at the first read instruction pointer. When the read operation is intercepted, the registers of the test platform are set according to the second preset feature set; monitor the execution of the application to be tested, and when the application to be tested executes abnormally and the exception information is the same as the first exception information, save the second missing feature into the missing exception feature set.
[0040] Step 7: Delete the second missing feature from the missing feature set. If the missing feature set is not empty, execute step 5; otherwise, execute step 8.
[0041] Step 8: Select hardware features from the redundant feature set as the first redundant features, and add the first redundant features to the standard feature set to obtain a third preset feature set.
[0042] Step 9, load a lightweight Hypervisor on the test platform and execute the application to be tested; in kernel state, when the Hypervisor detects that the application to be tested executes an operation to read hardware features, set the registers of the test platform according to the third preset feature set; in user state, monitor the execution of the application to be tested, and when the application to be tested executes abnormally and the abnormal information is the same as the first abnormal information, save the first redundant feature into the redundant abnormal feature set.
[0043] Step 10, delete the first redundant feature from the redundant feature set. If the redundant feature set is not empty, execute step 8. Otherwise, if the redundant abnormal feature set is empty, restore the redundant feature set, restart the test platform, and no longer load the lightweight Hypervisor, then execute step 11. If the redundant abnormal feature set is not empty, execute step 14.
[0044] In order to further improve the accuracy of the redundant exception feature set, after loading the lightweight Hypervisor to execute the application to be tested, the present invention continues to use the dynamic instruction conversion engine to load and execute the application to be tested to re-acquire the redundant exception feature set, and the intersection of the redundant exception feature sets obtained twice is the final redundant exception feature set.
[0045] Step 11: Select hardware features from the redundant feature set as second redundant features, and add the second redundant features to the standard feature set to obtain a fourth preset feature set.
[0046] Step 12: Use a dynamic instruction conversion engine to load and execute the application to be tested and add an interception event of the read operation at the first read instruction pointer. When the read operation is intercepted, set the register of the test platform according to the fourth preset feature set; monitor the execution of the application to be tested, and when the application to be tested executes abnormally and the exception information is the same as the first exception information, save the second redundant feature into the redundant exception feature set.
[0047] Step 13: Delete the second redundant feature from the redundant feature set. If the redundant feature set is not empty, execute step 11; otherwise, execute step 14.
[0048] Step 14: Remove redundant abnormal feature sets from the abnormal platform feature set, and then merge the missing abnormal feature sets to obtain the maximum hardware feature set required for the application to be tested to run normally on the target hardware platform. Example
[0049] In this embodiment, an automatic debugging method based on hardware virtualization provided by the present invention is adopted to obtain the maximum CPU feature set required by the application for application execution exceptions caused by CPU feature differences of the target hardware platform, specifically including:
[0050] S1. Obtain the CPU features of the hardware platform that enable the application under test to work normally, recorded as normalCPUFeatures.
[0051] S2. Obtain the CPU features of the target hardware platform that cause the application to be tested to work abnormally, recorded as wrongCPUFeatures. At the same time, record the exception information exceptionInfo including the exception type, exception instruction address, exception module, exception dynamic library, etc., wherein the exception instruction address is the address where the exception occurs, which is a relative address relative to the loading base address of the executable file of the application to be tested.
[0052] S3. On the test platform, an open source project is selected to create and load a lightweight Hypervisor based on hardware virtualization. From the system hierarchy, the Hypervisor layer is located below the operating system layer, and the Hypervisor intercepts the reading operation of the CPU characteristics by the application under test.
[0053] S4. The CPU features that exist in normalCPUFeatures but do not exist in wrongCPUFeatures are recorded as missedCPUFeatures, and the CPU features that do not exist in normalCPUFeatures but exist in wrongCPUFeatures are recorded as redundantCPUFeatures.
[0054] S5. Record the CPU feature in missedCPUFeatures as missedFeature, and perform the following steps for each missedFeature:
[0055] S5.1. Record the CPU feature set to be tested as cpuFeaturesToVerify, set the initial value of cpuFeaturesToVerify to normalCPUFeatures, and delete missedFeature from cpuFeaturesToVerify.
[0056] S5.2. When the Hypervisor detects that the application under test reads the CPU features, it modifies the register according to cpuFeaturesToVerify; at the same time, it records the information of the instruction pointer of the application under test reading the CPU features, and adds the information to listReadCPUFeaturesInstructionAddr;
[0057] S5.3. In user mode, monitor the execution status of the application under test. When an execution exception of the application under test is detected and the exception information is consistent with exceptionInfo, add the current missedFeature to missedFeaturesCausedException.
[0058] S6. If missedFeaturesCausedException is not empty, it means that the CPU feature that caused the application execution exception due to its missing has been obtained, and S7 is executed; if missedFeaturesCausedException is empty, it means that the Hypervisor has verified that the missing of all CPU features in missedCPUFeatures will not cause the application to be tested to execute abnormally, then the test platform is restarted and the Hypervisor is no longer loaded, and the following steps are executed:
[0059] S6.1. Use a dynamic instruction conversion engine, such as DynamoRIO, to load and execute the application under test, and use the engine to add an interception event after the address in listReadCPUFeaturesInstructionAddr.
[0060] S6.2. For each missedFeature in missedCPUFeatures, perform the following steps:
[0061] Set the initial value of cpuFeaturesToVerify to normalCPUFeatures and delete missedFeature from it; when the application under test executes the instruction to read the CPU features, the interception event is triggered to modify the value of the relevant register to cpuFeaturesToVerify after the instruction is executed, so as to set the CPU features;
[0062] In user mode, monitor the execution status of the application under test. When an execution exception of the application under test is detected and the exception information is consistent with exceptionInfo, add the missedFeature to missedFeaturesCausedException.
[0063] S7. Confirm the CPU features in redundantCPUFeatures that cause the application to be tested to execute abnormally, record the CPU features in redundantCPUFeatures as redundantFeature, and execute the following for each redundantFeature:
[0064] S7.1. Set the initial value of cpuFeaturesToVerify to normalCPUFeatures, and then add redundantFeature to cpuFeaturesToVerify.
[0065] S7.2. When the Hypervisor detects an operation to read CPU features, it modifies the register according to cpuFeaturesToVerify, and at the same time, records the instruction pointer information of the application under test reading the CPU features, and adds the information to listReadCPUFeaturesInstructionAddr.
[0066] S7.3. In user state, monitor the state of the application under test. When an execution exception of the application under test is detected and the exception information is consistent with exceptionInfo, add redundantFeature to redundantFeaturesCausedException.
[0067] S8. If redundantFeaturesCausedException is not empty, it means that the CPU features that cause application execution exceptions due to redundancy have been obtained, and S9 is executed; if redundantFeaturesCausedException is empty, it means that using Hypervisor to test each CPU feature in redundantCPUFeatures will not cause the application to be tested to execute abnormally, then the test platform is restarted and the Hypervisor is no longer loaded, and the following steps are executed:
[0068] S8.1. Use DynamoRIO to load the application under test and add an interception event after the address in listReadCPUFeaturesInstructionAddr.
[0069] S8.2. Record the CPU feature in redundantCPUFeatures as redundantFeature, and perform the following steps for each redundantFeature:
[0070] Set the initial value of cpuFeaturesToVerify to normalCPUFeatures, and then add redundantFeature to cpuFeaturesToVerify; after reading the CPU feature instruction and executing it, modify the relevant register value to cpuFeaturesToVerify to modify the CPU Features; in user state, monitor the execution status of the application under test, and when an execution exception of the application under test is detected and the exception information is consistent with exceptionInfo, record redundantFeature in redundantFeaturesCausedException.
[0071] S9. The maximum CPU feature set that can ensure the normal operation of the application under test on the target hardware platform is: the wrongCPUFeatures set minus the CPU features in the redundantFeaturesCausedException set, and then the CPU features in the missedFeaturesCausedException set are merged. The resulting set is the maximum CPU feature set.
[0072] In summary, the above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An automatic debugging method based on hardware virtualization, It is characterized in that The specific steps include: Step 1: forming a standard feature set from the hardware features that make the application to be tested work normally; forming an abnormal platform feature set from the hardware features of the target hardware platform where the application to be tested works abnormally, and saving the abnormal information as the first abnormal information; forming a missing feature set with the hardware features that exist in the standard feature set and do not exist in the abnormal platform feature set as missing features, and forming a redundant feature set with the hardware features that do not exist in the standard feature set and exist in the abnormal platform feature set as redundant features; Step 2: Select a hardware feature from the missing feature set as the first missing feature, and delete the first missing feature from the standard feature set to obtain a first preset feature set; Step 3: Create and load a Hypervisor based on hardware virtualization on the test platform, and execute the application to be tested; in the kernel state, when it is detected that the application to be tested executes an operation of reading hardware features, record the instruction pointer of the operation as a first read instruction pointer, and set the register according to the first preset feature set; in the user state, when the application to be tested executes an exception and the exception information is the same as the first exception information, save the first missing feature into the missing exception feature set; Step 4, delete the first missing feature from the missing feature set. If the missing feature set is not empty, execute step 2. Otherwise, if the missing abnormal feature set is empty, restore the missing feature set, restart the test platform, and do not load the Hypervisor again, then execute step 5. If the missing abnormal feature set is not empty, execute step 7. Step 5: Select a hardware feature from the missing feature set as a second missing feature, and delete the second missing feature from the standard feature set to obtain a second preset feature set; Step 6: Use a dynamic instruction conversion engine to load and execute the application to be tested and add an interception event of a read operation at the first read instruction pointer, and when the read operation is intercepted, set the register according to the second preset feature set; When the application to be tested executes abnormally and the abnormal information is the same as the first abnormal information, the second missing feature is saved in the missing abnormal feature set; the second missing feature is deleted from the missing feature set, and if the missing feature set is not empty, step 5 is executed, otherwise step 7 is executed; Step 7: Select a hardware feature from the redundant feature set as a first redundant feature, and add the first redundant feature to the standard feature set to obtain a third preset feature set; Step 8, loading the Hypervisor on the test platform and executing the application to be tested; in the kernel state, when it is detected that the application to be tested executes an operation of reading hardware features, setting the register according to the third preset feature set; in the user state, when the application to be tested executes an exception and the exception information is the same as the first exception information, saving the first redundant feature into the redundant exception feature set; Step 9, delete the first redundant feature from the redundant feature set. If the redundant feature set is not empty, execute step 7. Otherwise, if the redundant abnormal feature set is empty, restore the redundant feature set, restart the test platform, and do not load the Hypervisor again, then execute step 10. If the redundant abnormal feature set is not empty, execute step 12. Step 10: Select hardware features from the redundant feature set as second redundant features, and add the second redundant features to the standard feature set to obtain a fourth preset feature set; Step 11: Use a dynamic instruction conversion engine to load and execute the application to be tested and add an interception event of a read operation at the first read instruction pointer, and when the read operation is intercepted, set the register according to the fourth preset feature set; When the application to be tested executes abnormally and the abnormal information is the same as the first abnormal information, the second redundant feature is saved in the redundant abnormal feature set; the second redundant feature is deleted from the redundant feature set, and if the redundant feature set is not empty, step 10 is executed, otherwise step 12 is executed; Step 12: Remove redundant abnormal feature sets from the abnormal platform feature set, and then merge the missing abnormal feature sets to obtain the hardware feature set required for the normal operation of the application to be tested on the target hardware platform.
2. The automatic debugging method according to claim 1, It is characterized in that The step 4 is: deleting the first missing feature from the missing feature set, and if the missing feature set is not empty, executing step 2; otherwise, restoring the missing feature set, restarting the test platform, and not loading the Hypervisor again, and then executing step 5; Step 5: Select a hardware feature from the missing feature set as a second missing feature, and delete the second missing feature from the standard feature set to obtain a second preset feature set; Step 6: Use a dynamic instruction conversion engine to load and execute the application to be tested and add an interception event of a read operation at the first read instruction pointer, and when the read operation is intercepted, set the register according to the second preset feature set; When the application to be tested executes abnormally and the exception information is the same as the first exception information, the second missing feature is saved in the missing exception feature set; the second missing feature is deleted from the missing feature set, and if the missing feature set is not empty, step 5 is executed; otherwise, the intersection of the missing exception feature set obtained in step 3 and the missing exception feature set obtained in step 6 is taken as the final missing exception feature set, and then step 7 is executed.
3. The automatic debugging method according to claim 1, It is characterized in that The step 9 is: deleting the first redundant feature from the redundant feature set, and if the redundant feature set is not empty, executing step 7; otherwise, restoring the redundant feature set, restarting the test platform, and not loading the Hypervisor again, and then executing step 10; Step 10: Select hardware features from the redundant feature set as second redundant features, and add the second redundant features to the standard feature set to obtain a fourth preset feature set; Step 11: Use a dynamic instruction conversion engine to load and execute the application to be tested and add an interception event of a read operation at the first read instruction pointer, and when the read operation is intercepted, set the register according to the fourth preset feature set; When the application to be tested executes abnormally and the exception information is the same as the first exception information, the second redundant feature is saved in the redundant exception feature set; the second redundant feature is deleted from the redundant feature set, and if the redundant feature set is not empty, step 10 is executed; otherwise, the intersection of the redundant exception feature set obtained in step 8 and the redundant exception feature set obtained in step 11 is taken as the final redundant exception feature set, and then step 12 is executed.
4. The automatic debugging method according to claim 1, It is characterized in that The hardware features include CPU features, CPU identification and I / O port status.
5. The automatic debugging method according to claim 1, It is characterized in that The exception information includes the exception type, the exception instruction address and the exception module.
6. The automatic debugging method according to claim 5, It is characterized in that The abnormal instruction address is a relative address relative to the loading base address of the executable file of the application to be tested.
7. The automatic debugging method according to claim 1, It is characterized in that The dynamic instruction conversion engine is DynamoRIO.
