CN103207830A - Simulator with software breakpoint - Google Patents
Simulator with software breakpoint Download PDFInfo
- Publication number
- CN103207830A CN103207830A CN2012100097027A CN201210009702A CN103207830A CN 103207830 A CN103207830 A CN 103207830A CN 2012100097027 A CN2012100097027 A CN 2012100097027A CN 201210009702 A CN201210009702 A CN 201210009702A CN 103207830 A CN103207830 A CN 103207830A
- Authority
- CN
- China
- Prior art keywords
- user program
- software breakpoint
- module
- emulation
- data
- 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
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a simulator with a software breakpoint. The simulator with the software breakpoint comprises a simulation chip, a simulation module, a memory and an integrated development environment module on a user computer, wherein the simulation chip and the simulation module are connected by a first normal data/address bus; the simulation module and the memory are connected by a second normal data/address bus; a stop sign signal line is connected between the simulation chip and the simulation module; the simulation module is connected with the integrated development environment module on the user computer via a simulation communication channel; and a software breakpoint information table is stored in the integrated development environment module and is revised by the integrated development environment module. According to the simulator with the software breakpoint, which is disclosed by the invention, the setting/removing efficiency of the software breakpoint can be integrally improved, the user debugging feeling and efficiency are improved, and the program revising error risk in the memory is lowered.
Description
Technical field
The present invention relates to a kind of processor chips emulator, particularly relate to a kind of emulator that has software breakpoint.
Background technology
The user program that has the user to develop in the processor chips, in the writing and debug of user program, employed instrument generally is the processor chips emulator.Use the storer that comprises the every function simulating chip of product treatment device chip and deposit user program, the work behavior that reads and carry out user program of analog equipment processor chips in the emulator.The miscellaneous part of emulator and emulation chip, storer cooperatively interact and realize every debug function, comprise setting/removing breakpoint, single step run program etc.
The breakpoint function is the prerequisite basic function of emulator, also is to use one of maximum debugging method in the program debug.Comprise Hardware Breakpoint and these two kinds of breakpoints of software breakpoint in the emulator that adopts scan chain technique to realize.Hardware Breakpoint is realized with register resources in emulation chip, the Hardware Breakpoint register memory is put the user program statement address that the user is provided with breakpoint, when arranging Hardware Breakpoint in program, the user writes the Hardware Breakpoint register in the emulation chip, when emulation chip reads at full speed and carries out user program, the user program statement address that emulation chip in case find reads by data/address bus is identical with the user program statement address that the Hardware Breakpoint register memory is put, will stop to carry out the user program statement on this address, enter halted state.The user removes Hardware Breakpoint by Integrated Development Environment, only needs to remove this user program statement address, breakpoint place of depositing in the corresponding Hardware Breakpoint register in the emulation chip by emulator and gets final product.But, realize that because Hardware Breakpoint need take the emulation chip register resources so generally all only support 2-4 Hardware Breakpoint in the existing emulator, this quantitatively is can't satisfy the program debug demand far away.Therefore, also have software breakpoint usually in the emulator that adopts scan chain technique to realize.The software breakpoint implementation is that the user is when arranging software breakpoint in program, by Integrated Development Environment module (on the PC) recording setting user program statement address and the user program phrase data of software breakpoint, the user program phrase data that the place, user program statement address that is provided with software breakpoint in the storer in the user program replaced in the nonstandard program statement that can identify with emulation chip only by emulator (for example the A5 machine code instruction in 8051 can be used for doing software breakpoint).After emulation chip begins to read and carries out user program, in case find that by the user program phrase data that data/address bus reads be the nonstandard program statement that the only emulation chip be scheduled to can be identified, will stop to carry out the program statement on the data/address bus, enter halted state; By emulator the user program phrase data (the nonstandard program statement that predetermined only emulation chip can be identified) at this place, software breakpoint program address is replaced back corresponding original user program statement data according to the record in the Integrated Development Environment module then, carry out user program in order to continue from this breakpoint.The user removes software breakpoint by the Integrated Development Environment module, also needs by emulator the user program phrase data (the nonstandard program statement that predetermined only emulation chip can be identified) at this place, software breakpoint program address in the storer to be replaced back corresponding original user program statement data according to the record in the Integrated Development Environment module.
From above-mentioned realization principle as can be seen, than Hardware Breakpoint, the number that software breakpoint arranges can be unrestricted, but when arranging and remove software breakpoint, all once revise the process of user program statement in the storer.If storer is volatile memory, for example then there is not any problem in SRAM (Static Random Access Memory, static RAM) etc.If but what deposit user program in the product chips is nonvolatile memory, EEPROM (E1ectrically Erasable Programmable Read-Only Memory for example, EEPROM (Electrically Erasable Programmable Read Only Memo)), FLASH nonvolatile memories such as (flash memories), and for the real simulation memory performance, the emulator internal storage use with product treatment device chip in consistent nonvolatile memory; Because nonvolatile memory all has by page or leaf (128 bytes or 512 byte one pages etc.) and the characteristics that write by flow process (wipe earlier whole page then write etc.), arrange/when the removing software breakpoint is just revised certain customers' program statement, need the storage page at target program statement place be write by the whole page or leaf of flow process again; It is very slow to show as setting/removing software breakpoint operation like this, very big with the setting/removing speed gap of Hardware Breakpoint, influences user's debugging impression and efficient.Therefore, generally all be preferentially to use Hardware Breakpoint when the user arranges breakpoint in the emulator, after using up, the Hardware Breakpoint resource just brings into use software breakpoint automatically.In addition, bring into operation before the user program, the action of breakpoint setting/removing is generally comparatively frequent, after Hardware Breakpoint uses up, the software breakpoint number of using is many, replaces in the storer user program statement repeatedly and also can add the large memories internal program and revise the risk of makeing mistakes.Run into the process that software breakpoint recovers the original user program statement because program is out of service, this process user experience substantially less than, so basic not influence.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of emulator that has software breakpoint, can improve the setting/elimination efficiency of software breakpoint on the whole, improves user's debugging impression and efficient, reduces the storer internal program and revises the risk of makeing mistakes.
For solving the problems of the technologies described above, the emulator that has software breakpoint of the present invention comprises: emulation chip, emulation module, storer, and the Integrated Development Environment module on the user computer;
Connect by first normal data/address bus between described emulation chip and the emulation module, connect by second normal data/address bus between described emulation module and the storer, also be connected with one between described emulation chip and the emulation module and stop the marking signal line; Be connected by the simulation communication passage between described emulation module and the described Integrated Development Environment module;
All are provided with user program statement address and the corresponding original user program statement data of software breakpoint described Integrated Development Environment module records, constitute the software breakpoint information table and leave in the described Integrated Development Environment module, by this Integrated Development Environment module it is made amendment;
After starting the user program execution, described emulation module obtains the software breakpoint information table from the Integrated Development Environment module, and obtains each software breakpoint corresponding user program statement address and user program phrase data by the software breakpoint information table; Described emulation module order from storer reads each page data that comprises software breakpoint respective user program statement address, is temporarily stored in the emulation module; The non-standard program statement that described emulation module can be identified with emulation chip only, replace the user program phrase data at the place, each user program statement address that is provided with software breakpoint in this page data according to the software breakpoint information table, replace the back and by emulation module this page data is write flow process again in the write store by storer; After necessary page or leaf rewriting and replacement were finished in all storeies, described emulation chip just began to read and carry out user program.
In the user program implementation, in case described emulation chip finds that the user program phrase data that reads is described non-standard program statement, then stops to carry out the user program statement, enters halted state, and notify emulation module to run into software breakpoint, stop to carry out user program; Emulation module is replaced back corresponding original user program statement data to the user program phrase data at place, current software breakpoint respective user program statement address in the user program in the storer according to the software breakpoint information table.
When being set, only revises software breakpoint described software breakpoint information table; When removing the software breakpoint that has arranged, only remove corresponding software breakpoint corresponding user program statement address and original user program statement data in the described software breakpoint information table.
Described storer is nonvolatile memory, is used for depositing user program; Described emulation module reads user program and sends emulation chip to by first normal data/address bus from storer by second normal data/address bus, reads for emulation chip.
Described emulation module is carried out page data by second normal data/address bus to storer and is read, wipes page data and write the page data operation, and the page data that reads is temporarily stored in the emulation module, and can make amendment to temporary page data.
Adopt the emulator that has software breakpoint of the present invention, can improve the setting/elimination efficiency of software breakpoint on the whole, improve user's debugging efficiency, reduce the storer internal program and revise the risk of makeing mistakes; Help to improve job stability, the raising user impression of emulator systems.
Description of drawings
The present invention is further detailed explanation below in conjunction with the drawings and specific embodiments:
Accompanying drawing is the described emulator one example structure synoptic diagram that has software breakpoint.
Embodiment
Shown in accompanying drawing, the described emulator 1 that has software breakpoint comprises: emulation chip 2, emulation module 3, storer 4, and the software breakpoint information table 5 that records in the Integrated Development Environment module 6 on the user computer and the Integrated Development Environment 6.Connect by first normal data/address bus 7 between emulation chip 2 and the emulation module 3,4 are connected by second normal data/address bus 9 between emulation module 3 and storer.Also be provided with one between emulation chip 2 and the emulation module 3 and stop marking signal line 10.Be connected by simulation communication passage 8 between the Integrated Development Environment module 6 on emulation module 3 and the user computer.Software breakpoint information table 5 leaves in the Integrated Development Environment module 6, by Integrated Development Environment module 6 it is made amendment.
Before beginning to carry out user program, when the user arranges software breakpoint by Integrated Development Environment module 6 in program, all are provided with user program statement address and the corresponding original user program statement data of software breakpoint by Integrated Development Environment module 6 records, constitute software breakpoint information table 5, namely this software breakpoint information table 5 has comprised user program statement address and the corresponding original user program statement data that are provided with software breakpoint.Arrange software breakpoint and only revise software breakpoint information table 5 in the Integrated Development Environment module 6 this moment, the software breakpoint that same removing has arranged is also only revised software breakpoint user program statement address and original user program statement data corresponding in (removing) software breakpoint information table 5.
After user's start-up routine is carried out, from Integrated Development Environment module 6, obtain software breakpoint information table 5 by emulation module 3 by simulation communication passage 8 earlier.Emulation module 3 reads each page data by second normal data/address bus 9 order from storer 4 and (only reads the page or leaf that wherein comprises the corresponding program address of software breakpoint, those pages or leaves that do not comprise the corresponding program address of software breakpoint do not need to read out), be temporarily stored in the emulation module 3.The nonstandard program statement that emulation module 3 can be identified with emulation chip 2 only (for example the A5 machine code instruction in 8051 can be used for doing software breakpoint), replace the user program phrase data at the place, each user program statement address that is provided with software breakpoint in this page data according to the software breakpoint information table 5 of record in the Integrated Development Environment module 6, replace the back and by emulation module 3 this page data is write flow process (wipe earlier afterwards write etc.) again in the write store 4 by storer 4.After necessary page or leaf rewriting, replacement are finished in all storeies 4, emulation chip 2 just begins to read and carry out user program via emulation module 3, in case emulation chip 2 finds that by the user program phrase data that first data/address bus 7 reads be the nonstandard program statement that the only emulation chip 2 be scheduled to can be identified, just stop to carry out the user program statement on first normal data/address bus, enter halted state; And run into software breakpoint and stopped carrying out user program by stopping marking signal 10 notice emulation modules 3.Then, emulation module 3 is replaced back corresponding original user program statement data to the user program phrase data at place, current software breakpoint respective user program statement address in the user program in the storer 4 according to the software breakpoint information table 5 of record in the Integrated Development Environment module 6.
Like this, even the action of software breakpoint setting before the run user program/removing is many, also because when setting/removing software breakpoint, directly storer 4 is not done user program statement replacement operation, and the speed of writing software breakpoint information table 5 in the Integrated Development Environment module 6 of computer end is replaced the speed of user program statement in the storer 4 relatively and is wanted fast a lot, therefore, improved the setting/elimination efficiency of software breakpoint, improved user's impression, also reduced simultaneously and replaced program statement in the storer 4 repeatedly and cause the risk of makeing mistakes.
From the description of above-mentioned implementation process as can be seen, the number that software breakpoint arranges still can be unrestricted, and only when beginning to carry out user program just once according to the process of user program statement in the 4 inner pagings of software breakpoint information table 5 modification storeies.If particularly storer 4 has the user program statement address of a plurality of software breakpoint correspondences in certain page, after emulation module 3 reads out this page or leaf from storer 4, finish in this page or leaf all software breakpoint respective user program statement address user program statements once and replace, and write flow process by storer 4 once and be written in the storer 4.Whenever in the existing emulator, a software breakpoint is set all needs in storer 4, to read out a page data, again press the flow process write store after the replacement, promoted efficient and the speed of arranging significantly on the whole, this page minimizing of reading, wipe, writing indegree has simultaneously also reduced in the storer 4 because repeatable operation causes the risk of makeing mistakes, and has also prolonged the life-span of storer 4.
Below through the specific embodiment and the embodiment the present invention is had been described in detail, but these are not to be construed as limiting the invention.Under the situation that does not break away from the principle of the invention, those skilled in the art also can make many distortion and improvement, and these also should be considered as protection scope of the present invention.
Claims (5)
1. an emulator that has software breakpoint is characterized in that, comprising: emulation chip, emulation module, storer, and the Integrated Development Environment module on the user computer;
Connect by first normal data/address bus between described emulation chip and the emulation module, connect by second normal data/address bus between described emulation module and the storer, also be connected with one between described emulation chip and the emulation module and stop the marking signal line; Be connected by the simulation communication passage between described emulation module and the described Integrated Development Environment module;
All are provided with user program statement address and the corresponding original user program statement data of software breakpoint described Integrated Development Environment module records, constitute the software breakpoint information table and leave in the described Integrated Development Environment module, by this Integrated Development Environment module it is made amendment;
After starting the user program execution, described emulation module obtains the software breakpoint information table from the Integrated Development Environment module, and obtains each software breakpoint corresponding user program statement address and user program phrase data by the software breakpoint information table; Described emulation module order from storer reads each page data that comprises software breakpoint respective user program statement address, is temporarily stored in the emulation module; The non-standard program statement that described emulation module can be identified with emulation chip only, replace the user program phrase data at the place, each user program statement address that is provided with software breakpoint in this page data according to the software breakpoint information table, replace the back and by emulation module this page data is write flow process again in the write store by storer; After necessary page or leaf rewriting and replacement were finished in all storeies, described emulation chip just began to read and carry out user program.
2. emulator as claimed in claim 1, it is characterized in that: in the user program implementation, in case described emulation chip finds that the user program phrase data that reads is described non-standard program statement, then stop to carry out the user program statement, enter halted state, and notify emulation module to run into software breakpoint, stop to carry out user program; Emulation module is replaced back corresponding original user program statement data to the user program phrase data at place, current software breakpoint respective user program statement address in the user program in the storer according to the software breakpoint information table.
3. emulator as claimed in claim 1 is characterized in that: only revise described software breakpoint information table when software breakpoint is set; When removing the software breakpoint that has arranged, only remove corresponding software breakpoint corresponding user program statement address and original user program statement data in the described software breakpoint information table.
4. emulator as claimed in claim 1, it is characterized in that: described storer is nonvolatile memory, is used for depositing user program; Described emulation module reads user program and sends emulation chip to by first normal data/address bus from storer by second normal data/address bus, reads for emulation chip.
5. as claim 1 or 4 described emulators, it is characterized in that: described emulation module is carried out page data by second normal data/address bus to storer and is read, wipes page data and write the page data operation, the page data that reads is temporarily stored in the emulation module, and can make amendment to temporary page data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210009702.7A CN103207830B (en) | 2012-01-13 | 2012-01-13 | Emulator with software breakpoint |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210009702.7A CN103207830B (en) | 2012-01-13 | 2012-01-13 | Emulator with software breakpoint |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103207830A true CN103207830A (en) | 2013-07-17 |
CN103207830B CN103207830B (en) | 2016-12-14 |
Family
ID=48755059
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210009702.7A Expired - Fee Related CN103207830B (en) | 2012-01-13 | 2012-01-13 | Emulator with software breakpoint |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103207830B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104461859A (en) * | 2014-08-27 | 2015-03-25 | 北京中电华大电子设计有限责任公司 | Emulator and method for supporting NVM soft breakpoint debugging |
CN105487968A (en) * | 2014-10-09 | 2016-04-13 | 上海华虹集成电路有限责任公司 | Simulator capable of equivalently realizing EEPROM (Electrically Erasable Programmable Read-Only Memory) |
WO2017215377A1 (en) * | 2016-06-16 | 2017-12-21 | 中兴通讯股份有限公司 | Method and device for processing hard memory error |
CN108388522A (en) * | 2018-05-10 | 2018-08-10 | 上海市信息网络有限公司 | Emulator and breakpoint implementing method |
CN108647144A (en) * | 2018-05-10 | 2018-10-12 | 上海市信息网络有限公司 | Emulator and code execute abnormal breakpoint implementing method |
CN110431536A (en) * | 2017-03-20 | 2019-11-08 | 微软技术许可有限责任公司 | Realize the breakpoint in entire data structure |
CN110955598A (en) * | 2019-11-20 | 2020-04-03 | 杭州迪普科技股份有限公司 | Breakpoint processing method and device of kernel mode program |
CN110968494A (en) * | 2018-09-28 | 2020-04-07 | 珠海格力电器股份有限公司 | Software debugging method and device and computer storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020129338A1 (en) * | 2001-03-07 | 2002-09-12 | Macdonell Kevin | Method and system for on-line submission and debug of software code for a portable computer system or electronic device |
CN101013393A (en) * | 2006-10-19 | 2007-08-08 | 北京中星微电子有限公司 | Method and system for simulating chip operation |
CN101329650A (en) * | 2007-06-20 | 2008-12-24 | 上海华虹集成电路有限责任公司 | Smart card emulator |
-
2012
- 2012-01-13 CN CN201210009702.7A patent/CN103207830B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020129338A1 (en) * | 2001-03-07 | 2002-09-12 | Macdonell Kevin | Method and system for on-line submission and debug of software code for a portable computer system or electronic device |
CN101013393A (en) * | 2006-10-19 | 2007-08-08 | 北京中星微电子有限公司 | Method and system for simulating chip operation |
CN101329650A (en) * | 2007-06-20 | 2008-12-24 | 上海华虹集成电路有限责任公司 | Smart card emulator |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104461859A (en) * | 2014-08-27 | 2015-03-25 | 北京中电华大电子设计有限责任公司 | Emulator and method for supporting NVM soft breakpoint debugging |
CN104461859B (en) * | 2014-08-27 | 2017-07-11 | 北京中电华大电子设计有限责任公司 | A kind of emulator and method for supporting the soft debugging breakpoints of NVM |
CN105487968A (en) * | 2014-10-09 | 2016-04-13 | 上海华虹集成电路有限责任公司 | Simulator capable of equivalently realizing EEPROM (Electrically Erasable Programmable Read-Only Memory) |
WO2017215377A1 (en) * | 2016-06-16 | 2017-12-21 | 中兴通讯股份有限公司 | Method and device for processing hard memory error |
CN110431536A (en) * | 2017-03-20 | 2019-11-08 | 微软技术许可有限责任公司 | Realize the breakpoint in entire data structure |
CN108388522A (en) * | 2018-05-10 | 2018-08-10 | 上海市信息网络有限公司 | Emulator and breakpoint implementing method |
CN108647144A (en) * | 2018-05-10 | 2018-10-12 | 上海市信息网络有限公司 | Emulator and code execute abnormal breakpoint implementing method |
CN110968494A (en) * | 2018-09-28 | 2020-04-07 | 珠海格力电器股份有限公司 | Software debugging method and device and computer storage medium |
CN110955598A (en) * | 2019-11-20 | 2020-04-03 | 杭州迪普科技股份有限公司 | Breakpoint processing method and device of kernel mode program |
CN110955598B (en) * | 2019-11-20 | 2024-02-27 | 杭州迪普科技股份有限公司 | Breakpoint processing method and device for kernel mode program |
Also Published As
Publication number | Publication date |
---|---|
CN103207830B (en) | 2016-12-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103207830A (en) | Simulator with software breakpoint | |
CN103473067B (en) | Built-in Linux subregion and data restoration method, system and system development method | |
CN102169459B (en) | Method, device and intelligent card for accessing data | |
CN102750317B (en) | Method and device for data persistence processing and data base system | |
CN103577308B (en) | Method for obtaining log files of mobile device | |
CN105740157A (en) | Data storage device and flash memory control method | |
CN102662690A (en) | Method and apparatus for starting application program | |
CN104615550A (en) | Storage equipment bad block processing method and device and storage equipment | |
CN103677653A (en) | Data processing method and electronic device based on solid state disk (SSD) | |
CN104239096A (en) | Method and unit for realizing security data partitions in Android system | |
CN106528443B (en) | FLASH management system and method suitable for spaceborne data management | |
CN104461859A (en) | Emulator and method for supporting NVM soft breakpoint debugging | |
CN103514101A (en) | Method for accessing flash memory and related memory device | |
CN104468419A (en) | Method and system for recovering configuration of interchanger and interchanger | |
CN102629212A (en) | Method for indirectly programming to NANDFLASH based on J-LINK | |
CN108132871B (en) | Airborne computer interface fault recording method | |
CN103440181A (en) | Method and system for modifying files | |
CN107193558B (en) | Log file generation method and device | |
CN109656475A (en) | A kind of method, apparatus that cache is automatically closed, terminal and storage medium | |
CN206058176U (en) | A kind of automobile-used BootLoader commissioning devices and test automobile | |
CN102467444A (en) | Simulation debugging system for special function register | |
CN104765626A (en) | Firmware program writing method and device | |
CN103177085A (en) | Check point operation method and device | |
CN103678073A (en) | Simulation system | |
CN102750167A (en) | Method and device for starting application program and computer system |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20161214 Termination date: 20200113 |