CN105824750A - Soft breakpoint simulation method during NorFlash program space debugging - Google Patents
Soft breakpoint simulation method during NorFlash program space debugging Download PDFInfo
- Publication number
- CN105824750A CN105824750A CN201610145172.7A CN201610145172A CN105824750A CN 105824750 A CN105824750 A CN 105824750A CN 201610145172 A CN201610145172 A CN 201610145172A CN 105824750 A CN105824750 A CN 105824750A
- Authority
- CN
- China
- Prior art keywords
- instruction
- debugger
- breakpoint
- soft
- processor
- 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
- 238000000034 method Methods 0.000 title claims abstract description 24
- 238000004088 simulation Methods 0.000 title claims abstract description 16
- 238000003780 insertion Methods 0.000 claims abstract description 5
- 230000037431 insertion Effects 0.000 claims abstract description 5
- 230000002159 abnormal effect Effects 0.000 claims description 8
- 230000005856 abnormality Effects 0.000 claims 1
- 230000002547 anomalous effect Effects 0.000 claims 1
- 238000007726 management method Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3698—Environments for analysis, debugging or testing of software
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
一种NorFlash程序空间调试的软断点模拟方法,包括如下步骤:(1)处理器编码阶段,对于软断点指令的编码,要为全0的编码格式;(2)在NorFlash程序空间调试阶段,当调试器有向程序空间插入断点指令的需求时,调试器调用断点指令插入单元,该单元利用NorFlash空间可以按照特定长度将指定位置从1写入0的特征,插入处理器的软断点指令,即写入全0;(3)当调试器收到运行程序的调试请求时,判断当前PC处的指令是否与软断点指令列表中的断点地址匹配;(4)当处理器运行中遇到软断点指令之后,调试器应当判断这条软断点指令地址是否与软断点模块中全部软断点地址匹配。本发明调试效率较高、适用性良好。
A kind of soft breakpoint simulation method of NorFlash program space debugging, comprises the steps: (1) processor coding stage, for the coding of soft breakpoint instruction, will be the coding format of all 0; (2) in NorFlash program space debugging stage , when the debugger needs to insert a breakpoint instruction into the program space, the debugger calls the breakpoint instruction insertion unit, which utilizes the feature that the NorFlash space can write the specified position from 1 to 0 according to a specific length, and inserts the processor's software Breakpoint instruction, that is, write all 0; (3) When the debugger receives the debugging request of the running program, judge whether the instruction at the current PC matches the breakpoint address in the soft breakpoint instruction list; (4) When processing After encountering a soft breakpoint instruction during the running of the debugger, the debugger should judge whether the address of this soft breakpoint instruction matches all the soft breakpoint addresses in the soft breakpoint module. The invention has high debugging efficiency and good applicability.
Description
技术领域technical field
本发明属于处理器NorFlash程序空间的调试领域,尤其涉及RISC嵌入式处理器NorFlash程序空间调试中的软断点的实现方法。。The invention belongs to the field of debugging of a processor NorFlash program space, and in particular relates to a method for realizing a soft breakpoint in the debugging of a RISC embedded processor NorFlash program space. .
背景技术Background technique
在基于RISC处理器的嵌入式系统开发中,只读空间(NorFlash,E2PROM等)的开发是必不可少的,几乎所有的嵌入式设备在完成开发之后,都需要将代码烧写到只读空间中,实现嵌入式设备上电直接运行在Flash上,即可工作的功能。在只读器件中,NorFlash以其线性地址寻址,直接可执行指令的特点,受到了嵌入式设备的青睐。In the development of embedded systems based on RISC processors, the development of read-only space (NorFlash, E 2 PROM, etc.) In the reading space, the embedded device can be powered on and run directly on the Flash, and then it can work. Among read-only devices, NorFlash is favored by embedded devices for its linear address addressing and directly executable instructions.
对于RAM空间来说,由于其空间可以随意修改内容,开发人员只需要设置软断点来实现对程序运行的控制。软断点设置之后,调试器在每次运行程序之前,首先需要做的是将设置了软断点的地址上的指令替换为处理器的断点指令,然后运行程序,处理器运行期间遇到断点指令之后,会将信息返回给调试器,从而实现了对程序的控制。软断点的实现由于对处理器调试没有多余的硬件需求,所以理论上是可以设置无限多个的。For the RAM space, since the content of the space can be modified at will, developers only need to set soft breakpoints to control the running of the program. After the soft breakpoint is set, the first thing the debugger needs to do before running the program each time is to replace the instruction at the address where the soft breakpoint is set with the breakpoint instruction of the processor, and then run the program. After the breakpoint instruction, the information will be returned to the debugger, thus realizing the control of the program. Since the realization of soft breakpoints has no redundant hardware requirements for processor debugging, it is theoretically possible to set an infinite number of them.
由于NorFlash不能像RAM那样支持随意写操作,所以现有NorFlash程序空间调试基本上都需要硬断点来完成对程序运行的控制,开发人员如果希望运行在NorFlash空间的程序在某处停下来,需要在该处设置一个硬断点,处理器会接收到调试器设置硬断点的信息,使用其内部的硬件资源,完成硬断点的设置,后续运行中程序如果触发该硬断点,处理器会将信息返回给调试器,从而实现对程序的控制。这种方式的最大问题在于,硬断点的实现是需要硬件开销的,而且与硬件断点的实现个数成正比,对于一些极低功耗的嵌入式设备来说,硬断点个数可能只有一个(甚至没有),开发人员将无法在控制程序运行的时候同时设置多个断点进行程序调试;或者在设置了硬断点之后无法通过调试器观察点去检测程序中某个变量的变化,因为调试器的观察点的实现需要消耗处理器中一个硬断点资源。Because NorFlash cannot support arbitrary write operations like RAM, so the existing NorFlash program space debugging basically requires hard breakpoints to complete the control of program running. If developers want to stop the program running in the NorFlash space somewhere, they need to Set a hard breakpoint here, the processor will receive the information that the debugger sets the hard breakpoint, and use its internal hardware resources to complete the setting of the hard breakpoint. If the program triggers the hard breakpoint during subsequent running, the processor will Information is returned to the debugger, allowing control of the program. The biggest problem with this method is that the implementation of hard breakpoints requires hardware overhead, and is proportional to the number of hardware breakpoints. For some extremely low-power embedded devices, the number of hard breakpoints may With only one (or even none), developers will not be able to set multiple breakpoints for program debugging while the control program is running; or after setting a hard breakpoint, they will not be able to detect the change of a variable in the program through the debugger observation point , because the implementation of the debugger's watchpoint consumes a hard breakpoint resource in the processor.
只读空间由于其软断点指令无法写入、替换的问题,硬件断点又存在个数限制,使得NorFlash程序空间的程序开发调试效率受到了影响,一些极端情况下,某些调试需求还无法实现。Due to the problem that the soft breakpoint instruction cannot be written or replaced in the read-only space, and the number of hardware breakpoints is limited, the efficiency of program development and debugging in the NorFlash program space is affected. In some extreme cases, certain debugging requirements cannot accomplish.
发明内容Contents of the invention
为了克服已有嵌入式开发中NorFlash程序空间调试效率较低、适用性较差的不足,本发明提供一种调试效率较高、适用性良好的在NorFlash程序空间调试的软断点模拟方法。In order to overcome the shortcomings of low debugging efficiency and poor applicability in NorFlash program space in existing embedded development, the present invention provides a soft breakpoint simulation method for debugging in NorFlash program space with high debugging efficiency and good applicability.
本发明解决其技术问题所采用的技术方案是:The technical solution adopted by the present invention to solve its technical problems is:
一种在NorFlash程序空间调试的软断点模拟方法,所述软断点模拟方法包括如下步骤:A kind of soft breakpoint simulation method of NorFlash program space debugging, described soft breakpoint simulation method comprises the steps:
(1)处理器编码阶段,对于软断点指令的编码,要为全0的编码格式;(1) In the processor encoding stage, for the encoding of the soft breakpoint instruction, it must be an encoding format of all 0s;
(2)在NorFlash程序空间调试阶段,当调试器有向程序空间插入断点指令的需求时,调试器调用断点指令插入单元,该单元利用NorFlash空间可以按照特定长度将指定位置从1写入0的特征,插入处理器的软断点指令,即写入全0;(2) In the NorFlash program space debugging stage, when the debugger needs to insert a breakpoint instruction into the program space, the debugger calls the breakpoint instruction insertion unit, which uses the NorFlash space to write the specified position from 1 according to a specific length The feature of 0, insert the soft breakpoint instruction of the processor, that is, write all 0;
(3)当调试器收到运行程序的调试请求时,首先判断当前PC处的指令是否与软断点指令列表中的断点地址匹配;如果不匹配,则表示该软断点是程序本身的指令,调试器可以按照原有流程,停止程序的执行即可;如果匹配,则执行如下流程:(3) When the debugger receives the debugging request of the running program, it first judges whether the instruction at the current PC matches the breakpoint address in the soft breakpoint instruction list; if it does not match, it means that the soft breakpoint is the program itself command, the debugger can follow the original process and stop the execution of the program; if it matches, the following process will be executed:
(3.1)调试器会解析PC处被替换的处理器的二进制指令流,输出格式化结果,该结果包含指令类型、指令操作数以及指令可能产生的全部异常类型;(3.1) The debugger will analyze the binary instruction stream of the replaced processor at the PC, and output a formatted result, which includes the instruction type, instruction operand, and all exception types that may be generated by the instruction;
(3.2)调试器内部指令执行单元会首先根据解析结果对指令是否产生异常进行判断,判断依据依照处理器异常类型而定;(3.2) The internal instruction execution unit of the debugger will first judge whether the instruction is abnormal according to the analysis result, and the judgment basis depends on the type of processor exception;
(3.3)如果指令不会产生异常,调试器会读取指令解析中的操作数部分以及指令类型,调用特定的调试命令,控制处理器完成这条被替换指令的执行,最后根据调试命令选择停止程序、运行程序;(3.3) If the instruction does not generate an exception, the debugger will read the operand part and the instruction type in the instruction parsing, call a specific debugging command, control the processor to complete the execution of the replaced instruction, and finally choose to stop according to the debugging command program, running program;
(3.4)如果指令会产生异常,调试器应该根据解析的异常类型,调用指定的调试命令,将处理器设定到指定的异常状态中,然后继续根据调试命令选择停止、运行程序;(3.4) If the instruction will generate an exception, the debugger should call the specified debugging command according to the analyzed exception type, set the processor to the specified abnormal state, and then continue to choose to stop and run the program according to the debugging command;
(3.5)若指令正常执行,调试器会执行PC=PC+{当前指令长度}操作;若指令执行会产生异常,调试器会执行PC=异常向量表[异常号],跳到异常入口处执行。(3.5) If the instruction is executed normally, the debugger will execute the PC=PC+{current instruction length} operation; if the instruction execution will generate an exception, the debugger will execute PC=exception vector table [abnormal number], and jump to the exception entry for execution.
(4)当处理器运行中遇到软断点指令之后,调试器应当判断这条软断点指令地址是否与软断点模块中全部软断点地址匹配:(4) When the processor encounters a soft breakpoint instruction during operation, the debugger should judge whether the address of this soft breakpoint instruction matches all the soft breakpoint addresses in the soft breakpoint module:
(4.1)如果匹配,则如(3)所述由调试器模拟执行这条指令;(4.1) If it matches, the debugger simulates the execution of this instruction as described in (3);
(4.2)如果不匹配,则不需要做任何特殊操作。(4.2) If there is no match, no special action is required.
本发明的技术构思为:利用NorFlash器件可以以特定的长度将保存的值从1写成0的特性;要求处理器的软断点指令编码必须是全0,编码长度可以随意;利用调试器的基本调试功能来模拟处理器的异常状态、实现处理器的指令功能。The technical idea of the present invention is: use the characteristic that the NorFlash device can write the saved value from 1 to 0 with a specific length; require that the soft breakpoint instruction code of the processor must be all 0, and the code length can be arbitrary; The debugging function is used to simulate the abnormal state of the processor and realize the instruction function of the processor.
本发明的有益效果主要表现在:1)该方法实现了NorFlash程序空间软断点的插入,以及模拟执行处理器指令,以软件模拟指令执行的方式来间接实现硬件断点的功能,解决了断点设置个数有限的问题,从而提高了嵌入式NorFlash空间程序调试的调试效率;The beneficial effects of the present invention are mainly manifested in: 1) the method realizes the insertion of soft breakpoints in the NorFlash program space, and simulates the execution of processor instructions, and indirectly realizes the function of hardware breakpoints in the manner of software simulation instruction execution, and solves the problem of breakpoints. Set a limited number of questions, thereby improving the debugging efficiency of embedded NorFlash space program debugging;
2)该方法的实现并没有占用任何的硬件开销,在嵌入式这种对资源有限制要求的领域中,具有很高的实用价值;2) The implementation of this method does not occupy any hardware overhead, and it has high practical value in the field of embedded, which has limited requirements on resources;
3)该方法在嵌入式NorFlash调试中,节省了硬件开销,对于用于调试的硬件资源有限的处理器的调试中,可以满足之前无法满足的一些调试需求。3) This method saves hardware overhead in debugging embedded NorFlash, and can meet some debugging requirements that could not be met before in debugging a processor with limited hardware resources for debugging.
附图说明Description of drawings
图1是NorFlash软断点模拟系统框图;Figure 1 is a block diagram of the NorFlash soft breakpoint simulation system;
图2是调试器断点管理流程图;Figure 2 is a flow chart of debugger breakpoint management;
图3是处理器指令模拟模块结构框图;Fig. 3 is a structural block diagram of a processor instruction simulation module;
图4是处理器异常模拟单元流程图。Fig. 4 is a flow chart of the processor exception simulation unit.
具体实施方式detailed description
下面结合附图对本发明作进一步描述。The present invention will be further described below in conjunction with the accompanying drawings.
参照图1~图4,一种在NorFlash程序空间调试的软断点模拟方法,所述软断点模拟方法包括如下步骤:With reference to Fig. 1~Fig. 4, a kind of soft breakpoint simulation method of debugging in NorFlash program space, described soft breakpoint simulation method comprises the steps:
(1)处理器编码阶段,对于软断点指令的编码,要为全0的编码格式;(1) In the processor encoding stage, for the encoding of the soft breakpoint instruction, it must be an encoding format of all 0s;
(2)在NorFlash程序空间调试阶段,当调试器有向程序空间插入断点指令的需求时,调试器调用断点指令插入单元,该单元利用NorFlash空间可以按照特定长度将指定位置从1写入0的特征,插入处理器的软断点指令,即写入全0;(2) In the NorFlash program space debugging stage, when the debugger needs to insert a breakpoint instruction into the program space, the debugger calls the breakpoint instruction insertion unit, which uses the NorFlash space to write the specified position from 1 according to a specific length The feature of 0, insert the soft breakpoint instruction of the processor, that is, write all 0;
(3)当调试器收到运行程序的调试请求时,首先判断当前PC处的指令是否与软断点指令列表中的断点地址匹配;如果不匹配,则表示该软断点是程序本身的指令,调试器可以按照原有流程,停止程序的执行即可;如果匹配,则执行如下流程:(3) When the debugger receives the debugging request of the running program, it first judges whether the instruction at the current PC matches the breakpoint address in the soft breakpoint instruction list; if it does not match, it means that the soft breakpoint is the program itself command, the debugger can follow the original process and stop the execution of the program; if it matches, the following process will be executed:
(3.1)调试器会解析PC处被替换的处理器的二进制指令流,输出格式化结果,该结果包含指令类型、指令操作数以及指令可能产生的全部异常类型;(3.1) The debugger will analyze the binary instruction stream of the replaced processor at the PC, and output a formatted result, which includes the instruction type, instruction operand, and all exception types that may be generated by the instruction;
(3.2)调试器内部指令执行单元会首先根据解析结果对指令是否产生异常进行判断,判断依据依照处理器异常类型而定;(3.2) The internal instruction execution unit of the debugger will first judge whether the instruction is abnormal according to the analysis result, and the judgment basis depends on the type of processor exception;
(3.3)如果指令不会产生异常,调试器会读取指令解析中的操作数部分以及指令类型,调用特定的调试命令,控制处理器完成这条被替换指令的执行,最后根据调试命令选择停止程序、运行程序;(3.3) If the instruction does not generate an exception, the debugger will read the operand part and the instruction type in the instruction parsing, call a specific debugging command, control the processor to complete the execution of the replaced instruction, and finally choose to stop according to the debugging command program, running program;
(3.4)如果指令会产生异常,调试器应该根据解析的异常类型,调用指定的调试命令,将处理器设定到指定的异常状态中,然后继续根据调试命令选择停止、运行程序;(3.4) If the instruction will generate an exception, the debugger should call the specified debugging command according to the analyzed exception type, set the processor to the specified abnormal state, and then continue to choose to stop and run the program according to the debugging command;
(3.5)若指令正常执行,调试器会执行PC=PC+{当前指令长度}操作;若指令执行会产生异常,调试器会执行PC=异常向量表[异常号],跳到异常入口处执行。(3.5) If the instruction is executed normally, the debugger will execute the PC=PC+{current instruction length} operation; if the instruction execution will generate an exception, the debugger will execute PC=exception vector table [abnormal number], and jump to the exception entry for execution.
(4)当处理器运行中遇到软断点指令之后,调试器应当判断这条软断点指令地址是否与软断点模块中全部软断点地址匹配:(4) When the processor encounters a soft breakpoint instruction during operation, the debugger should judge whether the address of this soft breakpoint instruction matches all the soft breakpoint addresses in the soft breakpoint module:
(4.1)如果匹配,则如(3)所述由调试器模拟执行这条指令;(4.1) If it matches, the debugger simulates the execution of this instruction as described in (3);
(4.2)如果不匹配,则不需要做任何特殊操作。(4.2) If there is no match, no special action is required.
本实施例中,为调试器增加启动NorFlash程序空间调试的命令。由于本发明中,对NorFlash的软断点管理方法是与一般RAM中的软断点实现完全不同,所以这里需要对调试器添加进行NorFlash程序空间进行调试的命令。In this embodiment, a command to start NorFlash program space debugging is added for the debugger. Because in the present invention, the soft breakpoint management method of NorFlash is completely different from the soft breakpoint implementation in general RAM, so it is necessary to add commands for debugging the NorFlash program space to the debugger.
更新调试器断点管理模块,新增NorFlash断点写入单元;通常情况下NorFlash具有特定长度从1写入0的特性,调试器应该利用该特性,写入处理器断点指令,当NorFlash要求的特定长度大于处理器断点指令的时候,例如,NorFlash要求以全字写入,而断点指令为半字,这时候,调试器可以以全字写入包含断点的数据0xFFFF0000,由于1无法正常写入,断点写入单元的这种操作,实际上达到了向NorFlash写入半字断点指令的效果,且没有影响其他程序空间。Update the breakpoint management module of the debugger and add the NorFlash breakpoint writing unit; usually, NorFlash has the characteristic of writing a specific length from 1 to 0, and the debugger should use this characteristic to write processor breakpoint instructions. When NorFlash requires When the specified length is greater than the breakpoint instruction of the processor, for example, NorFlash requires to write in full word, but the breakpoint instruction is half word, at this time, the debugger can write the data containing the breakpoint 0xFFFF0000 in full word, because 1 It cannot be written normally, and the operation of writing breakpoints to the unit actually achieves the effect of writing half-word breakpoint instructions to NorFlash without affecting other program spaces.
更新调试器断点管理模块,当设定的软断点真正插入到NorFlash空间后,调试器应当记录该断点,因为NorFlash空间的插入的软断点指令无法修改,所以调试器在整个调试过程中记录下插入的断点信息,无论该断点是否被删除;当该断点是已经删除的软断点,那么调试器需要模拟此处指令的执行,然后继续运行程序;当该断点没有删除,调试器在模拟完成此处指令执行后,根据调试命令,运行或停止程序;Update the breakpoint management module of the debugger. When the set soft breakpoint is actually inserted into the NorFlash space, the debugger should record the breakpoint. Because the soft breakpoint instruction inserted in the NorFlash space cannot be modified, the debugger will Record the inserted breakpoint information in , regardless of whether the breakpoint is deleted; if the breakpoint is a soft breakpoint that has been deleted, then the debugger needs to simulate the execution of the instruction here, and then continue to run the program; when the breakpoint is not Delete, the debugger runs or stops the program according to the debugging command after the simulation completes the execution of the instruction here;
更新调试器断点管理模块,每当收到运行程序的命令时,断点管理模块介入调试器处理流程,用来对当前指令进行检测,查看当前指令是否为调试其写入的软断点指令,如果是,则会启动“处理器指令模拟模块”;(如图2所示);每当程序停止,调试器处理内存查看需求时,断点管理模块需要介入处理流程,当内存范围包含该断点指令时,需要将读取的目标地址替换为调试器内部记录的指令的编码。Update the debugger breakpoint management module. Whenever a command to run the program is received, the breakpoint management module intervenes in the debugger processing flow to detect the current instruction and check whether the current instruction is a soft breakpoint instruction for debugging. , if it is, the "processor instruction simulation module" will be started; (as shown in Figure 2); whenever the program stops and the debugger handles the memory viewing requirements, the breakpoint management module needs to intervene in the processing flow, when the memory range includes the When using a breakpoint instruction, it is necessary to replace the read target address with the code of the instruction recorded inside the debugger.
处理器指令模拟模块中主要包含三个单元(如图3所示):The processor instruction simulation module mainly includes three units (as shown in Figure 3):
处理器指令解析单元;负责将调试器断点管理模块中保存的断点处二进制指令解析成相应的处理器指令。其输出结果中包含了该指令的操作数、寄存器号等信息,还包含了可能产生的异常类型。The processor instruction parsing unit is responsible for parsing the binary instructions at the breakpoints saved in the debugger breakpoint management module into corresponding processor instructions. The output results include information such as the operand and register number of the instruction, and also include possible exception types.
处理器异常模拟单元;根据指令解析单元中的输出结果,首先找到可能产生的异常类型列表,检测每个异常是否产生,特权违反异常的检测为例,调试器可以执行查看处理器状态寄存器的命令,通过查看处理器状态,判断当前指令是否超越权限,随后进入后续逻辑处理(如图4所示),当判断异常产生,异常处理单元则会阻塞该指令进入指令执行单元,然后根据异常类型,调试器调整处理器状态到异常入口,以特权违反异常为例,调试器需要执行如下逻辑步骤:Processor exception simulation unit; according to the output results in the instruction analysis unit, first find the list of possible exception types, and check whether each exception occurs. Take the detection of privilege violation exception as an example. The debugger can execute the command to view the processor status register , by checking the state of the processor, judge whether the current instruction exceeds the authority, and then enter the subsequent logical processing (as shown in Figure 4), when it is judged that an exception occurs, the exception processing unit will block the instruction from entering the instruction execution unit, and then according to the exception type, The debugger adjusts the processor state to the exception entry. Taking the privilege violation exception as an example, the debugger needs to perform the following logical steps:
1.设置处理器异常号为特权违反异常号;1. Set the processor exception number as the privilege violation exception number;
2.将处理器状态寄存器和PC分别设置到其对应的影子寄存器中;2. Set the processor status register and PC to their corresponding shadow registers;
3.清除处理器指令跟踪的控制位、中断使能位;3. Clear the control bit and interrupt enable bit of the processor instruction trace;
4.读取处理器异常处理入口,并根据异常向量号计算出特权违反异常的入口地址,然后赋值给PC,最后根据调试命令,运行或停止程序;当异常处理单元判断这条指令没有异常产生时,则会直接将指令解析单元中输出的结果发送给指令执行单元;4. Read the exception handling entry of the processor, and calculate the entry address of the privilege violation exception according to the exception vector number, then assign it to the PC, and finally run or stop the program according to the debugging command; when the exception handling unit judges that this instruction has no exception , the result output from the instruction parsing unit will be directly sent to the instruction execution unit;
处理器执行模拟单元;根据处理解析单元中输出的结果,读取操作数,并对处理器进行相应的操作,以特权指令【MFCRR0,PSR】为例,这条指令是将处理器状态寄存器的值赋值给处理器通用寄存器,调试器需要执行如下逻辑步骤:The processor executes the simulation unit; reads the operands according to the output results of the processing analysis unit, and performs corresponding operations on the processor. Taking the privileged instruction [MFCRR0, PSR] as an example, this instruction is to set the status register of the processor To assign values to processor general-purpose registers, the debugger needs to perform the following logical steps:
1.读取处理器状态寄存器;1. Read the processor status register;
2.更新处理器通用寄存器的值为读取的状态寄存器的值;2. Update the value of the general-purpose register of the processor to the value of the read status register;
3.调整PC=PC+{断点指令长度};3. Adjust PC=PC+{breakpoint instruction length};
4.根据调试命令,运行或停止程序。4. According to the debugging command, run or stop the program.
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610145172.7A CN105824750B (en) | 2016-05-31 | 2016-05-31 | A kind of soft breakpoint analogy method in the debugging of the NorFlash program spaces |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610145172.7A CN105824750B (en) | 2016-05-31 | 2016-05-31 | A kind of soft breakpoint analogy method in the debugging of the NorFlash program spaces |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105824750A true CN105824750A (en) | 2016-08-03 |
CN105824750B CN105824750B (en) | 2018-05-22 |
Family
ID=56987194
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610145172.7A Active CN105824750B (en) | 2016-05-31 | 2016-05-31 | A kind of soft breakpoint analogy method in the debugging of the NorFlash program spaces |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105824750B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109344089A (en) * | 2018-10-18 | 2019-02-15 | 京信通信系统(中国)有限公司 | A kind of method and device operating norflash |
CN110968494A (en) * | 2018-09-28 | 2020-04-07 | 珠海格力电器股份有限公司 | Software debugging method and device and computer storage medium |
CN111752845A (en) * | 2020-06-30 | 2020-10-09 | 江苏恒宝智能系统技术有限公司 | A debugging tool and its debugging method and system |
CN110955598B (en) * | 2019-11-20 | 2024-02-27 | 杭州迪普科技股份有限公司 | Breakpoint processing method and device for kernel mode program |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060277438A1 (en) * | 2005-06-07 | 2006-12-07 | Pedersen Frode M | Mechanism for providing program breakpoints in a microcontroller with flash program memory |
CN102117243A (en) * | 2010-12-29 | 2011-07-06 | 杭州晟元芯片技术有限公司 | Method for high efficiently debugging by using software breakpoint in Flash memory |
CN102508777A (en) * | 2011-11-04 | 2012-06-20 | 杭州中天微系统有限公司 | In-circuit emulator device supporting multiple lower layer interfaces |
CN102831054A (en) * | 2012-06-30 | 2012-12-19 | 华为技术有限公司 | Program breakpoint processing method and device |
CN104461859A (en) * | 2014-08-27 | 2015-03-25 | 北京中电华大电子设计有限责任公司 | Emulator and method for supporting NVM soft breakpoint debugging |
CN104778116A (en) * | 2014-01-09 | 2015-07-15 | 深圳市中兴微电子技术有限公司 | Multibreak software debugging device and method |
-
2016
- 2016-05-31 CN CN201610145172.7A patent/CN105824750B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060277438A1 (en) * | 2005-06-07 | 2006-12-07 | Pedersen Frode M | Mechanism for providing program breakpoints in a microcontroller with flash program memory |
CN102117243A (en) * | 2010-12-29 | 2011-07-06 | 杭州晟元芯片技术有限公司 | Method for high efficiently debugging by using software breakpoint in Flash memory |
CN102508777A (en) * | 2011-11-04 | 2012-06-20 | 杭州中天微系统有限公司 | In-circuit emulator device supporting multiple lower layer interfaces |
CN102831054A (en) * | 2012-06-30 | 2012-12-19 | 华为技术有限公司 | Program breakpoint processing method and device |
CN104778116A (en) * | 2014-01-09 | 2015-07-15 | 深圳市中兴微电子技术有限公司 | Multibreak software debugging device and method |
CN104461859A (en) * | 2014-08-27 | 2015-03-25 | 北京中电华大电子设计有限责任公司 | Emulator and method for supporting NVM soft breakpoint debugging |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110968494A (en) * | 2018-09-28 | 2020-04-07 | 珠海格力电器股份有限公司 | Software debugging method and device and computer storage medium |
CN109344089A (en) * | 2018-10-18 | 2019-02-15 | 京信通信系统(中国)有限公司 | A kind of method and device operating norflash |
CN110955598B (en) * | 2019-11-20 | 2024-02-27 | 杭州迪普科技股份有限公司 | Breakpoint processing method and device for kernel mode program |
CN111752845A (en) * | 2020-06-30 | 2020-10-09 | 江苏恒宝智能系统技术有限公司 | A debugging tool and its debugging method and system |
Also Published As
Publication number | Publication date |
---|---|
CN105824750B (en) | 2018-05-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3788490B1 (en) | Execution control with cross-level trace mapping | |
EP3785127B1 (en) | Selectively tracing portions of computer process execution | |
US8972785B2 (en) | Classifying processor testcases | |
CN110580226B (en) | Object code coverage rate testing method, system and medium for operating system level program | |
KR101519845B1 (en) | Method For Anti-Debugging | |
US7783867B2 (en) | Controlling instruction execution in a processing environment | |
US9785536B2 (en) | Code injection for conditional breakpoints | |
JP6195572B2 (en) | Computer program, method and system for determining the status of runtime instrumentation control | |
US9176848B2 (en) | Program debugger and program debugging | |
CN103430158B (en) | Use Execution Single Step to Diagnose Coding | |
JP2015515654A (en) | Converting program event recording events to runtime instrumentation events | |
CN105824750B (en) | A kind of soft breakpoint analogy method in the debugging of the NorFlash program spaces | |
CN111813670B (en) | A Non-Intrusive MC/DC Coverage Statistical Analysis Method | |
CN102722438B (en) | Kernel debugging method and equipment | |
CN111367742A (en) | Method, device, terminal and computer readable storage medium for debugging MVP processor | |
US20060277371A1 (en) | System and method to instrument references to shared memory | |
US9111034B2 (en) | Testing of run-time instrumentation | |
CN100474266C (en) | Debugging system used for digital signal processor and debug method thereof | |
CN108228239B (en) | Branch instruction grabbing method and device based on quick simulator QEMU | |
CN114238107A (en) | Tracking debugging method, system and computer readable storage medium | |
CN106970825A (en) | A kind of ARM7 simulation objectives machine implementation methods based on GDB configurable frameworks | |
CN116340081A (en) | RISCV memory access violation detection method and device based on hardware virtualization | |
CN118860762B (en) | Simulation system and method based on digital signal processor | |
CN109753308A (en) | Verify system and instruction path monitoring method in instruction path | |
Van Dung et al. | Function profiling for embedded software by utilizing QEMU and analyzer tool |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |