CN107451045A - A kind of method and device of abnormal information positioning - Google Patents

A kind of method and device of abnormal information positioning Download PDF

Info

Publication number
CN107451045A
CN107451045A CN201610374524.6A CN201610374524A CN107451045A CN 107451045 A CN107451045 A CN 107451045A CN 201610374524 A CN201610374524 A CN 201610374524A CN 107451045 A CN107451045 A CN 107451045A
Authority
CN
China
Prior art keywords
stack
abnormal
information
call function
address information
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.)
Withdrawn
Application number
CN201610374524.6A
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.)
Beijing Xinwei Telecom Technology Inc
Original Assignee
Beijing Xinwei Telecom Technology Inc
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 Beijing Xinwei Telecom Technology Inc filed Critical Beijing Xinwei Telecom Technology Inc
Priority to CN201610374524.6A priority Critical patent/CN107451045A/en
Publication of CN107451045A publication Critical patent/CN107451045A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program

Abstract

The invention discloses a kind of method and device of abnormal information positioning.The program includes:When running microcontroller operating system μ C/OS II, monitor whether abnormal interrupt is triggered;When listening to abnormal interrupt and being triggered, available information is preserved;Whole stack address information according to corresponding to obtaining the available information;Each stack according to corresponding to being found all stack address information, and the effective information preserved in whole stacks is exported;Anomaly source program statement and function call chain are determined according to the effective information.The program can solve the technical problem that when the operations of μ C/OS II occur abnormal, can not position abnormal information.

Description

