Method, device and electronic device for organizing and generating memory debugging information

By obtaining the file data definition of the specified file and using multi-threaded parallel extraction and matching technology, the memory debugging information is automatically organized and generated, which solves the high error rate problem caused by manual assembly, improves the generation speed and accuracy, and ensures the correctness and efficiency of the debugging tool.

CN120448248BActive Publication Date: 2025-09-26SHANDONG YINGXIN COMP TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510963551.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-14
Publication Date
2025-09-26
Estimated Expiration
2045-07-14

AI Technical Summary

Technical Problem

In the prior art, the generation of memory debugging information relies on manual assembly, resulting in a high error rate and affecting the accuracy and efficiency of debugging tools.

Method used

By obtaining the file data definition of the specified file and using multi-threaded parallel extraction and matching technology, the memory debugging information is automatically organized and generated, including non-nested composite types, header file member composite types and full file member matching, to generate memory debugging combination information and perform verification.

Benefits of technology

It realizes the automatic generation of memory debugging information, improves the generation speed and accuracy, reduces human errors, and ensures the correctness and efficiency of debugging tools.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448248B_ABST
    Figure CN120448248B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and electronic device for organizing and generating memory debugging information, and relates to the field of computer technology. The method comprises: obtaining a specified file; generating and storing target storage information of each specified file according to the extracted file data definition of each specified file; wherein the target storage information of a specified file of a nested composite type includes composite type matching information; generating memory debugging combination information corresponding to the specified file according to the target storage information; the present application can utilize non-nested composite type matching within the file, member composite type matching of the header file and member matching of the full file retrieval to implement dependency analysis of the specified file of the nested composite type, thereby utilizing the result of the dependency analysis to organize and generate memory debugging combination information, thereby realizing automatic organization and generation of memory debugging information, improving the generation speed and accuracy of memory debugging information, and facilitating the use of subsequent debugging tools.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, and electronic device for organizing and generating memory debugging information. Background Art

[0002] Linux (an operating system) is widely used in various scenarios, including servers, embedded systems, and supercomputers. Due to its open source nature, Linux systems are highly customizable and extensible, encompassing a large number of kernel modules, drivers, applications, and services. The complex interactions between these components necessitate powerful debugging tools to help developers and system administrators understand and troubleshoot issues. For example, LDBE (an online or memory dump file-based debugging and management tool) is a debugging tool within the Management Control System (MCS) framework. It supports online synchronous viewing of problematic memory information and remote synchronous or asynchronous viewing of problematic issues.

[0003] Currently, the memory information and format displayed by debugging tools (such as LDBE) must be organized in a code-like format according to certain rules before compilation. Related technologies often manually assemble and configure memory debugging information (or memory display information) for use by debugging tools. However, manual assembly results in a high error rate, making it difficult to ensure the accuracy of memory debugging information, which impacts the subsequent use of debugging tools. Therefore, how to automatically organize and generate memory debugging information and improve its speed and accuracy is a pressing issue. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to provide a method, device and electronic device for organizing and generating memory debug information, so as to realize automatic organization and generation of memory debug information and improve the generation speed and accuracy of memory debug information.

[0005] To solve the above technical problems, an embodiment of the present application provides a method for organizing and generating memory debugging information, including:

[0006] Obtaining a specified file; wherein the specified file is a file in a specified file range in the storage device management system;

[0007] generating and storing target storage information for each of the specified files based on the extracted file data definitions of each of the specified files; wherein the target storage information for a specified file of a nested composite type includes composite type matching information, the composite type matching information including at least one of non-nested composite type matching information for intra-file matching, member composite type matching information for header file matching, and full-file member matching information;

[0008] Generate memory debugging combination information corresponding to the designated file according to the target storage information.

[0009] On the other hand, generating and storing target storage information of each of the specified files according to the extracted file data definition of each of the specified files includes:

[0010] extracting file data definitions of each of the designated files;

[0011] Determining and storing target file data and summary information of each target designated file according to a file data definition of each target designated file; wherein the target designated file is a designated file whose data type in the file data definition includes a nested composite type; the target file data includes a header file, a nested composite type, and a member composite type, and the summary information includes header file storage address information, nested composite type storage address information, and a member composite type index;

[0012] According to the non-nested composite types in the file data definition of each target specified file, matching the respective nested composite types to determine the non-nested composite type matching information;

[0013] According to the header file of each target designated file, the member composite type in the file data definition of the associated designated file is matched to determine the member composite type matching information;

[0014] Member matching is performed using the composite type in the file data definition of each target specified file to determine the full file member matching information.

[0015] On the other hand, after extracting the file data definition of each designated file, the method further includes:

[0016] Memory debugging information of each non-target designated file is generated according to the file data definition of each non-target designated file; wherein, the non-target designated file includes a designated file whose data type in the file data definition includes a basic type or a non-nested composite type; and the target storage information of the designated file of the basic type or the non-nested composite type includes the memory debugging information.

[0017] In another aspect, extracting the file data definition of each of the designated files includes:

[0018] Using the main thread to allocate a first sub-thread corresponding to each of the designated files; wherein each of the first sub-threads corresponds to a different designated file;

[0019] The first sub-thread is utilized to extract the file data definitions of the designated files in parallel and store them in the first temporary data areas corresponding to the designated files.

[0020] On the other hand, utilizing the first sub-thread to extract the file data definitions of the designated files in parallel to the first temporary data areas corresponding to the designated files includes:

[0021] Utilizing the current first thread, extracting the file data definition of the current designated file into the corresponding first temporary data area, and recording thread binding information; wherein the thread binding information includes the extraction result, the current designated file being any of the designated files, and the current first thread being the first thread corresponding to the current designated file;

[0022] If the extraction result is extraction failure, the current first thread is used to reclaim the first temporary data area corresponding to the current specified file, and a new first temporary data area corresponding to the current specified file is applied for, and the steps of using the current first thread to extract the file data definition of the current specified file to the corresponding first temporary data area and record the thread binding information are executed; wherein, the storage space of the recovered first temporary data area is half of the storage space of the new first temporary data area.

[0023] On the other hand, at any moment, the number of the first sub-threads is less than or equal to a thread number threshold; the thread number threshold is a threshold determined based on the quotient of the pre-allocated memory size and the preset single file requirement size, the pre-allocated memory size is the product of the remaining memory size and a preset parameter, and the preset parameter is less than 1.

[0024] On the other hand, according to the file data definition of each target-specified file, determining and storing the target file data and summary information of each target-specified file includes:

[0025] The first sub-thread is utilized to determine and store the target file data and summary information of the corresponding target designated files according to the file data definition of the corresponding target designated files in the first temporary data area.

[0026] On the other hand, according to the non-nested composite type in the file data definition of each target specified file, matching the respective nested composite types and determining the non-nested composite type matching information includes:

[0027] Using the main thread, allocating a first target number of second threads to the current target specified file according to the number of nested composite types in the file data definition of the current target specified file; wherein the current target specified file is any of the target specified files, and the first target number is greater than or equal to 2 and less than or equal to a single-file thread number threshold;

[0028] Utilizing the first second thread, extracting the non-nested composite type in the data definition of the current target specified file to the corresponding second temporary data area;

[0029] Utilize the remaining second threads to read non-nested composite types from the second temporary data area in sequence, traverse and match the corresponding nested composite types; if the match is successful, update the non-nested composite type matching information.

[0030] On the other hand, the method further comprises: utilizing the remaining second threads to sequentially read non-nested composite types from the second temporary data area, and after traversing and matching the corresponding nested composite types, the method further comprises:

[0031] If the nested composite types corresponding to all the remaining second threads are matched to the corresponding non-nested composite types, then performing the step of generating the memory debugging combination information corresponding to the designated file according to the target storage information;

[0032] If at least one nested composite type corresponding to any of the remaining second threads does not match a corresponding non-nested composite type, the step of matching the member composite type in the file data definition of the associated designated file according to the header file of each target designated file and determining the member composite type matching information is executed.

[0033] On the other hand, according to the header file of each target designated file, matching the member composite type in the file data definition of the associated designated file to determine the member composite type matching information includes:

[0034] Using the main thread, assigning a corresponding third sub-thread to each header file of the current target specified file; wherein each of the third sub-threads corresponds to a different header file;

[0035] Using the third sub-thread, traverse the member composite types of each stored target specified file and match them with the corresponding header files; if the match is successful, update the non-nested composite type matching information, and if a header file exists in the successfully matched header file, record the header file in the successfully matched header file as a sub-header file;

[0036] After all header files of the current target specified file are traversed, the main thread is used to determine whether a target sub-header file exists; wherein the target sub-header file includes the sub-header file that is not successfully matched to the current target specified file;

[0037] If yes, use the main thread to allocate a corresponding third sub-thread to each of the target sub-header files;

[0038] Utilize the third sub-thread to traverse the member composite types of each stored target specified file and match them with the corresponding target sub-header file; if the match is successful, update the non-nested composite type matching information, and when a header file exists in the successfully matched sub-header file, record the header file in the successfully matched sub-header file as a sub-header file, and execute the step of using the main thread to determine whether the target sub-header file exists.

[0039] On the other hand, performing member matching using the composite type in the file data definition of each target specified file to determine the full file member matching information includes:

[0040] Using the main thread, assigning a corresponding fourth sub-thread to each of the target designated files; wherein each of the fourth sub-threads corresponds to a different target designated file;

[0041] Utilizing the fourth sub-thread, extracting in parallel the composite types in the file data definitions of the target designated files into the corresponding third temporary data areas;

[0042] Allocating a second target number of fifth threads to the current target designated file using the main thread; wherein the current target designated file is any of the target designated files;

[0043] The fifth thread is used to traverse the composite types in the third temporary data area corresponding to the current target designated file and match them with the member types of the corresponding designated files; if the match is successful, the full file member matching information of the current target designated file is updated.

[0044] On the other hand, getting the specified file includes:

[0045] Obtaining the designated file and manually assembling debugging information according to the received debugging information verification instruction;

[0046] Correspondingly, after generating the memory debugging combination information corresponding to the specified file according to the target storage information, the method further includes:

[0047] Verifying the manually assembled debugging information using the memory debugging combination information to obtain a verification result;

[0048] If the verification result is failure, an alarm message will be output.

[0049] On the other hand, using the memory debugging combination information to verify the manually assembled debugging information and obtain a verification result includes:

[0050] The manually assembled debugging information is verified according to the memory debugging combination information and the placeholders of the basic types and / or the placeholders and offsets of the composite types of the manually assembled debugging information to obtain a verification result.

[0051] The present application also provides a device for organizing and generating memory debugging information, including:

[0052] An information collection module is used to obtain a specified file; wherein the specified file is a file in a specified file range in the storage device management system;

[0053] a dependency analysis module, configured to generate and store target storage information for each of the specified files based on the extracted file data definitions of each of the specified files; wherein the target storage information for a specified file of a nested composite type includes composite type matching information, wherein the composite type matching information includes at least one of non-nested composite type matching information for intra-file matching, member composite type matching information for header file matching, and full-file member matching information;

[0054] The debugging generation module is used to generate memory debugging combination information corresponding to the specified file according to the target storage information.

[0055] In addition, the present application also provides an electronic device, including:

[0056] memory for storing computer programs;

[0057] The processor is configured to implement the steps of the above-mentioned method for organizing and generating memory debugging information when executing the computer program.

[0058] The present application provides a method for organizing and generating memory debugging information, comprising: obtaining a specified file; wherein the specified file is a file in a specified file range in a storage device management system; generating and storing target storage information of each specified file based on the extracted file data definition of each specified file; wherein the target storage information of a specified file of a nested composite type includes composite type matching information, and the composite type matching information includes at least one of non-nested composite type matching information matching within the file, member composite type matching information matching a header file, and full file member matching information.

[0059] As can be seen, this application generates and stores target storage information for each specified file based on the extracted file data definitions. This allows for dependency analysis of nested composite type specified files using non-nested composite type matching within the file, member composite type matching in header files, and member matching in full-file retrieval. This allows for the organization and generation of memory debug combination information using the results of the dependency analysis, enabling automatic organization and generation of memory debug information, improving the speed and accuracy of memory debug information generation, and facilitating the use of subsequent debugging tools. Furthermore, this application also provides a memory debug information organization and generation device and electronic device, which also have the aforementioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0061] Figure 1 A flowchart of a method for organizing and generating memory debugging information provided in an embodiment of the present application;

[0062] Figure 2 A schematic diagram of a storage area of ​​a storage module provided in an embodiment of the present application;

[0063] Figure 3 A flowchart of another method for organizing and generating memory debugging information provided in an embodiment of the present application;

[0064] Figure 4 A flowchart of a dependency analysis provided in an embodiment of the present application;

[0065] Figure 5 A schematic diagram of a process for defining parallel extraction of file data provided in an embodiment of the present application;

[0066] Figure 6 A schematic diagram of a flow chart for member composite type matching within a single file provided in an embodiment of the present application;

[0067] Figure 7 A schematic diagram of a process for header file dependency analysis provided in an embodiment of the present application;

