CN101425038A - Method and system for searching software error - Google Patents

Method and system for searching software error Download PDF

Info

Publication number
CN101425038A
CN101425038A CNA2008102398910A CN200810239891A CN101425038A CN 101425038 A CN101425038 A CN 101425038A CN A2008102398910 A CNA2008102398910 A CN A2008102398910A CN 200810239891 A CN200810239891 A CN 200810239891A CN 101425038 A CN101425038 A CN 101425038A
Authority
CN
China
Prior art keywords
software
global variable
numerical value
address
main frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CNA2008102398910A
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.)
Vimicro Corp
Original Assignee
Vimicro Corp
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 Vimicro Corp filed Critical Vimicro Corp
Priority to CNA2008102398910A priority Critical patent/CN101425038A/en
Publication of CN101425038A publication Critical patent/CN101425038A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a method for looking for software errors and a system thereof. The method comprises the following steps: before and after the error step is executed, a host obtains numerical values of global variables respectively from a system for operating the software or a simulation system and stores the values; the host automatically compares the numerical values of global variables obtained before and after the error step is executed and inputs marks of the global variables in which the numerical values change; and users search that whether the processing to the global variables exists errors according to the global variables with changed numerical values. Correspondingly, the system for looking for the software errors provided by the invention comprises the system for operating the software or the simulation system, a storage module, a control module and a comparative module. The invention can conveniently and fast look for the errors of the global variables.

Description

