CN109766273A - Localization method, device, computer equipment and the storage medium of endless loop - Google Patents

Localization method, device, computer equipment and the storage medium of endless loop Download PDF

Info

Publication number
CN109766273A
CN109766273A CN201811612920.3A CN201811612920A CN109766273A CN 109766273 A CN109766273 A CN 109766273A CN 201811612920 A CN201811612920 A CN 201811612920A CN 109766273 A CN109766273 A CN 109766273A
Authority
CN
China
Prior art keywords
service routine
interrupt
interruption
endless loop
external interrupt
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811612920.3A
Other languages
Chinese (zh)
Other versions
CN109766273B (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.)
PAX Computer Technology Shenzhen Co Ltd
Original Assignee
PAX Computer Technology Shenzhen 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 PAX Computer Technology Shenzhen Co Ltd filed Critical PAX Computer Technology Shenzhen Co Ltd
Priority to CN201811612920.3A priority Critical patent/CN109766273B/en
Publication of CN109766273A publication Critical patent/CN109766273A/en
Application granted granted Critical
Publication of CN109766273B publication Critical patent/CN109766273B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

This application involves a kind of localization method of endless loop, device, computer equipment and storage mediums.Method includes: when detecting that endless loop occurs in external interrupt service routine, it triggers quick-speed interruption service routine and interrupts external interrupt service routine, generated interruption result when obtaining through triggering quick-speed interruption service routine interruption external interrupt service routine, obtain the triggering times that triggering quick-speed interruption service routine interrupts external interrupt service routine, when triggering times are less than default triggering times, triggering quick-speed interruption service routine interrupts external interrupt service routine again, generate interrupting information corresponding with result is interrupted, and generate dis-assembling code corresponding with interrupting information, according to the endless loop position of the corresponding breakpoint address of interrupting information and dis-assembling Code location external interrupt service routine.The external interrupt service routine for endless loop occur is interrupted by triggering quick-speed interruption service routine, and endless loop is positioned according to dis-assembling code, the location efficiency of endless loop can be improved.

Description

