CN103218294A - Debugging method for embedded system, debugging conversion device and system - Google Patents

Debugging method for embedded system, debugging conversion device and system Download PDF

Info

Publication number
CN103218294A
CN103218294A CN2013101309268A CN201310130926A CN103218294A CN 103218294 A CN103218294 A CN 103218294A CN 2013101309268 A CN2013101309268 A CN 2013101309268A CN 201310130926 A CN201310130926 A CN 201310130926A CN 103218294 A CN103218294 A CN 103218294A
Authority
CN
China
Prior art keywords
line
debugging
source code
rule
order
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
CN2013101309268A
Other languages
Chinese (zh)
Other versions
CN103218294B (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.)
NANTONG HANGDA ELECTRONIC TECHNOLOGY Co.,Ltd.
Original Assignee
Huawei Technologies Co 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310130926.8A priority Critical patent/CN103218294B/en
Publication of CN103218294A publication Critical patent/CN103218294A/en
Application granted granted Critical
Publication of CN103218294B publication Critical patent/CN103218294B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention discloses a debugging method for an embedded system, a debugging conversion device and a system. The method is implemented by the following steps of acquiring an ordered conversion rule from an online debugging command to an offline debugging command; after receiving the source code of the online debugging command, converting the source code of the online debugging command into a code supporting offline debugging according to the conversion rule; and transmitting the code supporting offline debugging to a target board. According to the method, offline debugging of the online debugging command is realized through conversion from the source code of the online debugging command to the code of offline debugging, so that the problem of repeated development of online debugging and offline debugging of embedded system software can be solved, the problem of the need of modifying a debugger client during offline debugging of different platforms or during offline debugging of different versions for the same platform is avoided, the application range of an online debugging tool can be expanded, the development time of an offline debugging tool is shortened, and the development cost is reduced.

Description

