CN111506491A - Information processing method and device, storage medium and processor - Google Patents

Information processing method and device, storage medium and processor Download PDF

Info

Publication number
CN111506491A
CN111506491A CN201910100240.1A CN201910100240A CN111506491A CN 111506491 A CN111506491 A CN 111506491A CN 201910100240 A CN201910100240 A CN 201910100240A CN 111506491 A CN111506491 A CN 111506491A
Authority
CN
China
Prior art keywords
information
symbol table
symbol
debugging
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910100240.1A
Other languages
Chinese (zh)
Other versions
CN111506491B (en
Inventor
赵树起
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201910100240.1A priority Critical patent/CN111506491B/en
Publication of CN111506491A publication Critical patent/CN111506491A/en
Application granted granted Critical
Publication of CN111506491B publication Critical patent/CN111506491B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3628Software debugging of optimised code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses an information processing method and device, a storage medium and a processor. Wherein, the method comprises the following steps: compiling a source code, and storing a compiled symbol table into a symbol database, wherein the symbol table is used for recording debugging information between the source code and a program corresponding to the source code; determining index information of the symbol table based on the position information of the symbol table in the symbol database; and generating a distribution file of the program based on the compiled object code and the index information of the symbol table. The invention solves the technical problem that the object code generated during compiling the source code carries redundant debugging information in the related technology.

Description

Information processing method and device, storage medium and processor
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an information processing method and apparatus, a storage medium, and a processor.
Background
At present, after application software is developed, the application software needs to be compiled and debugged, for example, for the problem of application program segment errors and the like, the compilation is usually signed. In normal signed compilation, debug symbols will exist with the object code, possibly resulting in redundancy of the symbol table. For example, a CPP file includes a plurality of header files, and the debug information of each header file is stored in a plurality of object codes. This redundancy is further amplified during the linking stage, e.g., the same library may exist in multiple programs, each with a complete copy of the debug symbol. This leads to the following two problems: first, a problem of compiling, that is, many files are included in a plurality of programs or even in each final program for more complete code testing at the time of compiling, especially, basic library files, results in a large amount of repeated data in a symbol table, such as correspondence between symbols and files. By analyzing some programs, it was found that the file sizes containing symbols and removed symbols differ by a factor of 10. Secondly, the issue is a problem that the issue fails due to too large issue packages in the process of issuing the object code. To circumvent this problem, symbols are usually removed entirely in the related art. The full program content is stored in the release repository. When each project file is frequently called, a large amount of extra storage cost needs to be paid for this.
To solve the problem, the related art proposes two solutions, namely firstly, no symbol table is generated during compiling, and the option of generating the symbol table by a compiler is closed to avoid the influence of the symbol table on the size of the program, but the problem is that the complexity of debugging the program is very high, and normal debugging cannot be carried out when the program is abnormal, such as an application program segment error.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides an information processing method and device, a storage medium and a processor, which are used for at least solving the technical problem that redundant debugging information is carried in object codes generated during compiling of source codes in the related art.
According to an aspect of an embodiment of the present invention, there is provided an information processing method including: compiling a source code, and storing a compiled symbol table into a symbol database, wherein the symbol table is used for recording debugging information between the source code and a program corresponding to the source code; determining index information of the symbol table based on the position information of the symbol table in the symbol database; and generating a release file of the program based on the compiled object code and the index information of the symbol table.
Further, storing the compiled symbol table into a symbol database includes: storing the compiled symbol table into a symbol database comprises: judging whether the debugging information exists in the symbol database or not; if the target information in the debugging information exists in the symbol database, performing duplicate removal processing on the target information in the debugging information; and storing the debugging information after the deduplication processing into the symbol database.
Further, the performing of the deduplication processing on the target information in the debugging information includes: determining index information of target information in the debugging information in the symbol database; replacing the target information with index information of the target information in the symbol table; and taking the debugging information in the symbol table after replacement as debugging information after deduplication processing.
Further, the method further comprises: after generating a release file of the program based on the compiled generated object code and the index information of the symbol table, acquiring debugging information corresponding to the program from the symbol database through the index information of the symbol table; reconstructing the symbol table based on the acquired debugging information; and debugging the program by adopting the reconstructed symbol table.
Further, the method further comprises: detecting whether a plurality of versions of the program exist after generating a release file of the program based on the compiled generated object code and the index information of the symbol table; if a plurality of versions exist, determining index information in a symbol table of a release file of the programs of the plurality of versions; determining a shared symbol table from the symbol database based on index information in symbol tables of distribution files of the plurality of versions of programs; and determining index information of the shared symbol table based on the position information of the shared symbol table in the symbol database, so that the release files of the programs of the multiple versions share the shared symbol table through the index information of the shared symbol table.
According to another aspect of the embodiments of the present invention, there is also provided an information processing apparatus including: the system comprises a storage unit, a symbol database and a debugging unit, wherein the storage unit is used for compiling a source code and storing a compiled symbol table into the symbol database, and the symbol table is used for recording debugging information between the source code and a program corresponding to the source code; a first determination unit, configured to determine index information of the symbol table according to location information of the symbol table in the symbol database; and the generating unit is used for generating a release file of the program according to the compiled object code and the index information of the symbol table.
Further, the storage unit includes: the judging module is used for judging whether the debugging information exists in the symbol database; the de-duplication processing module is used for performing de-duplication processing on the target information in the debugging information under the condition that the target information in the debugging information exists in the symbol database; and the storage module is used for storing the debugging information after the deduplication processing into the symbol database.
Further, the deduplication processing module comprises: the first determining submodule is used for determining the index information of target information in the debugging information in the symbol database; a substitution submodule for substituting the index information of the target information for the target information in the symbol table; and the second determination submodule is used for taking the substituted debugging information in the symbol table as the debugging information after the deduplication processing.
Further, the apparatus further comprises: an obtaining unit, configured to obtain debugging information corresponding to the program from the symbol database through index information of the symbol table after generating a release file of the program based on the compiled target code and the index information of the symbol table; the reconstruction unit is used for reconstructing the symbol table according to the acquired debugging information; and the debugging unit is used for debugging the program by adopting the reconstructed symbol table.
Further, the apparatus further comprises: a detecting unit configured to detect whether a plurality of versions of the program exist after generating a distribution file of the program based on the compiled object code and the index information of the symbol table; a second determining unit configured to determine, if a plurality of versions exist, index information in a symbol table of a distribution file of the programs of the plurality of versions; a third determination unit configured to determine a shared symbol table from the symbol database based on index information in symbol tables of distribution files of the plurality of versions of programs; a fourth determination unit, configured to determine index information of the shared symbol table according to the location information of the shared symbol table in the symbol database, so that the release files of the multiple versions of programs share the shared symbol table through the index information of the shared symbol table.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute any one of the information processing methods described above.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to execute a program, where the program executes the information processing method described in any one of the above.
In the embodiment of the invention, a symbol table and an object code are separated, a source code is compiled, and the compiled symbol table is stored in a symbol database, wherein the symbol table is used for recording debugging information between the source code and a program corresponding to the source code; determining index information of the symbol table based on the position information of the symbol table in the symbol database; the method and the device have the advantages that the release file of the program is generated based on the index information of the compiled object code and the symbol table, the fine granularity separation of the object code and the debugging information of the application program is achieved, and the debugging information is free of redundancy, so that the technical effect of greatly reducing the size of the file of the object code generated during compiling is achieved, and the technical problem that the object code generated during compiling of the source code in the related technology carries redundant debugging information is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a computer terminal according to the prior art;
FIG. 2 is a flow chart of a method of information processing according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an information processing apparatus according to an embodiment of the present invention; and
fig. 4 is a block diagram of an alternative computer terminal according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
There is also provided, in accordance with an embodiment of the present invention, a method embodiment of information processing, it being noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Fig. 1 shows a hardware configuration block diagram of a computer terminal (or mobile device) for implementing an information processing method. As shown in fig. 1, the computer terminal 10 (or mobile device 10) may include one or more (shown as 102a, 102b, … …, 102 n) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors 102 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuit may be a single stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computer terminal 10 (or mobile device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 104 may be used for storing software programs and modules of application software, such as program instructions/data storage devices corresponding to the () method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the () method of the application program. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Under the above operating environment, the present application provides an information processing method as shown in fig. 2. Fig. 2 is a flowchart of an information processing method according to a first embodiment of the present invention.
Step S101, compiling a source code, and storing a compiled symbol table into a symbol database, wherein the symbol table is used for recording debugging information between the source code and a program corresponding to the source code.
The program described above may be a binary program. It should be noted that, in the information processing method provided in the embodiment of the present application, only necessary logic related to executable code is in the object code during compiling, and other debugging information that should be stored together with the object code is stored in the symbol database.
Step S102, based on the position information of the symbol table in the symbol database, determining the index information of the symbol table.
Step S103, generating a distribution file of the program based on the compiled object code and the index information of the symbol table.
The release file is a software package that can be directly installed. For example, an installation package with the format of. apk. Through the steps, the index information of the symbol table and the target code are separated to generate the release file, and the corresponding symbol table in the release file is associated by the index information, so that the size of the file of the target code generated during compiling can be greatly reduced, and the size of the generated release file can be remarkably reduced. On the other hand, according to the embodiment of the application, a complete symbol table can be reconstructed according to the index information, and problem debugging is not affected.
According to the information processing method provided by the embodiment of the application, a symbol table and an object code are separated, a source code is compiled, and the compiled symbol table is stored in a symbol database, wherein the symbol table is used for recording debugging information between the source code and a program corresponding to the source code; determining index information of the symbol table based on the position information of the symbol table in the symbol database; the method and the device have the advantages that the release file of the program is generated based on the index information of the compiled object code and the symbol table, the fine granularity separation of the object code and the debugging information of the application program is achieved, and the debugging information is free of redundancy, so that the technical effect of greatly reducing the size of the file of the object code generated during compiling is achieved, and the technical problem that the object code generated during compiling of the source code in the related technology carries redundant debugging information is solved.
In the information processing method provided in the embodiment of the present application, storing the compiled symbol table in the symbol database includes: judging whether debugging information exists in the symbol database; if the target information in the debugging information exists in the symbol database, carrying out duplicate removal processing on the target information in the debugging information; and storing the debugging information after the deduplication processing into a symbol database.
In order to reduce the size of the symbol database, all repeated symbols are deduplicated, according to the scheme, if the information in the compiled symbol table exists in the symbol database, the repeated part is deduplicated, and the unrepeated part is stored in the symbol database.
It should be noted that besides symbols, some unsigned data that can be reused, such as a large amount of inline code, whose code segment mapping relationship with file name and line number is also decompressed. The symbol database is not affiliated to any specific executable program or compiling unit, so any redundant information can be reduced into one entity data and a plurality of index information, and the space occupation of the symbol database is greatly reduced.
In order to reduce the size of the symbol database, only one copy of repeated data in the symbol table is recorded, and in order to ensure that the information in the index table corresponding to the target code is complete, the deduplication processing of the target information in the debug information in the application includes: determining index information of target information in the debugging information in a symbol database; replacing the target information with index information of the target information in the symbol table; and taking the debugging information in the symbol table after replacement as the debugging information after the deduplication processing.
For example, if the information of a-to-B in the index table exists in the symbol database, and if the 2 nd segment of page 3, numbered 3002 exists, the index table is replaced with "3002". And the processed index table is stored in the symbol database, so that the size of the symbol database is further reduced.
Optionally, in the information processing method provided in the embodiment of the present application, the method further includes: after generating a release file of a program based on the compiled generated target code and the index information of the symbol table, acquiring debugging information corresponding to the program from the symbol database through the index information of the symbol table; reconstructing a symbol table based on the acquired debugging information; and debugging the program by adopting the reconstructed symbol table.
Through the scheme, the symbol table of a certain program can be reconstructed, and the symbol table file can be created according to the standard format of the symbol table according to the content recorded in the symbol database for debugging.
Optionally, in the information processing method provided in the embodiment of the present application, the method further includes: detecting whether a plurality of versions of a program exist after generating a distribution file of the program based on the compiled generated object code and index information of the symbol table; if a plurality of versions exist, determining index information in symbol tables of release files of the programs of the plurality of versions; determining a shared symbol table from a symbol database based on index information in symbol tables of distribution files of a plurality of versions of programs; and determining the index information of the shared symbol table based on the position information of the shared symbol table in the symbol database, so that the release files of the programs of multiple versions share the shared symbol table through the index information of the shared symbol table.
Through the scheme, further deduplication is realized, most codes are not changed in the software iteration process, and the same symbol table information can be shared among different software versions for the same part, so that the occupied space of the symbol database is further compressed.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
According to an embodiment of the present invention, there is also provided an apparatus for implementing the information processing method, as shown in fig. 3, the apparatus including: a storage unit 301, a first determination unit 302, and a generation unit 303.
Specifically, the storage unit 301 is configured to compile a source code, and store a compiled symbol table in a symbol database, where the symbol table is used to record debugging information between the source code and a program corresponding to the source code;
a first determining unit 302, configured to determine index information of the symbol table according to the location information of the symbol table in the symbol database;
a generating unit 303, configured to generate a distribution file of the program according to the compiled object code and the index information of the symbol table.
Optionally, in the information processing apparatus provided in the embodiment of the present application, the storage unit 301 includes: the judging module is used for judging whether the debugging information exists in the symbol database; the de-duplication processing module is used for performing de-duplication processing on the target information in the debugging information under the condition that the target information in the debugging information exists in the symbol database; and the storage module is used for storing the debugging information after the deduplication processing into the symbol database.
Optionally, in the information processing apparatus provided in the embodiment of the present application, the deduplication processing module includes: the first determining submodule is used for determining the index information of target information in the debugging information in the symbol database; the substitution submodule is used for substituting the index information of the target information for the target information in the symbol table; and the second determination submodule is used for taking the debugging information in the replaced symbol table as the debugging information after the deduplication processing.
Optionally, in the information processing apparatus provided in the embodiment of the present application, the apparatus further includes: an acquisition unit, configured to acquire debugging information corresponding to a program from a symbol database through index information of a symbol table after generating a distribution file of the program based on a compiled generated object code and the index information of the symbol table; the reconstruction unit is used for reconstructing the symbol table according to the acquired debugging information; and the debugging unit is used for debugging the program by adopting the reconstructed symbol table.
Optionally, in the information processing apparatus provided in the embodiment of the present application, the apparatus further includes: a detecting unit configured to detect whether a plurality of versions of the program exist after generating a distribution file of the program based on the compiled object code and the index information of the symbol table; a second determining unit configured to determine, if a plurality of versions exist, index information in a symbol table of a distribution file of the programs of the plurality of versions; a third determination unit configured to determine a shared symbol table from the symbol database based on index information in symbol tables of distribution files of the plurality of versions of programs; a fourth determination unit, configured to determine index information of the shared symbol table according to the location information of the shared symbol table in the symbol database, so that the release files of the multiple versions of programs share the shared symbol table through the index information of the shared symbol table.
It should be noted here that the storage unit 301, the first determination unit 302, and the generation unit 303 correspond to steps S101 to S103 in embodiment 1, and the two modules are the same as the corresponding steps in the implementation example and application scenario, but are not limited to the disclosure in the first embodiment. It should be noted that the modules described above as part of the apparatus may be run in the computer terminal 10 provided in the first embodiment.
Example 3
The embodiment of the invention can provide a computer terminal which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced with a terminal device such as a mobile terminal.
Optionally, in this embodiment, the computer terminal may be located in at least one network device of a plurality of network devices of a computer network.
In this embodiment, the computer terminal may execute program codes of the following steps in the information processing method of the application program: compiling a source code, and storing a compiled symbol table into a symbol database, wherein the symbol table is used for recording debugging information between the source code and a program corresponding to the source code; determining index information of the symbol table based on the position information of the symbol table in the symbol database; and generating a release file of the program based on the compiled object code and the index information of the symbol table.
In this embodiment, the computer terminal may further execute program codes of the following steps in the information processing method of the application program: storing the compiled symbol table into a symbol database comprises: storing the compiled symbol table into a symbol database comprises: judging whether the debugging information exists in the symbol database or not; if the target information in the debugging information exists in the symbol database, performing duplicate removal processing on the target information in the debugging information; and storing the debugging information after the deduplication processing into the symbol database.
In this embodiment, the computer terminal may further execute program codes of the following steps in the information processing method of the application program: the performing of the deduplication processing on the target information in the debugging information comprises: determining index information of target information in the debugging information in the symbol database; replacing the target information with index information of the target information in the symbol table; and taking the debugging information in the symbol table after replacement as debugging information after deduplication processing.
In this embodiment, the computer terminal may further execute program codes of the following steps in the information processing method of the application program: after generating a distribution file of the program based on the compiled generated object code and the index information of the symbol table, the method further includes: acquiring debugging information corresponding to the program from the symbol database through the index information of the symbol table; reconstructing the symbol table based on the acquired debugging information; and debugging the program by adopting the reconstructed symbol table.
In this embodiment, the computer terminal may further execute program codes of the following steps in the information processing method of the application program: after generating a distribution file of the program based on the compiled generated object code and the index information of the symbol table, the method further includes: detecting whether a plurality of versions of the program exist; if a plurality of versions exist, determining index information in a symbol table of a release file of the programs of the plurality of versions; determining a shared symbol table from the symbol database based on index information in symbol tables of distribution files of the plurality of versions of programs; and determining index information of the shared symbol table based on the position information of the shared symbol table in the symbol database, so that the release files of the programs of the multiple versions share the shared symbol table through the index information of the shared symbol table.
Alternatively, fig. 4 is a block diagram of a computer terminal according to an embodiment of the present invention. As shown in fig. 4, the computer terminal a may include: one or more processors (only one shown), memory.
The memory may be used to store software programs and modules, such as program instructions/modules corresponding to the information processing method and apparatus in the embodiments of the present invention, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, so as to implement the information processing method described above. The memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory remotely located from the processor, and these remote memories may be connected to terminal a through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor can call the information and application program stored in the memory through the transmission device to execute the following steps: compiling a source code, and storing a compiled symbol table into a symbol database, wherein the symbol table is used for recording debugging information between the source code and a program corresponding to the source code; determining index information of the symbol table based on the position information of the symbol table in the symbol database; and generating a release file of the program based on the compiled object code and the index information of the symbol table.
Optionally, the processor may further execute the program code of the following steps: storing the compiled symbol table into a symbol database comprises: storing the compiled symbol table into a symbol database comprises: judging whether the debugging information exists in the symbol database or not; if the target information in the debugging information exists in the symbol database, performing duplicate removal processing on the target information in the debugging information; and storing the debugging information after the deduplication processing into the symbol database.
Optionally, the processor may further execute the program code of the following steps: the performing of the deduplication processing on the target information in the debugging information comprises: determining index information of target information in the debugging information in the symbol database; replacing the target information with index information of the target information in the symbol table; and taking the debugging information in the symbol table after replacement as debugging information after deduplication processing.
Optionally, the processor may further execute the program code of the following steps: the method further comprises the following steps: after generating a release file of the program based on the compiled generated object code and the index information of the symbol table, acquiring debugging information corresponding to the program from the symbol database through the index information of the symbol table; reconstructing the symbol table based on the acquired debugging information; and debugging the program by adopting the reconstructed symbol table.
Optionally, the processor may further execute the program code of the following steps: the method further comprises the following steps: detecting whether a plurality of versions of the program exist after generating a release file of the program based on the compiled generated object code and the index information of the symbol table; if a plurality of versions exist, determining index information in a symbol table of a release file of the programs of the plurality of versions; determining a shared symbol table from the symbol database based on index information in symbol tables of distribution files of the plurality of versions of programs; and determining index information of the shared symbol table based on the position information of the shared symbol table in the symbol database, so that the release files of the programs of the multiple versions share the shared symbol table through the index information of the shared symbol table.
The embodiment of the invention provides a scheme of an information processing method. Compiling the source code by adopting a mode of separating a symbol table from a target code, and storing the compiled symbol table into a symbol database, wherein the symbol table is used for recording debugging information between the source code and a program corresponding to the source code; determining index information of the symbol table based on the position information of the symbol table in the symbol database; the method and the device have the advantages that the release file of the program is generated based on the index information of the compiled object code and the symbol table, the fine granularity separation of the object code and the debugging information of the application program is achieved, and the debugging information is free of redundancy, so that the technical effect of greatly reducing the size of the file of the object code generated during compiling is achieved, and the technical problem that the object code generated during compiling of the source code in the related technology carries redundant debugging information is solved.
It can be understood by those skilled in the art that the structure shown in fig. 4 is only an illustration, and the computer terminal may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 4 is a diagram illustrating the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 4, or have a different configuration than shown in FIG. 4.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Example 4
The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the storage medium may be configured to store a program code executed by the information processing method provided in the first embodiment.
Optionally, in this embodiment, the storage medium may be located in any one of computer terminals in a computer terminal group in a computer network, or in any one of mobile terminals in a mobile terminal group.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: compiling a source code, and storing a compiled symbol table into a symbol database, wherein the symbol table is used for recording debugging information between the source code and a program corresponding to the source code; determining index information of the symbol table based on the position information of the symbol table in the symbol database; and generating a release file of the program based on the compiled object code and the index information of the symbol table.
Optionally, the storage medium may be further configured to store program codes for performing the following steps: storing the compiled symbol table into a symbol database comprises: storing the compiled symbol table into a symbol database comprises: judging whether the debugging information exists in the symbol database or not; if the target information in the debugging information exists in the symbol database, performing duplicate removal processing on the target information in the debugging information; and storing the debugging information after the deduplication processing into the symbol database.
Optionally, the storage medium may be further configured to store program codes for performing the following steps: the performing of the deduplication processing on the target information in the debugging information comprises: determining index information of target information in the debugging information in the symbol database; replacing the target information with index information of the target information in the symbol table; and taking the debugging information in the symbol table after replacement as debugging information after deduplication processing.
Optionally, the storage medium may be further configured to store program codes for performing the following steps: the method further comprises the following steps: after generating a release file of the program based on the compiled generated object code and the index information of the symbol table, acquiring debugging information corresponding to the program from the symbol database through the index information of the symbol table; reconstructing the symbol table based on the acquired debugging information; and debugging the program by adopting the reconstructed symbol table.
Optionally, the storage medium may be further configured to store program codes for performing the following steps: the method further comprises the following steps: detecting whether a plurality of versions of the program exist after generating a release file of the program based on the compiled generated object code and the index information of the symbol table; if a plurality of versions exist, determining index information in a symbol table of a release file of the programs of the plurality of versions; determining a shared symbol table from the symbol database based on index information in symbol tables of distribution files of the plurality of versions of programs; and determining index information of the shared symbol table based on the position information of the shared symbol table in the symbol database, so that the release files of the programs of the multiple versions share the shared symbol table through the index information of the shared symbol table.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (12)

1. An information processing method characterized by comprising:
compiling a source code, and storing a compiled symbol table into a symbol database, wherein the symbol table is used for recording debugging information between the source code and a program corresponding to the source code;
determining index information of the symbol table based on the position information of the symbol table in the symbol database;
and generating a release file of the program based on the compiled object code and the index information of the symbol table.
2. The method of claim 1, wherein storing the compiled symbol table in a symbol database comprises:
judging whether the debugging information exists in the symbol database or not;
if the target information in the debugging information exists in the symbol database, performing duplicate removal processing on the target information in the debugging information;
and storing the debugging information after the deduplication processing into the symbol database.
3. The method of claim 2, wherein performing deduplication processing on target information in the debug information comprises:
determining index information of target information in the debugging information in the symbol database;
replacing the target information with index information of the target information in the symbol table;
and taking the debugging information in the symbol table after replacement as debugging information after deduplication processing.
4. The method of claim 1, further comprising:
after generating a release file of the program based on the compiled generated object code and the index information of the symbol table, acquiring debugging information corresponding to the program from the symbol database through the index information of the symbol table;
reconstructing the symbol table based on the acquired debugging information;
and debugging the program by adopting the reconstructed symbol table.
5. The method of claim 1, further comprising:
detecting whether a plurality of versions of the program exist after generating a release file of the program based on the compiled generated object code and the index information of the symbol table;
if a plurality of versions exist, determining index information in a symbol table of a release file of the programs of the plurality of versions;
determining a shared symbol table from the symbol database based on index information in symbol tables of distribution files of the plurality of versions of programs;
and determining index information of the shared symbol table based on the position information of the shared symbol table in the symbol database, so that the release files of the programs of the multiple versions share the shared symbol table through the index information of the shared symbol table.
6. An information processing apparatus characterized by comprising:
the system comprises a storage unit, a symbol database and a debugging unit, wherein the storage unit is used for compiling a source code and storing a compiled symbol table into the symbol database, and the symbol table is used for recording debugging information between the source code and a program corresponding to the source code;
a first determination unit, configured to determine index information of the symbol table according to location information of the symbol table in the symbol database;
and the generating unit is used for generating a release file of the program according to the compiled object code and the index information of the symbol table.
7. The apparatus of claim 6, wherein the storage unit comprises:
the judging module is used for judging whether the debugging information exists in the symbol database;
the de-duplication processing module is used for performing de-duplication processing on the target information in the debugging information under the condition that the target information in the debugging information exists in the symbol database;
and the storage module is used for storing the debugging information after the deduplication processing into the symbol database.
8. The apparatus of claim 7, wherein the deduplication processing module comprises:
the first determining submodule is used for determining the index information of target information in the debugging information in the symbol database;
a substitution submodule for substituting the index information of the target information for the target information in the symbol table;
and the second determination submodule is used for taking the substituted debugging information in the symbol table as the debugging information after the deduplication processing.
9. The apparatus of claim 6, further comprising:
an obtaining unit, configured to obtain debugging information corresponding to the program from the symbol database through index information of the symbol table after generating a release file of the program based on the compiled target code and the index information of the symbol table;
the reconstruction unit is used for reconstructing the symbol table according to the acquired debugging information;
and the debugging unit is used for debugging the program by adopting the reconstructed symbol table.
10. The apparatus of claim 6, further comprising:
a detecting unit configured to detect whether a plurality of versions of the program exist after generating a distribution file of the program based on the compiled object code and the index information of the symbol table;
a second determining unit configured to determine, if a plurality of versions exist, index information in a symbol table of a distribution file of the programs of the plurality of versions;
a third determination unit configured to determine a shared symbol table from the symbol database based on index information in symbol tables of distribution files of the plurality of versions of programs;
a fourth determination unit, configured to determine index information of the shared symbol table according to the location information of the shared symbol table in the symbol database, so that the release files of the multiple versions of programs share the shared symbol table through the index information of the shared symbol table.
11. A storage medium characterized by comprising a stored program, wherein an apparatus in which the storage medium is located is controlled to execute the information processing method according to any one of claims 1 to 5 when the program runs.
12. A processor, characterized in that the processor is configured to execute a program, wherein the program executes the information processing method according to any one of claims 1 to 5.
CN201910100240.1A 2019-01-31 2019-01-31 Information processing method and device, storage medium and processor Active CN111506491B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910100240.1A CN111506491B (en) 2019-01-31 2019-01-31 Information processing method and device, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910100240.1A CN111506491B (en) 2019-01-31 2019-01-31 Information processing method and device, storage medium and processor

Publications (2)

Publication Number Publication Date
CN111506491A true CN111506491A (en) 2020-08-07
CN111506491B CN111506491B (en) 2023-05-02

Family

ID=71863793

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910100240.1A Active CN111506491B (en) 2019-01-31 2019-01-31 Information processing method and device, storage medium and processor

Country Status (1)

Country Link
CN (1) CN111506491B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022237610A1 (en) * 2021-05-10 2022-11-17 阿里巴巴(中国)有限公司 Program compiling method and program loading method
WO2022247442A1 (en) * 2021-05-24 2022-12-01 北京字节跳动网络技术有限公司 Symbol parsing method and apparatus, and device and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6813762B1 (en) * 2000-02-22 2004-11-02 Freescale Semiconductor, Inc. Method for processing program files in a programming language capable of dynamic loading
US20050160058A1 (en) * 2004-01-15 2005-07-21 Li Xinliang D. Program optimization
CN1971519A (en) * 2005-11-24 2007-05-30 富士施乐株式会社 Storage medium, method, and apparatus for creating a protected executable program
CN101650664A (en) * 2009-06-30 2010-02-17 北京飞天诚信科技有限公司 Link method and linker
CN102147743A (en) * 2011-03-28 2011-08-10 博视联(苏州)信息科技有限公司 Method for accelerating startup of embedded system application program
CN103176990A (en) * 2011-12-21 2013-06-26 方正国际软件(北京)有限公司 Spatial data storage and spatial data storage reading method and spatial data storage reading system
CN105528365A (en) * 2014-09-30 2016-04-27 国际商业机器公司 Method and device for managing executable files
CN107402885A (en) * 2017-08-02 2017-11-28 郑州云海信息技术有限公司 A kind of program debugging method and device
CN108052327A (en) * 2017-12-11 2018-05-18 北京奇虎科技有限公司 A kind of kernel module compiling, loading method and device
CN108139892A (en) * 2015-10-15 2018-06-08 华为技术有限公司 Source code is to the conversion method and system of object code in computer

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6813762B1 (en) * 2000-02-22 2004-11-02 Freescale Semiconductor, Inc. Method for processing program files in a programming language capable of dynamic loading
US20050160058A1 (en) * 2004-01-15 2005-07-21 Li Xinliang D. Program optimization
CN1971519A (en) * 2005-11-24 2007-05-30 富士施乐株式会社 Storage medium, method, and apparatus for creating a protected executable program
CN101650664A (en) * 2009-06-30 2010-02-17 北京飞天诚信科技有限公司 Link method and linker
CN102147743A (en) * 2011-03-28 2011-08-10 博视联(苏州)信息科技有限公司 Method for accelerating startup of embedded system application program
CN103176990A (en) * 2011-12-21 2013-06-26 方正国际软件(北京)有限公司 Spatial data storage and spatial data storage reading method and spatial data storage reading system
CN105528365A (en) * 2014-09-30 2016-04-27 国际商业机器公司 Method and device for managing executable files
CN108139892A (en) * 2015-10-15 2018-06-08 华为技术有限公司 Source code is to the conversion method and system of object code in computer
CN107402885A (en) * 2017-08-02 2017-11-28 郑州云海信息技术有限公司 A kind of program debugging method and device
CN108052327A (en) * 2017-12-11 2018-05-18 北京奇虎科技有限公司 A kind of kernel module compiling, loading method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
聂南;谢晓东;甘勇;: "基于XML Schema技术的编译符号表生成方法" *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022237610A1 (en) * 2021-05-10 2022-11-17 阿里巴巴(中国)有限公司 Program compiling method and program loading method
WO2022247442A1 (en) * 2021-05-24 2022-12-01 北京字节跳动网络技术有限公司 Symbol parsing method and apparatus, and device and storage medium

Also Published As

Publication number Publication date
CN111506491B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
CN108459962B (en) Code normalization detection method and device, terminal equipment and storage medium
CN105511911B (en) The generation method and device of system firmware upgrade package
CN107632828B (en) Multi-dts file supporting method, compiling device and embedded equipment
CN107092554B (en) Method and device for confirming fault code of application program
US20140229936A1 (en) Method and apparatus for efficient provisioning of cloned virtual machine images using deduplication metadata
US11231916B2 (en) Method and apparatus for data compilation using intermediate class files, electronic device and non-transitory computer readable storage medium
CN105677509B (en) The restoration methods and device of data in database
CN110737594B (en) Database standard conformance testing method and device for automatically generating test cases
CN111506491B (en) Information processing method and device, storage medium and processor
CN108121565B (en) Method, device and system for generating instruction set code
CN115391403B (en) Data integration method and data integration device based on rule engine
GB2507554A (en) Encoding diagnostic data in an error message for a computer program
CN108509215A (en) A kind of replacing options of system software, device, terminal device and storage medium
CN109918221B (en) Hard disk error reporting analysis method, system, terminal and storage medium
CN114144764A (en) Stack tracing using shadow stack
CN110058961B (en) Method and apparatus for managing storage system
CN114116505A (en) Code testing method and device
CN104199687B (en) A kind of method and apparatus of the processing data in dummy machine system
CN109460187A (en) A kind of qcow2 file data consistency verification method and verifying terminal
CN113110865A (en) Server hot updating method and device
CN111381905B (en) Program processing method, device and equipment
CN112306507A (en) Picture resource processing method, device, terminal and storage medium
CN107463638A (en) File sharing method and equipment between offline virtual machine
CN114895916A (en) Code deployment method, device, storage medium and electronic equipment
CN110347471B (en) Hierarchical display component system, display component calling method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant