CN102646051A - Method, system and terminal equipment for outputting function execution streams - Google Patents

Method, system and terminal equipment for outputting function execution streams Download PDF

Info

Publication number
CN102646051A
CN102646051A CN2012100646575A CN201210064657A CN102646051A CN 102646051 A CN102646051 A CN 102646051A CN 2012100646575 A CN2012100646575 A CN 2012100646575A CN 201210064657 A CN201210064657 A CN 201210064657A CN 102646051 A CN102646051 A CN 102646051A
Authority
CN
China
Prior art keywords
register
soft interrupt
target program
value
module
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.)
Pending
Application number
CN2012100646575A
Other languages
Chinese (zh)
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.)
World (Shanghai) Technology Development Co., Ltd.
Original Assignee
Shenzhen Temobi Science and Technology 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 Shenzhen Temobi Science and Technology Co Ltd filed Critical Shenzhen Temobi Science and Technology Co Ltd
Priority to CN2012100646575A priority Critical patent/CN102646051A/en
Publication of CN102646051A publication Critical patent/CN102646051A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method, a system and terminal equipment for outputting function execution streams. Soft interrupt numbers are written in target program, the target program is operated, whether the function in the target program has the soft interrupt numbers or not is judged, and the function execution streams are output if the soft interrupt numbers exist. The function invoking relationship is clearly recorded by the execution streams, the practical operation logic of the target program can be fast and dynamically observed, the soft development and maintenance cost is reduced, and the software development and debugging time is shortened. When source codes are compiled, stack frame information when all functions in the source codes are compiled are generated, and meanwhile, the optimization options are omitted, so the soft interrupt numbers are accurately written in each function, and further, the function execution streams are accurately output.

Description

