CN100478914C - Symbol debug method and system in cross integration development environment - Google Patents
Symbol debug method and system in cross integration development environment Download PDFInfo
- Publication number
- CN100478914C CN100478914C CNB2007101067013A CN200710106701A CN100478914C CN 100478914 C CN100478914 C CN 100478914C CN B2007101067013 A CNB2007101067013 A CN B2007101067013A CN 200710106701 A CN200710106701 A CN 200710106701A CN 100478914 C CN100478914 C CN 100478914C
- Authority
- CN
- China
- Prior art keywords
- file
- target
- debug
- debugging
- title
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a method for debugging the symbol in a cross integration development environment, which can satisfy the requirement of rapidly debugging for developer and shorten the period of software development. The method includes the steps: (a) a host computer, based on the environmental information of target computer, compiles the source file which is running on the target computer to produce a target executable file which contains a debugging information and a executing body; (b) the host computer separates out the debugging information from the target executable file and splits the information into a plurality of debugging symbol fils and a discription file containing a spilting information, and restricts the corresponding relation between the discription file and the executing body; (c) a debugger is started with no load, when the executing body on the target computer is debugged, the discription file is looked up, the desired symbol debugging file is loaded.
Description
Technical field
The present invention relates to adjustment method in a kind of software Integrated Development Environment, the symbol debug method in particularly a kind of software cross integration development environment.
Background technology
Cross integration development environment is a kind of integration tool that generally uses in the embedded system software development process.Along with the complexity day by day of software systems, software debugging seems particularly important as important approach of error correction, and the developer requires also to become increasingly conspicuous for the high efficiency of debugging.
Because the complicated physics size and the incidental Debugging message of software of making of software systems increases sharply, traditional development environment once offers debugger (debugger) with Debugging message, cause debugger because of handling too much information inefficiency, can't satisfy the demand of developer for quick debugging.Therefore, providing a kind of adjustment method fast is software Integrated Development Environment technical matters to be solved.
Summary of the invention
The technical problem to be solved in the present invention provides the symbol debug method in a kind of cross integration development environment, can satisfy the demand of developer for quick debugging, shortens the cycle of software development.
In order to solve the problems of the technologies described above, the invention provides the symbol debug method in a kind of cross integration development environment, may further comprise the steps:
(a) main frame compiles according to the environmental information of the target machine source file to operation that need be on target machine, generates the target executable file, and described target executable file comprises Debugging message and carries out body;
(b) main frame is isolated Debugging message from the target executable file, and it is split as a plurality of debug symbol files and a description document that comprises fractionation information, and the corresponding relation of agreement description document and described execution body;
(c) the zero load startup of debugger when according to the debugging action execution body on the target machine being debugged, is searched description document according to source file title or target debug address, loads the debug symbol file that needs and debugs.
Further, described Debugging message is the information that comprises variable and function.
Further, in described step (b), described main frame is split as a plurality of debug symbol files by module with Debugging message, the corresponding one or more source files of each debug symbol file.
Further, preserve following information and corresponding relation thereof in the described description document: source file path and title, instruction of target executable file or the reference position of data on target machine, instruction of target executable file or end position or the length information of data on target machine, the path of debug symbol file and title.
Further, when having comprised another debug symbol file again in the debug symbol file, the path and the title of also preserving the source file of involved debug symbol file in the described description document.
Further, in described step (c), when described debugger is debugged the execution body on the target machine according to the debugging action, search description document, obtain the path and the title of debug symbol file according to source file title or target debug address.
Further, the executable debugging of debugger action is following one or more: breakpoint, single step are set, follow into, follow out, recall, variable monitors.
Further, when debugging action when breakpoint is set, debugger need be searched description document according to the source file title, obtains the path and the title of debug symbol file; When debugging action for single step, follow into or when following out, described debugger finds the target debug address by local code or stack information, according to this address search description document, obtains the path and the title of debug symbol file; When the debugging action monitors for variable, obtain the target debug address by searching the system symbol table, and then obtain the path and the title of debug symbol file; When debugging action when recalling, described debugger obtains the target debug address by stack information, and then obtains the path and the title of debug symbol file.
In order to solve the problems of the technologies described above, the present invention provides the system of the symbolic debugging in a kind of cross integration development environment again, comprises main frame, debugger, target machine, it is characterized in that,
Described main frame, be used for the source file that needs are executed in target machine being compiled generation target executable file according to the environmental information of target machine, described target executable file comprises Debugging message and carries out body, and described Debugging message separated from described target executable file, be split as a plurality of debug symbol files and a description document that comprises fractionation information, and the corresponding relation of agreement description document and described execution body;
Described debugger is used for according to the debugging action execution body on the target machine being debugged, and according to source file title or target debug address, searches description document, loads the debug symbol file that needs and debugs.
Further, preserve following information and corresponding relation thereof in the described description document: source file path and title, instruction of target executable file or the reference position of data on target machine, instruction of target executable file or end position or the length information of data on target machine, the path of debug symbol file and title.
Compared with prior art, with method of the present invention be applied to implement in the actual intersection the integration environment after, make debugger can operate in state efficiently, realized software symbolic debugging efficiently, reduce the meaningless stand-by period of developer, shortened the construction cycle of software.
Description of drawings
Fig. 1 is the symbol debug method process flow diagram of the embodiment of the invention;
Fig. 2 is a kind of symbolic debugging cyclic flow graph of the embodiment of the invention.
Embodiment
In the software debugging of reality, always a kind of activity with locality feature of current debugging is characterized as precondition with this, the present invention with break the whole up into parts, the guiding theory of dynamic load, realize debugging pretreater strategy, finally improve the efficient of software debugging.What is called breaks the whole up into parts and is meant existing debug symbol information in the software execution module is split according to a certain criterion; The purpose of dynamic load is selectively to load the debugging enironment of Debugging message to debugger according to the needs of debugging.
The specific embodiment of the present invention and development environment are closely related, be with reference to environment with tornado ppc version, ELF (Executable and Linking Format) destination file format and stab debug symbol storage format below, other environment can be with reference to enforcement.
Symbolic debugging system in the present embodiment cross integration development environment comprises main frame (Host machine), debugger, target machine (Target machine), wherein:
Described main frame, be used for the source file that needs are executed in target machine being compiled generation target executable file according to the environmental information of target machine, described target executable file comprises Debugging message and carries out body, and described Debugging message separated from described target executable file, be split as a plurality of debug symbol files and a description document that comprises fractionation information, and the corresponding relation of agreement description document and described execution body;
Described debugger is used for according to the debugging action execution body on the target machine being debugged, and according to source file title or target debug address, searches description document, loads the debug symbol file that needs and debugs.
Debugger can be on the Host machine, also can be separately outside.
As shown in Figure 1, symbol debug method in the cross integration development environment of present embodiment may further comprise the steps:
Step 110, the Host machine to compiling at the source file of the operation on the Target machine, generates the target executable file according to the environmental information of Target machine, and described target executable file comprises Debugging message and carries out body;
The execution body portion of target executable file is kept on the Target machine simultaneously.
Step 120, the Host machine is isolated Debugging message from the target executable file, and is split into a plurality of independently debug symbol files, generates a description document that comprises fractionation information simultaneously, and the corresponding relation of agreement description document and described execution body;
With Debugging message from the target executable file, split come out to be one after the process handled of connector, promptly its execution place on opportunity should engineering compiled connect generate one comprise the file destination carried out of Debugging message after.
The Host machine is according to the header of target executable file, find the Debugging message memory block, Debugging message is modular storage mostly, a module is corresponding with one or more source files, with these modules is that unit splits, and generates the debug symbol file (or claiming the Debugging message file) of a plurality of dispersions.Simultaneously, also generate a description document, correspondence instruction or data area to the split debug symbol file that comes out are described, in description document, preserve following information and corresponding relation thereof: source file path and title (when having comprised another debug symbol file again in the debug symbol file, also preserving included source file path and title), the instruction of target executable file or the data reference position pointer on target machine and the path and the title of end position pointer (perhaps reference position and length information), debug symbol file.
Debugging message mainly is made up of the relevant information of debug symbol, and the debug symbol file is the carrier of Debugging message.Debugging message that Tornado ppc is original and operation code data are completely all in a file (ELF), in the present embodiment, this parent file torn open be two parts, the one, moving body (or claiming to carry out body) file, the one, Debugging message file (comprising information such as all variablees, function).The Debugging message file is still a very big file, this file is split come again, and the Debugging message file that originally this is very big has just been deleted from the parent file, only preserves the moving body file in the Target machine.
Debug symbol information can be divided according to different .c and be organized together, and is placed on the back of x2.c such as the Debugging message of x1.c, and these Debugging message have been formed the Debugging message section of whole ELF file jointly.But the c file that has has comprised other c file, comprised y2.c (#include) such as y1.c, the Debugging message of y1 and y2 just is included in the debug symbol file like this, so after this debug symbol file split out, corresponding source file was exactly two.
Step 130, the zero load startup of debugger;
Owing in step 120, the Debugging message in the target executable file is split out, so debugger can not analyzed any Debugging message and startup fast.
When step 140, debugger are debugged the execution body on the target machine according to current debugging action, search description document, the debug symbol file that dynamic load needs is debugged;
In the integration environment, before debugger is implemented the debugging action, can obtain some debugging enironment information, by analyzing these information can the be correct Debugging message scope is locked.Further, when the user has done certain debugging action, debugger is searched description document according to a current debugging file title (be the source file title---specified by the user) or the target debug address (carrying out the memory address that the body file moves on target device) treated, obtains the pathname of debug symbol file.There is the path relation of agreement owing to carry out the description document of body file and back access phase generation, so can searches further definite should the loading description document to which debug symbol file of debugger.In brief, by obtaining a certain condition in the debugging enironment, source file title or target debug address find corresponding debug symbol file load to give debugger in description document, and debugger just can be finished current debugging action.
Described target debug address is that the user directly or indirectly informs, need on certain address, breakpoint be set such as the user, this is a direct mode, perhaps the user need be to certain variation-tracking, what the user provided is a symbol, obtain this address by the destination address of searching the symbol correspondence, this is an indirect mode.
The executable debugging of debugger action comprises following one or more: breakpoint (setbreakpoint), single step (step) are set, follow into (step into), follow out (step out), recall (backtrace) and variable supervision (add watch) etc.
Breakpoint is set, and this function is the file name that obtains current operation from the integration environment, finds corresponding debug symbol file by description document;
Follow into, this function is to enter next layer functions from current execution function, the debug symbol file of the source file at next function place of possibility does not also load in this case, in order to find the address of next function, analysis is found the function call instruction from one section internal memory of PC (programmable counter) beginning, obtains the address of next layer functions, according to this address, debugger finds corresponding debug symbol file by description document;
Follow out, this function is to get back to the upper level function, can know back that just stack to which address, finds corresponding debug symbol file by description document then by checking the information of current call stack;
Single step, this function are that each to carry out a source file capable, but when carrying out that function returns to the end, and be similar with " following out ", obtains back stack with " following out " same method and arrive which address so can use, and finds corresponding debug symbol file;
Recall, this function is to follow the tracks of stack to call, and according to the destination address of recalling, finds corresponding debug symbol file.
Variable monitors that this function is to search this variable symbol in symbol table, obtains its address, according to this address, finds corresponding debug symbol file by description document, and with its loading.
Fig. 2 is a kind of cyclic flow graph of symbolic debugging, may further comprise the steps:
Step 211 is analyzed stack information acquisition destination address, execution in step 213;
Step 212 is analyzed local code or stack information and is found destination address;
According to the destination address that code or stack information obtain moving on the target machine, in description document, obtain the position of debug symbol file according to this address.Comprised the function calls relation in the described stack.
Step 213 loads the debug symbol file according to the destination address scope;
Step 215 is debugged;
Step 216 judges whether to continue debugging, if, return step 205, otherwise, finish.
The present invention has guaranteed that debugger obtains necessary still minimum Debugging message set, has alleviated the burden of debugger so greatly, makes debugger be able to efficient operation.In addition, even software systems expand, debugging speed can not be affected yet.
This method has significantly been improved software debugging speed after implementing in projects such as the comprehensive access server UAS of my company, DSLAM, improved developer's development efficiency.
Should be noted that; the present invention also can have other multiple enforcement and extended mode; under the situation that does not deviate from spirit and scope of the invention; those of ordinary skill in the art obviously can make various corresponding changes and expansion to the present invention; perhaps participate in embodiment of the present invention in other environment and implement, but these changes and expansion all should belong to the scope that claims of the present invention are protected.
For example, can adopt other execution sequence, and be not limited to the judgement order among Fig. 2 the processing of each action of debugger.
Claims (10)
1, the symbol debug method in a kind of cross integration development environment may further comprise the steps:
(a) main frame compiles according to the environmental information of the target machine source file to operation that need be on target machine, generates the target executable file, and described target executable file comprises Debugging message and carries out body;
(b) main frame is isolated Debugging message from the target executable file, and it is split as a plurality of debug symbol files and a description document that comprises fractionation information, and the corresponding relation of agreement description document and described execution body;
(c) the zero load startup of debugger when according to the debugging action execution body on the target machine being debugged, is searched description document according to source file title or target debug address, loads the debug symbol file that needs and debugs.
2, the method for claim 1 is characterized in that, described Debugging message is the information that comprises variable and function.
3, the method for claim 1 is characterized in that, in described step (b), described main frame is split as a plurality of debug symbol files by module with Debugging message, the corresponding one or more source files of each debug symbol file.
4, the method for claim 1, it is characterized in that, preserve following information and corresponding relation thereof in the described description document: source file path and title, instruction of target executable file or the reference position of data on target machine, instruction of target executable file or end position or the length information of data on target machine, the path of debug symbol file and title.
5, method as claimed in claim 4 is characterized in that, when having comprised another debug symbol file again in the debug symbol file, and the source file path and the title of also preserving involved debug symbol file in the described description document.
6, the method for claim 1, it is characterized in that, in described step (c), when described debugger is debugged the execution body on the target machine according to the debugging action, search description document according to source file title or target debug address, obtain the path and the title of debug symbol file.
7, the method for claim 1 is characterized in that, the executable debugging of debugger action is following one or more: breakpoint, single step are set, follow into, follow out, recall, variable monitors.
8, method as claimed in claim 7 is characterized in that, when debugging action when breakpoint is set, debugger need be searched description document according to the source file title, obtains the path and the title of debug symbol file; When debugging action for single step, follow into or when following out, described debugger finds the target debug address by local code or stack information, according to this address search description document, obtains the path and the title of debug symbol file; When the debugging action monitors for variable, obtain the target debug address by searching the system symbol table, and then obtain the path and the title of debug symbol file; When debugging action when recalling, described debugger obtains the target debug address by stack information, and then obtains the path and the title of debug symbol file.
9, the symbolic debugging system in a kind of cross integration development environment comprises main frame, debugger, target machine, it is characterized in that,
Described main frame, be used for the source file that needs are executed in target machine being compiled generation target executable file according to the environmental information of target machine, described target executable file comprises Debugging message and carries out body, and described Debugging message separated from described target executable file, be split as a plurality of debug symbol files and a description document that comprises fractionation information, and the corresponding relation of agreement description document and described execution body;
Described debugger is used for according to the debugging action execution body on the target machine being debugged, and according to source file title or target debug address, searches description document, loads the debug symbol file that needs and debugs.
10, system as claimed in claim 9, it is characterized in that, preserve following information and corresponding relation thereof in the described description document: source file path and title, instruction of target executable file or the reference position of data on target machine, instruction of target executable file or end position or the length information of data on target machine, the path of debug symbol file and title.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007101067013A CN100478914C (en) | 2007-05-28 | 2007-05-28 | Symbol debug method and system in cross integration development environment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007101067013A CN100478914C (en) | 2007-05-28 | 2007-05-28 | Symbol debug method and system in cross integration development environment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101055542A CN101055542A (en) | 2007-10-17 |
CN100478914C true CN100478914C (en) | 2009-04-15 |
Family
ID=38795389
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2007101067013A Expired - Fee Related CN100478914C (en) | 2007-05-28 | 2007-05-28 | Symbol debug method and system in cross integration development environment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100478914C (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101968767A (en) * | 2010-10-15 | 2011-02-09 | 北京数码大方科技有限公司 | Macroprogram-based code debugging and simulation method and device |
US9026861B2 (en) * | 2012-10-02 | 2015-05-05 | Texas Instruments Incorporated | Debug trace stream timestamping using downstream correlation |
CN103699481A (en) * | 2013-12-03 | 2014-04-02 | 华为技术有限公司 | Code debugging method and code debugging system |
CN108388510B (en) * | 2018-02-09 | 2021-09-24 | 福建升腾资讯有限公司 | Method for controlling debugging information output through storage configuration and computer equipment |
CN109683900B (en) * | 2018-11-14 | 2022-02-18 | 浙江零跑科技股份有限公司 | Universal upper computer symbol searching and analyzing method for ELF file debugging information |
CN111338612A (en) * | 2020-02-18 | 2020-06-26 | 东风电子科技股份有限公司 | System and method for realizing C cross compiler integrated construction aiming at software development tool |
CN114816416A (en) * | 2022-04-11 | 2022-07-29 | 北京达佳互联信息技术有限公司 | Information processing method, device, equipment and storage medium |
-
2007
- 2007-05-28 CN CNB2007101067013A patent/CN100478914C/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN101055542A (en) | 2007-10-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100478914C (en) | Symbol debug method and system in cross integration development environment | |
CN100535870C (en) | Embedded system progress abnormal tracking position-finding method | |
CN103744709B (en) | patch loading method and device | |
CN109766124A (en) | Business development method, apparatus, computer equipment and storage medium | |
US20050177775A1 (en) | Data race detection using sequential program analysis | |
CN108073400A (en) | Software automation construction method, server and storage medium | |
US9645911B2 (en) | System and method for debugging firmware/software by generating trace data | |
CN104424002A (en) | Dynamic component loading method and system based on plug-in mechanism | |
CN109032631B (en) | Application program patch package obtaining method and device, computer equipment and storage medium | |
CN101866315B (en) | Test method and system of software development tool | |
US20110126179A1 (en) | Method and System for Dynamic Patching Software Using Source Code | |
CN102375778A (en) | Method and system for automatically testing digital signal processor (DSP) | |
CN101226502B (en) | Automatization test method and system | |
WO2019005228A1 (en) | Automated source code adaption to inject features between platform versions | |
CN109144799A (en) | Integrated testing method, apparatus, computer equipment and storage medium | |
CN101980546B (en) | Intelligent network platform, service execution method and method for analyzing service abnormality | |
CN115617687B (en) | Program instrumentation method, device, equipment and storage medium | |
US7287246B2 (en) | Debugging optimized flows with breakpoints using stored breakpoint trigger indicators | |
CN102063367B (en) | Off-line analysis method and device aiming at computer crash program | |
US9483262B2 (en) | Apparatus and method for identifying correspondence between an installed program and an interface in a source code | |
CN111880803B (en) | Software construction method and device applied to multiple platforms | |
CN111596970B (en) | Method, device, equipment and storage medium for dynamic library delay loading | |
CN105550575A (en) | Method and device for obtaining un-exported function address and data structure offset | |
CN104850015A (en) | Software packaging method and automobile electronic controller | |
CN107783765A (en) | file compiling method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20180428 Address after: California, USA Patentee after: Global innovation polymerization LLC Address before: 518057 Department of law, Zhongxing building, South hi tech Industrial Park, Nanshan District hi tech Industrial Park, Guangdong, Shenzhen Patentee before: ZTE Corp. |
|
TR01 | Transfer of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20090415 |
|
CF01 | Termination of patent right due to non-payment of annual fee |