[0068] Figure 8 A schematic diagram of a process flow for full-file retrieval dependency analysis provided in an embodiment of the present application;

[0069] Figure 9A structural block diagram of a device for organizing and generating memory debugging information provided in an embodiment of the present application;

[0070] Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0071] Figure 11 A schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0072] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0073] Please refer to Figure 1 , Figure 1 This is a flowchart of a method for organizing and generating memory debugging information provided by an embodiment of the present application. The method may include:

[0074] Step 101: Acquire a designated file; wherein the designated file is a file in a designated file range in a storage device management system.

[0075] It is understandable that the designated file in this embodiment can be a designated file range in the storage device management system (such as Figure 2 The files in the user-set information area (the range of files stored in the user-set information area), such as individual files or files in a folder, are the files for which corresponding memory debugging information (i.e., memory debugging combination information) needs to be generated. The storage device management system can be a management control system (MCS) that manages storage devices based on an operating system (such as Linux).

[0076] Correspondingly, the specific method of obtaining the specified file in this step can be set by the designer according to the practical scenario and user needs. For example, in this step, instructions can be generated based on the received debugging information (such as Figure 3 The user information in the file is obtained to obtain the specified file, and the corresponding file corresponding to the debugging information is generated to generate the corresponding memory debugging combination information, which is convenient for subsequent debugging tools to use. In this step, the instruction can also be verified according to the received debugging information (such as Figure 3), obtains the specified file and manually assembled debugging information, and uses the memory debugging combination information corresponding to the generated specified file to verify the manually assembled debugging information, thereby realizing automatic verification of the manually written memory debugging information, reducing the display disorder of the memory debugging information caused by coding errors, and further avoiding the problem positioning error of the debugging tool caused by the disordered display of the memory debugging information, thereby ensuring the correctness of the positioning, preventing the waste of ineffective human resources, and improving the efficiency of problem solving.

[0077] Step 102: Generate and store target storage information for each specified file based on the extracted file data definition of each specified file; wherein, the target storage information for the specified file of the nested composite type includes composite type matching information, and the composite type matching information includes at least one of the non-nested composite type matching information for intra-file matching, member composite type matching information for header file matching, and full-file member matching information.

[0078] It is understood that the file data definitions in this step may be data definitions extracted from each specified file, such as data definitions of each data type (e.g., base type and / or composite type) in the specified file. Data types may include base types (i.e., base data types) and composite types (i.e., composite data types). Composite types may include nested composite types and member composite types.

[0079] Accordingly, in this embodiment, a unified suffix may be configured for composite data definitions (ie, composite type data definitions) to facilitate the distinction between basic type and composite type data definitions, and to facilitate identification of different composite types.

[0080] It should be noted that in this step, the extracted file data definitions for each designated file can be used to generate and store target storage information for each designated file, facilitating the subsequent generation of memory debugging information (i.e., memory debugging combination information) corresponding to all designated files. For designated files whose file data definitions include nested composite types, their target storage information can include composite type matching information, such as at least one of non-nested composite type matching information for intra-file matching, member composite type matching information for header file matching, and member matching information for full-file retrieval (i.e., full-file member matching information). For example, the composite type matching information can include non-nested composite type matching information, member composite type matching information, and full-file member matching information.

[0081] The non-nested composite type matching information within the file may be the matching record information of the non-nested composite type and the nested composite type within a single specified file; the member composite type matching information matching the header file may be the matching record information of the header file and the member composite type of the associated specified file; the member matching information of the entire file may be the matching record information of the composite type and the member types (such as the member composite type) of all specified files (such as the member composite type). Figure 2 Dependency analysis result recording area in ); thereby realizing dependency analysis of specified files of nested composite types; non-nested composite types can be composite types that only nest basic types; nested composite types can be composite types that nest types other than basic types (such as member composite types and / or composite types of non-nested composite types).

[0082] Correspondingly, for designated files whose file data definitions only include base types or non-nested composite types (i.e., designated files of base types or non-nested composite types), their target storage information may include memory debugging information. In other words, in this step, memory debugging information for each non-target designated file may be generated based on the file data definitions of each non-target designated file. Non-target designated files include designated files whose data types in the file data definitions include base types or non-nested composite types. In other words, corresponding memory debugging information may be directly generated for designated files of base types or non-nested composite types.

[0083] Step 103: Generate memory debugging combination information corresponding to the specified file according to the target storage information.

[0084] In this step, the target storage information of each specified file can be used to generate memory debugging information corresponding to all specified files (i.e., memory debugging combination information), which can be output to a debugging tool (such as LDBE) for problem location, or manually assembled debugging information corresponding to the specified files (such as Figure 3 Verify the file to be verified in the .

[0085] Correspondingly, this step may also include a verification process of manually assembled debugging information, such as using memory debugging combination information to verify the manually assembled debugging information and obtain a verification result; if the verification result is verification failure, an alarm message (such as Figure 2 (Alarm information recorded for feedback in the feedback information area in the ).

[0086] Correspondingly, the specific method for verifying the manually assembled debugging information using the memory debugging combination information and obtaining the verification results can be set by the designer according to the usage scenario and user needs. For example, the manually assembled debugging information can be verified based on the placeholders of the basic types and / or the placeholders and offsets of the composite types of the memory debugging combination information and the manually assembled debugging information to obtain the verification results. For example, when the memory debugging combination information and the manually assembled debugging information include basic types and composite types, the manually assembled debugging information can be verified based on the placeholders of the basic types and the placeholders and offsets of the composite types of the memory debugging combination information and the manually assembled debugging information to obtain the verification results. Figure 3 As shown, after generating the debug display information (ie memory debug combination information), you can use it with the cache (as shown in Figure 2 The verified file (i.e., manually assembled debugging information) in the verification information area cache in the .txt file is compared with the placeholders of the basic and composite types, as well as the offsets of the composite types. For example, for basic types, the placeholder comparison is based on the definition name; for composite types, the placeholder and offset comparison is based on the composite type name and member definition name. If an inconsistency is found, the verification result is determined to be verification failure, and an alarm feedback is provided.

[0087] Furthermore, when there is no error in the comparison of the placeholders of the basic type and the composite type and the offset of the composite type (i.e., the comparison is consistent), the header files in the memory debugging combination information and the manually assembled debugging information can also be compared; if the header files are inconsistent, the verification result is determined to be verification failure, and an alarm feedback is performed.

[0088] Correspondingly, in this embodiment, basic rules and coding grammar rules can also be pre-configured (for example, Figure 2 The configuration rule information area in the is stored) to facilitate the generation of memory debugging combination information and the verification of subsequent manual assembly debugging information. For example, the basic rules may include each basic type and its corresponding occupied byte length (i.e., placeholder).

[0089] It should be noted that the specific process of step 102 in this embodiment can be set by the designer according to the practical scenario and user needs, such as Figure 4 As shown, step 102 may include:

[0090] Step 201: Extract the file data definition of each designated file.

[0091] This embodiment does not limit the specific method for extracting the file data definitions of each designated file. For example, the file data definitions of each designated file can be extracted serially in this step. To increase the extraction speed, the file data definitions of each designated file can also be extracted in parallel in this step. For example, in this step, a main thread can be used to assign a corresponding first sub-thread to each designated file; each first sub-thread corresponds to a different designated file; and the file data definitions of each designated file can be extracted in parallel by using the first sub-threads to their corresponding first temporary data areas.

[0092] Correspondingly, due to the large number of specified files or tight memory resources, it is difficult to allocate a first thread to all specified files at the same time. In some embodiments, the number of first sub-threads at any time may be less than or equal to the thread number threshold; the thread number threshold may be a threshold determined based on the quotient of the pre-allocated memory size and the preset single file requirement size, the pre-allocated memory size being the product of the remaining memory size and a preset parameter, and the preset parameter being less than 1, so as to achieve adaptive parallel extraction.

[0093] like Figure 5 As shown, the main thread applies for a thread (i.e., the first thread) from the thread resource pool for each specified file. In principle, in order to improve efficiency, a thread will be applied for each specified file. However, when the file range is very large or memory resources are very tight, it needs to be done in batches. Due to the problem of memory resource usage and resource pool size, the maximum number of threads that can be applied at the same time can be obtained by dynamically calculating the maximum parallel extraction value (i.e., the thread number threshold), and it cannot be infinite. For example, the thread number threshold = one tenth of the remaining memory size (i.e., the preset parameter) / the preset single file required size. The main thread records the specified file and the bound thread (i.e., the thread binding information, such as each record information can include the path name, extraction result, thread number, and the starting address of the record), and stores the last scanned position in the record. Figure 2 Once the thread resource allocation is completed for the specified file, multiple specified files will simultaneously use their own corresponding threads to extract the file data definition (i.e., file data definition) to the specified file. Figure 2 The temporary extraction data definition area (i.e., the first temporary data area) of the storage module shown is shown; if it is found during the extraction process that the allocated temporary resource area is insufficient to place the extracted file data definition, the extraction result of the associated specified file can be recorded as an extraction failure mark and the thread exits; if the data definition extraction can be completed successfully, the extraction result of the associated specified file can be recorded as an extraction success mark and the thread exits.

[0094] Step 202: Determine and store the target file data and summary information of each target specified file according to the file data definition of each target specified file.

[0095] Among them, the target specified file is a specified file whose data type in the file data definition includes a nested composite type; the target file data includes a header file, a nested composite type and a member composite type, and the summary information includes header file storage address information, nested composite type storage address information and member composite type index.

[0096] Accordingly, to improve efficiency, in this step, the first sub-thread can be used to determine and store the target file data and summary information of each corresponding target file based on the file data definition of the target file in the first temporary data area. Alternatively, a new first sub-thread can be allocated to each target file using the main thread; the new first sub-thread can be used to determine and store the target file data and summary information of each corresponding target file based on the file data definition of the target file in the first temporary data area.

[0097] like Figure 5 As shown, the main thread in the resource pool polls the relevant files and bound thread records (i.e., thread binding information). If a specified file is successfully extracted, each specified file is allocated a separate thread resource for processing; for non-basic type header files, member composite types, and nested composite types, the memory resources occupied can be calculated and classified, and the summary information is recorded in Figure 2 The summary information record area of ​​the storage module in the , such as the starting address of the header file and nested composite type area, the member composite type index and address, and the flag bit; for the specified file of the basic type or non-nested composite type, memory debugging information can be directly generated, and the corresponding temporary extraction area (i.e., the first temporary data area) can be recycled. If a record that fails to be extracted is polled, thread resources are allocated for each failed record to redefine the data extraction and a temporary double resource area is allocated to ensure sufficient resources; if the re-extraction fails again, the corresponding temporary extraction area is recycled and the re-extraction is continued, and the resources are doubled until the extraction is successful, waiting for the main thread to poll.

[0098] Accordingly, in some embodiments, the above-mentioned process of using the first sub-thread to extract the file data definition of each designated file in parallel to its corresponding first temporary data area may include: using the current first thread to extract the file data definition of the current designated file to the corresponding first temporary data area, and recording the thread binding information; if the extraction result is extraction failure, using the current first thread to reclaim the first temporary data area corresponding to the current designated file, and applying for a new first temporary data area corresponding to the current designated file, executing the step of using the current first thread to extract the file data definition of the current designated file to the corresponding first temporary data area, and recording the thread binding information; wherein the thread binding information includes the extraction result, the current designated file is any designated file, and the current first thread is the first thread corresponding to the current designated file; the storage space of the recovered first temporary data area is half of the storage space of the new first temporary data area; the initial size of the first temporary data area can be a preset area size (such as the preset single file requirement size mentioned above).

[0099] Step 203: Match the respective nested composite types according to the non-nested composite types in the file data definition of each target specified file, and determine the non-nested composite type matching information.

[0100] It is understandable that in this step, dependency analysis can be performed on each target specified file, and the respective nested composite types can be matched according to the non-nested composite types in the file data definition of each target specified file to determine the non-nested composite type matching information.

[0101] Among them, this embodiment does not limit the specific method of matching the respective nested composite types according to the non-nested composite types in the file data definition of each target specified file in this step to determine the non-nested composite type matching information. For example, in this step, the non-nested composite types in the file data definition of each target specified file can be matched with the respective nested composite types in turn to determine the non-nested composite type matching information; in order to improve efficiency, in this step, the non-nested composite types in the file data definition of each target specified file can also be matched with the respective nested composite types in parallel to determine the non-nested composite type matching information. For example, in this step, the main thread can be used to allocate a first target number of second threads to the current target specified file based on the number of nested composite types in the file data definition of the current target specified file; the first second thread is used to extract the non-nested composite types in the data definition of the current target specified file to the corresponding second temporary data area; the remaining second threads (i.e., the second threads other than the first second thread) are used to read the non-nested composite types from the second temporary data area in sequence, and traverse and match the corresponding nested composite types; if the match is successful, the non-nested composite type matching information is updated; wherein, the current target specified file is any target specified file, and the first target number is greater than or equal to 2 and less than or equal to the single-file thread number threshold (such as 6).

[0102] In other embodiments, the above-mentioned use of the remaining second threads to read non-nested composite types from the second temporary data area in sequence, and after traversing and matching the corresponding nested composite types, may also include: if the nested composite types corresponding to all the remaining second threads are matched to the corresponding non-nested composite types, then entering step 103 to generate memory debugging combination information using the target storage information of all the designated files; if at least one nested composite type corresponding to any of the remaining second threads is not matched to the corresponding non-nested composite type, then entering step 204; accordingly, step 204 can be to match the member composite type in the file data definition of the associated designated file according to the header file of the current target designated file, and determine the member composite type matching information of the current target designated file.

[0103] like Figure 6As shown, the main thread in the resource pool can poll the summary information corresponding to each target-specified file in the storage module in batches. In parallel, it allocates 2 to 6 thread resources (i.e., second threads) to each member composite type (i.e., member composite types corresponding to nested composite types) in each target-specified file. The number of allocated thread resources depends on the number of nested composite types contained in the target-specified file; the more nested composite types, the more thread resources are allocated. The final extracted file path of each batch is recorded in the extraction location record area to facilitate use by the next batch. The first allocated thread first extracts the data definition of the corresponding non-nested composite type from the file into the temporary extraction data definition area (i.e., the second temporary data area). If the extraction succeeds, the thread exits. If the extraction fails, the extraction area is released and resources are doubled to re-extract until the extraction succeeds, at which point the thread exits. Each of the remaining threads is responsible for a portion of consecutive composite type matches, sequentially reading non-nested composite types from the temporary extraction data definition area and then traversing the nested composite types it is responsible for. If a match is successful, the summary information is updated according to the associated index to indicate success, until all non-nested composite types in the temporary area are read. If it is not the last child thread, exit directly; if it is the last child thread, it needs to reclaim the corresponding temporary extraction area and then exit.

[0104] Step 204: According to the header file of each target designated file, the member composite type in the file data definition of the associated designated file is matched to determine the member composite type matching information.

[0105] Correspondingly, in order to improve efficiency, the composite type matching of the header files can be performed in parallel in this step; for example, in this step, the main thread can be used to assign a corresponding third sub-thread to each header file of the current target specified file; wherein, each third sub-thread corresponds to a different header file; using the third sub-thread, the member composite types of each stored target specified file are traversed and matched with the corresponding header files; if the match is successful, the non-nested composite type matching information is updated, and when there is a header file in the header file that is successfully matched, the header file in the header file that is successfully matched is recorded as a sub-header file; after all the header files of the current target specified file are traversed, A main thread is used to determine whether a target sub-header file exists; wherein the target sub-header file includes a sub-header file that corresponds to the current target specified file but has not been successfully matched; if so, the main thread is used to assign a corresponding third sub-thread to each target sub-header file; the third sub-thread is used to traverse the member composite types of each stored target specified file and match them with the corresponding target sub-header file; if the match is successful, the non-nested composite type matching information is updated, and when a header file exists in the successfully matched sub-header file, the header file in the successfully matched sub-header file is recorded as a sub-header file, and the step of using the main thread to determine whether a target sub-header file exists is executed.

[0106] In other embodiments, after the above-mentioned use of the third sub-thread to traverse the member composite types of each stored target specified file and match them with the corresponding header files, it can also include: if the header files corresponding to all the third sub-threads are matched to the corresponding member composite types, then enter step 103 to generate memory debugging combination information using the target storage information of all the specified files; if at least one header file corresponding to any third sub-thread is not matched to the corresponding member composite type, then enter step 204; accordingly, step 205 can be for performing member matching using the composite type in the file data definition of the current target specified file to determine the full file member matching information of the current target specified file.

[0107] That is to say, this embodiment does not limit the specific logical sequence of steps 203 to 205. For example, steps 203 to 205 can be performed in sequence, that is, non-nested composite type matching within the file, member composite type matching of the header file, and member matching of the full file search are performed on each target specified file respectively. In other embodiments, for each target specified file, step 203 can be first performed to perform non-nested composite type matching within the file. If all nested composite types within the file are matched to corresponding non-nested composite types, step 103 can be performed. Otherwise, step 204 can be performed to perform member composite type matching of the header file. If all header files are matched to corresponding member composite types, step 103 can be performed. Otherwise, step 205 can be performed to perform member matching of the full file search.

[0108] like Figure 7 As shown, the main thread in the resource pool can serially traverse the header file record information corresponding to each file in the storage device. Allocate thread resources (in principle, each header file is bound to a thread, but there are also limitations due to memory and resource pool issues) to process the header files contained in a single file in batches in parallel. If the extraction fails, the corresponding temporary extraction area is recycled and the temporary extraction resources are doubled again and then re-extracted, and the cycle is repeated until the extraction is successful; if the extraction is successful, the member composite type is matched. If the match is successful, the summary information is updated until the extracted file is matched, and the header files contained in the header file are recorded in the header file record area in the storage module associated with this file (such as Figure 2 After the last child thread exits, the main thread traverses the summary information area of ​​the current file to check whether all matches have been completed. If all matches have been completed, the main thread proceeds to step 205. Otherwise, the main thread can re-poll the sub-header file area of ​​the header file information record area and allocate thread resources for extraction and matching processing (the processing process is the same as the above-mentioned header file processing) until there are no sub-header file records and then exits.

[0109] Step 205: Perform member matching using the composite type in the file data definition of each target specified file to determine the member matching information of the entire file.

[0110] Correspondingly, in order to improve efficiency, this step can perform parallel full-file search and matching. For example, this step can use the main thread to assign a corresponding fourth sub-thread to each target designated file; wherein each fourth sub-thread corresponds to a different target designated file; using the fourth sub-thread, extract the composite type in the file data definition of each target designated file in parallel to the corresponding third temporary data area; using the main thread to assign the second target number of fifth threads to the current target designated file; wherein the current target designated file is any target designated file; using the fifth thread, traverse the composite type in the third temporary data area corresponding to the current target designated file and match it with the member type of the corresponding designated file; if the match is successful, update the full file member matching information of the current target designated file.

[0111] like Figure 8 As shown, the main thread in the resource pool can traverse all target specified files in batches (in principle, each file is bound to a thread (i.e., the fourth thread), but there are also limitations due to memory and resource pool issues). First, the assigned sub-threads extract the composite types in the file data definition in parallel to the temporary extraction data definition area (i.e., the third temporary data area). After the extraction is completed, the extraction is marked as successful and the exit is marked. Then, the main thread polls the successfully extracted target specified files and allocates multiple sub-thread resources for each target specified file again (i.e., the fifth thread, which is determined by the number of files contained in the file area in the storage module, and each sub-thread is responsible for a part of the file area), and performs member type (such as member composite type) matching in parallel. When the match is successful, the summary information is updated, and the associated file path (i.e., full file member matching information) is recorded after deduplication. Figure 2 The dependency analysis result area of ​​the storage module shown is stored until all corresponding temporary area matches are completed.

[0112] In this embodiment, the embodiment of the present application generates and stores the target storage information of each specified file based on the file data definition of each specified file extracted, and can utilize the non-nested composite type matching within the file, the member composite type matching of the header file, and the member matching of the full file retrieval to realize the dependency analysis of the specified files of the nested composite type, thereby utilizing the results of the dependency analysis to organize and generate memory debugging combination information, realize the automatic organization and generation of memory debugging information, improve the generation speed and accuracy of memory debugging information, and facilitate the use of subsequent debugging tools.

[0113] Corresponding to the above method embodiment, an embodiment of the present application further provides a memory debugging information organization generation device. The memory debugging information organization generation device described below and the memory debugging information organization generation method described above can refer to each other.

[0114] Please refer to Figure 9 , Figure 9 This is a structural block diagram of a device for organizing and generating memory debugging information provided in an embodiment of the present application. The device may include:

[0115] The information collection module 10 is used to obtain a specified file; wherein the specified file is a file in a specified file range in the storage device management system;

[0116] The dependency analysis module 20 is configured to generate and store target storage information for each designated file based on the extracted file data definitions of each designated file; wherein the target storage information for a designated file of a nested composite type includes composite type matching information, and the composite type matching information includes at least one of non-nested composite type matching information for intra-file matching, member composite type matching information for header file matching, and full-file member matching information;

[0117] The debugging generation module 30 is used to generate memory debugging combination information corresponding to the specified file according to the target storage information.

[0118] In some embodiments, the dependency analysis module 20 may include:

[0119] The extraction submodule is used to extract the file data definition of each specified file;

[0120] a storage submodule, configured to determine and store target file data and summary information of each target designated file according to a file data definition of each target designated file; wherein the target designated file is a designated file whose data type in the file data definition includes a nested composite type; the target file data includes a header file, a nested composite type, and a member composite type; and the summary information includes header file storage address information, nested composite type storage address information, and a member composite type index;

[0121] The intra-file matching submodule is used to match the respective nested composite types according to the non-nested composite types in the file data definition of each target specified file, and determine the non-nested composite type matching information;

[0122] The header file matching submodule is used to match the member composite type in the file data definition of the associated specified file according to the header file of each target specified file, and determine the member composite type matching information;

[0123] The member matching submodule is used to perform member matching using the composite type in the file data definition of each target specified file to determine the member matching information of the entire file.

[0124] In some embodiments, the debugging generation module 30 can also be used to generate memory debugging information for each non-target designated file based on the file data definition of each non-target designated file; wherein the non-target designated file includes a designated file whose data type in the file data definition includes a basic type or a non-nested composite type; and the target storage information of the designated file of the basic type or the non-nested composite type includes memory debugging information.

[0125] In some embodiments, the extraction submodule may include:

[0126] A first thread allocation unit is configured to allocate a first sub-thread corresponding to each designated file using a main thread; wherein each first sub-thread corresponds to a different designated file;

[0127] The parallel extraction unit is used to utilize the first sub-thread to extract the file data definitions of each designated file in parallel to the first temporary data area corresponding to each file.

[0128] In some embodiments, the parallel extraction unit may include:

[0129] an extraction and binding subunit, configured to extract, using the current first thread, the file data definition of the current designated file to the corresponding first temporary data area, and record thread binding information; wherein the thread binding information includes the extraction result, the current designated file being any designated file, and the current first thread being the first thread corresponding to the current designated file;

[0130] The re-application sub-unit is used to, if the extraction result is extraction failure, use the current first thread to reclaim the first temporary data area corresponding to the current specified file, apply for a new first temporary data area corresponding to the current specified file, and send a start signal to the extraction binding sub-unit; wherein, the storage space of the recovered first temporary data area is half of the storage space of the new first temporary data area.

[0131] In some embodiments, the number of first sub-threads at any moment is less than or equal to a thread number threshold; the thread number threshold is a threshold determined based on the quotient of the pre-allocated memory size and the preset single file requirement size, the pre-allocated memory size is the product of the remaining memory size and a preset parameter, and the preset parameter is less than 1.

[0132] In some embodiments, the storage submodule may be specifically configured to utilize the first subthread to determine and store the target file data and summary information of the respective corresponding target designated files according to the file data definition of the respective target designated files in the respective first temporary data areas.

[0133] In some embodiments, the intra-file matching submodule may include:

[0134] a second thread allocation unit, configured to allocate a first target number of second threads to the current target specified file using the main thread according to the number of nested composite types in the file data definition of the current target specified file; wherein the current target specified file is any target specified file, and the first target number is greater than or equal to 2 and less than or equal to a single-file thread number threshold;

[0135] The non-nested extraction unit is used to extract the non-nested composite type in the data definition of the current target specified file into the corresponding second temporary data area by using the first second thread;

[0136] The non-nested matching unit is used to use the remaining second threads to read non-nested composite types from the second temporary data area in sequence, traverse and match the corresponding nested composite types; if the match is successful, update the non-nested composite type matching information.

[0137] In some embodiments, the non-nested matching unit is further configured to, using the remaining second threads, sequentially read non-nested composite types from the second temporary data area, traverse and match the corresponding nested composite types, and then, if the corresponding nested composite types of all the remaining second threads are matched with corresponding non-nested composite types, send a start signal to the debug generation module 30;

[0138] If at least one nested composite type corresponding to any of the remaining second threads is not matched to a corresponding non-nested composite type, a start signal is sent to the header file matching submodule.

[0139] In some embodiments, the header file matching submodule may include:

[0140] A third thread allocation unit is configured to allocate a corresponding third sub-thread to each header file of the current target specified file using the main thread; wherein each third sub-thread corresponds to a different header file;

[0141] a header file matching unit, configured to use a third sub-thread to traverse the member composite types of each stored target specified file and match them with the corresponding header file; if a match is successful, update the non-nested composite type matching information, and if a header file exists in the successfully matched header file, record the header file in the successfully matched header file as a sub-header file;

[0142] The sub-header file determination unit is used to determine whether a target sub-header file exists after traversing all header files of the current target specified file using the main thread; wherein the target sub-header file includes the sub-header file corresponding to the current target specified file that has not been successfully matched;

[0143] a fourth thread allocating unit, configured to allocate a corresponding third sub-thread to each target sub-header file using the main thread if the target sub-header file exists;

[0144] The sub-header file matching unit is used to use the third sub-thread to traverse the member composite types of each stored target specified file and match them with the corresponding target sub-header file; if the match is successful, the non-nested composite type matching information is updated, and when a header file exists in the successfully matched sub-header file, the header file in the successfully matched sub-header file is recorded as a sub-header file, and a start signal is sent to the sub-header file judgment unit.

[0145] In some embodiments, the member matching submodule may include:

[0146] a fifth thread allocation unit, configured to allocate a fourth sub-thread corresponding to each target designated file using the main thread; wherein each fourth sub-thread corresponds to a different target designated file;

[0147] The composite extraction unit is used to extract composite types in the file data definition of each target specified file in parallel into the corresponding third temporary data area by using the fourth sub-thread;

[0148] a sixth thread allocating unit, configured to allocate a second target number of fifth threads to a current target designated file using the main thread; wherein the current target designated file is any target designated file;

[0149] The member matching unit is used to use the fifth thread to traverse the composite types in the third temporary data area corresponding to the current target specified file and match them with the member types of the corresponding specified files; if the match is successful, the full file member matching information of the current target specified file is updated.

[0150] In some embodiments, the information collection module 10 may be specifically configured to obtain a specified file and manually assemble debugging information based on a received debugging information verification instruction;

[0151] Correspondingly, the device may further include:

[0152] A verification module is used to verify the manually assembled debugging information using the memory debugging combination information and obtain the verification result;

[0153] The alarm module is used to output an alarm message if the verification result is verification failure.

[0154] In some embodiments, the verification module may be specifically configured to verify the manually assembled debugging information based on the memory debugging combination information and the basic type placeholders and / or composite type placeholders and offsets of the manually assembled debugging information to obtain a verification result.

[0155] In this embodiment, the embodiment of the present application generates and stores target storage information of each specified file according to the file data definition of each specified file extracted through the dependency analysis module 20, and can utilize the non-nested composite type matching within the file, the member composite type matching of the header file, and the member matching of the full file retrieval to realize dependency analysis of the specified files of nested composite types, thereby utilizing the results of the dependency analysis to organize and generate memory debugging combination information, realize automatic organization and generation of memory debugging information, improve the generation speed and accuracy of memory debugging information, and facilitate the use of subsequent debugging tools.

[0156] Corresponding to the above method embodiment, an embodiment of the present application further provides an electronic device. The electronic device described below and the method for organizing and generating memory debugging information described above can refer to each other.

[0157] Please refer to Figure 10 , Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0158] Memory D1, for storing computer programs;

[0159] The processor D2 is configured to implement the steps of the method for organizing and generating memory debugging information provided in the above method embodiment when executing a computer program.

[0160] The electronic device provided in this embodiment may specifically be a computer or a server, such as a server running a storage device management system.

[0161] Corresponding to the above method embodiment, an embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium described below and the method for organizing and generating memory debugging information described above can refer to each other.

[0162] Please refer to Figure 11 , Figure 11 The computer-readable storage medium 40 stores a computer program 41, which, when executed by a processor, implements the steps of the method for organizing and generating memory debugging information provided in the above method embodiment.

[0163] The computer-readable storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, which may store program codes.

[0164] Corresponding to the above method embodiment, an embodiment of the present application further provides a computer program product. The computer program product described below and the method for organizing and generating memory debugging information described above can refer to each other.

[0165] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of the method for organizing and generating memory debugging information provided in the above method embodiment.

[0166] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. References to the common and similar parts between the various embodiments are sufficient. The devices, electronic devices, computer-readable storage media, and computer program products disclosed in the embodiments are described briefly because they correspond to the methods disclosed in the embodiments. For relevant details, refer to the description of the methods.

[0167] The above is a detailed introduction to the method, device, and electronic device for organizing and generating memory debugging information provided by this application. Specific examples are used herein to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of this application.

Claims

1. A method for organizing and generating memory debugging information, characterized in that: include: Obtaining a specified file; wherein the specified file is a file in a specified file range in the storage device management system; generating and storing target storage information for each of the specified files based on the extracted file data definitions of each of the specified files; wherein the target storage information for a specified file of a nested composite type includes composite type matching information, the composite type matching information including at least one of non-nested composite type matching information for intra-file matching, member composite type matching information for header file matching, and full-file member matching information; Generate memory debugging combination information corresponding to the specified file according to the target storage information; The method generates and stores target storage information of each of the designated files based on the extracted file data definitions, including: extracting the file data definitions of each of the designated files; determining and storing the target file data and summary information of each of the target designated files based on the file data definitions of each of the target designated files; wherein the target designated files are designated files whose data types in the file data definitions include nested composite types; the target file data include header files, nested composite types and member composite types, and the summary information includes header file storage address information, nested composite type storage address information and member composite type index; matching the respective nested composite types based on the non-nested composite types in the file data definitions of each of the target designated files to determine the non-nested composite type matching information; matching the member composite types in the file data definitions of the associated designated files based on the header files of each of the target designated files to determine the member composite type matching information; performing member matching using the composite types in the file data definitions of each of the target designated files to determine the full file member matching information.

2. The method for organizing and generating memory debugging information according to claim 1, characterized in that: After extracting the file data definition of each of the specified files, the method further includes: Memory debugging information of each non-target designated file is generated according to the file data definition of each non-target designated file; wherein, the non-target designated file includes a designated file whose data type in the file data definition includes a basic type or a non-nested composite type; and the target storage information of the designated file of the basic type or the non-nested composite type includes the memory debugging information.

3. The method for organizing and generating memory debugging information according to claim 1, characterized in that: Extracting the file data definition of each of the specified files includes: Using the main thread to allocate a first sub-thread corresponding to each of the designated files; wherein each of the first sub-threads corresponds to a different designated file; The first sub-thread is utilized to extract the file data definitions of the designated files in parallel and store them in the first temporary data areas corresponding to the designated files.

4. The method for organizing and generating memory debugging information according to claim 3, characterized in that: Utilizing the first sub-thread, extracting file data definitions of the designated files in parallel to their corresponding first temporary data areas, including: Utilizing the current first thread, extracting the file data definition of the current designated file into the corresponding first temporary data area, and recording thread binding information; wherein the thread binding information includes the extraction result, the current designated file being any of the designated files, and the current first thread being the first thread corresponding to the current designated file; If the extraction result is extraction failure, the current first thread is used to reclaim the first temporary data area corresponding to the current specified file, and a new first temporary data area corresponding to the current specified file is applied for, and the steps of using the current first thread to extract the file data definition of the current specified file to the corresponding first temporary data area and record the thread binding information are executed; wherein, the storage space of the recovered first temporary data area is half of the storage space of the new first temporary data area.

5. The method for organizing and generating memory debugging information according to claim 3, characterized in that: At any moment, the number of the first sub-threads is less than or equal to a thread number threshold; the thread number threshold is a threshold determined based on the quotient of the pre-allocated memory size and the preset single file requirement size, the pre-allocated memory size is the product of the remaining memory size and a preset parameter, and the preset parameter is less than 1.

6. The method for organizing and generating memory debugging information according to claim 3, characterized in that: According to the file data definition of each target specified file, the target file data and summary information of each target specified file are determined and stored, including: The first sub-thread is utilized to determine and store the target file data and summary information of the corresponding target designated files according to the file data definition of the corresponding target designated files in the first temporary data area.

7. The method for organizing and generating memory debugging information according to claim 1, characterized in that: According to the non-nested composite types in the file data definition of each target specified file, matching the respective nested composite types and determining the non-nested composite type matching information includes: Using the main thread, allocating a first target number of second threads to the current target specified file according to the number of nested composite types in the file data definition of the current target specified file; wherein the current target specified file is any of the target specified files, and the first target number is greater than or equal to 2 and less than or equal to a single-file thread number threshold; Utilizing the first second thread, extracting the non-nested composite type in the data definition of the current target specified file to the corresponding second temporary data area; Utilize the remaining second threads to read non-nested composite types from the second temporary data area in sequence, traverse and match the corresponding nested composite types; if the match is successful, update the non-nested composite type matching information.

8. The method for organizing and generating memory debugging information according to claim 7, characterized in that: Utilizing the remaining second threads to sequentially read non-nested composite types from the second temporary data area, and after traversing and matching the corresponding nested composite types, further comprising: If the nested composite types corresponding to all the remaining second threads are matched to the corresponding non-nested composite types, then performing the step of generating the memory debugging combination information corresponding to the designated file according to the target storage information; If at least one nested composite type corresponding to any of the remaining second threads does not match a corresponding non-nested composite type, the step of matching the member composite type in the file data definition of the associated designated file according to the header file of each target designated file and determining the member composite type matching information is executed.

9. The method for organizing and generating memory debugging information according to claim 1, wherein: According to the header file of each target designated file, the member composite type in the file data definition of the associated designated file is matched to determine the member composite type matching information, including: Using the main thread, assigning a corresponding third sub-thread to each header file of the current target specified file; wherein each of the third sub-threads corresponds to a different header file; Using the third sub-thread, traverse the member composite types of each stored target specified file and match them with the corresponding header files; if the match is successful, update the non-nested composite type matching information, and if a header file exists in the successfully matched header file, record the header file in the successfully matched header file as a sub-header file; After all header files of the current target specified file are traversed, the main thread is used to determine whether a target sub-header file exists; wherein the target sub-header file includes the sub-header file that is not successfully matched to the current target specified file; If yes, use the main thread to allocate a corresponding third sub-thread to each of the target sub-header files; Utilize the third sub-thread to traverse the member composite types of each stored target specified file and match them with the corresponding target sub-header file; if the match is successful, update the non-nested composite type matching information, and when a header file exists in the successfully matched sub-header file, record the header file in the successfully matched sub-header file as a sub-header file, and execute the step of using the main thread to determine whether the target sub-header file exists.

10. The method for organizing and generating memory debugging information according to claim 1, characterized in that: Performing member matching using the composite type in the file data definition of each target specified file to determine the full file member matching information includes: Using the main thread, assigning a corresponding fourth sub-thread to each of the target designated files; wherein each of the fourth sub-threads corresponds to a different target designated file; Utilizing the fourth sub-thread, extracting in parallel the composite types in the file data definitions of the target designated files into the corresponding third temporary data areas; Allocating a second target number of fifth threads to the current target designated file using the main thread; wherein the current target designated file is any of the target designated files; The fifth thread is used to traverse the composite types in the third temporary data area corresponding to the current target designated file and match them with the member types of the corresponding designated files; if the match is successful, the full file member matching information of the current target designated file is updated.

11. The method for organizing and generating memory debugging information according to any one of claims 1 to 10, characterized in that: Get the specified file, including: Obtaining the designated file and manually assembling debugging information according to the received debugging information verification instruction; Correspondingly, after generating the memory debugging combination information corresponding to the specified file according to the target storage information, the method further includes: Verifying the manually assembled debugging information using the memory debugging combination information to obtain a verification result; If the verification result is failure, an alarm message will be output.

12. The method for organizing and generating memory debugging information according to claim 11, characterized in that: Verifying the manually assembled debugging information using the memory debugging combination information to obtain a verification result includes: The manually assembled debugging information is verified according to the memory debugging combination information and the placeholders of the basic types and / or the placeholders and offsets of the composite types of the manually assembled debugging information to obtain a verification result.

13. A memory debugging information organization and generation device, characterized in that: include: An information collection module is used to obtain a specified file; wherein the specified file is a file in a specified file range in the storage device management system; a dependency analysis module, configured to generate and store target storage information for each of the specified files based on the extracted file data definitions of each of the specified files; wherein the target storage information for a specified file of a nested composite type includes composite type matching information, wherein the composite type matching information includes at least one of non-nested composite type matching information for intra-file matching, member composite type matching information for header file matching, and full-file member matching information; A debugging generation module, configured to generate memory debugging combination information corresponding to the specified file according to the target storage information; The dependency analysis module is specifically used to extract the file data definition of each of the designated files; determine and store the target file data and summary information of each target designated file according to the file data definition of each target designated file; wherein, the target designated file is a designated file whose data type in the file data definition includes a nested composite type; the target file data includes a header file, a nested composite type and a member composite type, and the summary information includes header file storage address information, nested composite type storage address information and member composite type index; match the respective nested composite types according to the non-nested composite types in the file data definition of each of the target designated files, and determine the non-nested composite type matching information; match the member composite types in the file data definition of the associated designated file according to the header file of each of the target designated files, and determine the member composite type matching information; perform member matching using the composite types in the file data definition of each of the target designated files, and determine the full file member matching information.

14. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the method for organizing and generating memory debugging information according to any one of claims 1 to 12 when executing the computer program.

Citation Information

Patent Citations

  • System fault debugging method and device

    CN108241545A

  • Debugging information output method and device, electronic equipment and storage medium

    CN111694704A