CN103218294B - A kind of adjustment method of embedded system, debugging conversion equipment and system - Google Patents

A kind of adjustment method of embedded system, debugging conversion equipment and system Download PDF

Info

Publication number
CN103218294B
CN103218294B CN201310130926.8A CN201310130926A CN103218294B CN 103218294 B CN103218294 B CN 103218294B CN 201310130926 A CN201310130926 A CN 201310130926A CN 103218294 B CN103218294 B CN 103218294B
Authority
CN
China
Prior art keywords
line
source code
debugging
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.)
Active
Application number
CN201310130926.8A
Other languages
Chinese (zh)
Other versions
CN103218294A (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

Abstract

The embodiment of the invention discloses a kind of adjustment method of embedded system, debugging conversion equipment and system, wherein the realization of method comprises: the transformation rule of on-line debugging order to off-line debug command obtaining customization; After the source code receiving on-line debugging order, according to described transformation rule, the source code of described on-line debugging order is converted to the code supporting off-line debugging; The code of described support off-line debugging is sent to Target Board.By the conversion of code that on-line debugging order is carried out debugging from the source code of on-line debugging order to off-line, realize the off-line debugging of on-line debugging order, the on-line debugging of built-in system software and the overlapping development problem of off-line debugging can be solved, avoid realizing off-line debugging to different platforms, or when identical platform being realized to the off-line debugging of different editions, all need to revise the problem of debugger client, therefore, the usable range of online debugging acid can be increased, shorten the development time of off-line debugging acid, reduce cost of development.

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, debugging conversion equipment and system of embedded system.
Background technology
Embedded system is normally towards application-specific, and it requires very strict to the execution sequence of logic and execution time.Embedded system is applicable to the strict dedicated system of function, reliability, cost, volume, power consumption requirements.Software development for embedded system is also different from general application software, the former requires that the hardware of developer to embedded system has enough understandings, the software developing a good embedded system is very difficult, is therefore necessary very much the debugger of applicable embedded system.
Existing embedded type debugging mode mainly contains two kinds of modes: one is on-line debugging, and another is off-line debugging.
The scheme of the on-line debugging of embedded system is usually as follows: dispose debugger service end on embedded board (that is: Target Board), dispose debugger client at PC(personalcomputer, personal computer) on, client and service end are by the expanding channels such as network interface or serial ports.Service end is responsible for the resource of access or control embedded system (such as, internal memory, register etc.), client on PC is responsible for accepting the order input of user, carries out command analysis, Debugging message resolves and the real-time/non-real time analysis of debugged program, and the output of Commissioning Analysis result etc.
On-line debugging comprises again non real-time debud mode (that is: stop debud mode), real-time debug mode (that is: non-stop debud mode).Stop debud mode needs first by debugged program stopped, then the information of routine analyzer and state.Non-stop debud mode then can the related status information etc. of Real-time Obtaining program.These two kinds of on-line debugging modes all existing defects, specific as follows:
(1) if the disconnecting of the client of certain moment debugger and the service end of Target Board, then program occurs abnormal.At this moment because the client of debugger cannot obtain the real-time condition of debugged program, the also state of uncontrollable debugged program, causes on-line debugging mode to lose efficacy.
(2), because the exception of program has randomness and non-reproducibility usually, cause the reproduction difficulty of such problem comparatively large, the inefficacy of on-line debugging reduces causing the efficiency of positioning problems and analysis.
, because test process completes at Target Board, there is not the connection between Target Board and debugger in the scheme of off-line test; Therefore can avoid above-mentioned technological deficiency, the scheme of off-line debugging is usually as follows: 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.; Target Board is the acquisition Debugging message of off-line and the dump file of above-mentioned backup on debugger, then analyzes program exception reason.But also there is following defect in off-line debugging:
The platform run due to Target Board is of a great variety, and comprise operating system and the relevant information of Target Board platform in the dump file of backup, the dump file therefore backed up there are differences on form.In addition, in the systemic software development stage of Target Board, the edition upgrading of this system software is usually very fast, but the dump file form corresponding to different editions system software there are differences again.Therefore, debugger client is realizing the dump file supporting different platform, or supports the dump file of same platform different editions, then need to change in a large number debugger client.Like this, in order to solve debugger client and the contradiction of platform on file layout is supported, still need amendment debugger client, and often revise debugger and need a large amount of manpowers and time.
In sum, off-line debugging constantly revises debugger client to realize off-line debugging due to needs, and the difficulty causing realizing off-line analysis is comparatively large, cost is higher, the time is long.In addition, the debugging acid of on-line debugging and off-line debugging needs to develop respectively, there is the problem of overlapping development.
Summary of the invention
Embodiments provide a kind of adjustment method of embedded system, debugging conversion equipment and system, for increasing the usable range of on-line debugging instrument, shorten the development time of off-line debugging acid, reduce cost of development.
The embodiment of the present invention provides a kind of adjustment method of embedded system on the one hand, comprising:
Obtain the transformation rule of on-line debugging order to off-line debug command of customization;
After the source code receiving on-line debugging order, according to described transformation rule, the source code of described on-line debugging order is converted to the code supporting off-line debugging;
The code of described support off-line debugging is sent to Target Board.
In conjunction with implementation on the one hand, in the first optional implementation, the described source code by described on-line debugging order converts the code supporting off-line debugging to, sends to Target Board to comprise the code of described support off-line debugging:
The source code of described on-line debugging order is converted to the source code of off-line debug command; By the off-line order source code that obtains and current debugger client, carry out secondary compiling and generate the debugger client supporting off-line debugging, the debugger client of described support off-line debugging is sent to Target Board; Or,
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 the first optional implementation, in the optional implementation of the second, the source code that the described source code by described on-line debugging order converts off-line debug command to comprises:
Compiler is used the source code of described on-line debugging order to be converted to the source code of off-line order; Or, 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 the optional implementation of the second, in the third optional implementation, the source code that the source code of described on-line debugging order converts off-line order to comprises by described use compiler:
Read in the source code of described on-line debugging order, carry out the rule match of character string according to described transformation rule, if the match is successful, then call conversion process interface and generate the compiler morphology that can identify or syntactic units, the source code of then output off-line debug command.
In conjunction with on the one hand, the first, the second 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, internal memory distribution rule;
Described symbol table information transformation rule is: the address mapping information of on-line debugging order business related symbol or globak symbol is transformed into the rule of the symbolic information that in-circuit debugger can identify;
Described register and call stack rule are: general-purpose register number, Function return addresses, 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 of distribution.
The embodiment of the present invention two aspect provides a kind of debugging conversion equipment of embedded system, comprising:
Rule unit, for the transformation rule of the on-line debugging order to off-line debug command that obtain customization;
Source code receiving element, for receiving the source code of online debug command;
Converting unit, for after described source code receiving element receives the source code of on-line debugging order, the transformation rule got according to described Rule unit, converts the code supporting off-line debugging to by the source code of described on-line debugging order;
Transmitting element, the code for the support off-line debugging described converting unit obtained sends to Target Board.
In conjunction with the implementation of two aspects, in the first optional implementation, described converting unit, specifically for converting the source code of off-line debug command to by the source code of described on-line debugging order; The off-line order source code obtained and current debugger client are carried out secondary compiling and generate the debugger client supporting off-line debugging; Or, 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 transmitting element, the debugger client specifically for the support off-line debugging described converting unit obtained sends to Target Board; Or the dynamic base that described converting unit obtains is sent to Target Board.
In conjunction with the implementation of two aspects, in the optional implementation of the second, described converting unit, converts the source code of off-line order to by the source code of described on-line debugging order specifically for use compiler; Or, 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 the implementation of the second, in the third optional implementation, described converting unit comprises:
Reading unit, for reading in the source code of the on-line debugging order that described source code receiving element receives;
Matching unit, the transformation rule for obtaining according to described Rule unit carries out the rule match of character string;
Source code generation unit, if the match is successful for described matching unit, then calls conversion process interface and generates the compiler morphology that can identify or syntactic units, the source code of then output off-line debug command.
In conjunction with on the one hand, the first, the second or the third optional implementation, in the 4th kind of optional implementation, described Rule unit, the transformation rule of acquisition comprises: at least one item in symbol table information transformation rule, register and call stack rule, debugging output interface transformation rule, internal memory distribution rule;
Described symbol table information transformation rule is: the address mapping information of on-line debugging order business related symbol or globak symbol is transformed into the rule of the symbolic information that in-circuit debugger can identify;
Described register and call stack rule are: general-purpose register number, Function return addresses, 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 of distribution.
The embodiment of the present invention three aspect provides a kind of debug system of embedded system, comprises, and debugger, Target Board, also comprise: the debugging conversion equipment of any one that the embodiment of the present invention provides;
Described debugging conversion equipment receives the source code of online debug command from the client of described debugger, and will support that the service end of described Target Board exported to by the code of off-line debugging.
As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages: by the conversion of code on-line debugging order being carried out debugging from the source code of on-line debugging order to off-line, realize the off-line debugging of on-line debugging order, the on-line debugging of built-in system software and the overlapping development problem of off-line debugging can be solved, avoid realizing off-line debugging to different platforms, or when identical platform being realized to the off-line debugging of different editions, all need to revise the problem of debugger client, therefore, the usable range of online debugging acid can be increased, shorten the development time of off-line debugging acid, reduce cost of development.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly introduced, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is embodiment of the present invention method flow schematic diagram;
Fig. 2 is the modular structure schematic diagram that the embodiment of the present invention generates off-line order;
Fig. 3 is the embodiment of the present invention typical debugger networking schematic diagram;
Fig. 4 is that the embodiment of the present invention orders the schematic flow sheet converting off-line order to online;
Fig. 5 is embodiment of the present invention source-to-source translation process instance schematic diagram;
Fig. 6 is embodiment of the present invention debugging conversion device structure schematic diagram;
Fig. 7 is embodiment of the present invention debugging conversion device structure schematic diagram;
Fig. 8 is embodiment of the present invention system architecture schematic diagram.
Embodiment
In order to make the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, the present invention is described in further detail, and obviously, described embodiment is only a part of embodiment of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making other embodiments all obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiments provide a kind of adjustment method of embedded system, as shown in Figure 1, comprising:
101: the transformation rule of on-line debugging order to off-line debug command obtaining customization;
Above-mentioned on-line debugging order is to the transformation rule of off-line debug command, can be to set up arbitrarily the rule of online debug command to off-line debug command corresponding relation, transformation rule can increase according to actual needs or reduce, the concrete form embodiment of the present invention gives following citing: alternatively, and 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, internal memory distribution rule; Above-mentioned symbol table information transformation rule is: the address mapping information of on-line debugging order business related symbol or globak symbol is transformed into the rule of the symbolic information that in-circuit debugger can identify; Above-mentioned register and call stack rule are: general-purpose register number, Function return addresses, 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 of distribution.It should be noted that, the rule of code conversion can have many types, and above citing should not be construed as the restriction to the embodiment of the present invention.
102: after the source code receiving on-line debugging order, according to above-mentioned transformation rule, the source code of above-mentioned on-line debugging order is converted to the code supporting off-line debugging;
Alternatively, the embodiment of the present invention gives the scheme that two kinds are optionally supported the code of off-line debugging, as follows: the above-mentioned source code by above-mentioned on-line debugging order converts to supports that the code of off-line debugging comprises: the source code source code of above-mentioned on-line debugging order being converted to off-line debug command; By the off-line order source code that obtains and current debugger client, carry out secondary compiling and generate the debugger client supporting off-line debugging; Or, the source code of above-mentioned on-line debugging order is converted to the code of off-line debug command and is linked as dynamic base.
Alternatively, the embodiment of the present invention gives two kinds of on-line debugging orders to the source code of off-line debug command to the conversion implementation of source code, particularly: the source code that the above-mentioned source code by above-mentioned on-line debugging order converts 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; Or, 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 present invention gives and uses compiler to realize the specific implementation of source code to the conversion of source code, as follows: the source code that the source code of above-mentioned on-line debugging order converts off-line order to comprises by above-mentioned use compiler: the source code reading in above-mentioned on-line debugging order, the rule match of character string is carried out according to above-mentioned transformation rule, if the match is successful, then call conversion process interface and generate the compiler morphology that can identify or syntactic units, the source code of then output off-line debug command.
103: the code of above-mentioned support off-line debugging is sent to Target Board.
Above scheme, by the conversion of code that on-line debugging order is carried out debugging from the source code of on-line debugging order to off-line, realize the off-line debugging of on-line debugging order, the on-line debugging of built-in system software and the overlapping development problem of off-line debugging can be solved, avoid realizing off-line debugging to different platforms, or when identical platform being realized to the off-line debugging of different editions, all need to revise the problem of debugger client, therefore, the usable range of online debugging acid can be increased, shorten the development time of off-line debugging acid, reduce cost of development.
Alternatively, corresponding to two kinds of optional schemes supporting the code of off-line debugging of preceding embodiment, the above-mentioned code by above-mentioned support off-line debugging sends to Target Board to comprise: the debugger client of above-mentioned support off-line debugging is sent to Target Board; Or, above-mentioned dynamic base is sent to Target Board.
Following examples form with regard to structure respectively, debug networking, source code changes and the scheme of angle to above embodiment of example illustrates in more detail.
One, structure composition
Refer to and Figure 2 shows that: by source-to-source translation, generate the modular structure schematic diagram of off-line order, wherein the direction of arrow is data flow.
For the online of embedded system development and off-line debugger can use C as programming language in this example.On-line debugging order source code (mainly .c and .h file) is as the input source of off-line command converter.
Off-line command converter mainly contains three parts: symbol resolution module, dump file parsing module and source-to-source translation module.
Symbol resolution module obtains definition and the address mapping table of globak symbol from input source, and the denotational description information relevant to business, after carrying out symbol resolution and processing, outputs to source-to-source translation module.
Another input of source-to-source translation module is from dump file parsing module, dump file parsing module mainly completes the analysis and treament to off-line files register and call stack rule, this part ISA(IndustrialStandardArchitecture that is usual and embedded system, industrial standard architecture bus) strong correlation.
Just can be completed the output of last off-line debug command source code (mainly .c and .h file) by the inner rule defined after source-to-source translation module gets the information of needs.Off-line debugger now has been provided with the business related symbol table information and address information that in-circuit debugger module has, and uses the printing interface of off-line debugger just can obtain product service related information.
Two, networking is debugged
Typical debugger networking schematic diagram as shown in Figure 3,
Under on-line debugging scene, be positioned at PC(personalcomputer, personal computer) the debugger client of holding and the debugging services end that is positioned on Target Board (Board) by ETH(Ethernet, network interface) or the passage such as serial ports communicate.Wherein also include IDE(IntegratedDevelopmentEnvironment in PC side, Integrated Development Environment), application program, system and internal memory/register is also included in Board side.
Under off-line debugging scenarios, register/memory information, operation system information or product business information required for debugger client is obtained from the dump file (CoreFileonPC) of PC by file I/O.
Three, source code conversion
Referring to Fig. 4 is: online order converts the schematic flow sheet of off-line order to.
401: formulate the transformation rule that on-line debugging order smooths to off-line debug command;
On-line debugging order has the rule of complete set to the conversion of off-line order.The customization of rule mainly can comprise following a few part: symbol table information transformation rule, main formulates the rule address mapping information of on-line debugging order business related symbol or globak symbol being transformed into the symbolic information that in-circuit debugger can identify.Register and call stack rule, comprise general-purpose register number, Function return addresses, the register configuration such as stack pointer and PC pointer, and function call stack information etc.Debugging output interface transformation rule, formulates and the command interface of on-line debugging is transformed into off-line debug command interface.Internal memory distribution rule, determines the size and distribution etc. of privately owned internal memory or shared drive.According to the demand of practical business, can 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 be: the source code reading in online debug command, carries out the rule match of character string according to the transformation rule of above-mentioned formulation.If the match is successful, then call conversion process interface and generate the compiler morphology that can identify or syntactic units, then exported the source code of last off-line debug command by compiler.
403: the source code of the off-line debugging had nothing to do together with framework and conversion by the source code of the off-line debug command that will generate in 402, is compiled in and can generates new off-line debugger client together.
Above protocol step 402 and 403 all can adopt other modes to replace, specific as follows:
In above-mentioned schematic flow sheet 4 402 is have employed the source code that the source code of on-line debugging order is converted to off-line debug command by source code conversion compiler.Replacement scheme can not rely on compiler, realizes separately the conversion client instrument that the source code of on-line debugging order is converted to the source code of off-line debug command by.That is crossover tool can depart from compiler, and client utility possesses process of analysis rule map, generates the function of final source code.
In schematic flow sheet 4 402 another kind of replacement schemes are by compiler, and the code (mainly .c and .h file) of the off-line order converted is linked into a dynamic base (.dll or .so form).Secondary compiling so in 403 just can be omitted, and the debugger client of off-line only needs the dynamic base of generation in dynamic load 402 just can complete corresponding debug function.
Four, example
Below a kind of enforcement scene:
Refer to and Figure 5 shows that a source-to-source translation process instance, this example is to inquire about the CPU(CentralProcessingUnit of current system, central processing unit) load factor is example, Fig. 5 adopts C language to write, the related specifications can write with reference to C language, wherein left side one source code that is classified as on-line debugging order, the source code of corresponding with it off-line debug command that what right side arrow was pointed to is, the source code of on-line debugging order is converted to the process of the source code of off-line debug command by this example.Mainly be divided into three steps:
1, the global variable in this order realization is identified.This is the global variable that a business is relevant, is first to have the transformation rule identifying this service symbol.Rule is very simple, identifies the character string (namely in Fig. 5, the boldface letter content gone up most in a dotted line frame in large frame above) in quotation marks.
Off-line command converter constantly reads in input file (i.e. side code on the left of Fig. 5), when recognizing DSP_LkAddr key word, (this is the calling interface of a service inquiry symbolic address, when Rulemaking, can this interface interchange be configured in rule, coupling for character string), off-line command converter matches this key word character string bracketed with double quotation marks below, is exactly gstruCpuLoad in this example.Subsidiary implicit transformation rule is Member call original structure body Member call being converted to recognized character string, as struCpuLoad.uwCurLoad---->gstruCpuLoad.uwC urLoad, this transformation result is using the input as function call translation interface below.Conversion corresponding relation shown in arrow as shown in Figure 5.
2, obtain the function call of global variable value, replace to the function call in off-line debug client end.
As in Fig. 5, convert the calling interface DSP_CommRead of online query business address of variable to corresponding off-line calling interface getSymAddrSize, struCpuLoad.uwCurLoad---->gstruCpuLoad.uwC urLoad transformation result is above imported into as interface parameters simultaneously.
3, the function call returning results output is ordered to replace to the function call of off-line debug client end.
After the interface conversion that globak symbol and the acquisition overall situation are measured completes, just can realize the conversion of final step platform printout interface, this converted the function achieving last debug results output switching.On-line debugging interface LBB_DSP_Printf in such as this example is transformed into off-line printing interface printf.
Adopt above scheme, because the on-line debugging of built-in system software and off-line debugging are applied to different scenes, and the debud mode that is all absolutely necessary.The embodiment of the present invention realizes the off-line debugging of on-line debugging order, the on-line debugging of built-in system software and the overlapping development problem of off-line debugging can be solved, by the conversion of code that on-line debugging order is carried out debugging from the source code of on-line debugging order to off-line, convert the off-line debug command that can use on PC to, and using symbol resolution power and energy to become address and length the product business information related in order, namely off-line order can obtain system related information by the corresponding memory address interval of inquiry.The off-line debugging realizing on-line debugging order can be avoided realizing off-line debugging to different platforms, or when identical platform being realized to the off-line debugging of different editions, all need to revise the problem of debugger client, therefore, the inventive method can increase the usable range of online debugging acid, shorten the development time of off-line debugging acid, reduce cost of development.
The embodiment of the present invention additionally provides a kind of debugging conversion equipment of embedded system, as shown in Figure 6, comprising:
Rule unit 601, for the transformation rule of the on-line debugging order to off-line debug command that obtain customization;
Source code receiving element 602, for receiving the source code of online debug command;
Converting unit 603, for after above-mentioned source code receiving element 602 receives the source code of on-line debugging order, the transformation rule got according to above-mentioned Rule unit 601, converts the code supporting off-line debugging to by the source code of above-mentioned on-line debugging order;
Transmitting element 604, the code for the support off-line debugging above-mentioned converting unit 603 obtained sends to Target Board.
Above scheme, by the conversion of code that on-line debugging order is carried out debugging from the source code of on-line debugging order to off-line, realize the off-line debugging of on-line debugging order, the on-line debugging of built-in system software and the overlapping development problem of off-line debugging can be solved, avoid realizing off-line debugging to different platforms, or when identical platform being realized to the off-line debugging of different editions, all need to revise the problem of debugger client, therefore, the usable range of online debugging acid can be increased, shorten the development time of off-line debugging acid, reduce cost of development.
Alternatively, above-mentioned converting unit 603, specifically for converting the source code of off-line debug command to by the source code of above-mentioned on-line debugging order; The off-line order source code obtained and current debugger client are carried out secondary compiling and generate the debugger client supporting off-line debugging; Or, the source code of above-mentioned on-line debugging order is converted to the code of off-line debug command and is linked as dynamic base;
Above-mentioned transmitting element 604, the debugger client specifically for the support off-line debugging above-mentioned converting unit 603 obtained sends to Target Board; Or the dynamic base that above-mentioned converting unit 603 obtains is sent to Target Board.
Alternatively, above-mentioned converting unit 603, converts the source code of off-line order to by the source code of above-mentioned on-line debugging order specifically for use compiler; Or, 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, for reading in the source code of the on-line debugging order that above-mentioned source code receiving element 602 receives;
Matching unit 702, the transformation rule for obtaining according to above-mentioned Rule unit 601 carries out the rule match of character string;
Source code generation unit 704, if the match is successful for above-mentioned matching unit 702, then calls conversion process interface and generates the compiler morphology that can identify or syntactic units, the source code of then output off-line debug command.
Alternatively, above-mentioned Rule unit 601, the transformation rule of acquisition comprises: at least one item in symbol table information transformation rule, register and call stack rule, debugging output interface transformation rule, internal memory distribution rule;
Above-mentioned symbol table information transformation rule is: the address mapping information of on-line debugging order business related symbol or globak symbol is transformed into the rule of the symbolic information that in-circuit debugger can identify;
Above-mentioned register and call stack rule are: general-purpose register number, Function return addresses, 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 of distribution.
The embodiment of the present invention additionally provides a kind of debug system of embedded system, as shown in Figure 8, comprises, and debugger 801, Target Board 803, also comprise: any one debugging conversion equipment 802 that the embodiment of the present 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 that the service end of above-mentioned Target Board 803 exported to by the code of off-line debugging.
It should be noted that in above-mentioned debugging conversion equipment embodiment, included unit is carry out dividing according to function logic, but is not limited to above-mentioned division, as long as can realize corresponding function; 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 realized in above-mentioned each embodiment of the method is that the hardware that can carry out instruction relevant by program completes, corresponding program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
These are only the present invention's preferably embodiment; 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 present invention discloses, the change 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 (9)

1. an adjustment method for embedded system, is characterized in that, comprising:
Obtain the transformation rule of on-line debugging order to off-line debug command of customization;
After the source code receiving on-line debugging order, according to described transformation rule, the source code of described on-line debugging order is converted to the code supporting off-line debugging;
The code of described support off-line debugging is sent to Target Board;
Wherein, the described source code by described on-line debugging order converts the code supporting off-line debugging to, sends to Target Board to comprise the code of described support off-line debugging:
The source code of described on-line debugging order is converted to the source code of off-line debug command; By the off-line order source code that obtains and current debugger client, carry out secondary compiling and generate the debugger client supporting off-line debugging, the debugger client of described support off-line debugging is sent to Target Board; Or,
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.
2. method according to claim 1, it is characterized in that, the source code that the described source code by described on-line debugging order converts off-line debug command to comprises:
Compiler is used the source code of described on-line debugging order to be converted to the source code of off-line order; Or, by client utility, the source code of described on-line debugging order is converted to the source code of off-line order.
3. method according to claim 2, it is characterized in that, the source code that the source code of described on-line debugging order converts off-line order to comprises by described use compiler:
Read in the source code of described on-line debugging order, carry out the rule match of character string according to described transformation rule, if the match is successful, then call conversion process interface and generate the compiler morphology that can identify or syntactic units, the source code of then output off-line debug command.
4. method according to claims 1 to 3 any one, 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, internal memory distribution rule;
Described symbol table information transformation rule is: the address mapping information of on-line debugging order business related symbol or globak symbol is transformed into the rule of the symbolic information that in-circuit debugger can identify;
Described register and call stack rule are: general-purpose register number, Function return addresses, 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 of distribution.
5. a debugging conversion equipment for embedded system, is characterized in that, comprising:
Rule unit, for the transformation rule of the on-line debugging order to off-line debug command that obtain customization;
Source code receiving element, for receiving the source code of online debug command;
Converting unit, for after described source code receiving element receives the source code of on-line debugging order, the transformation rule got according to described Rule unit, converts the code supporting off-line debugging to by the source code of described on-line debugging order;
Transmitting element, the code for the support off-line debugging described converting unit obtained sends to Target Board;
Wherein, described converting unit, specifically for converting the source code of off-line debug command to by the source code of described on-line debugging order; The off-line order source code obtained and current debugger client are carried out secondary compiling and generate the debugger client supporting off-line debugging; Or, 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 transmitting element, the debugger client specifically for the support off-line debugging described converting unit obtained sends to Target Board; Or the dynamic base that described converting unit obtains is sent to Target Board.
6. debug conversion equipment according to claim 5, it is characterized in that,
Described converting unit, converts the source code of off-line order to by the source code of described on-line debugging order specifically for use compiler; Or, by client utility, the source code of described on-line debugging order is converted to the source code of off-line order.
7. debug conversion equipment according to claim 6, it is characterized in that, described converting unit comprises:
Reading unit, for reading in the source code of the on-line debugging order that described source code receiving element receives;
Matching unit, the transformation rule for obtaining according to described Rule unit carries out the rule match of character string;
Source code generation unit, if the match is successful for described matching unit, then calls conversion process interface and generates the compiler morphology that can identify or syntactic units, the source code of then output off-line debug command.
8. device according to claim 5 to 7 any one, is characterized in that,
Described Rule unit, the transformation rule of acquisition comprises: at least one item in symbol table information transformation rule, register and call stack rule, debugging output interface transformation rule, internal memory distribution rule;
Described symbol table information transformation rule is: the address mapping information of on-line debugging order business related symbol or globak symbol is transformed into the rule of the symbolic information that in-circuit debugger can identify;
Described register and call stack rule are: general-purpose register number, Function return addresses, 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 of distribution.
9. a debug system for embedded system, comprises, and debugger, Target Board, is characterized in that, also comprises: the debugging conversion equipment of claim 5 to 8 any one;
Described debugging conversion equipment receives the source code of online debug command from the client of described debugger, and will support that the service end of described Target Board exported to by the code of off-line debugging.
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 CN103218294A (en) 2013-07-24
CN103218294B true 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)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631716B (en) * 2013-11-29 2017-06-06 华为技术有限公司 The conversion method and equipment of a kind of debug command
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
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
CN109726213B (en) * 2018-12-10 2021-11-19 阿里巴巴(中国)有限公司 Program code conversion method, device, medium and computing equipment
CN109656535B (en) * 2018-12-24 2022-02-08 思必驰科技股份有限公司 Voice skill off-line development method based on browser
CN109507991B (en) * 2018-12-25 2020-08-11 中国兵器装备集团自动化研究所 Double-shaft servo control platform debugging system and method
CN110806976B (en) * 2019-10-24 2022-03-22 青岛英泰软件技术有限公司 Method for remotely pushing shell and CMD (command-to-command) commands
CN110853327B (en) * 2019-11-02 2021-04-02 杭州雅格纳科技有限公司 Ship cabin equipment data field debugging and collecting method and device based on single chip microcomputer
CN111143218B (en) * 2019-12-27 2024-03-26 深圳市共进电子股份有限公司 Log debugging method and device suitable for 5G embedded equipment and readable storage medium
CN112416790B (en) * 2020-11-30 2023-04-14 中国航空工业集团公司西安航空计算技术研究所 Embedded software offline replay debugging method and device
CN114020607B (en) * 2021-10-26 2024-02-13 苏州浪潮智能科技有限公司 BMC debugging method and device and computer equipment
CN114253837B (en) * 2021-11-22 2023-03-24 杭州加速科技有限公司 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

Also Published As

Publication number Publication date
CN103218294A (en) 2013-07-24

Similar Documents

Publication Publication Date Title
CN103218294B (en) A kind of adjustment method of embedded system, debugging conversion equipment and system
CN109902105B (en) Data query system, method, device and storage medium for micro-service architecture
US20070198457A1 (en) Accessing and manipulating data in a data flow graph
CN100511177C (en) Symbol locating method of embedded system
US20120079461A1 (en) Extensible device object model
CN102087594B (en) Management method and device for extension point and plugins
CN102375778A (en) Method and system for automatically testing digital signal processor (DSP)
CA2967251A1 (en) Intelligent code differencing using code clone detection
US20100313197A1 (en) System and method for operating domain profile using database in core framework for sdr mobile terminals
CN101924656A (en) Method and device for realizing network equipment CLI (Command Line Interface for batch scripti) based on dynamic configuration
CN101101602A (en) Data format verification method and device
CN111831700A (en) System and method for interoperable communication of automation system components
CN105446819B (en) A kind of service connection system and its design method
CN114047970A (en) Configuration method and system of AUTOSAR (automotive open system architecture) architecture software
US20140359258A1 (en) Declarative Configuration Elements
US6934949B2 (en) Method, computer program product, and system for dual mode batch program execution
CN115022312A (en) Method and device for realizing multiple intelligent contract engines, electronic equipment and storage medium
US20070240164A1 (en) Command line pipelining
CN112148283A (en) Implementation method of cross-platform ABI compatible C + + component framework
Seco et al. Robust contract evolution in a typesafe microservices architecture
CN112540813A (en) Application generation method based on workflow engine
CN101145954A (en) Implementation method for piling class of communication function
Baker et al. Early UML model testing using TTCN-3 and the UML testing profile
CN115659941B (en) File generation method and device suitable for multiple types of interfaces
Teiniker et al. A test-driven component development framework based on the CORBA component model

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