A kind of method and device of abnormal information positioning
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method and device of abnormal information positioning.
Background technology
Microcontroller operating system is also referred to as μ C/OS II, is that one kind can be based on read-only memory (ROM) operation, can reduce , the real time multi task kernel of preemptive type, particularly suitable for microprocessor and controller, and be adapted to many real time operating systems (RTOS).μ C/OS- II predecessor is μ C/OS, earliest from U.S. embedded system expert Jean in 1992 J.Labrosse exists《Embedded System Programming》The article published on the May of magazine and 6 monthly magazines is published in instalments, and μ C/OS source code Issue is on the BBS of the magazine.
Nowadays, μ C/OS II are widely used in microprocessor, microcontroller and digital signal processor.μ C/ are being installed It is debugged, it is necessary to send out out personnel before OS II equipment is dispatched from the factory, with when ensureing to dispatch from the factory μ C/OS II it is normal.
The exception if μ C/OS II go on a journey in debugging process, system are put into deadlock state, any commonly employed debugging method It can not navigate to and produce the reason for abnormal.Developer can only track operation code by a small amount of method such as type information, directly Can just be oriented untill there is exception be where caused exception.If the product of a shaping, once μ C/OS II Operationally there is the abnormal position that can not just orient abnormal information, can only can not but be known different by restarting recovery system Normal reason is simultaneously repaired.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of method and device of abnormal information positioning, to solve in μ C/OS II When operation occurs abnormal, the technical problem of abnormal information can not be positioned.
In a first aspect, the embodiments of the invention provide a kind of method of abnormal information positioning, including:
When running microcontroller operating system μ C/OS II, monitor whether abnormal interrupt is triggered;
When listening to abnormal interrupt and being triggered, available information is preserved;
Whole stack address information according to corresponding to obtaining the available information;
Each stack according to corresponding to being found all stack address information, and the effective information preserved in each stack is defeated Go out;
Anomaly source program statement and function call chain are determined according to the effective information.
Second aspect, the embodiment of the present invention additionally provide a kind of device of abnormal information positioning, including:
Module is monitored, for when running microcontroller operating system μ C/OS II, monitoring whether abnormal interrupt is triggered;
Preserving module, for when listening to abnormal interrupt and being triggered, preserving available information;
Acquisition module, for whole stack address information according to corresponding to available information acquisition;
Output module, for each stack corresponding to being found according to all stack address information, and it will be preserved in each stack Effective information output;
Determining module, for determining anomaly source program statement and function call chain according to the effective information.
The method and device of abnormal information positioning provided in an embodiment of the present invention, when running μ C/OS II, by listening to When abnormal interrupt is triggered, available information, and whole stacks according to corresponding to determining available information are preserved, what is preserved in output stack has Information is imitated, anomaly source program statement and function call chain are determined according to effective information, realizes and is produced during μ C/OS II are run When raw abnormal, fast positioning to abnormal source statement and function call chain corresponding to finding, the efficiency of positioning is improved, it is convenient to develop People finder is to abnormal cause.
Brief description of the drawings
By reading the detailed description made to non-limiting example made with reference to the following drawings, of the invention is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is a kind of flow chart of the method for abnormal information positioning that the embodiment of the present invention one provides;
Fig. 2 is a kind of flow chart of the method for abnormal information positioning that the embodiment of the present invention two provides;
Fig. 3 is a kind of flow chart of the method for abnormal information positioning that the embodiment of the present invention three provides;
Fig. 4 is a kind of structural representation of the device for abnormal information positioning that the embodiment of the present invention four provides.
Embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention, rather than limitation of the invention.It also should be noted that in order to just Part related to the present invention rather than full content are illustrate only in description, accompanying drawing.
Embodiment one
Fig. 1 is a kind of flow chart of the method for abnormal information positioning that the embodiment of the present invention one provides.The present embodiment provides Method be applied to during μ C/OS II are run, to the situation of abnormal program statement fast positioning.The side that the present embodiment provides Method can be performed by the device that abnormal information positions, and the device can be realized by software and/or hardware, and be integrated in installation In μ C/OS II terminal.With reference to figure 1, this method includes:
S110, when running microcontroller operating system μ C/OS II, monitor abnormal interrupt whether be triggered.
Exemplary, when running μ C/OS II, it is necessary to first be compiled source program to be run, obtain the institutes of μ C/OS II In the form that terminal can recognize that.For example, obtained after source program is compiled executable with form (Executable and can be linked Linkable Format, ELF) text, the text of the form can be by the terminal recognition where μ C/OS II.Wherein, source journey Sequence can be the program that the programs of μ C/OS II and user write on the basis of the programs of μ C/OS II, and source program is C programmer.
Specifically, operation μ C/OS II refer to run the text after source program compiling, it is referred to as running source program compiling Program afterwards.The operating system of the place terminals of μ C/OS II reads every instruction in text, related according to the instruction calls of reading Function, and send to the function of calling the parameter of setting, the function of calling according to relevant parameter generating run result and returns Operation result, to complete the operation of this instruction.
Further, abnormal interrupt is preset.When μ II normal operations of C/OS, the abnormal interrupt will not be triggered, when When occurring abnormal in the runnings of μ C/OS II, abnormal interrupt is triggered, and μ C/OS II out of service.When running μ C/OS II Monitor whether abnormal interrupt is triggered, and then determine current μ C/OS II running status.
S120, when listening to abnormal interrupt and being triggered, preserve available information.
It is exemplary, when listening to abnormal interrupt and being triggered, show to occur in the runnings of μ C/OS II abnormal.Occur After exception, program out of service, while preserve available information.Wherein, when available information can be that μ C/OS II occur abnormal, with The register information of the functional dependence of calling either stack address information.
Wherein, one and call function phase can be established when running μ C/OS II, during instruction calls function in text The stack of pass.Address information, the parameter of function, current operating conditions and the upper calling letter of current calling function are deposited in stack Stack address information of number generation etc..Optionally, one piece of internal memory can be opened up in general register by calling during a function, as be adjusted With the stack of functional dependence, the relevant information of the function is preserved in stack.
Specifically, after abnormal interrupt is triggered, stack address corresponding to the stack of call function during program operation exception is determined Information, and preserve the stack address information.
Further, register information is referred to as general register information.General register is available for transmission and temporarily Deposit data, arithmetic logical operation is may also participate in, and preserve operation result.Can be each during storage program operation in general register The pointer of the related stack of call function and stack.Wherein, the general register of the pointer of stack also turns into pointer register, stack Pointer is referred to as the address information of stack.That is the address information of stack is stored in a register.
Specifically, after abnormal interrupt is triggered, determine general corresponding to the stack of call function during μ II operation exceptions of C/OS Register information, and preserve the general register information.
Optionally, can establish a new stack to preserve available information or preserve available information to flash memory In.
S130, whole stack address information according to corresponding to obtaining the available information.
Exemplary, the available information of preservation is analyzed can be to find nearest stack.Nearest stack is μ C/OS Stack corresponding to call function during II operation exception.
Specifically, during operation μ C/OS II, the function of every instruction calls correlation in the text according to compiling is understood.Every time Call function can all generate a stack.Due to there being the stack address information of a upper call function in each stack, therefore, according to The stack address information can of the upper call function stored in each stack finds the stack of a call function.It is determined that different When often after stack corresponding to call function, it is possible to according to corresponding to being found the stack address information of a upper call function in the stack Stack.According to the method described above, whole stack address information in function call chain when can be to find exception where call function.
Wherein, during function call chain is operation μ C/OS II, the called daisy chaining of each function.
S140, each stack according to corresponding to being found all stack address information, and the effective letter that will be preserved in each stack Breath output.
Exemplary, each stack according to corresponding to being found each stack address information.Effective information can be the address of call function The stack address information of information and a upper call function.Letter is called according to corresponding to being found the address information of call function Number.Order between each stack can be determined according to the stack address information of a upper call function, can according to the order between each stack To determine the order of program run time call function.For example, the upper call function deposited in the stack according to corresponding to A functions Stack address information finds a stack, and determines the stack that a stack is B functions, upper according to what is deposited in stack corresponding to B functions The stack address information of one call function finds a stack, and determines the stack that a stack is C function, does not have in the stack of C function There is the stack address information for being stored in a upper call function, i.e. C function is first call function.At this point it is possible to determine μ C/OS II The order of run time call function is C-B-A.
Specifically, because the information in stack is that the principle gone out afterwards according to first entering is deposited.If the effective information in stack does not exist The top of stack, then before effective information is exported, it is necessary to the data on effective information upper strata are sequentially output, will can just be deposited in stack The effective information output of storage.
S150, anomaly source program statement and function call chain are determined according to the effective information.
Exemplary, between each function and each function that the run time call of μ C/OS II can be determined according to effective information Sequentially.Determine function call chain when μ C/OS II are run.μ C/OS II can also produce multiple function call chains when running, because This can determine to produce abnormal function call chain according to effective information in above-mentioned stack.
Further, Program transformation is converted into the language that developer can watch and change into source program.According to Call function finds corresponding anomaly source program statement in source program during μ II operation exceptions of C/OS.Specifically, according to μ C/OS During II operation exception call function found in source program corresponding to the method for anomaly source program statement can be to determine source program Every sentence and call function corresponding relation, exception call function abnormal source program word accordingly is determined according to corresponding relation Sentence;The corresponding relation of every sentence of call function address and source program can also be to determine, is determined according to corresponding relation abnormal Anomaly source program statement corresponding to call function address.
Optionally, after anomaly source program statement and function call chain is navigated to, Log Report is generated.
The method for a kind of abnormal information positioning that the embodiment of the present invention one provides, when running μ C/OS II, by listening to When abnormal interrupt is triggered, available information, and whole stacks according to corresponding to determining available information are preserved, what is preserved in output stack has Information is imitated, anomaly source program statement and function call chain are determined according to effective information, realizes and produces exception in operation μ C/OS II When, fast positioning to abnormal source statement and function call chain corresponding to finding improve the efficiency of positioning, facilitate developer to look into Find abnormal cause.
Embodiment two
Fig. 2 is a kind of flow chart of the method for abnormal information positioning that the embodiment of the present invention two provides.The present embodiment be On the basis of above-described embodiment, to described when listening to abnormal interrupt and being triggered, the step of preserving available information and described Further restriction has been made in operation according to whole stack address information corresponding to available information acquisition, with reference to figure 2, this method bag Include:
S210, when running microcontroller operating system μ C/OS II, monitor abnormal interrupt whether be triggered.
S220, when listening to abnormal interrupt and being triggered, create abnormal stack.
It is exemplary, when listening to abnormal interrupt and being triggered, show to occur in the runnings of μ C/OS II abnormal.Enter one Step, the μ C/OS II out of service in exception, and a new stack is created, the stack is used for relevant information during storage program exception, The stack is turned into abnormal stack.
Specifically, one section of internal memory can be opened up in general register, as abnormal stack.It should be noted that abnormal stack It can not only create, can be created in the other positions of system in general register.
Further, μ C/OS II install within a processor, create the mode of abnormal stack can be different.Arranged in the present embodiment Lift the scheme that two different processors create abnormal stack:
If scheme one, μ C/OS II are arranged in the central processing unit PowerPC of reduced instruction set computer framework, listening to When abnormal interrupt is triggered, obtains abnormal stack and create instruction;Instruction is created according to the abnormal stack and creates abnormal stack.
Specifically, central processing unit (the Performance Optimization With of reduced instruction set computer framework Enhanced RISC-Performance Computing, PowerPC) the μ C/OS II under framework can be with self-defined stack, you can Stack is created to be instructed according to the establishment of developer.Wherein, the size of stack and the position created can be set by developer It is fixed.
Further, developer can preset position and the size that abnormal stack creates, in the runnings of μ C/OS II The middle position and size when occurring abnormal, created according to developer's abnormal stack set in advance generates abnormal stack and creates instruction, And instruction is created according to abnormal stack abnormal stack is created on the position of setting.
When further or occurring abnormal in the runnings of μ C/OS II, the exception that developer sends is obtained Stack create instruction, and according to abnormal stack create instruction in establishment position and size create corresponding to abnormal stack.
For example, when μ C/OS II occur abnormal, developer sends abnormal stack and creates instruction, and command content is general The internal memory of 80 bytes is opened up in register as abnormal stack.Abnormal stack is obtained to create instruction and create corresponding abnormal stack.
If scheme two, μ C/OS II are arranged in reduced instruction set computer microprocessor ARM, touched listening to abnormal interrupt During hair, abnormal stack is automatically created.
Specifically, the μ C/OS II under reduced instruction set computer microprocessor (Advanced RISC Machines, ARM) framework Cannot self-defined stack, but automatically create stack, the size of stack and create what position was all to determine.And after stack is created, need to The information for being stored in stack is automatically pressed into stack.
Further, when listening to abnormal interrupt and being triggered, μ C/OS II automatically create abnormal stack.
Optionally, microprocessor (the Microprocessor without interlocked of no inner interlocked pipelining-stage Piped stages, MIPS) μ C/OS II under framework are when listening to abnormal interrupt and being triggered, also to automatically create stack.
S230, the stack address information or general register information for determining call function during program exception, and by the calling The stack address information or general register information of function are saved in the abnormal stack.
Exemplary, available information can be general register information.During μ II operation programs of C/OS, each call function When the stack that creates all be the address information for having in deposit general register in general register stack.
Further, it is determined that when abnormal call function general register information, that is, determine storage exception call function stack General register, and then determine general register information.
Preferably, general register is pointer register, i.e. the register of store storehouse pointer, wherein, stack pointer is The address information of stack.During program operation exception, it is determined that corresponding pointer register, and by the stack stored in the pointer register Location information is put into abnormal stack.
Optionally, the stack address information of call function when available information can be program operation exception.Program operation exception After can trigger interruption and it is out of service, the stack of call function be last stack when abnormal, obtain last stack address believe Cease as it is abnormal when call function stack address information, and stack address information is saved in the abnormal stack.
S240, when determining operation exception according to the stack address information or general register information of call function during operation exception The stack of call function.
Further, determine to call during μ II operation exceptions of C/OS according to the information of the general register stored in abnormal stack The stack of function.
Specifically, call function when finding μ II operation exceptions of C/OS according to the stack address information stored in general register Corresponding stack address, stack corresponding to call function when finding program operation exception according to stack address.
Or adjusted when according to the stack address information of call function during μ II operation exceptions of C/OS directly determining that μ C/OS II are abnormal With the stack of function.
The stack address information for the upper call function deposited in S250, the stack according to call function during the operation exception The stack of a call function is found, and using the stack of a upper call function as current stack.
Specifically, relevant information when call function is store in the stack of call function, can according to the stack of call function To determine the stack address information of the position of call function and a upper call function.
Exemplary, the stack for the upper call function deposited according to the stack of call function during μ II operation exceptions of C/OS Location information can finds the stack of a call function.
Optionally, the stack of a upper call function will be found as current stack.
S260, successively according to the stack address information searching for the upper call function deposited in the current stack to upper one The stack of call function, until whole stack address information corresponding to acquisition.
Exemplary, according to the stack address information searching for the upper call function deposited in current stack to upper one calling The stack of function, further according to the call function upper again deposited in the stack of a upper call function stack address information searching to again The stack of a upper call function, is searched successively, the stack address information until finding initial call function.Acquisition is found Whole stack address information.
S270, each stack according to corresponding to being found all stack address information, and the effective letter that will be preserved in each stack Breath output.
S280, anomaly source program statement and function call chain are determined according to the effective information.
The method for a kind of abnormal information positioning that the embodiment of the present invention two provides, when running μ C/OS II, by listening to When abnormal interrupt is triggered, available information is preserved into abnormal stack, and whole stacks according to corresponding to determining available information, output stack The effective information of middle preservation, anomaly source program statement and function call chain are determined according to effective information, realized in operation μ C/OS II when producing abnormal, fast positioning to abnormal source statement and function call chain corresponding to finding, improves the efficiency of positioning, facilitates Developer finds abnormal cause.
Embodiment three
Fig. 3 is a kind of flow chart of the method for abnormal information positioning that the embodiment of the present invention three provides.The present embodiment be On the basis of above-described embodiment, to described the step of determining anomaly source program statement and function call chain according to the effective information Further restriction is made, with reference to figure 3, this method includes:
S310, when running microcontroller operating system μ C/OS II, monitor abnormal interrupt whether be triggered.
S320, when listening to abnormal interrupt and being triggered, preserve available information.
S330, whole stack address information according to corresponding to obtaining the available information.
S340, each stack according to corresponding to being found all stack address information, and the effective letter that will be preserved in each stack Breath output.
Specifically, effective information is preferably the address information of call function and the stack address information of a upper call function.
Optionally, the stack address information of a call function is not deposited in the stack of first call function, is only exported The address information of call function.
S350, the address of each sentence and call function letter in source program and source program is obtained to operation program progress dis-assembling Corresponding relation between breath.
Specifically, the source program of operation program is obtained using the method for dis-assembling.
Further, during dis-assembling, obtain in source program between each sentence and the address information of call function Corresponding relation.During due to operation μ C/OS II, each program statement can call corresponding function, and in the stack of each call function Deposit the address information of call function.During dis-assembling, source program sentence is obtained to each program statement dis-assembling When, it is determined that the corresponding relation between each source program sentence and the address information of call function.
S360, anomaly source program statement determined according to the corresponding relation.
Exemplary, according to the address information for the call function deposited in the stack of call function during μ II operation exceptions of C/OS And the corresponding relation in source program between each sentence and the address information of call function can be obtained by anomaly source program statement.
S370, function call chain determined according to the stack address information of a upper call function.
Exemplary, according to the address information of the upper call function exported in a stack, it is possible to determine two letters Calling order between number.The address information of a upper call function in whole stacks of determination is assured that μ C/OS The order of abnormal function call is produced in II running.It is assured that μ C/OS II are run according to the order of function call During produce abnormal function call chain.
The method for a kind of abnormal information positioning that the embodiment of the present invention three provides, when running μ C/OS II, by listening to When abnormal interrupt is triggered, available information, and whole stacks according to corresponding to determining available information are preserved, what is preserved in output stack has Information is imitated, the program progress dis-assembling to exception obtains source program, and determines anomaly source program statement and letter according to effective information Number call chains, realize when running μ C/OS II and producing abnormal, fast positioning to abnormal source statement and function tune corresponding to finding With chain, the efficiency of positioning is improved, facilitates developer to find abnormal cause.
Example IV
Fig. 4 is a kind of structural representation of the device for abnormal information positioning that the embodiment of the present invention four provides.With reference to figure 4, The device includes:Monitor module 401, preserving module 402, acquisition module 403, output module 404 and determining module 405.
Wherein, module 401 is monitored, is in microcontroller operating system μ II operation programs of C/OS, monitoring abnormal interrupt It is no to be triggered;Preserving module 402, for when listening to abnormal interrupt and being triggered, preserving available information;Acquisition module 403, use In whole stack address information according to corresponding to available information acquisition;Output module 404, for according to all stack addresses Information finds corresponding each stack, and the effective information preserved in each stack is exported;Determining module 405, for according to Effective information determines anomaly source program statement and function call chain.
The device for a kind of abnormal information positioning that the embodiment of the present invention four provides, when running μ C/OS II, by listening to When abnormal interrupt is triggered, available information, and whole stacks according to corresponding to determining available information are preserved, what is preserved in output stack has Information is imitated, anomaly source program statement and function call chain are determined according to effective information, realizes and produces exception in operation μ C/OS II When, fast positioning to abnormal source statement and function call chain corresponding to finding improve the efficiency of positioning, facilitate developer to look into Find abnormal cause.
On the basis of above-described embodiment, the preserving module 402 includes:Abnormal stack creating unit, for listen to it is different When often interruption is triggered, abnormal stack is created;Information holding unit, the stack address information of call function during for determining operation exception Or general register information, and the stack address information of the call function or general register information are saved in the abnormal stack In.
On the basis of above-described embodiment, the abnormal stack creating unit includes:First subelement, if pacifying for μ C/OS II In the central processing unit PowerPC of reduced instruction set computer framework, then when listening to abnormal interrupt and being triggered, abnormal stack is obtained Create instruction;Second subelement, abnormal stack is created for creating instruction according to the abnormal stack.
On the basis of above-described embodiment, the abnormal stack creating unit is specifically used for:If μ C/OS II are arranged on reduced instruction Collect in microprocessor ARM, then when listening to abnormal interrupt and being triggered, automatically create abnormal stack.
On the basis of above-described embodiment, the acquisition module 403 includes:Stack determining unit, during for according to operation exception The stack address information or general register information of call function determine the stack of call function during operation exception;Searching unit, it is used for According to the stack address information searching for the upper call function deposited in the stack of call function during the operation exception to upper one The stack of call function, and using the stack of a upper call function as current stack;Stack acquiring unit, for successively according to described current The stack address information searching for the upper call function deposited in stack to a upper call function stack, until complete corresponding to acquisition Portion's stack address information.
On the basis of above-described embodiment, the effective information includes:The address information of call function and upper calling letter Several stack address information.
On the basis of above-described embodiment, the determining module 405 includes:Dis-assembling unit, for being carried out to operation program Dis-assembling obtains the corresponding relation between each sentence and the address information of call function in source program and source program;Sentence determines single Member, for determining anomaly source program statement according to the corresponding relation;Call chain determining unit, for according to a upper tune Function call chain is determined with the stack address information of function.
A kind of device for abnormal information positioning that the embodiment of the present invention four provides can be used for performing above-mentioned any embodiment The method of the abnormal information positioning of offer, possesses corresponding function and beneficial effect.
Pay attention to, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various obvious changes, Readjust and substitute without departing from protection scope of the present invention.Therefore, although being carried out by above example to the present invention It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also Other more equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.