Localization method, device, computer equipment and the storage medium of endless loop
Technical field
This application involves field of computer technology, set more particularly to the localization method, device, computer of a kind of endless loop Standby and storage medium.
Background technique
When the processor in computer is handling internal data, there is emergency in the external world, and computer may require that Processor suspends current work and goes processing emergency, and after being disposed, processor can return the ground being interrupted originally Location, continues original work, and such process is known as interrupting.Computer breaks service routine when being interrupted in use, can be with Conventional interrupt issued transaction is carried out using external interrupt service routine, external interrupt service routine can support a variety of interruptions simultaneously Source, and the running priority grade of external interrupt service routine is higher than non-interrupted program, i.e. when external interrupt service routine is triggered Bring into operation corresponding service routine.When external interrupt service routine is interrupted, it is possible to endless loop can be fallen into, cause to interrupt Process exception will completely or almost completely occupy the runing time of CPU, generally require the position for navigating to endless loop generation, Interruption process can be just set to restore normal.In traditional method, endless loop can be positioned by hardware debugging tool, example Such as, endless loop can be positioned using JTAG hardware debugging tool, the positioning method of this endless loop needs CPU to have Jtag interface.Debugging message output statement can also be inserted into the interruption breakpoint bit of interrupt service routine to realize to endless loop Positioning.
However, it is very cumbersome to the localization method of endless loop at present, cause the location efficiency of endless loop lower.
Summary of the invention
Based on this, it is necessary to which in view of the above technical problems, the localization method, device, computer for providing a kind of endless loop are set The location efficiency of endless loop can be improved in standby and storage medium.
A kind of localization method of endless loop, which comprises
When detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption service routine interrupts the outside Interrupt service routine;
Generated interruption when interrupting the external interrupt service routine by triggering quick-speed interruption service routine is obtained to tie Fruit;
It obtains and triggers the triggering times that the quick-speed interruption service routine interrupts the external interrupt service routine;
When the triggering times are less than default triggering times, execute described in the triggering quick-speed interruption service routine interruption The step of external interrupt service routine;The interruption generated every time is obtained as a result, and generating interruption letter according to the interruption result of acquisition Breath;
Dis-assembling code is generated according to the interrupting information;
The breakpoint address corresponding with the interrupting information is obtained, according to the breakpoint address and the dis-assembling code Position the endless loop position of the external interrupt service routine.
In one of the embodiments, the method also includes:
Traverse interrupt source;
The target interrupt source of preset condition is determined for compliance with from the interrupt source;
It is described when detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption service routine interrupt described in External interrupt service routine, comprising:
When detecting that endless loop occurs in external interrupt service routine, quick-speed interruption clothes are triggered by the target interrupt source External interrupt service routine described in business program interrupt.
In one of the embodiments, the method also includes:
Obtain corresponding with target interrupt source interruption source program, and by the interruptions source program be written it is described it is quick in Disconnected service routine;
Extract the Interrupt Subroutine in the interruption source program;
It is described that the quick-speed interruption service routine interruption external interrupt service routine, packet are triggered by the target interrupt source It includes:
The Interrupt Subroutine, which is triggered, by the target interrupt source interrupts the external interrupt service routine.
In one of the embodiments, the method also includes:
Interrupt parameters are obtained, the interrupt parameters include interrupt mode, triggering mode, at least one in the down trigger period Kind;
Initialization process is carried out to the target interrupt source according to the interrupt parameters, obtaining that treated, target is interrupted Source;Treated the target interrupt source is for triggering the quick-speed interruption service routine.
In one of the embodiments, the method also includes:
Target output channel is determined from pre-set output channel;
According to the endless loop of external interrupt service routine described in the breakpoint address and the dis-assembling code building Location information;
The location information is exported with polling mode by the target output channel.
It is described in one of the embodiments, that dis-assembling code is generated according to the interrupting information, comprising:
The interruption title in the interrupting information is extracted, it is described to interrupt the entitled external interrupt service routine appearance extremely Subprogram title when circulation;
Subprogram when endless loop occurs in the external interrupt service routine is searched according to the interruption title;
Dis-assembling code is generated according to the subprogram.
It is described external according to the breakpoint address and the dis-assembling Code location in one of the embodiments, The endless loop position of interrupt service routine, comprising:
According to interruption name acquiring initial address corresponding with the subprogram;
Relative address is calculated according to the breakpoint address and the initial address;
The corresponding source code of the relative address is searched in the dis-assembling code, and described outer according to source code positioning The endless loop position of portion's interrupt service routine.
A kind of positioning device of endless loop, described device include:
Down trigger module, for when detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption to be taken External interrupt service routine described in business program interrupt;
Data obtaining module interrupts the external interrupt service routine by triggering quick-speed interruption service routine for obtaining When generated interruption result;
Number obtains module, triggers the quick-speed interruption service routine interruption external interrupt service routine for obtaining Triggering times;
Module is repeated, for executing in the triggering quickly when the triggering times are less than default triggering times The step of disconnected service routine interrupts the external interrupt service routine;The interruption generated every time is obtained as a result, and according to acquisition It interrupts result and generates interrupting information;
Code generation module, for generating dis-assembling code according to the interrupting information;
Endless loop locating module, for obtaining breakpoint address corresponding with the interrupting information, according to the breakpoint address And the endless loop position of external interrupt service routine described in the dis-assembling Code location.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing Device performs the steps of when executing the computer program
When detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption service routine interrupts the outside Interrupt service routine;
Generated interruption when interrupting the external interrupt service routine by triggering quick-speed interruption service routine is obtained to tie Fruit;
It obtains and triggers the triggering times that the quick-speed interruption service routine interrupts the external interrupt service routine;
When the triggering times are less than default triggering times, execute described in the triggering quick-speed interruption service routine interruption The step of external interrupt service routine;The interruption generated every time is obtained as a result, and generating interruption letter according to the interruption result of acquisition Breath;
Dis-assembling code is generated according to the interrupting information;
Breakpoint address corresponding with interrupting information is obtained, according to the breakpoint address and the dis-assembling Code location institute State the endless loop position of external interrupt service routine.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor It is performed the steps of when row
When detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption service routine interrupts the outside Interrupt service routine;
Generated interruption when interrupting the external interrupt service routine by triggering quick-speed interruption service routine is obtained to tie Fruit;
It obtains and triggers the triggering times that the quick-speed interruption service routine interrupts the external interrupt service routine;
When the triggering times are less than default triggering times, execute described in the triggering quick-speed interruption service routine interruption The step of external interrupt service routine;The interruption generated every time is obtained as a result, and generating interruption letter according to the interruption result of acquisition Breath;
Dis-assembling code is generated according to the interrupting information;
Breakpoint address corresponding with the interrupting information is obtained, it is fixed according to the breakpoint address and the dis-assembling code The endless loop position of the position external interrupt service routine.
Localization method, device, computer equipment and the storage medium of above-mentioned endless loop, when detect external interrupt service journey When endless loop occurs in sequence, triggering quick-speed interruption service routine interrupts external interrupt service routine, obtains through triggering quick-speed interruption Service routine interrupts generated when external interrupt service routine interrupt as a result, acquisition triggering quick-speed interruption service routine interruption is outer The triggering times of portion's interrupt service routine trigger quick-speed interruption again and service journey when triggering times are less than default triggering times Sequence interrupts external interrupt service routine, and generates and interrupt as a result, obtaining the interruption generated every time as a result, and according to the interruption of acquisition As a result interrupting information is generated, dis-assembling code is generated according to interrupting information, obtains breakpoint address corresponding with interrupting information, according to The endless loop position of breakpoint address and dis-assembling Code location external interrupt service routine.Due to quick-speed interruption service routine Priority is higher than the priority of external interrupt service routine, by triggering quick-speed interruption service routine come to there is the outer of endless loop Portion's interrupt service routine is interrupted, and according to the breakpoint address in interrupting information and the dis-assembling code of generation to endless loop into Row positioning, without being inserted into Debugging message output statement or positioning by hardware debugging tool, can be improved determining for endless loop Position efficiency.
Detailed description of the invention
Fig. 1 is the applied environment figure of the localization method of endless loop in one embodiment;
Fig. 2 is the flow diagram of the localization method of endless loop in one embodiment;
Fig. 3 is the flow diagram of the localization method of endless loop in another embodiment;
Fig. 4 is the structural block diagram of the positioning device of endless loop in one embodiment;
Fig. 5 is the internal structure chart of computer equipment in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not For limiting the application.
The localization method of endless loop provided by the embodiments of the present application can be applied in application environment as shown in Figure 1.Such as Shown in Fig. 1, which includes computer equipment 110.When computer equipment 110 detects that external interrupt service routine occurs When endless loop, computer equipment 110 can trigger quick-speed interruption service routine, and quick-speed interruption service routine can be used for interrupting outer Portion's interrupt service routine.Computer equipment 110 is available to interrupt external interrupt service by triggering quick-speed interruption service routine It is generated when program to interrupt as a result, the available triggering quick-speed interruption service routine of computer equipment 110 interrupts external interrupt The triggering times of service routine, when triggering times are less than default triggering times, computer equipment 110 can trigger quickly again Interrupt service routine interrupt external interrupt service routine, and again generate interrupt as a result, until computer equipment 110 obtain touching It sends out number and is not less than default triggering times.The available interruption generated every time of computer equipment 110 is as a result, and according to acquisition It interrupts result and generates interrupting information.Computer equipment 110 can generate dis-assembling code according to interrupting information.Computer equipment 110 available breakpoint address corresponding with interrupting information take according to breakpoint address and dis-assembling Code location external interrupt The endless loop position for program of being engaged in.It is understood that computer equipment 110 can be, but not limited to be various personal computers, pen Remember this computer, smart phone, tablet computer and portable wearable device.
In one embodiment, as shown in Fig. 2, providing a kind of localization method of endless loop, it is applied to Fig. 1 in this way In computer equipment for be illustrated, comprising the following steps:
Step 202, when detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption service routine is interrupted External interrupt service routine.
External interrupt service routine abbreviation IRQ (Interrupt Request) is interrupted, and is referred to general in central processing unit Interrupt requests, the interrupt processing for modules in computer equipment.IRQ interruption can support a variety of IRQ to interrupt simultaneously Source, and the running priority grade that IRQ is interrupted is higher than non-interrupted program, bring into operation corresponding service routine in triggering.
Quick-speed interruption service routine abbreviation FIQ (Fast Interrupt Request) is interrupted, and is referred in central processing unit Fast interrupt requests, in computer equipment quickly, the interrupt processing of low latency.FIQ interruption can support one kind or compared with Few several interrupt sources, running priority grade are interrupted higher than IRQ, and bring into operation corresponding service routine in triggering.
Endless loop, which refers to, controls the program that can not be terminated by itself.There is endless loop and refers to calculating in external interrupt service routine The system of machine equipment, which is fallen into IRQ interrupt service routine, cannot terminate and exit, so as to cause system program and all applications Program is no longer executed to expected follow-up process, and part IRQ is interrupted or all IRQ interruption will be responded no longer.
Computer equipment can detect the execution of program each in system.When computer equipment detects in outside When endless loop occurs in disconnected service routine, computer equipment can trigger quick-speed interruption service routine.Since quick-speed interruption services journey The priority of sequence is higher than the priority of external interrupt service routine, when computer equipment triggers quick-speed interruption service routine, Computer equipment can execute quick-speed interruption service routine with immediate precedence, so that external interrupt service routine is interrupted.
Step 204, it obtains in generated when passing through triggering quick-speed interruption service routine interruption external interrupt service routine Disconnected result.
When triggering quick-speed interruption service routine to interrupt external interrupt service routine, the available generation of computer equipment Interruption result.Wherein, interrupting can wrap in result containing with being interrupted the interruption title of program, the breakpoint for being interrupted program Location, the operational mode for being interrupted program, be interrupted code at the breakpoint of program, IRQ interrupt number and other as a result, not doing herein It limits.
Step 206, the triggering times that triggering quick-speed interruption service routine interrupts external interrupt service routine are obtained.
There can be a counter in computer equipment, interrupt external interrupt for recording triggering quick-speed interruption service routine The triggering times of service routine.When first time triggering quick-speed interruption service routine interrupts external interrupt service routine, counter Triggering times can be calculated as 1, when the quick-speed interruption service routine that sets out again interrupts external interrupt service routine, counter can Triggering times are calculated as 2.
Quick-speed interruption service routine is triggered in the counter that computer equipment can be got in real time interrupts external interrupt clothes The triggering times for program of being engaged in.
Step 208, when triggering times are less than default triggering times, triggering quick-speed interruption service routine interrupts external interrupt Service routine obtains the interruption generated every time as a result, and generating interrupting information according to the interruption result of acquisition.
Default triggering times can be what user pre-set, can also be what computer equipment generated.Wherein, it presets Triggering times can be related to interrupt source, and when interrupt source is the interrupt source of specified non-timed device, default triggering times can be with Be set as 10 times, it is 20 inferior;When interrupt source is timer interruption source, timer can be touched according to the down trigger period of setting It sends out quick-speed interruption service routine and interrupts external interrupt service routine, for example, the down trigger period being arranged in timer is 10s/ Secondary, timer can trigger a quick-speed interruption service routine every 10s and interrupt external interrupt service routine.
After getting triggering times, triggering times and the default triggering times that can be will acquire are compared computer equipment Compared with, and obtain comparison result.When the comparison result that computer equipment obtains is that triggering times are less than default triggering times, calculate Machine equipment can trigger quick-speed interruption service routine again and interrupt external interrupt service routine, and obtain triggering quick-speed interruption again Service routine, which interrupts, to interrupt caused by external interrupt service routine as a result, until the triggering times of computer equipment acquisition are not small In default triggering times.
When triggering times are greater than default triggering times, the available interruption generated every time of computer equipment is as a result, simultaneously Interrupting information is generated according to the interruption result of acquisition.It is produced that is, can wrap in the interrupting information that computer equipment generates containing each Raw interruption result.
Step 210, dis-assembling code is generated according to interrupting information.
Dis-assembling, which refers to the process of, switchs to assembly code object code, that is, machine language is converted to compilation language Speech.Wherein, machine language refers to that the computer equipment indicated with binary code can be with a kind of machine of Direct Recognition and execution Instruction;Assembler language is also known as symbolic language, specific assembler language and specific machine language instruction collection be it is one-to-one, Assembler language is easy for the language that user distinguishes, remembers and writes.
The interrupting information that computer equipment is got can be and be indicated with machine language.Computer equipment is in getting After disconnected information, corresponding dis-assembling code can be generated according to the interrupting information of acquisition.Wherein, during computer equipment is got When disconnected information can be triggering quick-speed interruption service routine interruption external interrupt service routine every time, generated interruption result Set.
Step 212, breakpoint address corresponding with interrupting information is obtained, according to outside breakpoint address and dis-assembling Code location The endless loop position of portion's interrupt service routine.
The available breakpoint address corresponding with interrupting information of computer equipment, wherein breakpoint address is external interrupt clothes The breakpoint address for program of being engaged in.The corresponding breakpoint address of the available interrupting information of computer equipment, computer equipment can bases Breakpoint address finds code corresponding with breakpoint address in dis-assembling code, and computer equipment can be corresponding from breakpoint address Code in navigate to the endless loop position of external interrupt service routine.
In the present embodiment, when computer equipment detects that endless loop occurs in external interrupt service routine, triggering is quick Interrupt service routine interrupts external interrupt service routine, obtains and interrupts external interrupt service by triggering quick-speed interruption service routine It is generated when program to interrupt as a result, obtaining the triggering time that triggering quick-speed interruption service routine interrupts external interrupt service routine Number triggers quick-speed interruption service routine again and interrupts external interrupt service routine when triggering times are less than default triggering times, And interruption is generated as a result, generating interrupting information according to all interruption results, and generate dis-assembling code according to interrupting information, it obtains Breakpoint address corresponding with interrupting information is followed according to breakpoint address and the dead of dis-assembling Code location external interrupt service routine Ring position.It is quick by triggering since the priority of quick-speed interruption service routine is higher than the priority of external interrupt service routine Interrupt service routine interrupts the external interrupt service routine for endless loop occur, and according to the breakpoint in interrupting information The dis-assembling code of location and generation positions endless loop, without being inserted into Debugging message output statement or being debugged by hardware Tool positions, and can be improved the location efficiency of endless loop.Wherein, the endless loop of external interrupt service routine can be system journey The endless loop of sequence can also be the endless loop etc. of nutritional program, interrupt external interrupt by triggering quick-speed interruption service routine Service routine can make endless loop positioning apply more extensive, and the validity and flexibly of a variety of endless loops positioning can be improved Property.
In one embodiment, a kind of localization method of the endless loop provided can also include the mistake for determining target interrupt source Journey specifically includes: traversal interrupt source;The target interrupt source of preset condition is determined for compliance with from interrupt source;When detecting in outside When endless loop occurs in disconnected service routine, quick-speed interruption service routine is triggered by target interrupt source and interrupts external interrupt service journey Sequence.
Interrupt source can be used to indicate that the source that can issue interrupt request singal.In one embodiment, any to be used for The interrupt source of triggering external interrupt service routine can be set to the interrupt source for triggering quick-speed interruption service routine.Mesh Mark interrupt source can be used for triggering quick-speed interruption service routine, so that external interrupt service routine is interrupted.Interrupt source can be Universal input and output port GPIO (General Purpose Input/Output), the port for being inserted into magnetic card, connection computer The keyboard etc. of equipment.Preset condition can be user setting, can also be computer equipment according to the use of each interrupt source Situation setting.The interrupt source for meeting preset condition can be in idle interrupt source, the interrupt source for not falling into endless loop, refer to Fixed interrupt source etc..
The available preset condition set of computer equipment.Computer equipment can be to the progress time of all interrupt source It goes through, and is determined for compliance with the target interrupt source of preset condition in all interrupt source according to preset condition.Wherein, target interrupt source It can be and carry out manually-operated interrupt source convenient for user.Preset condition can be user and be pre-set by computer equipment , it can also be what computer equipment was configured according to the use state of interrupt source.For example, computer equipment get it is pre- If condition is in idle interrupt source, computer equipment can be searched in all interrupt source in idle interrupt source, At this point it is possible to modify to the hardware circuit in computer equipment, computer equipment can will be found in idle Interrupt source is as target interrupt source.
When computer equipment does not find the target interrupt source for meeting preset condition, computer equipment can choose one As target interrupt source, timer can be interrupted a timer being in idle condition with clocked flip quick-speed interruption service routine External interrupt service routine.
When computer equipment detects that endless loop occurs in external interrupt service routine, computer equipment can pass through target Interrupt source interrupts external interrupt service routine by quick-speed interruption service routine to trigger quick-speed interruption service routine.For example, The target interrupt source that computer equipment determines is universal input and output port GPIO, when computer equipment detects that external interrupt takes When endless loop occurs in business program, computer equipment can trigger quick-speed interruption service journey by universal input and output port GPIO Sequence, so that quick-speed interruption service routine be made to interrupt external interrupt service routine.
In the present embodiment, computer equipment is determined for compliance with the mesh of preset condition by traversal interrupt source from interrupt source Interrupt source is marked, when detecting that endless loop occurs in external interrupt service routine, quick-speed interruption service is triggered by target interrupt source Program interrupt external interrupt service routine.Computer equipment finds the target interruption for meeting preset condition by preset condition Source can quickly find target interrupt source, to improve the effect that quick-speed interruption service routine interrupts external interrupt service routine Rate.
In one embodiment, a kind of localization method of the endless loop provided can also include interrupting external interrupt to service journey The process of sequence, specifically includes: obtaining interruption source program corresponding with target interrupt source, and will interrupt source program and quick-speed interruption is written Service routine;Extract the Interrupt Subroutine interrupted in source program;It is triggered in Interrupt Subroutine by target interrupt source Disconnected external interrupt service routine.
The corresponding interruption source program of target interrupt source can be used for triggering interrupt source and execute interruption, wherein interrupt source program In can wrap containing breakpoint information acquisition code, Interrupt Subroutine, breakpoint address retrieval, breakpoint address conversion and breakpoint Information output code etc..The available interruption source program corresponding with target interrupt source of computer equipment, computer equipment can be with It will interrupt in source program write-in quick-speed interruption service routine.It is answered specifically, breakpoint information can be acquired code by computer equipment It is inserted in the head of quick-speed interruption service routine, for collecting interrupting information to be output.Wherein, interrupting information may include It is interrupted the breakpoint address of program, the operational mode for being interrupted program, code at the breakpoint of program is interrupted, is currently being serviced External interrupt number etc., can also include other information, it is not limited here.Wherein, breakpoint address retrieval, breakpoint address conversion And breakpoint information output code can be located at after Interrupt Subroutine.Breakpoint address is retrieved for being examined according to breakpoint address Rope obtains the initial address that subprogram title corresponds to subprogram to corresponding subprogram title.Breakpoint address conversion is used for will Breakpoint address is converted to relative address, positions for endless loop.Breakpoint information output code is for exporting breakpoint information acquisition generation The collected breakpoint information of code institute.
Computer equipment can determine the implementation of Interrupt Subroutine according to target interrupt source.For example, working as target When interrupt source is the interrupt source selected from the corresponding interrupt source of external interrupt service routine, at the interruption of expression target interrupt source Reason subprogram has stored in computer equipment, and computer equipment can extract the sub- journey of interrupt processing from interrupting in source program Sequence;When target interrupt source is in idle interrupt source, computer equipment, which may determine that interrupt to whether there is in source program, to be had Interrupt Subroutine, when interrupting in source program there are when Interrupt Subroutine, computer equipment can be extracted at interruption Subprogram is managed, when interrupting there is no when Interrupt Subroutine in source program, computer equipment is available to interrupt processing Program, and Interrupt Subroutine is written and is interrupted in source program;When target interrupt source is timer, computer equipment can be with Judgement is interrupted with the presence or absence of there is Interrupt Subroutine in source program, and when interrupting in source program, there are Interrupt Subroutines When, computer equipment can extract Interrupt Subroutine, when interrupting in source program there is no when Interrupt Subroutine, calculate Machine equipment is available to arrive Interrupt Subroutine, and Interrupt Subroutine is written and is interrupted in source program.
Can be there are many interrupt source in computer equipment, each interrupt source can have multiple.For example, in computer equipment Can have the interrupt sources such as serial ports, GPIO port, USB interface, timer, wherein serial ports can have 4, GPIO port can have 5 A, USB interface can have 3, timer can have 8.The Interrupt Subroutine of same interrupt source can be identical.Example Such as, when serial ports 1 and serial ports 2 are used, and serial ports 3 is not used by, the Interrupt Subroutine of serial ports 3 be also it is existing, can With identical as the Interrupt Subroutine of serial ports 1 and serial ports 2.
Computer equipment can trigger Interrupt Subroutine by target interrupt source to interrupt external interrupt service routine. For example, target interrupt source is serial ports 1, computer equipment can interrupt external interrupt by the Interrupt Subroutine of serial ports 1 Service routine.
In one embodiment, a kind of localization method of the endless loop provided can also include carrying out just to target interrupt source The process of beginningization processing, specifically includes: obtaining interrupt parameters, interrupt parameters include interrupt mode, triggering mode, down trigger week At least one of phase;Initialization process is carried out to target interrupt source according to interrupt parameters, the target interrupt source that obtains that treated; Target interrupt source that treated is for triggering quick-speed interruption service routine.
Wherein, interrupt mode can be FIQ interrupt mode, IRQ interrupt mode etc., triggering mode can be edging trigger, Horizontal triggering, pulse-triggered etc., down trigger period can be 3 seconds, 5 seconds, 10 seconds etc., it is not limited here.Terminal parameter can For being adjusted to target interrupt source.Wherein, interrupt parameters can be what user was configured by computer equipment.Meter Machine equipment is calculated after getting interrupt parameters, initialization process can be carried out to target interrupt source.Specifically, computer equipment can To be adjusted according to the interrupt parameters got to the parameter of target interrupt source.For example, the interruption that computer equipment is got In parameter, interrupt mode is FIQ interrupt mode, triggering mode is edging trigger, the down trigger period is 10 seconds, computer equipment The interrupt mode of target interrupt source can be adjusted to FIQ interrupt mode, triggering mode is adjusted to edging trigger, touched interrupting Sending out period modulation is 10 seconds.
Wherein, carrying out initialization process to target interrupt source can also include that computer equipment control FIQ interrupts unlatching, can So that FIQ interrupt source enters working condition earlier.Computer equipment can initialize the output channel of interrupting information, And the output channel of opens interrupters information, convenient for the quick output of interrupting information.
In the present embodiment, for computer equipment by obtaining interrupt parameters, interrupt parameters include interrupt mode, trigger mode At least one of formula, down trigger period carry out initialization process to target interrupt source according to interrupt parameters, after obtaining processing Target interrupt source, target interrupt source that treated is for triggering quick-speed interruption service routine.It is right in advance that computer equipment passes through The parameter of target interrupt source carries out initialization process, can make the entrance working condition of target interrupt source earlier, computer equipment It, can be more quickly and convenient when triggering quick-speed interruption service routine using target interrupt source.
In one embodiment, a kind of localization method of the endless loop provided can also include the mistake of output location information Journey specifically includes: target output channel is determined from pre-set output channel;According to breakpoint address and dis-assembling code Generate the location information of the endless loop of external interrupt service routine;Positioning letter is exported with polling mode by target output channel Breath.
Output channel can be used for output information, and target output channel can be used for exporting location information.It is pre-set Output channel can be communication interface in computer equipment, screen, the printer connecting with computer equipment or other are defeated Channel etc. out, it is not limited here.Computer equipment can determine target output channel from pre-set output channel.Its In, it is randomly selected that target output channel can be computer equipment, can also be that user is logical from output by computer equipment It is selected in road.
Computer equipment can be according to the endless loop of breakpoint address and dis-assembling code building external interrupt service routine Location information.It include interrupt address in interrupting information since dis-assembling code is generated according to interrupting information, therefore, It include the corresponding code of interrupt address in dis-assembling code.Computer equipment can be according to interrupt address and dis-assembling code Generate the location information of the endless loop of external interrupt service routine.Specifically, computer equipment is available to multiple and different Interrupting information, the interrupt address in each interrupting information can be different.Computer equipment is raw according to different interrupting informations At different dis-assembling codes, computer equipment can find interrupting information corresponding with interrupt address, and then find The disconnected corresponding dis-assembling code of information, to generate location information.Specifically, computer equipment can be corresponding by interrupting information Machine code is converted to source code, i.e. dis-assembling code one by one in sequence, and computer equipment can be according to interrupting information lookup pair The source code answered, and the source code lines of source code are found, to navigate to the position of fault code according to the position of source code lines It sets.Since the interrupting information that computer equipment is got is different, the dis-assembling code generated is also different, so as to cause generation Location information it is also not identical.
Poll refers to that the central processing unit in computer equipment is inquired each output with certain period in order and led to Road sees if there is the requirement of data input or output, if so, then carrying out corresponding input/output service;If nothing, or input/ Output service processing finishes, and central processing unit just then inquires next output channel.It can be generated in computer equipment multiple Different location informations, when these location informations need to export, computer equipment can be by the way of poll respectively by this Multiple and different location informations are exported.
In the present embodiment, computer equipment determines target output channel from pre-set output channel, according to disconnected The location information of the endless loop of dot address and dis-assembling code building external interrupt service routine, by target output channel with Polling mode exports location information.Computer equipment is defeated by location information in a manner of poll selection target output channel Out, location information can be output to target position by target output channel, is carried out location information by way of poll Output, it can be ensured that the successful output of location information.
In one embodiment, a kind of localization method of the endless loop provided can also include the mistake for generating dis-assembling code Journey specifically includes: extracting the interruption title in interrupting information, interrupts when endless loop occurs in entitled external interrupt service routine Subprogram title;According to the subprogram interrupted when endless loop occurs in name acquiring external interrupt service routine;It is raw according to subprogram At dis-assembling code.
Interrupt program name when endless loop occurs in entitled external interrupt service routine.For example, external interrupt services journey There is endless loop when executing A program in sequence, interrupts entitled A program.Computer equipment after obtaining all interrupting informations, The interruption title in interrupting information can be extracted, according to the son interrupted when endless loop occurs in title lookup external interrupt service routine Program.For example, the entitled A program of interruption that computer equipment is extracted, computer equipment can be searched to be gone out in external interrupt routine A program when existing endless loop.Computer equipment can be found in respectively after extracting the interruption title in interrupting information The disconnected corresponding subprogram of title.Computer equipment can generate dis-assembling code according at least one subprogram found.
In the present embodiment, computer equipment is interrupted in entitled outside by extracting the interruption title in interrupting information There is subprogram title when endless loop in disconnected service routine, searches the appearance of external interrupt service routine extremely according to name acquiring is interrupted Subprogram when circulation generates dis-assembling code according to subprogram.Computer equipment can find appearance according to title is interrupted The efficiency for searching endless loop program can be improved in subprogram when endless loop.
In one embodiment, computer equipment can be known according to the interruption title in breakpoint information occurs endless loop Subprogram.Computer equipment can carry out dis-assembling to multiple subprogram actuating codes that endless loop occurs using disassemblers, Generate a dis-assembling file.Wherein, each assembly code row includes in the three parts such as relative address, machine code, assembly code Hold.Computer equipment can find out breakpoint address in dis-assembling file, then find out corresponding source code.Specifically, computer Equipment can search corresponding source code in the program source code that endless loop occurs, so that it is determined that endless loop code.
In one embodiment, a kind of localization method of the endless loop provided can also include the process of positioning endless loop, It specifically includes: according to interruption name acquiring initial address corresponding with subprogram;Phase is calculated according to breakpoint address and initial address To address;The corresponding source code of relative address is searched in dis-assembling code, and according to source code localized external interrupt service routine Endless loop position.
Computer equipment is after obtaining interruption title, available subprogram corresponding with title is interrupted, to get The corresponding initial address of subprogram.When initial address can be used to indicate that execution external interrupt service routine, the breakpoint with acquisition Address corresponds to the starting position of program.Relative address, which can be used to indicate that, corresponds to journey when endless loop occurs in external interrupt service routine The address that sequence is performed.Relative address can be calculated according to breakpoint address and initial address.Specifically, relative address can be with It is that breakpoint address subtracts initial address.
After computer equipment finds the corresponding interruption title of breakpoint address, it can find and interrupt the corresponding anti-remittance of title Compile code.Computer equipment can search the corresponding source of relative address according to the relative address calculated in dis-assembling code Code.Computer equipment can be according to the endless loop position of the source code localized external interrupt service routine found.
In the present embodiment, computer equipment is according to name acquiring initial address corresponding with subprogram is interrupted, according to disconnected Dot address and initial address calculate relative address, the corresponding source code of relative address are searched in dis-assembling code, and according to source code The endless loop position of localized external interrupt service routine.Computer equipment is according to the interruption name acquiring in interrupting information to relatively Address, so that endless loop can be improved according to the endless loop of the corresponding source code localized external interrupt service routine of relative address Location efficiency.
In one embodiment, as shown in figure 3, providing a kind of localization method of endless loop, concrete implementation step is such as Under:
Step 302, target output channel is determined from pre-set output channel.
Step 304, interrupt source is traversed, the target interrupt source of preset condition is determined for compliance with from interrupt source.
Step 306, interruption source program corresponding with target interrupt source is obtained, and source program write-in quick-speed interruption clothes will be interrupted Business program.
Step 308, the Interrupt Subroutine interrupted in source program is extracted.
Step 310, interrupt parameters are obtained, initialization process is carried out to target interrupt source according to interrupt parameters, is handled Target interrupt source afterwards.
Step 312, external interrupt service routine is run, when detecting that endless loop occurs in external interrupt service routine, is led to Crossing treated, target interrupt source triggering Interrupt Subroutine interrupts external interrupt service routine.
Step 314, it obtains in generated when passing through triggering quick-speed interruption service routine interruption external interrupt service routine Disconnected result.
Step 316, the triggering times that triggering quick-speed interruption service routine interrupts external interrupt service routine are obtained.
When triggering times are less than default triggering times, step 312 is executed to step 316.
Step 318, the interruption generated every time is obtained as a result, and generating interrupting information according to the interruption result of acquisition.
Step 320, interruption title corresponding with interrupting information is obtained, searches external interrupt service routine according to title is interrupted There is subprogram when endless loop.
Step 322, initial address corresponding with breakpoint address is searched, is calculated relatively according to breakpoint address and initial address Location.
Step 324, dis-assembling code is generated.
Step 326, the corresponding source code of relative address is searched in dis-assembling code, and is interrupted and taken according to source code localized external The endless loop for program of being engaged in.
Step 328, according to the positioning of the endless loop of breakpoint address and dis-assembling code building external interrupt service routine Information.
Step 330, location information is exported with polling mode by target output channel.
It should be understood that although each step in above-mentioned each flow chart is successively shown according to the instruction of arrow, It is these steps is not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps There is no stringent sequences to limit for rapid execution, these steps can execute in other order.Moreover, above-mentioned each flow chart In at least part step may include that perhaps these sub-steps of multiple stages or stage are not necessarily multiple sub-steps Completion is executed in synchronization, but can be executed at different times, the execution in these sub-steps or stage sequence is not yet Necessarily successively carry out, but can be at least part of the sub-step or stage of other steps or other steps in turn Or it alternately executes.
In one embodiment, as shown in figure 4, providing a kind of positioning device of endless loop, comprising: down trigger module 410, data obtaining module 420, number obtain module 430, repeat module 440, code generation module 450 and endless loop Locating module 460, in which:
Down trigger module 410, for triggering quick-speed interruption when detecting that endless loop occurs in external interrupt service routine Service routine interrupts external interrupt service routine.
Data obtaining module 420 interrupts external interrupt service routine by triggering quick-speed interruption service routine for obtaining When generated interruption result.
Number obtains module 430, and the touching of external interrupt service routine is interrupted for obtaining triggering quick-speed interruption service routine Send out number.
Module 440 is repeated, for executing triggering quick-speed interruption service when triggering times are less than default triggering times The step of program interrupt external interrupt service routine;The interruption generated every time is obtained as a result, and raw according to the interruption result of acquisition At interrupting information.
Code generation module 450, for generating dis-assembling code according to interrupting information.
Endless loop locating module 460, for obtaining breakpoint address corresponding with interrupting information, according to breakpoint address and instead The endless loop position of assembly code localized external interrupt service routine.
In the present embodiment, when detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption services journey Sequence interrupts external interrupt service routine, obtains and is produced when interrupting external interrupt service routine by triggering quick-speed interruption service routine Raw interruption is as a result, obtain the triggering times that triggering quick-speed interruption service routine interrupts external interrupt service routine, when triggering time When number is less than default triggering times, quick-speed interruption service routine is triggered again and interrupts external interrupt service routine, and generates interruption As a result, generating interrupting information according to all interruption results, and dis-assembling code, acquisition and interrupting information are generated according to interrupting information Corresponding breakpoint address, according to the endless loop position of breakpoint address and dis-assembling Code location external interrupt service routine.By It is higher than the priority of external interrupt service routine in the priority of quick-speed interruption service routine, journey is serviced by triggering quick-speed interruption Sequence interrupts the external interrupt service routine for endless loop occur, and according to the corresponding breakpoint address of interrupting information and generation Dis-assembling code endless loop is positioned, without being inserted into Debugging message output statement or being determined by hardware debugging tool Position, can be improved the location efficiency of endless loop.
In one embodiment, endless loop locating module 460 is also used to traverse interrupt source, is determined for compliance with from interrupt source pre- If the target interrupt source of condition, when detecting that endless loop occurs in external interrupt service routine, triggered by target interrupt source fast Fast interrupt service routine interrupts external interrupt service routine.
In one embodiment, endless loop locating module 460 is also used to obtain interrupt source journey corresponding with target interrupt source Sequence, and source program will be interrupted, quick-speed interruption service routine is written;Extract the Interrupt Subroutine interrupted in source program;Pass through mesh It marks interrupt source triggering Interrupt Subroutine and interrupts external interrupt service routine.
In one embodiment, endless loop locating module 460 is also used to obtain interrupt parameters, and interrupt parameters include interrupting mould At least one of formula, triggering mode, down trigger period carry out initialization process to target interrupt source according to interrupt parameters, The target interrupt source that obtains that treated, target interrupt source that treated is for triggering quick-speed interruption service routine.
In one embodiment, a kind of positioning device of the endless loop provided can also include message output module, be used for Target output channel is determined from pre-set output channel, according to breakpoint address and dis-assembling code building external interrupt The location information of the endless loop of service routine exports location information by target output channel with polling mode.
In one embodiment, code generation module 450 is also used to extract the interruption title in interrupting information, interrupts title Occur subprogram title when endless loop for external interrupt service routine, goes out according to name acquiring external interrupt service routine is interrupted Subprogram when existing endless loop generates dis-assembling code according to subprogram.
In one embodiment, endless loop locating module 460 is also used to look into according to the interruption name acquiring and the son The corresponding initial address of program, calculates relative address according to breakpoint address and initial address, searches in dis-assembling code opposite The corresponding source code in address, and according to the endless loop position of source code localized external interrupt service routine.
The specific of positioning device about endless loop limits the limit that may refer to the localization method above for endless loop Fixed, details are not described herein.Modules in the positioning device of above-mentioned endless loop can fully or partially through software, hardware and its Combination is to realize.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also be with It is stored in the memory in computer equipment in a software form, in order to which processor calls the above modules of execution corresponding Operation.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure Figure can be as shown in Figure 5.The computer equipment includes processor, the memory, network interface, display connected by system bus Screen, output device and input unit.Wherein, the processor of the computer equipment is for providing calculating and control ability.The calculating The memory of machine equipment includes non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system And computer program.The built-in storage provides ring for the operation of operating system and computer program in non-volatile memory medium Border.The network interface of the computer equipment is used to communicate with external terminal by network connection.The computer program is processed A kind of localization method of endless loop is realized when device executes.The display screen of the computer equipment can be liquid crystal display or electricity Sub- ink display screen, the input unit of the computer equipment can be the touch layer covered on display screen, be also possible to computer Key, trace ball or the Trackpad being arranged on device housings can also be external keyboard, Trackpad or mouse etc..Computer The output device of equipment can be used for exporting the endless loop position navigated to.
It will be understood by those skilled in the art that structure shown in Fig. 5, only part relevant to application scheme is tied The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, a kind of computer equipment, including memory and processor are provided, is stored in memory Computer program, the processor perform the steps of when executing computer program
When detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption service routine interrupts external interrupt Service routine;
Generated interrupting information when obtaining through triggering quick-speed interruption service routine interruption external interrupt service routine;
Obtain the triggering times that triggering quick-speed interruption service routine interrupts external interrupt service routine;
When triggering times are less than default triggering times, execute triggering quick-speed interruption service routine and interrupt external interrupt service The step of program;The interruption generated every time is obtained as a result, and generating interrupting information according to the interruption result of acquisition;
Dis-assembling code is generated according to interrupting information;
Breakpoint address corresponding with interrupting information is obtained, is taken according to breakpoint address and dis-assembling Code location external interrupt The endless loop position for program of being engaged in.
In one embodiment, traversal interrupt source is also performed the steps of when processor executes computer program;From interruption The target interrupt source of preset condition is determined for compliance in source;When detecting that endless loop occurs in external interrupt service routine, pass through mesh It marks interrupt source triggering quick-speed interruption service routine and interrupts external interrupt service routine.
In one embodiment, acquisition and target interrupt source are also performed the steps of when processor executes computer program Corresponding interruption source program, and source program will be interrupted, quick-speed interruption service routine is written;It extracts at the interruption interrupted in source program Manage subprogram;Interrupt Subroutine, which is triggered, by target interrupt source interrupts external interrupt service routine.
In one embodiment, acquisition interrupt parameters are also performed the steps of when processor executes computer program, are interrupted Parameter includes at least one of interrupt mode, triggering mode, down trigger period;According to interrupt parameters to target interrupt source into Row initialization process, the target interrupt source that obtains that treated;Target interrupt source that treated is for triggering quick-speed interruption service journey Sequence.
In one embodiment, it also performs the steps of when processor executes computer program from pre-set output Target output channel is determined in channel;According to the endless loop of breakpoint address and dis-assembling code building external interrupt service routine Location information;Location information is exported with polling mode by target output channel.
In one embodiment, it also performs the steps of and is extracted in interrupting information when processor executes computer program Title is interrupted, subprogram title when endless loop occurs in entitled external interrupt service routine is interrupted;According to interruption name acquiring There is subprogram when endless loop in external interrupt service routine;Dis-assembling code is generated according to subprogram.
In one embodiment, it is also performed the steps of when processor executes computer program according to interruption name acquiring Initial address corresponding with subprogram;Relative address is calculated according to breakpoint address and initial address;It is searched in dis-assembling code The corresponding source code of relative address, and according to the endless loop position of source code localized external interrupt service routine.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of when being executed by processor
When detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption service routine interrupts external interrupt Service routine;
Generated interruption result when obtaining through triggering quick-speed interruption service routine interruption external interrupt service routine;
Obtain the triggering times that triggering quick-speed interruption service routine interrupts external interrupt service routine;
When triggering times are less than default triggering times, execute triggering quick-speed interruption service routine and interrupt external interrupt service The step of program;The interruption generated every time is obtained as a result, and generating interrupting information according to the interruption result of acquisition;
Dis-assembling code is generated according to interrupting information;
Breakpoint address corresponding with interrupting information is obtained, is taken according to breakpoint address and dis-assembling Code location external interrupt The endless loop position for program of being engaged in.
In one embodiment, traversal interrupt source is also performed the steps of when computer program is executed by processor;Therefrom The target interrupt source of preset condition is determined for compliance in disconnected source;When detecting that endless loop occurs in external interrupt service routine, pass through Target interrupt source triggers quick-speed interruption service routine and interrupts external interrupt service routine.
In one embodiment, acquisition and target interrupt source are also performed the steps of when processor executes computer program Corresponding interruption source program, and source program will be interrupted, quick-speed interruption service routine is written;It extracts at the interruption interrupted in source program Manage subprogram;Interrupt Subroutine, which is triggered, by target interrupt source interrupts external interrupt service routine.
In one embodiment, acquisition interrupt parameters are also performed the steps of when computer program is executed by processor, in Disconnected parameter includes at least one of interrupt mode, triggering mode, down trigger period;According to interrupt parameters to target interrupt source Initialization process is carried out, the target interrupt source that obtains that treated;Target interrupt source that treated is for triggering quick-speed interruption service Program.
In one embodiment, it is also performed the steps of when computer program is executed by processor from pre-set defeated Target output channel is determined in channel out;It is followed according to breakpoint address and the dead of dis-assembling code building external interrupt service routine The location information of ring;Location information is exported with polling mode by target output channel.
In one embodiment, it also performs the steps of and is extracted in interrupting information when computer program is executed by processor Interruption title, interrupt subprogram title when endless loop occurs in entitled external interrupt service routine;It is obtained according to title is interrupted Subprogram when external interrupt service routine being taken endless loop occur;Dis-assembling code is generated according to subprogram.
In one embodiment, it also performs the steps of when computer program is executed by processor and is obtained according to interruption title Take initial address corresponding with subprogram;Relative address is calculated according to breakpoint address and initial address;It is looked into dis-assembling code The corresponding source code of relative address is looked for, and according to the endless loop position of source code localized external interrupt service routine.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (10)

1. a kind of localization method of endless loop, which comprises
When detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption service routine interrupts the external interrupt Service routine;
Generated interruption when interrupting the external interrupt service routine by triggering the quick-speed interruption service routine is obtained to tie Fruit;
It obtains and triggers the triggering times that the quick-speed interruption service routine interrupts the external interrupt service routine;
When the triggering times are less than default triggering times, execute the triggering quick-speed interruption service routine and interrupt the outside The step of interrupt service routine;The interruption generated every time is obtained as a result, and generating interrupting information according to the interruption result of acquisition;
Dis-assembling code is generated according to the interrupting information;
Breakpoint address corresponding with the interrupting information is obtained, according to the breakpoint address and the dis-assembling Code location institute State the endless loop position of external interrupt service routine.
2. the method according to claim 1, wherein the method also includes:
Traverse interrupt source;
The target interrupt source of preset condition is determined for compliance with from the interrupt source;
It is described when detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption service routine interrupts the outside Interrupt service routine, comprising:
When detecting that endless loop occurs in external interrupt service routine, quick-speed interruption is triggered by the target interrupt source and services journey Sequence interrupts the external interrupt service routine.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
Interruption source program corresponding with the target interrupt source is obtained, and the quick-speed interruption is written into the interruption source program and is taken Business program;
Extract the Interrupt Subroutine in the interruption source program;
It is described that the quick-speed interruption service routine interruption external interrupt service routine is triggered by the target interrupt source, comprising:
The Interrupt Subroutine, which is triggered, by the target interrupt source interrupts the external interrupt service routine.
4. according to the method described in claim 2, it is characterized in that, the method also includes:
Interrupt parameters are obtained, the interrupt parameters include at least one of interrupt mode, triggering mode, down trigger period;
Initialization process is carried out to the target interrupt source according to the interrupt parameters, the target interrupt source that obtains that treated;Institute Target interrupt source of stating that treated is for triggering the quick-speed interruption service routine.
5. the method according to claim 1, wherein the method also includes:
Target output channel is determined from pre-set output channel;
According to the positioning of the endless loop of external interrupt service routine described in the breakpoint address and the dis-assembling code building Information;
The location information is exported with polling mode by the target output channel.
6. the method according to claim 1, wherein it is described according to the interrupting information generate dis-assembling code, Include:
The interruption title in the interrupting information is extracted, endless loop occurs in the entitled external interrupt service routine of interruption When subprogram title;
Occurs subprogram when endless loop according to external interrupt service routine described in the interruption name acquiring;
Dis-assembling code is generated according to the subprogram.
7. according to the method described in claim 6, it is characterized in that, described according to the breakpoint address and the dis-assembling generation Code positions the endless loop position of the external interrupt service routine, comprising:
According to interruption name acquiring initial address corresponding with the subprogram;
Relative address is calculated according to the breakpoint address and the initial address;
The corresponding source code of the relative address is searched in the dis-assembling code, and is positioned in the outside according to the source code The endless loop position of disconnected service routine.
8. a kind of positioning device of endless loop, which is characterized in that described device includes:
Down trigger module, for when detecting that endless loop occurs in external interrupt service routine, triggering quick-speed interruption to service journey Sequence interrupts the external interrupt service routine;
Data obtaining module interrupts the external interrupt service routine when institute by triggering quick-speed interruption service routine for obtaining The interruption result of generation;
Number obtains module, for obtaining the touching for triggering the quick-speed interruption service routine and interrupting the external interrupt service routine Send out number;
Module is repeated, for when the triggering times are less than default triggering times, executing the triggering quick-speed interruption clothes The step of external interrupt service routine described in business program interrupt;The interruption generated every time is obtained as a result, and according to the interruption of acquisition As a result interrupting information is generated;
Code generation module, for generating dis-assembling code according to the interrupting information;
Endless loop locating module, for obtaining the breakpoint address corresponding with the interrupting information, according to the breakpoint address with And the endless loop position of external interrupt service routine described in the dis-assembling Code location.
9. a kind of computer equipment, including memory and processor, the memory are stored with computer program, feature exists In the step of processor realizes any one of claims 1 to 7 the method when executing the computer program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method described in any one of claims 1 to 7 is realized when being executed by processor.
CN201811612920.3A 2018-12-27 2018-12-27 Method and device for positioning endless loop, computer equipment and storage medium Active CN109766273B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811612920.3A CN109766273B (en) 2018-12-27 2018-12-27 Method and device for positioning endless loop, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811612920.3A CN109766273B (en) 2018-12-27 2018-12-27 Method and device for positioning endless loop, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109766273A true CN109766273A (en) 2019-05-17
CN109766273B CN109766273B (en) 2022-09-27

