A method and device for locating software toolkit address

By using link mapping files and the name information of the software development toolkit, searching and integrating symbol information to determine the address of the software toolkit, the problem of difficulty in locating component addresses in application crash monitoring is solved, and an efficient, code-free invasive address location method is realized.

CN114296978BActive Publication Date: 2025-05-16DOUYIN VISION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111618284.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-05-16
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

In application crash monitoring, it is difficult to locate the address of a specific component, which makes it difficult to judge the component to which the crash address belongs. The existing methods operate complexly and inefficiently.

Method used

By obtaining the application link mapping file and the name information of the software development toolkit, find the symbol information of the executable file corresponding to the software development toolkit, and determine the address information of the software development toolkit based on the starting address of the symbol information and the storage space occupied.

Benefits of technology

It implements intrusive location of the address information of the software toolkit without code, simplifies the operation process, improves efficiency, and accurately locates the target software development toolkit when the application crashes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114296978B_ABST
    Figure CN114296978B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method for locating the address of a software toolkit, which first obtains the link mapping file of an application and the name information of at least one software development toolkit of the application; then, based on the name information of each software development toolkit, searches the link mapping file for the symbol information of each executable file corresponding to the software development toolkit; finally, based on the starting address and storage space occupied size indicated by each symbol information found, determines the address information of the software development toolkit. The embodiment of the present disclosure searches for the symbol information of the executable file corresponding to the software development toolkit based on the link mapping file and the name information of the software development toolkit, and then determines the address information of the software development toolkit based on the starting address and storage space occupied size of the symbol information, without the need to modify each SDK code, which is convenient and fast, and has no code intrusion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method and device for locating a software toolkit address. Background Art

[0002] When monitoring the crash of an application, the application is usually monitored as a whole, that is, usually only the application that crashed is determined, and it is difficult to locate the address of the specific component that crashed. The reason is that it is difficult to determine the address range corresponding to the component, and then it is difficult to determine the component to which the crash address belongs. In an application, components usually exist in the form of a software development kit (SDK). If you want to determine the address information of the SDK, you need to add new source files to each SDK. This process is complicated and requires developers to add it manually, which is inefficient and easily leads to unreliable results after the code is rearranged in binary. Summary of the invention

[0003] The embodiments of the present disclosure at least provide a method and device for locating a software toolkit address.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for locating a software toolkit address, comprising:

[0005] Obtaining a link mapping file of an application and name information of at least one software development kit of the application;

[0006] Based on the name information of each software development kit, searching the link map file for the symbol information of each executable file corresponding to the software development kit;

[0007] Based on the starting address and the size of the storage space occupied indicated by each symbol information found, the address information of the software development kit is determined.

[0008] In an optional implementation manner, the method further includes:

[0009] When an application crash is detected, the target address where the crash occurred is obtained;

[0010] Based on the address space offset of the application when the crash occurs and the address information of the at least one software development kit, respectively determine the absolute address of each software development kit after the address space offset;

[0011] A target software development kit where the application crashes is determined based on the target address and the absolute address.

[0012] In an optional implementation, searching the link map file for symbol information of each executable file corresponding to the software development kit based on the name information of each software development kit includes:

[0013] Based on the name information of the software development kit, searching for each executable file corresponding to the software development kit from the link mapping file, and determining identification information assigned to each executable file;

[0014] Based on the identification information, the symbol information of each executable file corresponding to the software development kit is searched from the link mapping file.

[0015] In an optional implementation, searching the link map file for symbol information of each executable file corresponding to the software development kit based on the identification information includes:

[0016] Filtering out a plurality of candidate symbol information from the symbol information in the symbol information list according to the type information of each symbol in the symbol information list of the link mapping file;

[0017] From the candidate symbol information, symbol information matching the identification information of each executable file corresponding to the software development kit is searched as the symbol information of each executable file.

[0018] In an optional implementation, determining the address information of the software development kit based on the start address and the storage space occupied by each symbol information found includes:

[0019] Determine the address range corresponding to each symbol based on the starting address and storage space occupation information in the symbol information;

[0020] Integrate the address ranges of the symbols to obtain at least one target address range; each target address range is composed of the address range of at least one symbol;

[0021] Based on the software development kit to which the symbol corresponding to the at least one target address range belongs, address information of at least one software development kit of the application is determined.

[0022] In an optional implementation manner, the integrating the address ranges of the various symbols to obtain at least one target address range includes:

[0023] Based on the start address and the end address indicated by the address range of each symbol, if the end address of any symbol is adjacent to the start address of other symbols, the address ranges of any symbol and the other symbols are integrated to obtain at least one target address range; or,

[0024] Based on the line number of each symbol information in the link mapping file, the address ranges of symbols with corresponding adjacent line numbers are integrated to obtain at least one target address range.

[0025] In a second aspect, an embodiment of the present disclosure further provides a software toolkit address locating device, including:

[0026] An acquisition module, used for acquiring a link mapping file of an application and name information of at least one software development kit of the application;

[0027] A search module, used for searching the link map file for the symbol information of each executable file corresponding to the software development kit based on the name information of each software development kit;

[0028] The positioning module is used to determine the address information of the software development kit based on the starting address and the storage space occupied by each symbol information found.

[0029] In an optional implementation manner, the positioning module is further used for:

[0030] When an application crash is detected, the target address where the crash occurred is obtained;

[0031] Based on the address space offset of the application when the crash occurs and the address information of the at least one software development kit, respectively determine the absolute address of each software development kit after the address space offset;

[0032] A target software development kit where the application crashes is determined based on the target address and the absolute address.

[0033] In an optional implementation manner, the search module is specifically used to:

[0034] Based on the name information of the software development kit, searching for each executable file corresponding to the software development kit from the link mapping file, and determining identification information assigned to each executable file;

[0035] Based on the identification information, the symbol information of each executable file corresponding to the software development kit is searched from the link mapping file.

[0036] In an optional implementation, when the search module searches for symbol information of each executable file corresponding to the software development kit from the link map file based on the identification information, it is configured to:

[0037] Filtering out a plurality of candidate symbol information from the symbol information in the symbol information list according to the type information of each symbol in the symbol information list of the link mapping file;

[0038] From the candidate symbol information, symbol information matching the identification information of each executable file corresponding to the software development kit is searched as the symbol information of each executable file.

[0039] In an optional implementation, when determining the address information of the software development kit based on the starting address and the storage space occupied by each symbol information found, the positioning module is used to:

[0040] Determine the address range corresponding to each symbol based on the starting address and storage space occupation information in the symbol information;

[0041] Integrate the address ranges of the symbols to obtain at least one target address range; each target address range is composed of the address range of at least one symbol;

[0042] Based on the software development kit to which the symbol corresponding to the at least one target address range belongs, address information of at least one software development kit of the application is determined.

[0043] In an optional implementation manner, when the positioning module integrates the address ranges of the various symbols to obtain at least one target address range, it is used to:

[0044] Based on the start address and the end address indicated by the address range of each symbol, if the end address of any symbol is adjacent to the start address of other symbols, the address ranges of any symbol and the other symbols are integrated to obtain at least one target address range; or,

[0045] Based on the line number of each symbol information in the link mapping file, the address ranges of symbols with corresponding adjacent line numbers are integrated to obtain at least one target address range.

[0046] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.

[0047] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.

[0048] The software toolkit address positioning method and device provided by the embodiment of the present disclosure first obtains the link mapping file of the application and the name information of at least one software development toolkit of the application; then, based on the name information of each software development toolkit, searches the link mapping file for the symbol information of each executable file corresponding to the software development toolkit; finally, based on the starting address and storage space occupied size indicated by each symbol information found, determines the address information of the software development toolkit. The embodiment of the present disclosure searches for the symbol information of the executable file corresponding to the software development toolkit based on the link mapping file and the name information of the software development toolkit, and then determines the address information of the software development toolkit based on the starting address and storage space occupied size of the symbol information, without the need to modify each SDK code, which is convenient and fast, and has no code intrusion.

[0049] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0051] Figure 1 A flowchart of a method for locating a software toolkit address provided by an embodiment of the present disclosure is shown;

[0052] Figure 2 A flowchart of another software toolkit address locating method provided by an embodiment of the present disclosure is shown;

[0053] Figure 3 A schematic diagram of a software toolkit address locating device provided by an embodiment of the present disclosure is shown;

[0054] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0056] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0057] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0058] After research, it was found that if you want to determine the address information of the SDK, you need to add two source files to the SDK and adjust the compilation and linking order of the source files so that the two added source files are the first and last to be compiled and linked. In this way, the address of the SDK can be determined based on the addresses of the two added source files. However, this method is cumbersome and inefficient, and it is easy to make the results of the code unreliable after binary rearrangement.

[0059] Based on the above research, the present invention provides a method and device for locating the address of a software toolkit. According to the link mapping file and the name information of the software development toolkit, the symbol information of the executable file corresponding to the software development toolkit is found, and then the address information of the software development toolkit is determined according to the starting address of the symbol information and the size of the storage space occupied. There is no need to modify each SDK code, which is convenient, fast and non-code invasive.

[0060] To facilitate understanding of this embodiment, a software toolkit address location method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the software toolkit address location method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities. In some possible implementations, the method can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0061] See also Figure 1 FIG. 1 is a flowchart of a method for locating a software toolkit address provided by an embodiment of the present disclosure, the method comprising steps S101 to S103, wherein:

[0062] S101: Acquire a link mapping file of an application and name information of at least one software development kit of the application.

[0063] In this step, the above-mentioned application can be a program running under the iOS system, and can include multiple components. The components can be expressed in the form of SDK. Each SDK has corresponding name information (that is, identification information). The link map file can be an intermediate product generated when the source file of the application is compiled. In the process of compiling the source file into an executable binary file, a link map (Link Map) file is usually generated. The file can show the overall picture of the entire executable file, list the information of each compiled target file, and the code segment and data segment storage details of each target file. The target file can be an executable file with the suffix .o and a static library file with the suffix .a.

[0064] S102: Based on the name information of each software development kit, searching the link mapping file for symbol information of each executable file corresponding to the software development kit.

[0065] The link map file stores information about each executable file in the application. The executable file information can be used to determine the symbol information of each executable file. The symbol information usually includes the address information of the symbol.

[0066] For example, since the link mapping file records the information of each executable file, the information of the executable file usually includes the name information of the SDK to which it belongs. Therefore, based on the name information of the software development kit, the executable files included in the software development kit can be searched from the link mapping file, the location of the SDK name information can be found, and then the executable file to which the location belongs can be determined, and then the identification information assigned to the executable file can be determined from the information of the executable file.

[0067] Usually, an SDK can be compiled into multiple executable files, each executable file can have corresponding symbols. The link mapping file also includes information about each symbol. The symbol information includes identification information of the executable file corresponding to the symbol. In this way, the identification information of the above executable file can be searched in the link mapping file to locate the symbol information corresponding to the symbol of the executable file.

[0068] Since some SDK architectures do not support link map files, you can first filter the SDKs to exclude those that do not support link map files and only obtain the name information of SDKs that support link map files to reduce consumption of computing resources.

[0069] When determining the executable file corresponding to the SDK, the executable file of the SDK (such as the file with the suffix .o) can be filtered out from the object files Objectfiles in the link mapping file. For example, each line of data in the object file records the path of the executable file linked into the application product, and a number (identification information) is assigned to the information. In this way, the path containing the SDK name information can be obtained, thereby determining the numbers corresponding to these paths.

