CN1808397A - Test method for electronic device program - Google Patents

Test method for electronic device program Download PDF

Info

Publication number
CN1808397A
CN1808397A CN 200510005591 CN200510005591A CN1808397A CN 1808397 A CN1808397 A CN 1808397A CN 200510005591 CN200510005591 CN 200510005591 CN 200510005591 A CN200510005591 A CN 200510005591A CN 1808397 A CN1808397 A CN 1808397A
Authority
CN
China
Prior art keywords
program
order code
storage
electronic device
code
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
CN 200510005591
Other languages
Chinese (zh)
Other versions
CN100357908C (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.)
BenQ Corp
Original Assignee
BenQ 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 BenQ Corp filed Critical BenQ Corp
Priority to CNB2005100055912A priority Critical patent/CN100357908C/en
Publication of CN1808397A publication Critical patent/CN1808397A/en
Application granted granted Critical
Publication of CN100357908C publication Critical patent/CN100357908C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Disclosed is a testing method for electronic devices which comprises: loading electronic device program to program storage in computer; then performing the electronic device program, Operating System performs an error processing routine if storage accessing error occurs; the error processing gets address of a command code which causes the storage error first, then modifies command code in the program storage according to the program code address to prevent stage accessing errors.

Description

The method of testing of electronic device program
Technical field
The present invention relates to a kind of method of testing of electronic device program, particularly relate to a kind of method of testing that can dynamic auto modification electronic device program code.
Background technology
General present exploitation electronic installation can be divided into two parts, and some is a hardware, and another partly then belongs to the software development of electronic installation.In the process of software development at present, normally in computing machine, write program, and in having write emulator (Simulator) the simulation hardware work in computing machine afterwards, test and the operation of deinsectization (Debug).After treating that hardware development is finished, just can be directly with software transplanting to the hardware with the hardware operate together.
A lot of accessing operations to hardware are arranged in the program code of software.With the mobile phone is example, and the operation of these accesses is by certain I/O port (I/O Port) peripheral units such as its LCD screen, backlight or loudspeaker to be controlled.Yet, do not have I/O port on computers as the hardware of mobile phone, therefore in simulation process, the program code of access I/O port can cause the storage access mistake.
Generally speaking, carry out emulation on computers and only need test program code with the irrelevant part of hardware, and skip or ignore about the hardware program code.Software with the C language development is example, can utilize preprocessor (preprocessor), decision produces emulator version or hardware version when compiling (compiling), in the emulator version, be left in the basket and do not compiled about the program code of hardware system, just memory error can not take place when therefore carrying out on computers.For example following program code about hardware, it is defined with preprocessor #ifndef:
1.#ifndef?FEATURE_SIMULATOR
2. *(0x50200014)=0x0F
3.#endif
Wherein the 2nd line program is to be that the I/O port of 0x50200014 writes to the address, in the emulator version, FEATURE_SIMULATOR is defined in advance, therefore the 2nd line program code promptly can be left in the basket in the compilation phase, in hardware version, FEATURE_SIMULATOR is not defined, and therefore the 2nd line program code can be compiled, and therefore can carry out the accessing operation of correct I/O port.
Utilize the practice of preprocessor mark, in less, still be feasible about the program code of hardware, yet the software function of electronic installation is more and more at present, the program code of many accessing operations to hardware is also more, also therefore quite takes time and effort if utilize manually that each hardware is relevant program code to add as above-mentioned pre-process control.
Summary of the invention
In view of this, the purpose of this invention is to provide a kind of update routine code that do not need manually to repeat, when simulation stage, program can be automatically and real time modifying need do the program code of hardware access operation, to prevent memory error.
According to purpose of the present invention, a kind of method of testing of mobile phone program is proposed, method of testing comprises: at first, load the mobile phone program in a program storage.Then, carry out the mobile phone program, if a storage access mistake takes place, then this operating system is carried out an error handler.Carry out the address that an error handler comprises that at first acquisition causes an order code of memory error.Then, according to the address of program code, in program storage modify instruction sign indicating number, to prevent the storage access mistake.
For above-mentioned purpose of the present invention, feature and advantage can be become apparent, a preferred embodiment cited below particularly, and be described with reference to the accompanying drawings as follows.
Description of drawings
Figure 1A shows the emulator version of mobile phone program and makes calcspar.
Figure 1B shows the hardware version of mobile phone program and makes calcspar.
Fig. 2 A shows mobile phone program testing method process flow diagram.
Fig. 2 B shows the process flow diagram of step 118.
Embodiment
First embodiment
Figure 1A and Figure 1B are respectively the emulator version of mobile phone program and the making calcspar of hardware version.Please refer to Figure 1A, its emulator version that shows the mobile phone program is made calcspar.The source code of mobile phone program A (source code) A.C and simulate secondary letter formula source code B.C, may utilize as different languages such as C language, C Plus Plus or JAVA program languages and write, produce emulator execute file (A+B) .exe via 100 compilings of compiling/connector and after linking, this file can be carried out in computing machine, so that mobile phone program A is carried out emulation testing.Simulating secondary letter formula source code B.C makes mobile phone program A can carry out required secondary letter formula in computing machine, with the interface as mobile phone program A and operation system of computer, the source code of mobile phone program A is relevant to hardware access port at least one mobile phone.
Please refer to Figure 1B, its hardware version that shows the mobile phone program is made calcspar.The secondary letter formula of the source code A.C of mobile phone program A and hardware source code B ' .C is via compiler 103 compilings and link the back and produce hardware execute file (A+B ') .bin, and this file can load in the ROM (read-only memory) of mobile phone and carry out.
Owing to have many hardware-related program codes among the mobile phone A, if directly execution can cause memory error in computing machine, therefore in known technology, be in its source code A.C with preprocessor with hardware-related program code mark, make coding/connector 100 ignore these hardware-related program codes, yet the known practice needs add in source code A.C with manual type the mark of preprocessor, and is loaded down with trivial details and lose time.Need not change source code A.C in the present embodiment, only in secondary letter formula source code B.C, add error handler, make and to change program code in real time when memory error takes place, thereby avoid producing mistake.
During the general operation system executive, run into any mistake that can't handle and will produce error messages, present embodiment then increases the program of real time modifying program code in this error handler, make when operating system is found memory error, can the time update program.
Please refer to Fig. 2 A, it shows mobile phone program testing method process flow diagram.At first, load the program storage of emulator version execute file (A+B) .exe in computing machine of mobile phone program A, shown in step 110.Then, in step 112, carry out this execute file (A+B) .exe.Then, in step 114, if when carrying out the program code relevant, if generation storage access mistake with at least one hardware access port, this moment, operating system jumped to step 116 with the error process routine, otherwise continued to carry out (A+B) .exe in step 112.
Error handler is shown in step 116 and 118.In step 116, acquisition causes the address of the order code of storage access mistake.At last, in step 118, according to the address of program code, in program storage, revise the order code that makes a mistake in real time, when returning this order code address after making error handler finish and carrying out, this revises back order code, and the storage access mistake can't take place, and the continuation program is carried out.
Please refer to Fig. 2 B, it shows the process flow diagram of the real time modifying order code of step 118.At first, step 118a configuration one substitutes storer.Then, step 118b differentiates whether dispose alternative storer success.If configuration substitutes the storer success, then this order code of modification makes it change the access alternative storer of configuration this time in program storage, and returns step 112 and continue to carry out this modification back order code.If it is unsuccessful that configuration substitutes storer, then can change this order code in program storage is the inoperation (NOP) or the instructions such as (JUMP) of jumping.For example original order code in storage address 0x17354 is the instruction of C7 0,100 00 00 00, and it is the operation of hardware being carried out access, when carrying out this order code is memory error takes place.After the error handler modification, the program code that can be changed into inoperation (NOP) is as 90 90 90 90 90 90 instruction, or the program code (JUMP) that is modified as jump as the skip instruction (Jump) of EB 04 0,000 00 00 with this row order code of tripping.
In the above-mentioned practice, not necessarily to dispose alternative storer, also can skips steps 118a and 118b and directly execution in step 118c to change order code.
In the present embodiment, if still have the situation of other access memory mistake to produce, error handler all can utilize above-mentioned mode to solve the problem of access memory error messages.Simultaneously, more can utilize when memory error taking place next time, the reduction last time memory error the time, the order code of in program storage, being revised.
The method of testing of the electronic device program that the above embodiment of the present invention is disclosed, at this is to be example with the mobile phone, under the situation that does not change the mobile phone program, utilize the directly order code of dynamic and real-time modification generation access memory mistake of error handler, reduce the time that modification of program is manually carried out in emulator utilization in the past greatly.After emulation testing is errorless, the mobile phone program can directly compile and connect to (A+B ') .bin shown in Figure 1B, loading on mobile phone can carry out, and does not need source document A.C is carried out any modification, has reduced the time-histories of whole software research and development with the software and hardware integration.
In sum; though the present invention discloses as above with a preferred embodiment; right its is not in order to limiting the present invention, and those skilled in the art can be used for a variety of modifications and variations without departing from the spirit and scope of the present invention, so protection scope of the present invention is as the criterion with the application's claim.

Claims (8)

1. the method for testing of a program is applicable to that a computer system tests an electronic device program, and this computer system operation is in an operating system, and this method of testing comprises:
Load the program storage of this electronic device program in this computer system;
Carry out this electronic device program, if a storage access mistake takes place,
Acquisition causes the address of an order code of this storage access mistake; And
According to the address of this order code, revise this order code in this program storage, to prevent this storage access mistake.
2. the method for claim 1 is wherein revised this order code step and is comprised that configuration one substitutes storer, and revises this order code in this program storage, should substitute storer so that this order code changes access into.
3. method as claimed in claim 2 when configuration should substitute memory error, is to change this order code to prevent this storage access mistake wherein.
4. method as claimed in claim 2 is wherein changed in this order code step, is this order code is replaced by inoperation (NOP) or the order code of jump (JUMP).
5. the method for claim 1 is wherein revised in this order code step, is this order code is replaced by inoperation (NOP) or the order code of jump (JUMP).
6. the method for testing of a program, this procedural application is in an electronic installation, and this electronic installation has at least one hardware access port, and this method of testing comprises:
Load the program storage of this electronic device program in a computer system;
Carry out this electronic device program, if the storage access mistake with respect to this at least one hardware access port takes place;
Acquisition causes the address of an order code of this storage access mistake; And
According to the address of this order code, revise this order code in this program storage, to prevent this storage access mistake.
7. method as claimed in claim 6, this method also comprises:
Omit this order code, the continuation program is carried out.
8. method as claimed in claim 6 is wherein changed in this order code step, is this order code is replaced by inoperation (NOP) or the order code of jump (JUMP).
CNB2005100055912A 2005-01-21 2005-01-21 Test method for electronic device program Expired - Fee Related CN100357908C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100055912A CN100357908C (en) 2005-01-21 2005-01-21 Test method for electronic device program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100055912A CN100357908C (en) 2005-01-21 2005-01-21 Test method for electronic device program

Publications (2)

Publication Number Publication Date
CN1808397A true CN1808397A (en) 2006-07-26
CN100357908C CN100357908C (en) 2007-12-26

Family

ID=36840306

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100055912A Expired - Fee Related CN100357908C (en) 2005-01-21 2005-01-21 Test method for electronic device program

Country Status (1)

Country Link
CN (1) CN100357908C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104267A (en) * 2018-10-26 2020-05-05 长鑫存储技术有限公司 Debugging processing method and debugging processing system of memory

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4475709B2 (en) * 1999-11-15 2010-06-09 株式会社ルネサステクノロジ Microcomputer
DE10027530A1 (en) * 2000-06-02 2001-12-06 Hitex Systementwicklung Ges Fu Method for automatically detecting software programming errors e.g. for multi-processor computer systems, involves picking off actual addresses of write/read accesses at address space of working memory
CN1167012C (en) * 2001-07-06 2004-09-15 宏碁股份有限公司 Test system for information equipment and test method
CN1275155C (en) * 2002-08-24 2006-09-13 中兴通讯股份有限公司 Abnormal failure location method in embedded operationi system
CN1503131A (en) * 2002-11-20 2004-06-09 科统科技股份有限公司 Memory device with automatic repairing function and automatic repairing method thereof
CN1323361C (en) * 2003-06-14 2007-06-27 中兴通讯股份有限公司 Processor system and method using multi memory of start-up procedure

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104267A (en) * 2018-10-26 2020-05-05 长鑫存储技术有限公司 Debugging processing method and debugging processing system of memory
CN111104267B (en) * 2018-10-26 2022-05-13 长鑫存储技术有限公司 Debugging processing method and debugging processing system of memory

Also Published As

Publication number Publication date
CN100357908C (en) 2007-12-26

Similar Documents

Publication Publication Date Title
CN101799763B (en) Method, device and system for patching kernel on line
EP0926592B1 (en) Software emulation system
US8429619B2 (en) Executable high-level trace file generation system
CN111124550B (en) Program dynamic loading method and device and storage medium
CN112084113B (en) Configurable automatic test method and system based on embedded simulation verification software
US20110126179A1 (en) Method and System for Dynamic Patching Software Using Source Code
US20130125096A1 (en) Systems and Methods for Dynamic Collection of Probe Call Sites
US20060200809A1 (en) Transforming code to expose glacial constants to a compiler
WO2019005228A1 (en) Automated source code adaption to inject features between platform versions
CN105354045A (en) Patch making method and apparatus and patch activation method and apparatus
US20100115502A1 (en) Post Processing of Dynamically Generated Code
CN105739992B (en) The method and system of software control memory partition and mapping based on GCC compiler
CN1273897C (en) Automatic approach for unit testing
CN111930398A (en) Application program updating method, device, system, medium and equipment
JPH09237202A (en) Method for executing debugging processing
CN111367579A (en) V-REP plug-in and processor in-loop simulation method based on V-REP plug-in
CN109144849B (en) Embedded software debugging method
CN100357908C (en) Test method for electronic device program
US6086622A (en) Method and apparatus for converting an architecture of a program and method, and apparatus for debugging a program by using them
JP2919302B2 (en) CPU simulation method
US6178547B1 (en) Method and apparatus for generating non-redundant symbolic debug information in computer programs
CN116594622A (en) Python program compiling method and system based on type deduction and data flow analysis
CN100517265C (en) Microcontroller emulation system
CN111984329B (en) Boot software standardized generation and execution method and system
CN112559336A (en) Method, device and system for adaptively debugging heterogeneous computing chip and mainboard chip

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C19 Lapse of patent right due to non-payment of the annual fee
CF01 Termination of patent right due to non-payment of annual fee