A kind of output function is carried out method, system and the terminal device of stream
Technical field
The present invention relates to the function call field, relate in particular to method, system and terminal device that a kind of output function is carried out stream.
Background technology
Traditional software debugging technology is divided into following dual mode:
1, implement the breakpoint place, ARM nuclear gets into the debug suspend pattern, at this time can carry out single step for jtag interface signal input instruction through the outside and carry out;
2, monitor the data observation point and execution observation point that sets through method for supervising.At this time ARM is in the environment of true operation;
More than two kinds of methods have following technical matters:
1, can only observe the test observation point, only play local understanding source program;
2, can not know function calling relationship in the understanding program;
3, can not dynamic observe the logic of target program actual motion fast;
Thereby research and development of software and maintenance cost are high, and the efficient of research and development of software and debugging is low.
Summary of the invention
The purpose of the embodiment of the invention is to propose method, system and the terminal device that a kind of output function is carried out stream, is intended to solve debugging technique of the prior art and can only observes the test observation point, has only played local understanding source program; Can not know the function calling relationship in the understanding program; Can not dynamic observe the logic of target program actual motion fast; The inefficient technical matters of research and development of software and maintenance cost height, research and development of software and debugging.
The embodiment of the invention is achieved in that a kind of method of output function execution stream, may further comprise the steps:
Compile source code generates target program, revises said target program and writes soft interrupt number;
Move said amended target program;
Judge whether the function in the said target program exists said soft interrupt number, if there is the execution stream of then exporting said function.
Another purpose of the embodiment of the invention is to propose the system that a kind of output function is carried out stream, and said system comprises: collector, write soft interrupt number module, operation module, judge module and output module;
Said collector is write soft interrupt number module and is linked to each other with said, is used for compile source code and generates target program;
Saidly write soft interrupt number module, link to each other with the operation module, be used to revise said target program and write soft interrupt number with said collector;
Said operation module is write soft interrupt number module and is linked to each other with judge module with said, is used to move said amended target program;
Said judge module links to each other with output module with said operation module, is used for judging whether the function of said target program exists said soft interrupt number, then notifies said output module if exist;
Said output module links to each other with said judge module, is used to receive the notice of said judge module, and exports the execution stream of said function.
Another purpose of the embodiment of the invention is to propose a kind of terminal device that said output function is carried out streaming system that comprises.
Beneficial effect of the present invention:
The present invention moves said target program through in target program, writing soft interrupt number, judges whether the function in the said target program exists said soft interrupt number, if there is the execution stream of then exporting said function.Said execution stream has clearly write down function calling relationship, and can obtain all on-the-spot functions, can be fast, the logic of object observing program actual motion dynamically, reduced research and development of software and maintenance cost, and shortened the time of research and development of software and debugging.When compile source code, compiler generates in the said source code all functions by the stack frame information of compile time, and option is optimized in cancellation simultaneously; At this moment each function has and has only a sub fp, ip, #4 instruction; Through said sub fp, ip, #4 instruction will be instructed mov ip exactly; The machine code of sp is revised as soft interrupt number, and further the execution of output function is flowed exactly.The target program behind the soft interrupt number is revised in operation; Obtain the value of LR register; And obtain 24 bit data of the soft interrupt instruction of SWI in the said address as the address of data access through LR-4, if 24 bit data of being obtained are the soft interrupt number of being revised, then export the value of LR register; Otherwise, jump to the section start of the soft interrupt handling routine of system itself.Through the value of output LR register, can export the full content of R0-R14.In addition, the process of revising the soft interrupt number and the value of output LR register can be encapsulated as PC instrument and soft interrupt routine respectively, further increases work efficiency; And; In the program debug process, target program is in the actual motion state fully, does not influence the operation of soft interrupt routine.
Description of drawings
Fig. 1 is the process flow diagram that a kind of output function of the present invention is carried out first preferred embodiment of stream method;
Fig. 2 is the process flow diagram that a kind of output function of the present invention is carried out second preferred embodiment of stream method;
Fig. 3 is the process flow diagram that a kind of output function of the present invention is carried out the 3rd preferred embodiment of stream method;
Fig. 4 is the structural representation that a kind of output function of the present invention is carried out first preferred embodiment of streaming system;
Fig. 5 is the structural representation that a kind of output function of the present invention is carried out second preferred embodiment of streaming system;
Fig. 6 is the structural representation that a kind of output function of the present invention is carried out the 3rd preferred embodiment of streaming system;
Fig. 7 is the structural representation that a kind of output function of the present invention is carried out the 4th preferred embodiment of streaming system;
Fig. 8 is the structural representation that a kind of output function of the present invention is carried out the 5th preferred embodiment of streaming system;
Fig. 9 is the structural representation that a kind of output function of the present invention is carried out the 6th preferred embodiment of streaming system.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer, below in conjunction with accompanying drawing and embodiment, the present invention is further elaborated, for the ease of explanation, only show the part relevant with the embodiment of the invention.Should be appreciated that the specific embodiment that this place is described, only be used to explain the present invention, not in order to restriction the present invention.
The present invention moves said target program through in target program, writing soft interrupt number, judges whether the function in the said target program exists said soft interrupt number, if there is the execution stream of then exporting said function.Said execution stream has clearly write down function calling relationship, and can obtain all on-the-spot functions, can be fast, the logic of object observing program actual motion dynamically, reduced research and development of software and maintenance cost, and shortened the time of research and development of software and debugging.When compile source code, compiler generates in the said source code all functions by the stack frame information of compile time, and option is optimized in cancellation simultaneously; At this moment each function has and has only a sub fp, ip, #4 instruction; Through said sub fp, ip, #4 instruction will be instructed mov ip exactly; The machine code of sp is revised as soft interrupt number, and further the execution of output function is flowed exactly.The target program behind the soft interrupt number is revised in operation; Obtain the value of LR register; And obtain 24 bit data of the soft interrupt instruction of SWI in the said address as the address of data access through LR-4, if 24 bit data of being obtained are the soft interrupt number of being revised, then export the value of LR register; Otherwise, jump to the section start of the soft interrupt handling routine of system itself.Through the value of output LR register, can export the full content of R0-R14.In addition, the process of revising the soft interrupt number and the value of output LR register can be encapsulated as PC instrument and soft interrupt routine respectively, further increases work efficiency; And; In the program debug process, target program is in the actual motion state fully, does not influence the operation of soft interrupt routine.
Embodiment one
Fig. 1 is the process flow diagram that a kind of output function of the present invention is carried out first preferred embodiment of stream method.Described method may further comprise the steps:
S101, compile source code generates target program, revises said target program and writes soft interrupt number;
S102 moves said amended target program;
S103 judges whether the function in the said target program exists said soft interrupt number, if there is the execution stream of then exporting said function;
Said " compile source code generation target program " comprising: option is optimized in cancellation, and compile source code generates target program, generates in the said source code all functions by the stack frame information of compile time;
Said " generate in the said source code all functions by the stack frame information of compile time " is specially:
The value of ip register holds sp: mov ip, sp;
Value in the ip register subtracts 4 and is saved in the fp register: sub fp, ip, #4;
Said optimization option is the option parameter of comprising in the compiler-02 ,-01, band " 0 " such as-03.
Embodiment two
Fig. 2 is the process flow diagram that a kind of output function of the present invention is carried out second preferred embodiment of stream method.Described method may further comprise the steps:
S201, option is optimized in cancellation, and compile source code generates target program, and generates in the said source code all functions by the stack frame information of compile time;
Optimize option by compiler cancellation during compile source code, compile said source code and generate target program, and generate in the said source code all functions by the stack frame information of compile time;
S202 searches the binary data of " value in the ip register subtracts 4 and is saved in the fp register " instruction in the target program; Promptly search the sub fp in the target program, ip, the binary data of #4 instruction;
Cancellation is optimized under the situation of option, mov ip, and the sp instruction is article one instruction that compiler gets into each function, said sub fp, ip, #4 is specially for carrying out the initialized sufficient and necessary condition of function:
According to stack frame principle fp register be before function is handled, must preserve the sp register as frame at the bottom of;
Compiler can not be used for other purpose the usefulness of fp register as the stack address storage when function was carried out, and instruction promptly can not occur and deposit new value in for the sp register, otherwise will destroy stack frame standard;
So sub fp, ip, #4 represent to get into a new function and a sub fp, ip, #4 can only be arranged;
S203 is to the binary data that returns inquiry " value in the sp register is saved in the ip register " instruction; Promptly to returning inquiry mov ip, the binary data of sp instruction;
After finding the binary data of said " value in the ip register subtracts 4 and is saved in the fp register " instruction, to returning inquiry up to the binary data that finds " value of sp register is saved in the ip register " instruction; That is, find said sub fp, ip is behind the binary data of #4 instruction, to returning inquiry up to finding mov ip, the binary data of sp instruction;
S204 is revised as soft interrupt number with the corresponding machine code of said " value of sp register is saved in the ip register " instruction, is about to said mov ip, and sp instructs corresponding machine code to be revised as soft interrupt number;
Said soft interrupt number is for can not be by the employed value of system, 0xaaaaaa for example, and said machine code 0xefaaaaaa representes soft interrupt instruction swi 0xaaaaaa;
S205, the target program behind the soft interrupt number is revised in operation;
S206 judges whether the function in the said target program exists said soft interrupt number, if there is the execution stream of then exporting said function.
Embodiment three
Fig. 3 is the process flow diagram that a kind of output function of the present invention is carried out the 3rd preferred embodiment of stream method.Described method may further comprise the steps:
S301, option is optimized in cancellation, and compile source code generates target program, and generates in the said source code all functions by the stack frame information of compile time;
S302 searches the binary data of " value in the ip register subtracts 4 and is saved in the fp register " instruction in the target program; Promptly search the sub fp in the target program, ip, the binary data of #4 instruction;
S303 is to the binary data that returns inquiry " value in the sp register is saved in the ip register " instruction; Promptly to returning inquiry mov ip, the binary data of sp instruction;
S304 is revised as soft interrupt number with the corresponding machine code of said " value in the sp register is saved in the ip register " instruction, is about to said mov ip, and sp instructs corresponding machine code to be revised as soft interrupt number;
S305, the target program behind the soft interrupt number is revised in operation;
S306 obtains the value of LR register; Promptly obtain the currency of LR register;
Said LR register is one of CPU general-purpose register; The currency of LR register has been preserved the return address that gets into after soft interruption and soft Interrupt Process are accomplished; Specifically preserve automatically by CPU core hardware, the address of next bar instruction of carrying out when withdrawing from after just soft Interrupt Process is accomplished, for example:
Swi?0xaaaaaa
Mov?r0,r0(LR)
Next bar instruction that said command M ov r0, r0 (LR) carry out when just withdrawing from after accomplishing for soft Interrupt Process;
S307 with " value in the LR register the subtracts 4 " address as data access, obtains 24 bit data of the soft interrupt instruction of SWI in the said address; Be about to LR-4 obtains the soft interrupt instruction of SWI in the said address as the address of data access 24 bit data;
For example, said 24 bit data are low 24 of said machine code 0xefaaaaaa, i.e. 0xaaaaaa;
SWI (Software Interrupt, soft interruption) is the instruction that cpu instruction is concentrated;
The value of LR register is the address of next bar instruction of carrying out when withdrawing from after soft Interrupt Process is accomplished, the address when LR-4 is exactly the soft interrupt instruction of current executed so;
S308 judges whether 24 bit data of being obtained are soft interrupt number, if not, then get into step S309, if then get into step S310;
If represent that then 24 bit data of being obtained are amended soft interrupt number;
If, do not represent that then 24 bit data of being obtained are the existing soft interrupt instruction of system;
S309 jumps to the section start of the soft interrupt handling routine of system itself;
S310, the value of output LR register;
Export the address of next bar instruction of carrying out when withdrawing from after soft Interrupt Process is accomplished, promptly export the execution stream of current function;
The value of the LR register of being exported can be used to draw function call tree etc., thereby image is expressed the call relation between the function in the program;
S311 is saved in the ip register with the value in the sp register; The mov ip that promptly executes instruction, sp;
S312 turns back to and continues to carry out current function on the value of LR register;
Finish soft Interrupt Process, turn back on the address of next bar instruction of carrying out when withdrawing from after soft Interrupt Process is accomplished and continue to carry out current function.
The further optimization of such scheme is that the process of said " revise said target program and write soft interrupt number " is encapsulated as the PC instrument, revises said target program and writes soft interrupt number through said PC instrument.
Said PC instrument is the application program that develops under the VC IDE, is used to revise the binary object file that compiler generates, and writes soft interrupt number.
The further optimization of such scheme is; The process of said " judging whether the function in the said target program exists said soft interrupt number; if there is the execution stream of then exporting said function " is encapsulated as soft interrupt routine, carries out stream through carrying out said soft interrupt routine output function.
The present invention moves said target program through in target program, writing soft interrupt number, judges whether the function in the said target program exists said soft interrupt number, if there is the execution stream of then exporting said function.Said execution stream has clearly write down function calling relationship, and can obtain all on-the-spot functions, can be fast, the logic of object observing program actual motion dynamically, reduced research and development of software and maintenance cost, and shortened the time of research and development of software and debugging.When compile source code, compiler generates in the said source code all functions by the stack frame information of compile time, and option is optimized in cancellation simultaneously; At this moment each function has and has only a sub fp, ip, #4 instruction; Through said sub fp, ip, #4 instruction will be instructed mov ip exactly; The machine code of sp is revised as soft interrupt number, and further the execution of output function is flowed exactly.The target program behind the soft interrupt number is revised in operation; Obtain the value of LR register; And obtain 24 bit data of the soft interrupt instruction of SWI in the said address as the address of data access through LR-4, if 24 bit data of being obtained are the soft interrupt number of being revised, then export the value of LR register; Otherwise, jump to the section start of the soft interrupt handling routine of system itself.Through the value of output LR register, can export the full content of R0-R14.In addition, the process of revising the soft interrupt number and the value of output LR register can be encapsulated as PC instrument and soft interrupt routine respectively, further increases work efficiency; And; In the program debug process, target program is in the actual motion state fully, does not influence the operation of soft interrupt routine.
Embodiment four
Fig. 4 is the structural representation that a kind of output function of the present invention is carried out first preferred embodiment of streaming system.
Described system comprises: collector, write soft interrupt number module, the operation module, judge module and output module;
Said collector is write soft interrupt number module and is linked to each other with said, is used for compile source code and generates target program;
Saidly write soft interrupt number module, link to each other with the operation module, be used to revise said target program and write soft interrupt number with said collector;
Said operation module is write soft interrupt number module and is linked to each other with judge module with said, is used to move said amended target program;
Said judge module links to each other with output module with said operation module, is used for judging whether the function of said target program exists said soft interrupt number, then notifies said output module if exist;
Said output module links to each other with said judge module, is used to receive the notice of said judge module, and exports the execution stream of said function.
The further optimization of such scheme is that said collector comprises: stack frame information unit, cancellation preferred cell and generation object element are illustrated in figure 5 as the structural representation that a kind of output function of the present invention is carried out second preferred embodiment of streaming system.
Said stack frame information unit links to each other with said cancellation preferred cell, is used for generating all functions of said source code by the stack frame information of compile time, is specially:
The value of ip register holds sp: mov ip, sp
Value in the ip register subtracts 4 and is saved in the fp register: sub fp, ip, #4;
Said cancellation preferred cell links to each other with the generation object element with said stack frame information unit, is used for cancellation and optimizes option;
Said cancellation is optimized option and is referred to cancel the option that parameter in the compiler comprises band " 0 " such as-02 ,-01 ,-03;
Said generation object element, with said cancellation preferred cell with write soft interrupt number module and link to each other, be used to generate target program.
Such scheme further optimized be, saidly write soft interrupt number module and comprise: first searches unit, second searches the unit and revises the unit, is illustrated in figure 6 as the structural representation that a kind of output function of the present invention is carried out the 3rd preferred embodiment of streaming system.
Said first searches the unit, searches the unit and generates object element and link to each other with said second, is used for searching the binary data that target program " value in the ip register subtracts 4 and is saved in the fp register " instructs;
Cancellation is optimized under the situation of option, mov ip, and the sp instruction is article one instruction that compiler gets into function, said sub fp, ip, #4 is specially for carrying out the initialized sufficient and necessary condition of function:
According to stack frame principle fp register be before function is handled, must preserve the sp register as frame at the bottom of;
Compiler can not be used for other purpose the usefulness of fp register as the stack address storage when function was carried out, and instruction promptly can not occur and deposit new value in for the sp register, otherwise will destroy stack frame standard;
So sub fp, ip, #4 represent to get into a new function and a sub fp, ip, #4 can only be arranged;
Said second searches the unit, searches the unit and revises the unit and link to each other with said first, is used for to returning the binary data that inquiry " value of sp register is saved in the ip register " is instructed; Promptly to returning inquiry movip, the binary data of sp instruction;
After finding the binary data of said " value in the ip register subtracts 4 and is saved in the fp register " instruction, to returning inquiry up to the binary data that finds " value of sp register is saved in the ip register " instruction;
Promptly find said sub fp, ip is behind the binary data of #4 instruction, to returning inquiry up to finding movip, the binary data of sp instruction;
Said modification unit; With said second search the unit with the operation module link to each other; Be used for the corresponding machine code of said " value of sp register is saved in the ip register " instruction is revised as soft interrupt number, be about to said mov ip, sp instructs corresponding machine code to be revised as soft interrupt number;
Said soft interrupt number is for can not be by the employed value of system, 0xaaaaaa for example, and said machine code 0xefaaaaaa representes soft interrupt instruction swi 0xaaaaaa.
Such scheme further optimized be, said judge module comprises and obtains the LR value cell, obtains data cell and judging unit, is illustrated in figure 7 as the structural representation that a kind of output function of the present invention is carried out the 4th preferred embodiment of streaming system.
The said LR value cell that obtains links to each other with the operation module with the said data cell of obtaining, and is used to obtain the value of LR register; Promptly obtain the currency of LR register;
Said LR register is one of CPU general-purpose register; The currency of LR register has been preserved the return address that gets into after the soft Interrupt Process of having no progeny in soft is accomplished; Specifically preserve automatically by CPU core hardware, the address of next bar instruction of carrying out when withdrawing from after just soft Interrupt Process is accomplished, for example:
Swi?0xaaaaaa
Mov?r0,r0(LR)
Next bar instruction that said command M ov r0, r0 (LR) carry out when just withdrawing from after accomplishing for soft Interrupt Process;
The said data cell of obtaining links to each other with judging unit with the said LR of obtaining value cell, is used for " value of LR register subtracts 4 " obtaining 24 bit data of the soft interrupt instruction of SWI in the said address as the address of data access; Be about to LR-4 obtains the soft interrupt instruction of SWI in the said address as the address of data access 24 bit data;
For example, said 24 bit data are low 24 of said machine code 0xefaaaaaa, i.e. 0xaaaaaa;
SWI (Software Interrupt, soft interruption) is the instruction that cpu instruction is concentrated;
The value of LR register is the address of next bar instruction of carrying out when withdrawing from after soft Interrupt Process is accomplished, the address when LR-4 is exactly the soft interrupt instruction of current executed so;
Said judging unit links to each other with output module with the said data cell of obtaining, and is used to judge whether 24 bit data of being obtained are soft interrupt number, if then notify output module;
If represent that then 24 bit data of being obtained are amended soft interrupt number;
Said output module also is used to receive the notice of said judging unit, and the value of output LR register;
Export the address of next bar instruction of carrying out when withdrawing from after soft Interrupt Process is accomplished, promptly export the execution stream of current function.
Such scheme further optimized be, said system also comprises and returns module, is illustrated in figure 8 as the structural representation that a kind of output function of the present invention is carried out the 5th preferred embodiment of streaming system;
The said module of returning links to each other with said output module, is used for value with the sp register and is saved in the ip register (the mov ip that promptly executes instruction sp), and turns back on the value of LR register and continues to carry out current function;
Finish soft Interrupt Process, continue to carry out current function on the address of next bar instruction of carrying out when turning back to soft interruption and withdrawing from.
The further optimization of such scheme is that said system also comprises the redirect module, is illustrated in figure 9 as the structural representation that a kind of output function of the present invention is carried out the 6th preferred embodiment of streaming system;
Said judging unit links to each other with said data cell, output module and the redirect module obtained, and also is used to judge the soft interrupt number whether 24 bit data obtained are, if not, then notify said redirect module;
Said redirect module links to each other with said judge module, is used to receive the notice of said judging unit, and jumps to the section start of the soft interrupt handling routine of system itself;
If, do not represent that then 24 bit data of being obtained are the existing soft interrupt number of system.
The present invention generates target program through the collector compile source code; Writing soft interrupt number module revises said target program and writes soft interrupt number; The operation module is moved said target program; Judge module judges whether the function in the said target program exists said soft interrupt number, if there is the execution stream of then being exported said function by output module.Said execution stream has clearly write down function calling relationship, and can obtain all on-the-spot functions, can be fast, the logic of object observing program actual motion dynamically, reduced research and development of software and maintenance cost, and shortened the time of research and development of software and debugging.Further, when compile source code, stack frame information unit generates in the said source code all functions by the stack frame information of compile time; Option is optimized in the cancellation of cancellation preferred cell; At this moment each function has and has only an instruction sub fp, ip, and #4 searches the unit through first and searches the sub fp in the target program, ip, the binary data of #4 instruction; Second searches the unit to returning inquiry mov ip, the binary data of sp instruction; Revise the unit with said mov ip, sp instructs corresponding machine code to be revised as soft interrupt number; Thereby write soft interrupt number to each function exactly.Further, when target program puts into operation, obtain the value that the LR value cell obtains the LR register; Obtain data cell the value in the LR register is subtracted 4 addresses as data access, obtain 24 bit data of the soft interrupt instruction of SWI in the said address; Whether 24 bit data that judgment unit judges is obtained are soft interrupt number, if, then by the value of output module output LR register; If, then do not jump to the section start of the soft interrupt handling routine of system itself by the redirect module.Through the value of output LR register, can export the full content of R0-R14.In addition, the process of revising the soft interrupt number and the value of output LR register can be encapsulated as PC instrument and soft interrupt routine respectively, further increases work efficiency; And; In the program debug process, target program is in the actual motion state fully, does not influence the operation of soft interrupt routine.
The system that output function provided by the invention is carried out stream need can be applied to output function carry out stream terminal device on, for example PC, PDA, mobile phone, server etc.
Those having ordinary skill in the art will appreciate that; All or part of step in realization the foregoing description method can be accomplished through the programmed instruction related hardware; Described program can be stored in the computer read/write memory medium, and described storage medium can be ROM, RAM, disk, CD etc.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (11)