A kind of method and system of seeking software error
Technical field
The present invention relates to a kind of method and system of seeking software error, relate in particular to a kind of method and system of in embedded system, seeking software global variable mistake.
Background technology
Along with becoming stronger day by day of embedded type CPU, embedded system also becomes increasingly complex, certainly, in the system of complexity, the mistake of software also may be a lot, if there is not the method for strong searching software error, these mistakes will seriously influence product quality, influence the image of company; Described herein is exactly the method that a kind of embedded software is sought software error.
Embedded software will move, and must compile under the compiler of corresponding CPU, and the code of generation comprises code segment (RO), stack segment (Stack) and global variable (RW and ZI).Fig. 1 shows the Memory Allocation mode in the embedded software, wherein:
RO represents code segment, and what place here is run time version, can only read and can not write;
Stack represents stack segment, storage be return address and the local variable that interrupt routine calls in the run time version;
What RW and ZI represented is global variable, and these data will account for internal memory always, for code is carried out service.
Generally, the correctness that software is carried out also requires stack except the correctness that requires RO section code logic, and the data in RW and the ZI all are correct, and wherein global variable is made mistakes and caused software error to occupy very big proportion in all embedded software mistakes.General way is exactly by increasing the method for test and software simulation, also not having a kind of method that can seek the global variable mistake quickly and easily now.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of method and system of seeking software error, can search out the mistake of global variable quickly and easily.
In order to address the above problem, the present invention seeks the method that the method for software error removes to search software error according to the characteristics of embedded software internal memory mode at global varible internal memory just, and this method also is applicable to and adopts other that global variable is kept at system in the internal memory.
The method of searching software error provided by the invention comprises:
Before the step of makeing mistakes of executive software and afterwards, main frame obtains the numerical value of global variable respectively and preserves from the system that moves described software or simulation system;
Described main frame is relatively carried out before the described step of makeing mistakes and the numerical value of the global variable that obtains afterwards automatically, the sign of the global variable that output numerical value changes;
Whether the processing that the user searches these global variables according to the sign of the vicissitudinous global variable of described numerical value exists mistake.
Further, said method also can have following characteristics:
Before carrying out described software, described main frame is preserved the address information of the global variable place internal memory of exporting in the described software translating process earlier;
Described main frame when obtaining the numerical value of global variable respectively from the simulation system of moving described software, is to obtain before execution makes mistakes step and afterwards before execution makes mistakes step and afterwards, the address and the numerical value of storage unit in the region of memory of global variable place.
Further, said method also can have following characteristics:
Before carrying out described software, described main frame is preserved the address of each global variable of exporting in the described software translating process and the correspondence relationship information between its sign earlier;
When described main frame is relatively carried out the numerical value of the global variable before and after the step of makeing mistakes automatically, be relatively to carry out before the step of makeing mistakes and the address and the numerical value of the storage unit that reads afterwards, search identical but the storage unit that numerical value is different in all addresses, as find, arrive the sign and the output of corresponding global variable again according to the address search of the storage unit that finds.
Further, said method also can have following characteristics:
The system of the described software of described operation or simulation system are embedded system or are the embedded system that the embedded running environment on described main frame is promptly simulated.
Further, said method also can have following characteristics:
The step that the described step of makeing mistakes makes a mistake when being meant executive software comprises the instruction of one or more in the software.
The system of searching software error provided by the invention comprises system or the simulation system of moving described software, and memory module, control module and comparison module, wherein:
Described memory module comprises first data storage cell, is used for being kept at before the step of makeing mistakes of executive software the numerical value of the global variable that obtains from the system that moves described software or simulation system; And second data storage cell, be used for being kept at after the step of makeing mistakes of executive software the numerical value of the global variable that obtains from the system that moves described software or simulation system;
Described control module is used for carrying out alternately with the system or the simulation system of the described software of operation, comprise the part steps of carrying out in described software or the software, before the step of makeing mistakes of executive software and send the order of reading global variable afterwards with the numerical value that obtains global variable and be kept at described first data storage cell or second data storage cell, also be used to start described comparison module;
Described comparison module is used for after startup, the numerical value of the global variable in more described automatically first data storage cell and second data storage cell, and the sign of the global variable that changes of output numerical value.
Further, said system also can have following characteristics:
Described memory module also comprises the Memory Allocation information memory cell, is used for preserving the address information of global variable in internal memory that described software translating process is exported; What described first data storage cell and second data storage cell were preserved is the address and the numerical value of storage unit in the region of memory of global variable place.
Further, said system also can have following characteristics:
Described memory module also comprises the address of variable assignment information storage unit, is used for preserving the address of each global variable that described software translating process exports and the correspondence relationship information between its sign;
When described comparison module is relatively carried out the numerical value of the global variable before and after the step of makeing mistakes automatically, be the address and the numerical value of the storage unit of comparison first data storage cell and second data storage cell preservation, search identical but the storage unit that numerical value is different in all addresses, as find, the described correspondence relationship information of preserving according to the address and the described address of variable assignment information storage unit of the storage unit that finds finds the sign and the output of the global variable of described address correspondence again.
Further, said system also can have following characteristics:
The system of the described software of described operation is an embedded system, described memory module, control module and comparison module be positioned at the mutual main frame of this embedded system on.
Further, said system also can have following characteristics:
Described control module and comparison module are positioned on the main frame, and described memory module is positioned on the described main frame or with described main frame and is connected, and the simulation system of the described software of described operation is the embedded system that the embedded running environment on the described main frame is promptly simulated.
The present invention can automatically determine the global variable that changes when execution makes mistakes step, thereby the helper applications responsible official locatees the global issue module, and arrange the module owner to search wrong reason, thus improved the speed of software development, shortened the time of launch.
Description of drawings
Fig. 1 is the synoptic diagram of the Memory Allocation in the embedded software.
Fig. 2 is the structural drawing of embodiment of the invention system.
Fig. 3 is the process flow diagram of embodiment of the invention method.
Embodiment
Figure 2 shows that the structural drawing of present embodiment system, one simulation embedded system (also can be described as the simulation embedded system) is arranged in PC (or other main frames), comprise memory module in addition, control module and comparison module, and memory module comprises the Memory Allocation information memory cell, the address of variable assignment information storage unit, first data storage cell and second storage data units, described Memory Allocation information memory cell, the address of variable assignment information storage unit, first data storage cell and second data storage cell are corresponding to certain storage area, and these storage areas can be arranged in identical or different storer.And memory module also and do not require in main frame, also can be external storer etc., and the present invention does not limit.Wherein:
The Memory Allocation information memory cell is used to preserve the Memory Allocation address information, comprises the address information of each data segment (comprising global variable) place internal memory in the embedded software.
The address of variable assignment information storage unit is used to preserve the address information of each global variable, comprises the correspondence relationship information between variable name and the address.
First data storage cell is used for preserving address and the numerical value of carrying out global varible internal memory zone storage unit in the simulation embedded system of obtaining before the step of makeing mistakes;
Second data storage cell is used for preserving address and the numerical value of carrying out global varible internal memory zone storage unit in the simulation embedded system of obtaining after the step of makeing mistakes;
Control module is used for carrying out alternately to finish debug process with the simulation embedded system, comprise software that execution will be debugged or the part steps in the software, send the order of reading global variable to obtain in the simulation embedded system in the global varible internal memory zone address and the numerical value of storage unit and to be kept at described first data storage cell or second data storage cell according to the address information of each global variable to the simulation embedded system, also be used to start comparison module;
Comparison module is used for after startup, automatically the address and the numerical value that compare the storage unit in first data storage cell and second data storage cell, find identical but the storage unit that numerical value is different in all addresses, according to the address search address of variable assignment information of the storage unit that finds, the vicissitudinous global variable name of step front and back numerical value of makeing mistakes is carried out in output then.
The flow process of present embodiment method may further comprise the steps as shown in Figure 3:
At first preserve the address information of the Memory Allocation address information exported in the compilation process and each global variable, as setting up Memory Allocation table and address of variable allocation table.Compiler is exported the Memory Allocation address information automatically in compilation process, these information are exactly the content of Memory Allocation table, and mainly storage is the address information of each data segment in the embedded software; And compiler also can be exported the address information of each global variable, and these information also are stored in the address of variable allocation table, and establishes the corresponding relation between variable name and the address.
In debug process, the step that makes a mistake when determining executive software (in the literary composition this step is called the step of makeing mistakes, may comprises the instruction of one or more in the software) is just brought into use following flow process to carry out mistake and is searched, and process flow diagram comprises as shown in Figure 2:
Step 110, before execution made mistakes step, main frame (as PC) sent the order of reading global variable according to the Memory Allocation address information, obtained the address of storage unit and numerical value and preservation in the region of memory of global variable place in the simulation embedded system;
Step 120 is carried out the step of makeing mistakes;
Step 130, main frame are sent the order of reading global variable, obtain the address of storage unit and numerical value and preservation in the region of memory of global variable place in the simulation embedded system once more;
Step 140, main frame are relatively carried out the address and the numerical value of the storage unit that reads before and after the step of makeing mistakes, and search identical but the storage unit that numerical value is different in all addresses;
Step 150, as find, main frame obtains carrying out the vicissitudinous global variable name of step front and back numerical value of makeing mistakes again according to the address search address of variable table of the storage unit that finds;
Described global variable name also can identify with other of global variable and replace.
Step 160, whether the processing that user's (being the commissioning staff here) searches these global variables according to the vicissitudinous variable name of these numerical value exists mistake.
Global variable is made mistakes and is caused software error to occupy very big proportion in all embedded software mistakes.After using said method, can automatically be positioned at and carry out the vicissitudinous variable of step front and back numerical value of makeing mistakes, after the related software module developer is obtained these variable names, just can search whether there is mistake at the variation of these variablees.Therefore, the present invention can accelerate the search procedure of error reason, improves the speed of software development, has shortened the time of launch.
Because embedded system becomes increasingly complex and be huge, each software module is interrelated, and the developer is very difficult to problem identificatioin and where appears at, and this method is a fundamentally method of auxiliary debugging, has increased the means of developer's orientation problem.Because it is feasible and must finds the problem place, therefore improved the speed of software development greatly.
Above method also can be applied in the test process, this moment, software was installed in the actual embedded system, main frame can obtain the numerical value of the global variable of this software from this embedded system, carries out then automatically relatively and exports the vicissitudinous variable name of numerical value and do further for the user and search.
Significantly, the inventive method also is suitable for the system that global variable is kept in the internal memory for other, is not limited to be applied in the embedded system.