[0070] Afterwards, after obtaining the identification information of the executable files corresponding to each SDK, you can read the symbols in the link mapping file. This part stores the symbol information corresponding to the application, including the starting address of the symbol, the size of the storage space occupied, the identification information of the executable file to which it belongs, the symbol name, etc. You can locate the symbol information corresponding to the executable file based on the identification information of the executable file of the SDK found above, and obtain the symbol information of the symbol corresponding to the executable file.

[0071] Here, for some symbols, such as literal string, CFString, etc., these symbols will not appear directly in the crash stack and cannot provide a reference for crash detection. Therefore, when locating the SDK address for the purpose of crash location, the symbol information of these symbols may not be collected. According to the type information of each symbol in the symbol information list of the link mapping file, multiple candidate symbol information is first screened out from the symbol information in the symbol information list, and then the symbol information that matches the identification information of the executable file is searched from the candidate symbol information, which can effectively improve efficiency and reduce the consumption of computing resources.

[0072] Furthermore, when searching for symbol information, you can use the Gloabal Search Regular Expression and Print out the line (grep) command. Since the SDK may contain a large number of executable files, if all identification information is searched and filtered, it may cause memory overflow. To avoid this, you can perform group search, thereby reducing the data loaded in one search and reducing the computing pressure. When searching in groups, in order to avoid affecting the performance of the subsequent determination of the SDK address information, you can sort the filtered symbol information to prevent the order from being disrupted and consuming more computing resources for sorting.

[0073] S103: Determine the address information of the software development kit based on the start address and the size of the storage space occupied by each symbol information found.

[0074] In this step, the address length occupied by the symbol can be determined according to the size of the storage space occupied by the symbol, and then the address range of the symbol can be determined based on the starting address and the address length. The address range corresponding to each symbol can be determined based on the starting address and storage space occupation information in each symbol information. Usually an SDK will contain multiple symbols, and the symbols of an SDK are usually continuous. Therefore, the address ranges of each symbol can be integrated, and the continuous symbol addresses can be integrated together to obtain at least one target address range. The obtained target address range is composed of the address range of at least one symbol.

[0075] Exemplarily, based on the starting address and ending address indicated by the address range of each symbol, if the ending address of any symbol is adjacent to the starting address of other symbols, the above symbols are considered to be continuous symbols. After all continuous symbols are determined, the address ranges of continuous symbols can be integrated to obtain at least one target address range.

[0076] However, the above method needs to compare the starting address of each symbol with the ending address of other symbols, which involves a large amount of calculation and may have a certain impact on the performance of the device. Therefore, the address range can be integrated without using the starting address and ending address of the symbol. Instead, the address range can be integrated by using the number of lines in the link mapping file where the starting address and ending address of each symbol information are located. In the link mapping file, the symbol information itself is arranged in order of position. The corresponding symbols of symbol information with continuous lines are also continuous. Therefore, the line numbers of two symbol information in the link mapping file can be judged. If the line numbers corresponding to the two symbol information are adjacent, it can be determined that the two are also continuous, and their corresponding address ranges can be integrated. The integrated address range can continue to be integrated with the address ranges of other symbols to finally obtain the target address range.

[0077] Moreover, in some architectures, such as the armv7 architecture, due to the existence of the memory alignment mechanism, some consecutive symbol addresses are not necessarily consecutive, that is, there will be some empty bytes between two symbols. The address range is integrated according to the number of rows, and the target address range obtained is usually lower than the number obtained by integrating the start address and the end address, which is beneficial for subsequent use.

[0078] In this way, the target address range that is the same as the SDK to which it belongs can be used as the corresponding SDK address information.

[0079] Both of the above methods can be used to determine the target address range, and the specific method to be used can be selected based on the requirements of accuracy and performance.

[0080] After obtaining the address information of each SDK, the obtained address information can be used to locate the exception. For example, when an application crash is detected, the target memory address of the crash recorded in the crash stack can be obtained, and then the address information of each SDK is offset based on the address space offset of the application when the crash occurs, and the absolute address of each SDK after the address offset is determined. The absolute address is usually one or more address ranges. After obtaining the absolute address, it can be determined whether the target address is within a certain absolute address, and the crash can be located based on the judgment result to determine the target software development kit where the crash occurred in the application.

[0081] The software toolkit address location method provided by the embodiment of the present disclosure first obtains the link mapping file of the application and the name information of at least one software development toolkit of the application; then, based on the name information of each software development toolkit, the symbol information of each executable file corresponding to the software development toolkit is searched from the link mapping file; finally, based on the starting address and storage space occupied size indicated by each symbol information found, the address information of the software development toolkit is determined. The embodiment of the present disclosure finds the symbol information of the executable file corresponding to the software development toolkit according to the link mapping file and the name information of the software development toolkit, and then determines the address information of the software development toolkit according to the starting address and storage space occupied size of the symbol information, without the need to modify each SDK code, which is convenient and fast, and has no code intrusion.

[0082] See also Figure 2 As shown, it is a flow chart of another method for locating the address of a software toolkit provided by an embodiment of the present disclosure. First, a script for crash location needs to be accessed to the source code of the application. The accessed script can monitor the running status of the application, obtain the target memory address when a crash occurs, and execute instructions to locate the SDK where the crash occurs. After the script is accessed, the application can be packaged, and a link mapping Link Map file is generated during the packaging process. After the link mapping file is obtained, the link mapping file can be processed, and the identification information of the executable file can be found from the link mapping file, and then the symbol information of the SDK can be found using the found identification information. Finally, the address range is integrated using the found symbol information to obtain the address information of each SDK, and the address information is written into the packaged application. Exemplarily, the address information of the determined SDK can be written into the plist file. When the packaged application is running, if a crash occurs, the accessed script can be used to obtain the target memory address where the crash occurred, and the crash can be located according to the address information of the SDK to locate the specific SDK.

[0083] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0084] Based on the same inventive concept, the embodiment of the present disclosure also provides a software toolkit address locating device corresponding to the software toolkit address locating method. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned software toolkit address locating method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0085] Reference Figure 3FIG. 1 is a schematic diagram of a software toolkit address location provided by an embodiment of the present disclosure, wherein the device includes:

[0086] An acquisition module 310, configured to acquire a link mapping file of an application and name information of at least one software development kit of the application;

[0087] A search module 320, configured to search the link map file for symbol information of each executable file corresponding to the software development kit based on the name information of each software development kit;

[0088] The positioning module 330 is used to determine the address information of the software development kit based on the starting address and the storage space occupied by each symbol information found.

[0089] In an optional implementation manner, the positioning module 330 is further used to:

[0090] When an application crash is detected, the target address where the crash occurred is obtained;

[0091] Based on the address space offset of the application when the crash occurs and the address information of the at least one software development kit, respectively determine the absolute address of each software development kit after the address space offset;

[0092] A target software development kit where the application crashes is determined based on the target address and the absolute address.

[0093] In an optional implementation manner, the search module 320 is specifically used to:

[0094] Based on the name information of the software development kit, searching for each executable file corresponding to the software development kit from the link mapping file, and determining identification information assigned to each executable file;

[0095] Based on the identification information, the symbol information of each executable file corresponding to the software development kit is searched from the link mapping file.

[0096] In an optional implementation, when searching for symbol information of each executable file corresponding to the software development kit from the link map file based on the identification information, the search module 320 is used to:

[0097] Filtering out a plurality of candidate symbol information from the symbol information in the symbol information list according to the type information of each symbol in the symbol information list of the link mapping file;

[0098] From the candidate symbol information, symbol information matching the identification information of each executable file corresponding to the software development kit is searched as the symbol information of each executable file.

[0099] In an optional implementation, when determining the address information of the software development kit based on the starting address and the storage space occupied by each symbol information found, the positioning module 330 is used to:

[0100] Determine the address range corresponding to each symbol based on the starting address and storage space occupation information in the symbol information;