1. an output function is carried out the method that flows, and said method comprises step:
Compile source code generates target program, revises said target program and writes soft interrupt number;
Move said amended target program;
Judge whether the function in the said target program exists said soft interrupt number, if there is the execution stream of then exporting said function.
2. output function according to claim 1 is carried out the method for stream; It is characterized in that; Said " compile source code generation target program " comprising: option is optimized in cancellation, and compile source code generates target program, generates in the said source code all functions by the stack frame information of compile time.
3. output function according to claim 2 is carried out the method for stream, it is characterized in that said " revise said target program and write soft interrupt number " is specially:
Search the binary data that " value in the ip register is subtracted 4 be saved in the fp register " instruction in the target program;
To the binary data that returns inquiry " value in the sp register is saved in the ip register " instruction;
The corresponding machine code of said " value in the sp register is saved in the ip register " instruction is revised as soft interrupt number.
4. output function according to claim 3 is carried out the method for stream, it is characterized in that, said " judging whether the function in the said target program exists said soft interrupt number, if there is the execution stream of then exporting said function " is specially:
Obtain the value of LR register;
Address in the LR register is subtracted 4 addresses as data access, obtain 24 bit data of the soft interrupt instruction of SWI in the said address;
Judge whether 24 bit data obtained are soft interrupt number, if then export the value of LR register.
5. output function according to claim 4 is carried out the method for stream, it is characterized in that, said step " judges whether 24 bit data of being obtained are soft interrupt number, if then export the value of LR register " also comprises step afterwards:
Value in the sp register is saved in the ip register;
Turn back to and continue to carry out current function on the value of LR register.
6. output function according to claim 4 is carried out the method for stream, it is characterized in that, said step " is judged the soft interrupt number whether 24 bit data obtained are, if then export the value of LR register " and also comprised step afterwards:
If, then do not jump to the section start of the soft interrupt handling routine of system itself.
7. an output function is carried out the system of stream, it is characterized in that said system comprises: collector, write soft interrupt number module, operation module, judge module and output module;
Said collector is write soft interrupt number module and is linked to each other with said, is used for compile source code and generates target program;
Saidly write soft interrupt number module, link to each other with the operation module, be used to revise said target program and write soft interrupt number with said collector;
Said operation module is write soft interrupt number module and is linked to each other with judge module with said, is used to move said amended target program;
Said judge module links to each other with output module with said operation module, is used for judging whether the function of said target program exists said soft interrupt number, then notifies said output module if exist;
Said output module links to each other with said judge module, is used to receive the notice of said judge module, and exports the execution stream of said function.
8. output function according to claim 7 is carried out the system of stream, it is characterized in that said collector comprises: stack frame information unit, cancellation preferred cell and generation object element;
Said stack frame information unit links to each other with said cancellation preferred cell, is used for generating all functions of said source code by the stack frame information of compile time;
Said cancellation preferred cell links to each other with the generation object element with said stack frame information unit, is used for cancellation and optimizes option;
Said generation object element, with said cancellation preferred cell with write soft interrupt number module and link to each other, be used to generate target program.
9. output function according to claim 8 is carried out the system of stream, it is characterized in that, saidly writes soft interrupt number module and comprises: first searches unit, second searches the unit and revises the unit;
Said first searches the unit, searches the unit and generates object element and link to each other with said second, is used for searching the binary data that target program " value in the ip register subtracts 4 and is saved in the fp register " instructs;
Said second searches the unit, searches the unit and revises the unit and link to each other with said first, is used for to returning the binary data that inquiry " value of sp register is saved in the ip register " is instructed;
Said modification unit is searched the unit and is linked to each other with the operation module with said second, is used for instructing corresponding machine code to be revised as soft interrupt number with said " value of sp register is saved in the ip register ".
10. output function according to claim 9 is carried out the system of stream, it is characterized in that, said judge module comprises and obtains the LR value cell, obtains data cell and judging unit;
The said LR value cell that obtains links to each other with the operation module with the said data cell of obtaining, and is used to obtain the value of LR register;
The said data cell of obtaining links to each other with judging unit with the said LR of obtaining value cell, is used for " value of LR register subtracts 4 " obtaining 24 bit data of the soft interrupt instruction of SWI in the said address as the address of data access;
Said judging unit links to each other with output module with the said data cell of obtaining, and is used to judge whether 24 bit data of being obtained are soft interrupt number, if then notify output module;
Said output module also is used to receive the notice of said judging unit, and the value of output LR register.
11. an output function is carried out the terminal device of stream, it is characterized in that, described terminal device comprises the system of any described output function execution stream of claim 7-10.
CN2012100646575A 2012-03-13 2012-03-13 Method, system and terminal equipment for outputting function execution streams Pending CN102646051A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012100646575A CN102646051A (en) 2012-03-13 2012-03-13 Method, system and terminal equipment for outputting function execution streams

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012100646575A CN102646051A (en) 2012-03-13 2012-03-13 Method, system and terminal equipment for outputting function execution streams