A kind of adjustment method of embedded system, debugging conversion equipment and system
Technical field
The present invention relates to communication technical field, particularly a kind of adjustment method of embedded system, debugging conversion equipment and system.
Background technology
Embedded system is normally towards application-specific, and it requires very strict to the execution sequence and the execution time of logic.Embedded system is applicable to function, reliability, cost, volume, the strict dedicated system of power consumption.Software development for embedded system also is different from general application software, the former requires the developer that the hardware of embedded system is had enough understandings, the software of a good embedded system of exploitation is difficulty very, therefore is necessary very much the debugger of suitable embedded system.
Existing embedded type debugging mode mainly contains dual mode: a kind of is on-line debugging, and another is the off-line debugging.
The scheme of the on-line debugging of embedded system is as follows usually: dispose the debugger service end on embedded board (that is: Target Board), dispose the debugger client at PC(personal computer, personal computer) on, client is connected by passages such as network interface or serial ports with service end.Service end be responsible for visiting or controlling embedded system resource (such as, internal memory, register etc.), client on the PC is responsible for accepting user's order input, carries out real-time/non real-time analysis of command analysis, Debugging message parsing and debugged program, and the output of debugging analysis result etc.
On-line debugging comprises non real-time debud mode (that is: stop debud mode) again, real-time debug mode (that is: non-stop debud mode).The Stop debud mode needs earlier debugged program to be stopped, then the information of routine analyzer and state.The non-stop debud mode then can obtain the correlation behavior information of program etc. in real time.All there is defective in these two kinds of on-line debugging modes, and are specific as follows:
(1) if certain constantly client and the Target Board of debugger service end be connected interruptions, then the program appearance is unusually.At this moment because the client of debugger can't be obtained the real-time condition of debugged program, also the state of uncontrollable debugged program causes the on-line debugging mode to lose efficacy.
(2), because program unusual common has randomness and non-reproducibility, cause the reproduction difficulty of such problem greatlyyer, the inefficacy of on-line debugging will cause the efficient reduction of positioning problems and analysis.
Because test process finishes at Target Board, there be not being connected between Target Board and the debugger in the scheme of off-line test; Therefore can avoid above-mentioned technological deficiency, the scheme of off-line debugging is as follows usually: Target Board will comprise the dump file of backup, and the dump file of backup includes register information, memory information and operation system information etc.; The dump file that obtains Debugging message and above-mentioned backup of Target Board off-line on debugger is analyzed the program exception reason then.But also there is following defective in the off-line debugging:
Because the platform of Target Board operation is of a great variety, comprises operating system and the relevant information of Target Board platform in the dump file of backup, therefore the dump file of backup there are differences on form.In addition, in the systemic software development stage of Target Board, the edition upgrading of this system software is very fast usually, yet the dump file form of different editions system software correspondence be there are differences again.Therefore, the debugger client is at the dump file of realizing supporting different platform, or the dump file of support same platform different editions, then needs the debugger client is changed in a large number.Like this,, still need to revise the debugger client, need great amount of manpower and time and often revise debugger in order to solve debugger client and the platform contradiction on file layout is supported.
In sum, off-line debugging is owing to need constantly to revise the debugger client and bring in and realize the off-line debugging, causes realizing that the difficulty of off-line analysis is big, cost is higher, the time is long.In addition, the debugging acid of on-line debugging and off-line debugging needs exploitation respectively, has the problem of overlapping development.
Summary of the invention
The embodiment of the invention provides a kind of adjustment method, debugging conversion equipment and system of embedded system, is used to increase the usable range of online debugging acid, shortens the development time of off-line debugging acid, reduces cost of development.
The embodiment of the invention provides a kind of adjustment method of embedded system on the one hand, comprising:
Obtain the transformation rule of the on-line debugging order of customization to the off-line debug command;
Behind the source code that receives the on-line debugging order,, the source code of described on-line debugging order is converted to the code of support off-line debugging according to described transformation rule;
The code of described support off-line debugging is sent to Target Board.
In conjunction with implementation on the one hand, in first kind of optional implementation, described source code with described on-line debugging order converts the code of supporting the off-line debugging to, the code of described support off-line debugging is sent to Target Board comprise:
The source code of described on-line debugging order is converted to the source code of off-line debug command; With the off-line order source code that obtains and current debugger client, carry out the secondary compiling and generate the debugger client of supporting the off-line debugging, the debugger client of described support off-line debugging is sent to Target Board; Perhaps,
The source code of described on-line debugging order is converted to the code of off-line debug command and is linked as dynamic base, described dynamic base is sent to Target Board.
In conjunction with first kind of optional implementation, in second kind of optional implementation, the source code that described source code with described on-line debugging order converts the off-line debug command to comprises:
Use compiler the source code of described on-line debugging order to be converted to the source code of off-line order; Perhaps, by client utility the source code of described on-line debugging order is converted to the source code of off-line order.
In conjunction with second kind of optional implementation, in the third optional implementation, described use compiler comprises the source code that the source code of described on-line debugging order converts the off-line order to:
Read in the source code of described on-line debugging order, carry out the rule match of character string,, then call the conversion process interface and generate morphology or the syntactic units that compiler can be discerned, export the source code of off-line debug command then if the match is successful according to described transformation rule.
In conjunction with one side, first kind, second kind or the third optional implementation, in the 4th kind of optional implementation, described transformation rule comprises:
At least one item in symbol table information transformation rule, register and call stack rule, debugging output interface transformation rule, the internal memory distribution rule;
Described symbol table information transformation rule is: the rule of the symbolic information that the map addresses information translation of professional related symbol of on-line debugging order or globak symbol can be discerned to in-circuit debugger;
Described register and call stack rule are: general-purpose register number, function return address, the register configuration of stack pointer or personal computer PC pointer, and function call stack information;
Described debugging output interface transformation rule is: the command interface of on-line debugging is transformed into the rule of off-line debug command interface;
Described internal memory distribution rule is: determine the size of privately owned internal memory or shared drive and the rule that distributes.
The embodiment of the invention two aspects provide a kind of debugging conversion equipment of embedded system, comprising:
The rule acquiring unit is used to obtain the transformation rule of the on-line debugging order of customization to the off-line debug command;
The source code receiving element is used to receive the source code of online debug command;
Converting unit is used for after described source code receiving element receives the source code of on-line debugging order, according to the transformation rule that described regular acquiring unit gets access to, the source code of described on-line debugging order is converted to the code of support off-line debugging;
Transmitting element, the code that the support off-line that is used for that described converting unit is obtained is debugged sends to Target Board.
In conjunction with the implementation of two aspects, in first kind of optional implementation, described converting unit specifically is used for the source code of described on-line debugging order is converted to the source code of off-line debug command; The off-line order source code and the current debugger client that obtain are carried out the debugger client that the secondary compiling generates the debugging of support off-line; Perhaps, the source code with described on-line debugging order converts the code of off-line debug command to and is linked as dynamic base;
Described transmitting element, the debugger client that the support off-line that is used for that specifically described converting unit is obtained is debugged sends to Target Board; Perhaps the dynamic base that described converting unit is obtained sends to Target Board.
In conjunction with the implementation of two aspects, in second kind of optional implementation, described converting unit specifically is used to use compiler the source code of described on-line debugging order to be converted to the source code of off-line order; Perhaps, by client utility the source code of described on-line debugging order is converted to the source code of off-line order.
In conjunction with second kind implementation, in the third optional implementation, described converting unit comprises:
Reading unit is used to read in the source code of the on-line debugging order that described source code receiving element receives;
Matching unit is used for carrying out according to the transformation rule that described regular acquiring unit obtains the rule match of character string;
The source code generation unit is used for that the match is successful as if described matching unit, then calls the conversion process interface and generates morphology or the syntactic units that compiler can be discerned, and exports the source code of off-line debug command then.
In conjunction with one side, first kind, second kind or the third optional implementation, in the 4th kind of optional implementation, described regular acquiring unit, the transformation rule that obtains comprises: at least one item in symbol table information transformation rule, register and call stack rule, debugging output interface transformation rule, the internal memory distribution rule;
Described symbol table information transformation rule is: the rule of the symbolic information that the map addresses information translation of professional related symbol of on-line debugging order or globak symbol can be discerned to in-circuit debugger;
Described register and call stack rule are: general-purpose register number, function return address, the register configuration of stack pointer or personal computer PC pointer, and function call stack information;
Described debugging output interface transformation rule is: the command interface of on-line debugging is transformed into the rule of off-line debug command interface;
Described internal memory distribution rule is: determine the size of privately owned internal memory or shared drive and the rule that distributes.
The embodiment of the invention three aspects provide a kind of debug system of embedded system, comprise, debugger, Target Board also comprise: any one debugging conversion equipment that the embodiment of the invention provides;
Described debugging conversion equipment receives the source code of online debug command from the client of described debugger, and will support the code of off-line debugging to export to the service end of described Target Board.
As can be seen from the above technical solutions, the embodiment of the invention has the following advantages: by the on-line debugging order being carried out the conversion of the code of debugging from the source code of on-line debugging order to off-line, realize the off-line debugging of online debug command, can solve the on-line debugging of built-in system software and the overlapping development problem of off-line debugging, avoid different Platform Implementation off-line debugging, or all need to revise the problem of debugger client during to the debugging of the off-line of identical Platform Implementation different editions, therefore, can increase the usable range of online debugging acid, shorten the development time of off-line debugging acid, reduced cost of development.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the invention, the accompanying drawing of required use is briefly introduced in will describing embodiment below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is an embodiment of the invention method flow synoptic diagram;
Fig. 2 generates the modular structure synoptic diagram of off-line order for the embodiment of the invention;
Fig. 3 is the typical debugger networking of an embodiment of the invention synoptic diagram;
Fig. 4 becomes the schematic flow sheet of off-line order for the online command conversion of the embodiment of the invention;
Fig. 5 is an embodiment of the invention source-to-source transfer process example schematic;
Fig. 6 is embodiment of the invention debugging conversion device structure synoptic diagram;
Fig. 7 is embodiment of the invention debugging conversion device structure synoptic diagram;
Fig. 8 is an embodiment of the invention system architecture synoptic diagram.
Embodiment
In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with accompanying drawing, and obviously, described embodiment only is a part of embodiment of the present invention, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making all other embodiment that obtained under the creative work prerequisite.
The embodiment of the invention provides a kind of adjustment method of embedded system, as shown in Figure 1, comprising:
101: obtain the transformation rule of the on-line debugging order of customization to the off-line debug command;
Above-mentioned on-line debugging order is to the transformation rule of off-line debug command, can be to set up the rule of online debug command arbitrarily to off-line debug command corresponding relation, transformation rule can increase or reduce according to actual needs, the concrete form embodiment of the invention has provided following giving an example: alternatively, above-mentioned transformation rule comprises: at least one item in symbol table information transformation rule, register and call stack rule, debugging output interface transformation rule, the internal memory distribution rule; Above-mentioned symbol table information transformation rule is: the rule of the symbolic information that the map addresses information translation of professional related symbol of on-line debugging order or globak symbol can be discerned to in-circuit debugger; Above-mentioned register and call stack rule are: general-purpose register number, function return address, the register configuration of stack pointer or personal computer PC pointer, and function call stack information; Above-mentioned debugging output interface transformation rule is: the command interface of on-line debugging is transformed into the rule of off-line debug command interface; Above-mentioned internal memory distribution rule is: determine the size of privately owned internal memory or shared drive and the rule that distributes.Need to prove that the rule of code conversion can have many types, more than should not be construed as qualification for example to the embodiment of the invention.
102: behind the source code that receives the on-line debugging order,, the source code of above-mentioned on-line debugging order is converted to the code of support off-line debugging according to above-mentioned transformation rule;
Alternatively, the embodiment of the invention has provided two kinds of schemes of optionally supporting the code of off-line debugging, and is as follows: above-mentioned source code with above-mentioned on-line debugging order converts to supports the code of off-line debugging to comprise: the source code that the source code of above-mentioned on-line debugging order is converted to the off-line debug command; With the off-line order source code that obtains and current debugger client, carry out the secondary compiling and generate the debugger client of supporting the off-line debugging; Perhaps, the source code with above-mentioned on-line debugging order converts the code of off-line debug command to and is linked as dynamic base.
Alternatively, the embodiment of the invention gives two kinds of on-line debugging orders and arrives the conversion implementation of the source code of off-line debug command to source code, and particularly: the source code that above-mentioned source code with above-mentioned on-line debugging order converts the off-line debug command to comprises: use compiler the source code of above-mentioned on-line debugging order to be converted to the source code of off-line order; Perhaps, by client utility the source code of above-mentioned on-line debugging order is converted to the source code of off-line order.
Alternatively, the embodiment of the invention gives uses compiler to realize the specific implementation of source code to the conversion of source code, as follows: above-mentioned use compiler comprises the source code that the source code of above-mentioned on-line debugging order converts the off-line order to: the source code that reads in above-mentioned on-line debugging order, carry out the rule match of character string according to above-mentioned transformation rule, if the match is successful, then call the conversion process interface and generate morphology or the syntactic units that compiler can be discerned, export the source code of off-line debug command then.
103: the code of above-mentioned support off-line debugging is sent to Target Board.
Above scheme, by the on-line debugging order being carried out the conversion of the code of debugging from the source code of on-line debugging order to off-line, realize the off-line debugging of online debug command, can solve the on-line debugging of built-in system software and the overlapping development problem of off-line debugging, avoid different Platform Implementation off-line debugging, or all need to revise the problem of debugger client during to the debugging of the off-line of identical Platform Implementation different editions, therefore, can increase the usable range of online debugging acid, shorten the development time of off-line debugging acid, reduced cost of development.
Alternatively, corresponding to two kinds of schemes of optionally supporting the code of off-line debugging of front embodiment, above-mentioned code with above-mentioned support off-line debugging sends to Target Board and comprises: the debugger client of above-mentioned support off-line debugging is sent to Target Board; Perhaps, above-mentioned dynamic base is sent to Target Board.
Following examples respectively with regard to structure form, the angle of debugging networking, source code conversion and example illustrates in more detail to the scheme of above embodiment.
One, structure is formed
See also and Figure 2 shows that: by the source-to-source conversion, generate the modular structure synoptic diagram of off-line order, wherein the direction of arrow is data flow.
Can use C as programming language for the online and off-line debugger of embedded system development in this example.On-line debugging order source code (mainly being .c and .h file) is as the input source of off-line command converter.
The off-line command converter mainly contains three parts: symbol resolution module, dump file parsing module and source-to-source modular converter.
The symbol resolution module is obtained the definition and the address mapping table of globak symbol from input source, and the denotational description information relevant with business, after carrying out symbol resolution and handling, outputs to the source-to-source modular converter.
Another input of source-to-source modular converter is from the dump file parsing module, the dump file parsing module is mainly finished analysis and the processing to off-line files register and call stack rule, this part ISA(Industrial Standard Architecture common and embedded system, industrial standard architecture bus) strong correlation.
Just can finish the output of last off-line debug command source code (mainly being .c and .h file) after getting access to the information that needs when the source-to-source modular converter by the rule that inside defines.The off-line debugger of this moment has had professional related symbol table information and address information that the in-circuit debugger module has, uses the printing interface of off-line debugger just can obtain the product service related information.
Two, debugging networking
Typical debugger networking synoptic diagram as shown in Figure 3,
Under the on-line debugging scene, be positioned at PC(personal computer, personal computer) the debugger client of end and be positioned at debugging services end on the Target Board (Board) by ETH(Ethernet, network interface) or passage such as serial ports communicate.Wherein also include IDE(Integrated Development Environment, Integrated Development Environment in the PC side), also include application program, system and internal memory/register in the Board side.
Under the off-line debugging scene, the debugger client is obtained needed register/memory information, operation system information or product business information by file I/O from the dump file (Core File on PC) of PC.
Three, source code conversion
Seeing also Fig. 4 is: online command conversion becomes the schematic flow sheet of off-line order.
401: formulate the transformation rule that the on-line debugging order smooths to the off-line debug command;
The on-line debugging order has the complete rule of a cover to the conversion of off-line order.The customization of rule mainly can comprise following a few part: symbol table information transformation rule, the main rule of formulating the symbolic information that the map addresses information translation of professional related symbol of on-line debugging order or globak symbol can be discerned to in-circuit debugger.Register and call stack rule comprise the general-purpose register number, the function return address, and register configuration such as stack pointer and PC pointer, and function call stack information etc.Debugging output interface transformation rule, the command interface of formulating on-line debugging is transformed into off-line debug command interface.The internal memory distribution rule is determined the size of privately owned internal memory or shared drive and distribution etc.Can be according to the demand of practical business, add or delete some rule.
402: use source code conversion compiler the source code of on-line debugging order to be converted to the source code of off-line debug command;
The ultimate principle of the conversion of this step can for: read in the source code of online debug command, carry out the rule match of character string according to the transformation rule of above-mentioned formulation.If the match is successful, then call the conversion process interface and generate morphology or the syntactic units that compiler can be discerned, export the source code of last off-line debug command again by compiler.
403: the source code by the off-line debug command that will generate in 402 is compiled in and can generates new off-line debugger client together together with the source code of the irrelevant off-line debugging of framework and conversion.
Above scheme step 402 and 403 all can adopt other modes to replace, and is specific as follows:
In the above-mentioned schematic flow sheet 4 402 is to have adopted source code conversion compiler the source code of on-line debugging order to be converted to the source code of off-line debug command.Replacement scheme can not rely on compiler, realizes that separately a source code with the on-line debugging order converts the conversion client instrument of the source code of off-line debug command to.That is to say that crossover tool can break away from compiler, client utility possesses the process of analysis rule map, generates the function of final source code.
402 another kind of replacement schemes in the schematic flow sheet 4 are by compiler, and the code (mainly being .c and .h file) of changing the off-line order of coming out is linked into a dynamic base (.dll or .so form).The compiling of secondary in 403 just can be omitted so, and the debugger client of off-line only needs the dynamic base of generation in the dynamic load 402 just can finish corresponding debug function.
Four, example
Below be a kind of enforcement scene:
See also and Figure 5 shows that a source-to-source transfer process example, this example is to inquire about the CPU(Central Processing Unit of current system, central processing unit) load factor is an example, Fig. 5 adopts the C language compilation, can be with reference to the related specifications of C language compilation, left side one source code of classifying the on-line debugging order as wherein, right side arrow is pointed to is the source code of corresponding with it off-line debug command, this example converts the source code of on-line debugging order to the process of the source code of off-line debug command.Mainly be divided into three steps:
1, identifies this order global variable in realizing.This is the relevant global variable of a business, at first is the transformation rule that will have this service symbol of identification.Rule is very simple, the character string of identification in the quotation marks (be among Fig. 5, most going up a boldface letter content frame of broken lines in the top big frame).
The off-line command converter is constantly read in input file (being Fig. 5 left side side code), (this is the calling interface of a service inquiry symbolic address when recognizing the DSP_LkAddr key word, in Rulemaking, can be configured in this interface interchange in the rule, the coupling that is used for character string), the off-line command converter matches the character string that brackets with double quotation marks of this key word back, is exactly gstruCpuLoad in this example.Subsidiary implicit transformation rule is original structure body member to be called be converted to that the member of identification string calls, as struCpuLoad.uwCurLoad----〉gstruCpuLoad.uwCurLoad, this transformation result will be as the input of following function call translation interface.Conversion corresponding relation shown in the arrow as shown in Figure 5.
2, obtain the function call of global variable value, replace to the function call in the off-line debug client end.
In Fig. 5, converting the calling interface DSP_CommRead of the professional address of variable of online query to corresponding off-line calling interface getSymAddrSize, simultaneously top struCpuLoad.uwCurLoad----〉the gstruCpuLoad.uwCurLoad transformation result imports into as interface parameters.
3, the function call of order return results output replaces to the function call of off-line debug client end.
After globak symbol and the interface conversion of obtaining overall situation amount are finished, just can realize the conversion of final step platform printout interface, this has changed the function that has realized last debug results output switching.Be transformed into off-line printing interface printf such as the on-line debugging interface LBB_DSP_Printf in this example.
Adopt above scheme, debugging is applied to different scenes because the on-line debugging of built-in system software is with off-line, and the debud mode that all is absolutely necessary.The embodiment of the invention realizes the off-line debugging of online debug command, can solve the on-line debugging of built-in system software and the overlapping development problem of off-line debugging, by the on-line debugging order being carried out the conversion of the code of debugging from the source code of on-line debugging order to off-line, convert the off-line debug command that on PC, to use to, and the product business information that will relate in will ordering uses the symbol resolution function to convert address and length to, and the off-line order promptly can be obtained system related information by inquiry corresponding memory addresses interval.Realize that the off-line debugging of online debug command can avoid different Platform Implementation off-line debugging, or all need to revise the problem of debugger client during to the debugging of the off-line of identical Platform Implementation different editions, therefore, the inventive method can increase the usable range of online debugging acid, shorten the development time of off-line debugging acid, reduced cost of development.
The embodiment of the invention also provides a kind of debugging conversion equipment of embedded system, as shown in Figure 6, comprising:
Rule acquiring unit 601 is used to obtain the transformation rule of the on-line debugging order of customization to the off-line debug command;
Source code receiving element 602 is used to receive the source code of online debug command;
Converting unit 603 is used for after above-mentioned source code receiving element 602 receives the source code of on-line debugging order, according to the transformation rule that above-mentioned regular acquiring unit 601 gets access to, the source code of above-mentioned on-line debugging order is converted to the code of support off-line debugging;
Transmitting element 604, the code that the support off-line that is used for that above-mentioned converting unit 603 is obtained is debugged sends to Target Board.
Above scheme, by the on-line debugging order being carried out the conversion of the code of debugging from the source code of on-line debugging order to off-line, realize the off-line debugging of online debug command, can solve the on-line debugging of built-in system software and the overlapping development problem of off-line debugging, avoid different Platform Implementation off-line debugging, or all need to revise the problem of debugger client during to the debugging of the off-line of identical Platform Implementation different editions, therefore, can increase the usable range of online debugging acid, shorten the development time of off-line debugging acid, reduced cost of development.
Alternatively, above-mentioned converting unit 603 specifically is used for the source code of above-mentioned on-line debugging order is converted to the source code of off-line debug command; The off-line order source code and the current debugger client that obtain are carried out the debugger client that the secondary compiling generates the debugging of support off-line; Perhaps, the source code with above-mentioned on-line debugging order converts the code of off-line debug command to and is linked as dynamic base;
Above-mentioned transmitting element 604, the debugger client that the support off-line that is used for that specifically above-mentioned converting unit 603 is obtained is debugged sends to Target Board; Perhaps the dynamic base that above-mentioned converting unit 603 is obtained sends to Target Board.
Alternatively, above-mentioned converting unit 603 specifically is used to use compiler the source code of above-mentioned on-line debugging order to be converted to the source code of off-line order; Perhaps, by client utility the source code of above-mentioned on-line debugging order is converted to the source code of off-line order.
Alternatively, as shown in Figure 7, above-mentioned converting unit 603 comprises:
Reading unit 701 is used to read in the source code of the on-line debugging order that above-mentioned source code receiving element 602 receives;
Matching unit 702 is used for carrying out according to the transformation rule that above-mentioned regular acquiring unit 601 obtains the rule match of character string;
Source code generation unit 704 is used for that the match is successful as if above-mentioned matching unit 702, then calls the conversion process interface and generates morphology or the syntactic units that compiler can be discerned, and exports the source code of off-line debug command then.
Alternatively, above-mentioned regular acquiring unit 601, the transformation rule that obtains comprises: at least one item in symbol table information transformation rule, register and call stack rule, debugging output interface transformation rule, the internal memory distribution rule;
Above-mentioned symbol table information transformation rule is: the rule of the symbolic information that the map addresses information translation of professional related symbol of on-line debugging order or globak symbol can be discerned to in-circuit debugger;
Above-mentioned register and call stack rule are: general-purpose register number, function return address, the register configuration of stack pointer or personal computer PC pointer, and function call stack information;
Above-mentioned debugging output interface transformation rule is: the command interface of on-line debugging is transformed into the rule of off-line debug command interface;
Above-mentioned internal memory distribution rule is: determine the size of privately owned internal memory or shared drive and the rule that distributes.
The embodiment of the invention also provides a kind of debug system of embedded system, as shown in Figure 8, comprises, debugger 801, Target Board 803 also comprise: any one debugging conversion equipment 802 that the embodiment of the invention provides; Above-mentioned debugging conversion equipment 802 receives the source code of online debug command from the client of above-mentioned debugger 801, and will support the code of off-line debugging to export to the service end of above-mentioned Target Board 803.
It should be noted that among the above-mentioned debugging conversion equipment embodiment that each included unit is just divided according to function logic, but is not limited to above-mentioned division, as long as can realize function corresponding; In addition, the concrete title of each functional unit also just for the ease of mutual differentiation, is not limited to protection scope of the present invention.
In addition, one of ordinary skill in the art will appreciate that all or part of step that realizes among above-mentioned each method embodiment is to instruct relevant hardware to finish by program, corresponding program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be a ROM (read-only memory), disk or CD etc.
Below only be the preferable embodiment of the present invention; but protection scope of the present invention is not limited thereto; anyly be familiar with those skilled in the art in the technical scope that the embodiment of the invention discloses, the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.

Claims (11)

1. the adjustment method of an embedded system is characterized in that, comprising:
Obtain the transformation rule of the on-line debugging order of customization to the off-line debug command;
Behind the source code that receives the on-line debugging order,, the source code of described on-line debugging order is converted to the code of support off-line debugging according to described transformation rule;
The code of described support off-line debugging is sent to Target Board.
2. according to the described method of claim 1, it is characterized in that described source code with described on-line debugging order converts the code of supporting the off-line debugging to, the code of described support off-line debugging sent to Target Board comprise:
The source code of described on-line debugging order is converted to the source code of off-line debug command; With the off-line order source code that obtains and current debugger client, carry out the secondary compiling and generate the debugger client of supporting the off-line debugging, the debugger client of described support off-line debugging is sent to Target Board; Perhaps,
The source code of described on-line debugging order is converted to the code of off-line debug command and is linked as dynamic base, described dynamic base is sent to Target Board.
3. according to the described method of claim 2, it is characterized in that the source code that described source code with described on-line debugging order converts the off-line debug command to comprises:
Use compiler the source code of described on-line debugging order to be converted to the source code of off-line order; Perhaps, by client utility the source code of described on-line debugging order is converted to the source code of off-line order.
4. according to the described method of claim 3, it is characterized in that described use compiler comprises the source code that the source code of described on-line debugging order converts the off-line order to:
Read in the source code of described on-line debugging order, carry out the rule match of character string,, then call the conversion process interface and generate morphology or the syntactic units that compiler can be discerned, export the source code of off-line debug command then if the match is successful according to described transformation rule.
5. according to any described method of claim 1 to 4, it is characterized in that described transformation rule comprises:
At least one item in symbol table information transformation rule, register and call stack rule, debugging output interface transformation rule, the internal memory distribution rule;
Described symbol table information transformation rule is: the rule of the symbolic information that the map addresses information translation of professional related symbol of on-line debugging order or globak symbol can be discerned to in-circuit debugger;
Described register and call stack rule are: general-purpose register number, function return address, the register configuration of stack pointer or personal computer PC pointer, and function call stack information;
Described debugging output interface transformation rule is: the command interface of on-line debugging is transformed into the rule of off-line debug command interface;
Described internal memory distribution rule is: determine the size of privately owned internal memory or shared drive and the rule that distributes.
6. the debugging conversion equipment of an embedded system is characterized in that, comprising:
The rule acquiring unit is used to obtain the transformation rule of the on-line debugging order of customization to the off-line debug command;
The source code receiving element is used to receive the source code of online debug command;
Converting unit is used for after described source code receiving element receives the source code of on-line debugging order, according to the transformation rule that described regular acquiring unit gets access to, the source code of described on-line debugging order is converted to the code of support off-line debugging;
Transmitting element, the code that the support off-line that is used for that described converting unit is obtained is debugged sends to Target Board.
7. according to the described debugging conversion equipment of claim 6, it is characterized in that,
Described converting unit specifically is used for the source code of described on-line debugging order is converted to the source code of off-line debug command; The off-line order source code and the current debugger client that obtain are carried out the debugger client that the secondary compiling generates the debugging of support off-line; Perhaps, the source code with described on-line debugging order converts the code of off-line debug command to and is linked as dynamic base;
Described transmitting element, the debugger client that the support off-line that is used for that specifically described converting unit is obtained is debugged sends to Target Board; Perhaps the dynamic base that described converting unit is obtained sends to Target Board.
8. according to the described debugging conversion equipment of claim 6, it is characterized in that,
Described converting unit specifically is used to use compiler the source code of described on-line debugging order to be converted to the source code of off-line order; Perhaps, by client utility the source code of described on-line debugging order is converted to the source code of off-line order.
9. described according to Claim 8 debugging conversion equipment is characterized in that described converting unit comprises:
Reading unit is used to read in the source code of the on-line debugging order that described source code receiving element receives;
Matching unit is used for carrying out according to the transformation rule that described regular acquiring unit obtains the rule match of character string;
The source code generation unit is used for that the match is successful as if described matching unit, then calls the conversion process interface and generates morphology or the syntactic units that compiler can be discerned, and exports the source code of off-line debug command then.
10. according to any described device of claim 6 to 9, it is characterized in that,
Described regular acquiring unit, the transformation rule that obtains comprises: at least one item in symbol table information transformation rule, register and call stack rule, debugging output interface transformation rule, the internal memory distribution rule;
Described symbol table information transformation rule is: the rule of the symbolic information that the map addresses information translation of professional related symbol of on-line debugging order or globak symbol can be discerned to in-circuit debugger;
Described register and call stack rule are: general-purpose register number, function return address, the register configuration of stack pointer or personal computer PC pointer, and function call stack information;
Described debugging output interface transformation rule is: the command interface of on-line debugging is transformed into the rule of off-line debug command interface;
Described internal memory distribution rule is: determine the size of privately owned internal memory or shared drive and the rule that distributes.
11. the debug system of an embedded system comprises, debugger, Target Board is characterized in that, also comprise: the debugging conversion equipment that claim 6 to 10 is any;
Described debugging conversion equipment receives the source code of online debug command from the client of described debugger, and will support the code of off-line debugging to export to the service end of described Target Board.
CN201310130926.8A 2013-04-16 2013-04-16 A kind of adjustment method of embedded system, debugging conversion equipment and system Active CN103218294B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310130926.8A CN103218294B (en) 2013-04-16 2013-04-16 A kind of adjustment method of embedded system, debugging conversion equipment and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310130926.8A CN103218294B (en) 2013-04-16 2013-04-16 A kind of adjustment method of embedded system, debugging conversion equipment and system

Publications (2)

Publication Number Publication Date
CN103218294A true CN103218294A (en) 2013-07-24
CN103218294B CN103218294B (en) 2015-12-02

Family

ID=48816112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310130926.8A Active CN103218294B (en) 2013-04-16 2013-04-16 A kind of adjustment method of embedded system, debugging conversion equipment and system

Country Status (1)

Country Link
CN (1) CN103218294B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631716A (en) * 2013-11-29 2014-03-12 华为技术有限公司 Converting method and equipment for debugging commands
CN104461905A (en) * 2014-12-30 2015-03-25 东信和平科技股份有限公司 Method and system for debugging intelligent card virtual machine, API bank and upper layer application at same time
CN106897633A (en) * 2017-05-02 2017-06-27 成都优孚达信息技术有限公司 A kind of Embedded online offline functionality conversion equipment
CN107632819A (en) * 2016-07-14 2018-01-26 南京南瑞继保电气有限公司 A kind of method and system of the FPGA debugging based on symbol table
CN109213676A (en) * 2018-07-06 2019-01-15 中国电力科学研究院有限公司 A kind of offline adjustment method and device for test script
CN109507991A (en) * 2018-12-25 2019-03-22 中国兵器装备集团自动化研究所 A kind of two axis servo control platform debugging system and method
CN109656535A (en) * 2018-12-24 2019-04-19 苏州思必驰信息科技有限公司 The offline development approach of voice technical ability based on browser
CN109726213A (en) * 2018-12-10 2019-05-07 网易无尾熊(杭州)科技有限公司 A kind of program code conversion method, device, medium and calculate equipment
CN110806976A (en) * 2019-10-24 2020-02-18 青岛英泰软件技术有限公司 Method for remotely pushing shell and CMD (command-to-command) commands
CN110853327A (en) * 2019-11-02 2020-02-28 杭州雅格纳科技有限公司 Ship cabin equipment data field debugging and collecting method and device based on single chip microcomputer
CN111143218A (en) * 2019-12-27 2020-05-12 深圳市共进电子股份有限公司 Log debugging method and device suitable for 5G embedded equipment and readable storage medium
CN112416790A (en) * 2020-11-30 2021-02-26 中国航空工业集团公司西安航空计算技术研究所 Embedded software offline replay debugging method and device
CN114020607A (en) * 2021-10-26 2022-02-08 苏州浪潮智能科技有限公司 BMC (baseboard management controller) debugging method and device and computer equipment
CN114253837A (en) * 2021-11-22 2022-03-29 杭州加速科技有限公司 Multithreading debugging method and system for ATE (automatic test equipment) tester program and tester table

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7100086B1 (en) * 1998-03-31 2006-08-29 Seiko Epson Corporation Microcomputer, electronic equipment and debugging system
CN1862507A (en) * 2006-03-10 2006-11-15 华为技术有限公司 Single board fault positioning aid and positioning method
US7177791B1 (en) * 2003-12-05 2007-02-13 Unisys Corporation Offline emulated input/output processor debugger
CN101126989A (en) * 2006-08-15 2008-02-20 凌阳科技股份有限公司 Mobile telephone emulation system and method therefor
CN102662835A (en) * 2012-03-23 2012-09-12 凌阳科技股份有限公司 Program debugging method of embedded system and embedded system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7100086B1 (en) * 1998-03-31 2006-08-29 Seiko Epson Corporation Microcomputer, electronic equipment and debugging system
US7177791B1 (en) * 2003-12-05 2007-02-13 Unisys Corporation Offline emulated input/output processor debugger
CN1862507A (en) * 2006-03-10 2006-11-15 华为技术有限公司 Single board fault positioning aid and positioning method
CN101126989A (en) * 2006-08-15 2008-02-20 凌阳科技股份有限公司 Mobile telephone emulation system and method therefor
CN102662835A (en) * 2012-03-23 2012-09-12 凌阳科技股份有限公司 Program debugging method of embedded system and embedded system

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631716A (en) * 2013-11-29 2014-03-12 华为技术有限公司 Converting method and equipment for debugging commands
CN104461905A (en) * 2014-12-30 2015-03-25 东信和平科技股份有限公司 Method and system for debugging intelligent card virtual machine, API bank and upper layer application at same time
CN107632819B (en) * 2016-07-14 2021-02-09 南京南瑞继保电气有限公司 Symbol table-based programmable logic debugging method and system
CN107632819A (en) * 2016-07-14 2018-01-26 南京南瑞继保电气有限公司 A kind of method and system of the FPGA debugging based on symbol table
CN106897633A (en) * 2017-05-02 2017-06-27 成都优孚达信息技术有限公司 A kind of Embedded online offline functionality conversion equipment
CN106897633B (en) * 2017-05-02 2023-11-28 义乌中国小商品城大数据有限公司 Embedded online and offline function conversion equipment
CN109213676A (en) * 2018-07-06 2019-01-15 中国电力科学研究院有限公司 A kind of offline adjustment method and device for test script
CN109726213A (en) * 2018-12-10 2019-05-07 网易无尾熊(杭州)科技有限公司 A kind of program code conversion method, device, medium and calculate equipment
CN109726213B (en) * 2018-12-10 2021-11-19 阿里巴巴(中国)有限公司 Program code conversion method, device, medium and computing equipment
CN109656535A (en) * 2018-12-24 2019-04-19 苏州思必驰信息科技有限公司 The offline development approach of voice technical ability based on browser
CN109656535B (en) * 2018-12-24 2022-02-08 思必驰科技股份有限公司 Voice skill off-line development method based on browser
CN109507991A (en) * 2018-12-25 2019-03-22 中国兵器装备集团自动化研究所 A kind of two axis servo control platform debugging system and method
CN110806976A (en) * 2019-10-24 2020-02-18 青岛英泰软件技术有限公司 Method for remotely pushing shell and CMD (command-to-command) commands
CN110853327A (en) * 2019-11-02 2020-02-28 杭州雅格纳科技有限公司 Ship cabin equipment data field debugging and collecting method and device based on single chip microcomputer
CN111143218A (en) * 2019-12-27 2020-05-12 深圳市共进电子股份有限公司 Log debugging method and device suitable for 5G embedded equipment and readable storage medium
CN111143218B (en) * 2019-12-27 2024-03-26 深圳市共进电子股份有限公司 Log debugging method and device suitable for 5G embedded equipment and readable storage medium
CN112416790A (en) * 2020-11-30 2021-02-26 中国航空工业集团公司西安航空计算技术研究所 Embedded software offline replay debugging method and device
CN114020607A (en) * 2021-10-26 2022-02-08 苏州浪潮智能科技有限公司 BMC (baseboard management controller) debugging method and device and computer equipment
CN114020607B (en) * 2021-10-26 2024-02-13 苏州浪潮智能科技有限公司 BMC debugging method and device and computer equipment
CN114253837A (en) * 2021-11-22 2022-03-29 杭州加速科技有限公司 Multithreading debugging method and system for ATE (automatic test equipment) tester program and tester table