Claims (14)

  1. A kind of 1. method of abnormal information positioning, it is characterised in that including:
    When running microcontroller operating system μ C/OS II, monitor whether abnormal interrupt is triggered;
    When listening to abnormal interrupt and being triggered, available information is preserved;
    Whole stack address information according to corresponding to obtaining the available information;
    Each stack according to corresponding to being found all stack address information, and the effective information preserved in each stack is exported;
    Anomaly source program statement and function call chain are determined according to the effective information.
  2. 2. according to the method for claim 1, it is characterised in that when listening to abnormal interrupt and being triggered, preservation can use letter Breath includes:
    When listening to abnormal interrupt and being triggered, abnormal stack is created;
    The stack address information or general register information of call function during operation exception are determined, and by the stack of the call function Location information or general register information are saved in the abnormal stack.
  3. 3. according to the method for claim 2, it is characterised in that when listening to abnormal interrupt and being triggered, create abnormal stack Including:
    If μ C/OS II are arranged in the central processing unit PowerPC of reduced instruction set computer framework, touched listening to abnormal interrupt During hair, obtain abnormal stack and create instruction;
    Instruction is created according to the abnormal stack and creates abnormal stack.
  4. 4. according to the method for claim 2, it is characterised in that when listening to abnormal interrupt and being triggered, create abnormal stack Including:
    If μ C/OS II are arranged in reduced instruction set computer microprocessor ARM, when listening to abnormal interrupt and being triggered, automatic wound Build abnormal stack.
  5. 5. according to the method for claim 1, it is characterised in that whole stack addresses according to corresponding to obtaining the available information Information includes:
    Call function when determining operation exception according to the stack address information of call function during operation exception or general register information Stack;
    According to the stack address information searching for the upper call function deposited in the stack of call function during the operation exception to upper The stack of one call function, and using the stack of a upper call function as current stack;
    Successively according to the stack address information searching for the upper call function deposited in the current stack to a upper call function Stack, until whole stack address information corresponding to acquisition.
  6. 6. according to the method for claim 1, it is characterised in that the effective information includes:The address information of call function With the stack address information of a upper call function.
  7. 7. according to the method for claim 6, it is characterised in that according to the effective information determine anomaly source program statement and Function call chain includes:
    Dis-assembling is carried out to operation program to obtain in source program and source program between each sentence and the address information of call function Corresponding relation;
    Anomaly source program statement is determined according to the corresponding relation;
    Function call chain is determined according to the stack address information of a upper call function.
  8. A kind of 8. device of abnormal information positioning, it is characterised in that including:
    Module is monitored, for when running microcontroller operating system μ C/OS II, monitoring whether abnormal interrupt is triggered;
    Preserving module, for when listening to abnormal interrupt and being triggered, preserving available information;
    Acquisition module, for whole stack address information according to corresponding to available information acquisition;
    Output module, for each stack corresponding to being found according to all stack address information, and have what is preserved in each stack Imitate information output;
    Determining module, for determining anomaly source program statement and function call chain according to the effective information.
  9. 9. device according to claim 8, it is characterised in that the preserving module includes:
    Abnormal stack creating unit, for when listening to abnormal interrupt and being triggered, creating abnormal stack;
    Information holding unit, the stack address information or general register information of call function during for determining operation exception, and will The stack address information or general register information of the call function are saved in the abnormal stack.
  10. 10. device according to claim 9, it is characterised in that the abnormal stack creating unit includes:
    First subelement, if being arranged on for μ C/OS II in the central processing unit PowerPC of reduced instruction set computer framework, supervising When hearing that abnormal interrupt is triggered, obtain abnormal stack and create instruction;
    Second subelement, abnormal stack is created for creating instruction according to the abnormal stack.
  11. 11. device according to claim 9, it is characterised in that the abnormal stack creating unit is specifically used for:
    If μ C/OS II are arranged in reduced instruction set computer microprocessor ARM, when listening to abnormal interrupt and being triggered, automatic wound Build abnormal stack.
  12. 12. device according to claim 8, it is characterised in that the acquisition module includes:
    Stack determining unit, operation is determined for the stack address information according to call function during operation exception or general register information The stack of call function when abnormal;
    Searching unit, for the stack address for the upper call function deposited in the stack according to call function during the operation exception Information searching to a upper call function stack, and using the stack of a upper call function as current stack;
    Stack acquiring unit, for being arrived successively according to the stack address information searching for the upper call function deposited in the current stack The stack of a upper call function, until whole stack address information corresponding to acquisition.
  13. 13. device according to claim 8, it is characterised in that the effective information includes:The address information of call function With the stack address information of a upper call function.
  14. 14. device according to claim 13, it is characterised in that the determining module includes:
    Dis-assembling unit, each sentence and call function in source program and source program are obtained for carrying out dis-assembling to operation program Corresponding relation between address information;
    Sentence determining unit, for determining anomaly source program statement according to the corresponding relation;
    Call chain determining unit, for determining function call chain according to the stack address information of a upper call function.
CN201610374524.6A 2016-05-31 2016-05-31 A kind of method and device of abnormal information positioning Withdrawn CN107451045A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610374524.6A CN107451045A (en) 2016-05-31 2016-05-31 A kind of method and device of abnormal information positioning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610374524.6A CN107451045A (en) 2016-05-31 2016-05-31 A kind of method and device of abnormal information positioning

Publications (1)

Publication Number Publication Date
CN107451045A true CN107451045A (en) 2017-12-08

Family

ID=60485697

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610374524.6A Withdrawn CN107451045A (en) 2016-05-31 2016-05-31 A kind of method and device of abnormal information positioning

Country Status (1)

Country Link
CN (1) CN107451045A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664250A (en) * 2018-03-27 2018-10-16 北京奇艺世纪科技有限公司 A kind of code process method and device
CN109189598A (en) * 2018-08-01 2019-01-11 百富计算机技术(深圳)有限公司 A kind of method, processor and terminal device interrupting positioning
CN110609761A (en) * 2019-09-06 2019-12-24 北京三快在线科技有限公司 Method and device for determining fault source, storage medium and electronic equipment
CN110618940A (en) * 2019-09-19 2019-12-27 腾讯科技(深圳)有限公司 Stack information tracking method and device, computer readable medium and computing device
CN110620698A (en) * 2018-06-19 2019-12-27 杭州海康威视数字技术股份有限公司 Software abnormity diagnosis method, device, equipment and system
CN111124900A (en) * 2019-12-11 2020-05-08 深圳震有科技股份有限公司 Data acquisition method and device during abnormal program operation, terminal and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1477505A (en) * 2002-08-24 2004-02-25 深圳市中兴通讯股份有限公司 Abnormal failure location method in embedded operationi system
CN1655124A (en) * 2005-03-04 2005-08-17 清华大学 PowerPC processor based vehicular operating system interrupt management method
CN101211309A (en) * 2006-12-29 2008-07-02 中兴通讯股份有限公司 Embedded system progress abnormal tracking position-finding method
CN101539883A (en) * 2009-05-05 2009-09-23 北京和利时系统工程有限公司 Error tracking method of embedded system and device thereof
US20120297370A1 (en) * 2011-05-16 2012-11-22 Texas Instruments Incorporated Stack Analysis for Post Mortem Analysis
CN103077112A (en) * 2012-10-16 2013-05-01 中兴通讯股份有限公司 Software debugging method and system
CN105204990A (en) * 2015-08-21 2015-12-30 上海斐讯数据通信技术有限公司 Abnormity debugging method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1477505A (en) * 2002-08-24 2004-02-25 深圳市中兴通讯股份有限公司 Abnormal failure location method in embedded operationi system
CN1655124A (en) * 2005-03-04 2005-08-17 清华大学 PowerPC processor based vehicular operating system interrupt management method
CN101211309A (en) * 2006-12-29 2008-07-02 中兴通讯股份有限公司 Embedded system progress abnormal tracking position-finding method
CN101539883A (en) * 2009-05-05 2009-09-23 北京和利时系统工程有限公司 Error tracking method of embedded system and device thereof
US20120297370A1 (en) * 2011-05-16 2012-11-22 Texas Instruments Incorporated Stack Analysis for Post Mortem Analysis
CN103077112A (en) * 2012-10-16 2013-05-01 中兴通讯股份有限公司 Software debugging method and system
CN105204990A (en) * 2015-08-21 2015-12-30 上海斐讯数据通信技术有限公司 Abnormity debugging method and system

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664250A (en) * 2018-03-27 2018-10-16 北京奇艺世纪科技有限公司 A kind of code process method and device
CN110620698A (en) * 2018-06-19 2019-12-27 杭州海康威视数字技术股份有限公司 Software abnormity diagnosis method, device, equipment and system
CN109189598A (en) * 2018-08-01 2019-01-11 百富计算机技术(深圳)有限公司 A kind of method, processor and terminal device interrupting positioning
CN109189598B (en) * 2018-08-01 2022-01-25 百富计算机技术(深圳)有限公司 Interrupt positioning method, processor and terminal equipment
CN110609761A (en) * 2019-09-06 2019-12-24 北京三快在线科技有限公司 Method and device for determining fault source, storage medium and electronic equipment
CN110609761B (en) * 2019-09-06 2020-10-16 北京三快在线科技有限公司 Method and device for determining fault source, storage medium and electronic equipment
CN110618940A (en) * 2019-09-19 2019-12-27 腾讯科技(深圳)有限公司 Stack information tracking method and device, computer readable medium and computing device
CN110618940B (en) * 2019-09-19 2024-02-06 腾讯科技(深圳)有限公司 Stack information tracking method, device, computer readable medium and computing device
CN111124900A (en) * 2019-12-11 2020-05-08 深圳震有科技股份有限公司 Data acquisition method and device during abnormal program operation, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN107451045A (en) A kind of method and device of abnormal information positioning
CN106227671B (en) Program analysis of running performance method and device
US6356795B1 (en) Synchronization method
CN109783161B (en) Method and device for determining running information of application program in iOS system
US20020069302A1 (en) Method and system for passing messages between threads
CN102063286B (en) Program flow controls
US8752056B2 (en) Running native code across single or multi-core hybrid processor achitecture
CN109933465B (en) Exception handling method, exception handling device, server and storage medium
US20030101380A1 (en) Method and system for rewriting unwind data in the presence of exceptions
TW201738737A (en) An apparatus and method for managing address collisions when performing vector operations
US20090044040A1 (en) Modification of array access checking in aix
CN105589739B (en) A kind of process control system and method
KR102147355B1 (en) Method and apparatus for converting programs
US20060277552A1 (en) Facilitating handling of exceptions in a program implementing a M-on-N threading model
WO2009009090A1 (en) Exception-based error handling in an array-based language
US8566813B2 (en) Method and system generating execution file system device
CN111209135A (en) Log processing method and device
US7080204B2 (en) Cache controller computer system and method for program recompilation
Dooley et al. Detecting and using critical paths at runtime in message driven parallel programs
WO2019075805A1 (en) Robot interaction method and system thereof
CN110244954A (en) A kind of Compilation Method and equipment of application program
JP3120434B2 (en) Program operation analysis method
Rowlett Building an object process around use cases
JP7045846B2 (en) Programming language conversion support device, programming language conversion support method, and program
JPH0455945A (en) Compiled code output system for generation of nonlocal outlet function frame

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20171208