Family

ID=66451044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811612920.3A Active CN109766273B (en) 2018-12-27 2018-12-27 Method and device for positioning endless loop, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109766273B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928778A (en) * 2019-11-19 2020-03-27 百富计算机技术(深圳)有限公司 Endless loop positioning method and device, computer equipment and storage medium
CN111984521A (en) * 2019-05-23 2020-11-24 核工业理化工程研究院 Board-level debugging method without JTAG intervention
CN113220334A (en) * 2021-05-25 2021-08-06 百富计算机技术(深圳)有限公司 Program fault positioning method, terminal device and computer readable storage medium
CN113778884A (en) * 2021-09-14 2021-12-10 北京爱芯科技有限公司 Simulation debugging method and device, computing equipment and computer storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020073131A1 (en) * 2000-12-13 2002-06-13 Brenner Kenneth J. Unified exception handling for hierarchical multi-interrupt architectures
CN101504615A (en) * 2009-03-24 2009-08-12 杭州华三通信技术有限公司 Method and apparatus for providing positioning information for task endless loop
CN102253859A (en) * 2010-05-21 2011-11-23 康佳集团股份有限公司 Embedded device system deadlock debugging device and method
CN103226507A (en) * 2013-04-28 2013-07-31 惠州市德赛西威汽车电子有限公司 Method for preventing system crash in embedded system
CN103778009A (en) * 2012-10-18 2014-05-07 深圳市中兴微电子技术有限公司 Interrupt processing method and device
CN106201892A (en) * 2016-07-20 2016-12-07 中国航空工业集团公司航空动力控制系统研究所 Aborted source location detection method for embedded software
CN107220175A (en) * 2017-05-08 2017-09-29 百富计算机技术(深圳)有限公司 Application program endless loop localization method, device, computer equipment and storage medium
CN107885650A (en) * 2016-09-30 2018-04-06 联芯科技有限公司 A kind of program debugging method and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020073131A1 (en) * 2000-12-13 2002-06-13 Brenner Kenneth J. Unified exception handling for hierarchical multi-interrupt architectures
CN101504615A (en) * 2009-03-24 2009-08-12 杭州华三通信技术有限公司 Method and apparatus for providing positioning information for task endless loop
CN102253859A (en) * 2010-05-21 2011-11-23 康佳集团股份有限公司 Embedded device system deadlock debugging device and method
CN103778009A (en) * 2012-10-18 2014-05-07 深圳市中兴微电子技术有限公司 Interrupt processing method and device
CN103226507A (en) * 2013-04-28 2013-07-31 惠州市德赛西威汽车电子有限公司 Method for preventing system crash in embedded system
CN106201892A (en) * 2016-07-20 2016-12-07 中国航空工业集团公司航空动力控制系统研究所 Aborted source location detection method for embedded software
CN107885650A (en) * 2016-09-30 2018-04-06 联芯科技有限公司 A kind of program debugging method and system
CN107220175A (en) * 2017-05-08 2017-09-29 百富计算机技术(深圳)有限公司 Application program endless loop localization method, device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
周立功: "《面向AMetal框架和接口的C编程》", 《面向AMETAL框架和接口的C编程》 *
文全刚编著: "汇编语言程序设计 基于ARM体系结构", 《汇编语言程序设计 基于ARM体系结构 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111984521A (en) * 2019-05-23 2020-11-24 核工业理化工程研究院 Board-level debugging method without JTAG intervention
CN111984521B (en) * 2019-05-23 2022-11-29 核工业理化工程研究院 Board-level debugging method without JTAG (Joint test action group) intervention
CN110928778A (en) * 2019-11-19 2020-03-27 百富计算机技术(深圳)有限公司 Endless loop positioning method and device, computer equipment and storage medium
CN110928778B (en) * 2019-11-19 2023-09-15 百富计算机技术(深圳)有限公司 Dead-loop positioning method, device, computer equipment and storage medium
CN113220334A (en) * 2021-05-25 2021-08-06 百富计算机技术(深圳)有限公司 Program fault positioning method, terminal device and computer readable storage medium
CN113220334B (en) * 2021-05-25 2024-04-16 百富计算机技术(深圳)有限公司 Program fault positioning method, terminal equipment and computer readable storage medium
CN113778884A (en) * 2021-09-14 2021-12-10 北京爱芯科技有限公司 Simulation debugging method and device, computing equipment and computer storage medium

Also Published As

Publication number Publication date
CN109766273B (en) 2022-09-27

Similar Documents

Publication Publication Date Title
CN109766273A (en) Localization method, device, computer equipment and the storage medium of endless loop
CN102236621B (en) Computer interface information configuration system and method
CN106096338B (en) A kind of virtualization software guard method obscured with data flow
CN102609241B (en) hot patch method and device
CN107506291B (en) Analysis method and device based on data acquisition
CN104794050A (en) Application program test method, device and system
CN104169889A (en) Run-time instrumentation sampling in transactional-execution mode
CN106649084A (en) Function call information obtaining method and apparatus, and test device
CN101084485A (en) Apparatus and method for improving emulation speed of high-level languages in on-chip emulation systems
CN107800757B (en) User behavior recording method and device
CN109783351A (en) Interface detection method, apparatus and computer readable storage medium
CN107003931B (en) Decoupling test validation from test execution
US20160077831A1 (en) Accurate and performant code design using memoization
CN110955598B (en) Breakpoint processing method and device for kernel mode program
CN103514072A (en) Method and device for debugging graphical service for visual programming
CN102855186A (en) Method for processing Java card debugging information
CN107220175A (en) Application program endless loop localization method, device, computer equipment and storage medium
CN102004692B (en) Process debugged method and device
CN104899140B (en) A kind of method of testing of mobile terminal component
CN110287094A (en) UI automated testing method, device and computer readable storage medium
CN109726115A (en) It is a kind of based on Intel processor tracking anti-debug automatically bypass method
CN107291617A (en) A kind of leak analysis method based on implicit tainting
CN113010434A (en) System and method for realizing lightweight application point burying
CN113094052A (en) Application construction method and device, computer equipment and storage medium
CN107704175B (en) Image collection method and device and storage medium

Legal Events

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