Also Published As

Publication number Publication date
CN103218294B (en) 2015-12-02

Similar Documents

Publication Publication Date Title
CN103218294A (en) Debugging method for embedded system, debugging conversion device and system
US7761586B2 (en) Accessing and manipulating data in a data flow graph
CN101908015B (en) Device and method for creating test case based on components
US20200359094A1 (en) Screen parameter configuration system
CN102087594B (en) Management method and device for extension point and plugins
CN104346146B (en) A kind of method of cross-platform transformation applications code and device
CN100375057C (en) Automatic test auxiliary system and corresponding software automatic test method
CN101126981A (en) Script order registration method, method and device for calling source program code
CN111813804B (en) Data query method and device, electronic equipment and storage medium
CN100517222C (en) Model conversion frame supporting separation of conversion engine and mapping rule and the method
CN102866944A (en) Pressure testing system and method
CN101174237B (en) Automatic test method, system and test device
CN100511140C (en) Method for script language calling multiple output parameter interface by component software system
CN101154227A (en) Code generation method based on ASN type object
CN101866315A (en) Test method and system of software development tool
CN201435074Y (en) Device for generating test case based on member
CN101211360A (en) System and method for processing a plurality of data form of report forms data source
CN101980546A (en) Intelligent network platform, service execution method and method for analyzing service abnormality
CN105446819B (en) A kind of service connection system and its design method
CN101136780A (en) Method, system to obtain user command information, and user command registered device
CN114202419A (en) Message generation method, device, equipment, storage medium and program product
CN108876527A (en) Method of servicing and service unit, using open platform and storage medium
CN202143092U (en) Message processing system
CN102520971A (en) Data interaction method and device based on computer-aided design (CAD) software
CN106354966B (en) The method of the conversion of chip id E project file and rapid configuration artificial debugging environment

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: 20191213

Address after: No.1, floor 3, No.319, zhanggongshan Road, Yuhui District, Bengbu City, Anhui Province

Patentee after: Bengbu guijiu Intellectual Property Service Co., Ltd

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: Huawei Technologies Co., Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201019

Address after: 226000 No. 998 Century Avenue, hi tech Zone, Jiangsu, Nantong

Patentee after: NANTONG HANGDA ELECTRONIC TECHNOLOGY Co.,Ltd.

Address before: No.1, floor 3, No.319, zhanggongshan Road, Yuhui District, Bengbu City, Anhui Province

Patentee before: Bengbu guijiu Intellectual Property Service Co.,Ltd.

TR01 Transfer of patent right