[0101] Integrate the address ranges of the symbols to obtain at least one target address range; each target address range is composed of the address range of at least one symbol;

[0102] Based on the software development kit to which the symbol corresponding to the at least one target address range belongs, address information of at least one software development kit of the application is determined.

[0103] In an optional implementation manner, when the positioning module 330 integrates the address ranges of the various symbols to obtain at least one target address range, it is configured to:

[0104] Based on the start address and the end address indicated by the address range of each symbol, if the end address of any symbol is adjacent to the start address of other symbols, the address ranges of any symbol and the other symbols are integrated to obtain at least one target address range; or,

[0105] Based on the line number of each symbol information in the link mapping file, the address ranges of symbols with corresponding adjacent line numbers are integrated to obtain at least one target address range.

[0106] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0107] Corresponds to Figure 1 The software toolkit address location method in the present disclosure also provides an electronic device 400, such as Figure 4 FIG. 4 is a schematic diagram of the structure of an electronic device 400 provided in an embodiment of the present disclosure, including:

[0108] Processor 41, memory 42, and bus 43; memory 42 is used to store execution instructions, including internal memory 421 and external memory 422; the internal memory 421 is also called internal memory, which is used to temporarily store the operation data in the processor 41 and the data exchanged with the external memory 422 such as a hard disk. The processor 41 exchanges data with the external memory 422 through the internal memory 421. When the electronic device 400 is running, the processor 41 communicates with the memory 42 through the bus 43, so that the processor 41 executes the following instructions:

[0109] Obtaining a link mapping file of an application and name information of at least one software development kit of the application;

[0110] Based on the name information of each software development kit, searching the link map file for the symbol information of each executable file corresponding to the software development kit;

[0111] Based on the starting address and the size of the storage space occupied indicated by each symbol information found, the address information of the software development kit is determined.

[0112] In an optional implementation manner, the processor 41 is further configured to execute:

[0113] When an application crash is detected, the target address where the crash occurred is obtained;

[0114] Based on the address space offset of the application when the crash occurs and the address information of the at least one software development kit, respectively determine the absolute address of each software development kit after the address space offset;

[0115] A target software development kit where the application crashes is determined based on the target address and the absolute address.

[0116] In an optional implementation manner, in the instructions executed by the processor 41, searching the link map file for symbol information of each executable file corresponding to the software development kit based on the name information of each software development kit includes:

[0117] Based on the name information of the software development kit, searching for each executable file corresponding to the software development kit from the link mapping file, and determining identification information assigned to each executable file;

[0118] Based on the identification information, the symbol information of each executable file corresponding to the software development kit is searched from the link mapping file.

[0119] In an optional implementation manner, in the instructions executed by the processor 41, searching the link map file for symbol information of each executable file corresponding to the software development kit based on the identification information includes:

[0120] Filtering out a plurality of candidate symbol information from the symbol information in the symbol information list according to the type information of each symbol in the symbol information list of the link mapping file;

[0121] From the candidate symbol information, symbol information matching the identification information of each executable file corresponding to the software development kit is searched as the symbol information of each executable file.

[0122] In an optional implementation manner, in the instructions executed by the processor 41, determining the address information of the software development kit based on the starting address and the storage space occupied by each symbol information found includes:

[0123] Determine the address range corresponding to each symbol based on the starting address and storage space occupation information in the symbol information;

[0124] Integrate the address ranges of the symbols to obtain at least one target address range; each target address range is composed of the address range of at least one symbol;

[0125] Based on the software development kit to which the symbol corresponding to the at least one target address range belongs, address information of at least one software development kit of the application is determined.

[0126] In an optional implementation manner, in the instruction executed by the processor 41, the address ranges of the symbols are integrated to obtain at least one target address range, including:

[0127] Based on the start address and the end address indicated by the address range of each symbol, if the end address of any symbol is adjacent to the start address of other symbols, the address ranges of any symbol and the other symbols are integrated to obtain at least one target address range; or,

[0128] Based on the line number of each symbol information in the link mapping file, the address ranges of symbols with corresponding adjacent line numbers are integrated to obtain at least one target address range.

[0129] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the software toolkit address location method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0130] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the software toolkit address location method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.

[0131] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).

[0132] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0133] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0134] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0135] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as 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.

[0136] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A method for locating a software toolkit address, characterized in that: include: Obtaining a link mapping file of an application and name information of at least one software development kit of the application; Based on the name information of each software development kit, searching the link map file for the symbol information of each executable file corresponding to the software development kit; Based on the starting address and the size of the storage space occupied by each symbol information found, the address information of the software development kit is determined, Wherein, determining the address information of the software development kit based on the starting address and the storage space occupied by each symbol information found includes: Determine the address range corresponding to each symbol based on the starting address and storage space occupation information in the symbol information; Integrate the address ranges of the symbols to obtain at least one target address range; each target address range is composed of the address range of at least one symbol; Based on the software development kit to which the symbol corresponding to the at least one target address range belongs, address information of at least one software development kit of the application is determined.

2. The method according to claim 1, characterized in that The method further comprises: When an application crash is detected, the target address where the crash occurred is obtained; Based on the address space offset of the application when the crash occurs and the address information of the at least one software development kit, respectively determine the absolute address of each software development kit after the address space offset; A target software development kit where the application crashes is determined based on the target address and the absolute address.

3. The method according to claim 1, characterized in that The step of searching the link map file for symbol information of each executable file corresponding to the software development kit based on the name information of each software development kit includes: Based on the name information of the software development kit, searching for each executable file corresponding to the software development kit from the link mapping file, and determining identification information assigned to each executable file; Based on the identification information, the symbol information of each executable file corresponding to the software development kit is searched from the link mapping file.

4. The method according to claim 3, characterized in that The searching, based on the identification information, from the link map file for symbol information of each executable file corresponding to the software development kit comprises: Filtering out a plurality of candidate symbol information from the symbol information in the symbol information list according to the type information of each symbol in the symbol information list of the link mapping file; From the candidate symbol information, symbol information matching the identification information of each executable file corresponding to the software development kit is searched as the symbol information of each executable file.

5. The method according to claim 1, characterized in that The step of integrating the address ranges of the symbols to obtain at least one target address range includes: Based on the start address and the end address indicated by the address range of each symbol, if the end address of any symbol is adjacent to the start address of other symbols, the address ranges of any symbol and the other symbols are integrated to obtain at least one target address range; or, Based on the line number of each symbol information in the link mapping file, the address ranges of symbols with corresponding adjacent line numbers are integrated to obtain at least one target address range.

6. A software toolkit address locating device, characterized in that: include: An acquisition module, used for acquiring a link mapping file of an application and name information of at least one software development kit of the application; A search module, used for searching the link map file for the symbol information of each executable file corresponding to the software development kit based on the name information of each software development kit; A positioning module is used to determine the address information of the software development kit based on the starting address and storage space occupied by each symbol information found, Wherein, the positioning module is further used for: Determine the address range corresponding to each symbol based on the starting address and storage space occupation information in the symbol information; Integrate the address ranges of the symbols to obtain at least one target address range; each target address range is composed of the address range of at least one symbol; Based on the software development kit to which the symbol corresponding to the at least one target address range belongs, address information of at least one software development kit of the application is determined.

7. The device according to claim 6, characterized in that The positioning module is also used for: When an application crash is detected, the target address where the crash occurred is obtained; Based on the address space offset of the application when the crash occurs and the address information of the at least one software development kit, respectively determine the absolute address of each software development kit after the address space offset; A target software development kit where the application crashes is determined based on the target address and the absolute address.

8. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the software toolkit address location method as described in any one of claims 1 to 5 are performed.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the software toolkit address locating method as claimed in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for dynamically loading relocatable file

    CN101697131A

  • Techniques to prelink software to improve memory de-duplication in a virtual system

    CN103975303A