Publications (1)

Publication Number Publication Date
CN102646051A true CN102646051A (en) 2012-08-22

Family

ID=46658880

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012100646575A Pending CN102646051A (en) 2012-03-13 2012-03-13 Method, system and terminal equipment for outputting function execution streams

Country Status (1)

Country Link
CN (1) CN102646051A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109726095A (en) * 2017-10-27 2019-05-07 深圳市中兴微电子技术有限公司 A kind of method, system and device of multi core chip debugging

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030023955A1 (en) * 2001-07-26 2003-01-30 International Business Machines Corporation Efficient monitoring of program variables under debug
CN1971534A (en) * 2005-11-21 2007-05-30 洛阳卓航测控设备有限责任公司 Method for setting breakpoint of user software program of SCM development system
CN101178685A (en) * 2007-09-27 2008-05-14 上海大学 Enhancement type microprocessor piece on-chip dynamic state tracking method with special function register breakpoints
CN101246449A (en) * 2008-02-25 2008-08-20 华为技术有限公司 Tracking function invocation track method and device
CN101339581A (en) * 2008-08-29 2009-01-07 北京中星微电子有限公司 Embedded system on-line debugging emulation method based on communication interruption
CN101639805A (en) * 2008-07-31 2010-02-03 国际商业机器公司 Method and equipment for tracing variable in program debugging

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030023955A1 (en) * 2001-07-26 2003-01-30 International Business Machines Corporation Efficient monitoring of program variables under debug
CN1971534A (en) * 2005-11-21 2007-05-30 洛阳卓航测控设备有限责任公司 Method for setting breakpoint of user software program of SCM development system
CN101178685A (en) * 2007-09-27 2008-05-14 上海大学 Enhancement type microprocessor piece on-chip dynamic state tracking method with special function register breakpoints
CN101246449A (en) * 2008-02-25 2008-08-20 华为技术有限公司 Tracking function invocation track method and device
CN101639805A (en) * 2008-07-31 2010-02-03 国际商业机器公司 Method and equipment for tracing variable in program debugging
CN101339581A (en) * 2008-08-29 2009-01-07 北京中星微电子有限公司 Embedded system on-line debugging emulation method based on communication interruption

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GDUTLIUYUN827: "SWI中断", 《HTTP://WENKU.BAIDU.COM/VIEW/BA2CE64733687E21AF45A966.HTML?RE=VIEW 》 *
台继荣 等: "一个可编程C语言图像处理软件中跟踪调试功能的实现", 《计算机工程与科学》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109726095A (en) * 2017-10-27 2019-05-07 深圳市中兴微电子技术有限公司 A kind of method, system and device of multi core chip debugging

Similar Documents

Publication Publication Date Title
CN106940654B (en) Automatic detection and positioning method for memory error in source code
CN101446918B (en) Method for realizing debugging of single function by user state debugger and system thereof
CN100375060C (en) Embedded system and real-time monitoring and processing method thereof
CN104063325A (en) Automatic generation device and method for test cases of embedded software
CN103729288A (en) Application program debugging method under embedded multi-core environment
CN107515808A (en) Log recording method, device, computer equipment and computer-readable recording medium
CN101458725B (en) Microcontroller chip and debug method thereof
JP2007500401A (en) Software debugging apparatus and method
CN100359472C (en) Method for processing library function call in binary translation
CN104346274A (en) Program debugger and program debugging method
CN111767116B (en) Virtual machine for developing programming language for mechanical arm program and running method for assembly file
CN102289362A (en) Segmented symbolic execution device and working method thereof
CN101847096B (en) Optimization method of stack variable-containing function
CN111989655B (en) SOC chip, method for determining hotspot function and terminal equipment
US6598181B1 (en) Method and system for debugging multiple function calls
US20200143061A1 (en) Method and apparatus for tracking location of input data that causes binary vulnerability
CN111680290A (en) Code pile inserting frame system based on Ether house virtual machine
CN109542444A (en) Monitoring method, device, server and the storage medium of JAVA application
KR101636517B1 (en) Computing system and method for processing debug information of computing system
CN107977577A (en) access instruction access detection method and device
CN102646051A (en) Method, system and terminal equipment for outputting function execution streams
CN110187884B (en) Memory access instruction instrumentation optimization method in multi-thread application scene
US7664997B2 (en) Failure handling and debugging with causalities
CN102495795B (en) Software vulnerability testing method based on intermediate language analysis
CN115795489B (en) Software vulnerability static analysis method and device based on hardware-level process tracking

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 19, building 18, Changhong technology building, 518057 South twelve Road, South tech Zone, Nanshan District hi tech Zone, Guangdong, Shenzhen

Applicant after: SHENZHEN TEMOBI TECHNOLOGY CO., LTD.

Address before: 19, building 18, Changhong technology building, 518057 South twelve Road, South tech Zone, Nanshan District hi tech Zone, Guangdong, Shenzhen

Applicant before: Shenzhen Temobi Science & Tech Development Co.,Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: SHENZHEN TEMOBI SCIENCE + TECHNOLOGY CO., LTD. TO: SHENZHEN RONGCHANG TIANXIA TECHNOLOGY CO., LTD.

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: RONGCHUANG TIANXIA (SHANGHAI) TECHNOLOGY DEVELOPME

Free format text: FORMER OWNER: SHENZHEN RONGCHANG TIANXIA TECHNOLOGY CO., LTD.

Effective date: 20150610

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20150610

Address after: 200433 Shanghai City, Yangpu District Wei Road No. 6 room 502-8

Applicant after: World (Shanghai) Technology Development Co., Ltd.

Address before: 19, building 18, Changhong technology building, 518057 South twelve Road, South tech Zone, Nanshan District hi tech Zone, Guangdong, Shenzhen

Applicant before: SHENZHEN TEMOBI TECHNOLOGY CO., LTD.

WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120822

WD01 Invention patent application deemed withdrawn after publication