Claims (10)

1, a kind of method of seeking software error comprises:
Before the step of makeing mistakes of executive software and afterwards, main frame obtains the numerical value of global variable respectively and preserves from the system that moves described software or simulation system;
Described main frame is relatively carried out before the described step of makeing mistakes and the numerical value of the global variable that obtains afterwards automatically, the sign of the global variable that output numerical value changes;
Whether the processing that the user searches these global variables according to the sign of the vicissitudinous global variable of described numerical value exists mistake.
2, the method for claim 1 is characterized in that:
Before carrying out described software, described main frame is preserved the address information of the global variable place internal memory of exporting in the described software translating process earlier;
Described main frame when obtaining the numerical value of global variable respectively from the simulation system of moving described software, is to obtain before execution makes mistakes step and afterwards before execution makes mistakes step and afterwards, the address and the numerical value of storage unit in the region of memory of global variable place.
3, method as claimed in claim 2 is characterized in that:
Before carrying out described software, described main frame is preserved the address of each global variable of exporting in the described software translating process and the correspondence relationship information between its sign earlier;
When described main frame is relatively carried out the numerical value of the global variable before and after the step of makeing mistakes automatically, be relatively to carry out before the step of makeing mistakes and the address and the numerical value of the storage unit that reads afterwards, search identical but the storage unit that numerical value is different in all addresses, as find, arrive the sign and the output of corresponding global variable again according to the address search of the storage unit that finds.
4, as claim 1 or 2 or 3 described methods, it is characterized in that:
The system of the described software of described operation or simulation system are embedded system or are the embedded system that the embedded running environment on described main frame is promptly simulated.
5, method as claimed in claim 4 is characterized in that:
The step that the described step of makeing mistakes makes a mistake when being meant executive software comprises the instruction of one or more in the software.
6, a kind of system of seeking software error is characterized in that, comprises system or the simulation system of moving described software, and memory module, control module and comparison module, wherein:
Described memory module comprises first data storage cell, is used for being kept at before the step of makeing mistakes of executive software the numerical value of the global variable that obtains from the system that moves described software or simulation system; And second data storage cell, be used for being kept at after the step of makeing mistakes of executive software the numerical value of the global variable that obtains from the system that moves described software or simulation system;
Described control module is used for carrying out alternately with the system or the simulation system of the described software of operation, comprise the part steps of carrying out in described software or the software, before the step of makeing mistakes of executive software and send the order of reading global variable afterwards with the numerical value that obtains global variable and be kept at described first data storage cell or second data storage cell, also be used to start described comparison module;
Described comparison module is used for after startup, the numerical value of the global variable in more described automatically first data storage cell and second data storage cell, and the sign of the global variable that changes of output numerical value.
7, system as claimed in claim 6 is characterized in that:
Described memory module also comprises the Memory Allocation information memory cell, is used for preserving the address information of global variable in internal memory that described software translating process is exported; What described first data storage cell and second data storage cell were preserved is the address and the numerical value of storage unit in the region of memory of global variable place.
8, system as claimed in claim 7 is characterized in that:
Described memory module also comprises the address of variable assignment information storage unit, is used for preserving the address of each global variable that described software translating process exports and the correspondence relationship information between its sign;
When described comparison module is relatively carried out the numerical value of the global variable before and after the step of makeing mistakes automatically, be the address and the numerical value of the storage unit of comparison first data storage cell and second data storage cell preservation, search identical but the storage unit that numerical value is different in all addresses, as find, the described correspondence relationship information of preserving according to the address and the described address of variable assignment information storage unit of the storage unit that finds finds the sign and the output of the global variable of described address correspondence again.
9, as claim 6 or 7 or 8 described systems, it is characterized in that:
The system of the described software of described operation is an embedded system, described memory module, control module and comparison module be positioned at the mutual main frame of this embedded system on.
10, as claim 6 or 7 or 8 described systems, it is characterized in that:
Described control module and comparison module are positioned on the main frame, and described memory module is positioned on the described main frame or with described main frame and is connected, and the simulation system of the described software of described operation is the embedded system that the embedded running environment on the described main frame is promptly simulated.
CNA2008102398910A 2008-12-19 2008-12-19 Method and system for searching software error Pending CN101425038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008102398910A CN101425038A (en) 2008-12-19 2008-12-19 Method and system for searching software error

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008102398910A CN101425038A (en) 2008-12-19 2008-12-19 Method and system for searching software error

Publications (1)

Publication Number Publication Date
CN101425038A true CN101425038A (en) 2009-05-06

Family

ID=40615669

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008102398910A Pending CN101425038A (en) 2008-12-19 2008-12-19 Method and system for searching software error

Country Status (1)

Country Link
CN (1) CN101425038A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101980176A (en) * 2010-10-29 2011-02-23 华为数字技术有限公司 Software error code transferring method, device and system
CN109117357A (en) * 2017-06-23 2019-01-01 中兴通讯股份有限公司 It record global variable information and detects global variable and crosses the border the method, apparatus of operation

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1523503A (en) * 2003-09-05 2004-08-25 中兴通讯股份有限公司 An embedded real time operating system fault analysis positioning system and method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1523503A (en) * 2003-09-05 2004-08-25 中兴通讯股份有限公司 An embedded real time operating system fault analysis positioning system and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101980176A (en) * 2010-10-29 2011-02-23 华为数字技术有限公司 Software error code transferring method, device and system
CN109117357A (en) * 2017-06-23 2019-01-01 中兴通讯股份有限公司 It record global variable information and detects global variable and crosses the border the method, apparatus of operation

Similar Documents

Publication Publication Date Title
CN107122368B (en) Data verification method and device and electronic equipment
CN101369249B (en) Method and apparatus for marking GUI component of software
US7150006B2 (en) Techniques for managed code debugging
CN101308471B (en) Method and device for data restoration
US20110106776A1 (en) Incremental implementation of undo/redo support in legacy applications
CN103150188B (en) The compatible video card fast initializing method of the x86 of non-x 86 instruction set computer
CN103136107A (en) Variable debugging method of embedded program dynamic storage allocation
US11513944B1 (en) Ranking tests based on code change and coverage
CN112015491A (en) Method, device and computer storage medium for realizing function jump
CN105224459A (en) Method for testing reading and writing BIOS configuration function of BMC through OEM command under LINUX platform
CN102063328A (en) System for detecting interrupt-driven type program data competition
CN109388573B (en) Error detection method and system during running of interrupt-driven program without false alarm
CN113836023B (en) Compiler security testing method based on architecture cross check
CN111813670A (en) Non-invasive MC/DC coverage statistical analysis method
CN113094252A (en) Test case generation method and device, computer equipment and storage medium
CN109783837A (en) Emulator, analogue system, emulation mode and simulated program
CN101425038A (en) Method and system for searching software error
CN110096888B (en) Method and system for accelerating verification and analyzing SMM potential safety hazard
CN113779918A (en) SoC simulation method, device, computing equipment and computer storage medium
CN102591669A (en) Modularized computer firmware and realizing method thereof
CN105511940B (en) The method and system of authorization virtual machine access Xenstore in a kind of Xen virtualization
CN110780919A (en) Method and system for manufacturing and maintaining application program language package
CN104915352A (en) Method and device for verifying processed data accuracy under MapReduce environment
CN113448746B (en) Configuration processing method, configuration platform and related equipment
JP2002014847A (en) Device for checking program and method for the same and recording medium with checking program stored

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20090506