WO2013155822A1 - Method, device and system for realizing pass-by data breakpoint - Google Patents
Method, device and system for realizing pass-by data breakpoint Download PDFInfo
- Publication number
- WO2013155822A1 WO2013155822A1 PCT/CN2012/083108 CN2012083108W WO2013155822A1 WO 2013155822 A1 WO2013155822 A1 WO 2013155822A1 CN 2012083108 W CN2012083108 W CN 2012083108W WO 2013155822 A1 WO2013155822 A1 WO 2013155822A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- breakpoint
- data
- instruction
- data breakpoint
- file
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 238000004891 communication Methods 0.000 claims description 27
- 230000001960 triggered effect Effects 0.000 claims description 22
- 238000011084 recovery Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 11
- 230000000694 effects Effects 0.000 description 9
- 230000006870 function Effects 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000001568 sexual effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect 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/362—Debugging of software
Definitions
- the present invention relates to the field of computers, and in particular, to a method, device and system for implementing transitive data breakpoints.
- the pass-through data breakpoint is a necessary function for rewriting after the software locates the data or instructions.
- the basic principle of the data breakpoint is to set the data or instruction address to be monitored to the debug register of the CPU. When the CPU accesses the monitored data or instruction address, a trap exception handler is triggered. After the trap exception handler, it will return to the context that triggered the trap exception handler and continue execution. The entire process does not affect the state of the original system.
- the CPU When the source program runs to the address of the monitored data or instruction, the CPU will trigger a trap exception handler.
- the trap In Linux ARM or Unix ARM systems, since the trap is a synchronous exception, after executing the trap exception handler, , will re-execute the instruction that triggered the trap. In this way, the trap exception handler is triggered again, resulting in a loop trigger, which fails to implement the traversal data breakpoint, which in turn leads to the interruption of the service of the existing software system.
- Embodiments of the present invention provide a method, apparatus, and system for implementing transitive data breakpoints for implementing transitive data breakpoints in a Linux ARM or Unix ARM system.
- the embodiment of the present invention adopts the following technical solutions:
- a method for implementing a transitive data breakpoint is provided, which is applied to a Linux ARM or Unix ARM system running an active program, wherein at least one number is set in the source program.
- the method includes: canceling the data breakpoint when the source program runs to an instruction set with a data breakpoint;
- a method for implementing a transitive data breakpoint for use in a Linux ARM or Unix ARM system running an active program; the source program is provided with at least one data breakpoint; the method includes: When the source program runs to an instruction set with a data breakpoint, the data breakpoint is canceled;
- the modified next instruction is restored to the backup instruction.
- a communication system including a memory and at least one
- An operating system is running in the CPU, and at least one sequence is run on the operating system; the source program and the exception handling program are loaded in the memory, and at least one of the source program is set a data breakpoint, the exception handler is triggered when the source program runs to an instruction having a data breakpoint, the exception handler is further used,
- the data breakpoint is canceled when the source program runs to an instruction set with a data breakpoint. Decoding the instruction with the data breakpoint set; executing the decoded instruction;
- a communication system including a memory and at least one
- An operating system is run in the CPU, and at least one sequence is run on the operating system; the source program and the exception processing program are loaded in the memory, and the source program is set At least one data breakpoint, triggering an exception handler when the source program runs to an instruction having a data breakpoint, the exception handler also being used,
- the data breakpoint is canceled when the source program runs to an instruction set with a data breakpoint
- the modified next instruction is restored to the backup instruction.
- a device for implementing a transitive data breakpoint for use in a Linux ARM or Unix ARM system running an active program, wherein the source program is provided with at least one data breakpoint, wherein the The device for breaking the data data includes: a first canceling module, configured to cancel the data breakpoint when the source program runs to an instruction set with a data breakpoint;
- a decoding module configured to decode the instruction with a data breakpoint
- a first execution module configured to execute the decoded instruction
- a setting module configured to re-set a data breakpoint at the instruction with the data breakpoint set
- a pointing module configured to point the program counter PC pointer to the next instruction of the instruction set with the data breakpoint, wherein The program counter PC pointer is used to store the address of the next instruction to be executed.
- a device for implementing a transitive data breakpoint for use in a Linux ARM or Unix ARM system running an active program; the source program is provided with at least one data breakpoint, wherein the Devices for sexual data breakpoints include:
- a second canceling module configured to cancel the data breakpoint when the source program runs to an instruction set with a data breakpoint
- a backup module configured to back up the next instruction of the instruction with a data breakpoint , as a backup instruction
- a modification module configured to modify the next instruction of the instruction with the data breakpoint to be an illegal instruction
- a second execution module configured to execute the instruction with a data breakpoint and the modified next instruction
- a recovery module configured to recover a data breakpoint at the instruction with the data breakpoint set; And for restoring the modified next instruction to the backup instruction.
- FIG. 1 is a schematic diagram of a method for implementing a transitive data breakpoint according to an embodiment of the present invention
- FIG. 2 is a schematic diagram of another method for implementing a transitive data breakpoint according to an embodiment of the present invention
- Another method for implementing a breakpoint of a transitive data
- FIG. 4a is a schematic structural diagram of a communication system according to an embodiment of the present invention
- 4b is a partial schematic diagram of a communication system according to an embodiment of the present invention.
- Figure 4c is a schematic diagram of the principle of a conventional application compilation process
- FIG. 5 is a schematic diagram of an apparatus for implementing a transitive data breakpoint according to an embodiment of the present invention
- FIG. 6 is a schematic diagram of another apparatus for implementing a transitive data breakpoint according to an embodiment of the present invention
- Yet another device that implements breakpoints in transit data are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. example. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
- the method for implementing the transitive data breakpoint provided by the embodiment of the present invention is applied to a Linux ARM or Unix ARM system running an active program, wherein at least one data breakpoint is set in the source program; the method is as shown in FIG. , including:
- canceling the data breakpoint at the breakpoint of the source program can directly invoke the method of canceling the data breakpoint in the operating system.
- the context information of the instruction that triggers the exception handler is saved, so that the CPU will resume the interrupt after executing the exception handler.
- the context of the source program continues to be implemented, and the process can be implemented by the prior art, and details are not described herein again.
- the instruction is found by the saved context information of the instruction that triggers the exception handler. Since the instruction is an unpredictable machine language, the instruction needs to be decoded at this time to obtain the information of the instruction, which lays the next step for the operation. basis.
- the method for setting data breakpoints provided by the kernel can be directly called in the abnormal program to be set.
- the program counter PC pointer still points to the instruction with the data breakpoint set.
- the next instruction that executes the instruction that triggered the exception handler needs to point the PC pointer to the next instruction of the instruction with the data breakpoint set.
- the method for implementing the traversal data breakpoint achieveds the implementation of the instruction that triggers the exception handler by executing the instruction that triggers the exception handler in the exception handler and then returns to the source program to execute the next instruction that triggers the exception handler.
- the effect of the data breakpoint, and will not trigger the exception handler again, causing a loop trigger, and the data breakpoint can be reused.
- the method for implementing a transitive data breakpoint further includes:
- create a data breakpoint file directory this step can be invoked by calling the Linux system.
- the kernel_kobj property to create a data breakpoint directory exemplarily, create the hwbrk directory, which is implemented by the following program:
- Hw_breakpoint_kobj kobject_create_and_add(" hwbrk", kernel_kobj); if ( !hw_breakpoint_kobj)
- the process creates a file by calling a function provided by the Linux system kernel, such as sysfs_create_group, etc., in the hwbrk data breakpoint directory
- data breakpoints can be set in the source program by calling the data breakpoint-related functions provided by the Linux system kernel in the write attribute of the data breakpoint file.
- the breakpoint address to be monitored is written in the data breakpoint file, and the data breakpoint is set in the source program according to the breakpoint address in the data breakpoint file.
- the user needs The monitored breakpoint parameter is written into the data breakpoint file; the data breakpoint file searches for a corresponding breakpoint address according to the breakpoint parameter to a preset symbol table, and according to the breakpoint address Set data breakpoints in the source program.
- the data breakpoint file when the data breakpoint file is written into the data, the data is determined to be a breakpoint address or a breakpoint parameter, and when the data is a breakpoint address, the data breakpoint file sets the data at the corresponding position of the source program. a breakpoint, so that when the source program runs to the data breakpoint, the exception handler is triggered; when the data is a breakpoint parameter, the data breakpoint file finds the corresponding breakpoint address of the breakpoint parameter, and Setting a data breakpoint at the breakpoint address to trigger an exception handler when the source program runs to an instruction having the breakpoint parameter, wherein the breakpoint parameter More specifically, the following program code can be used to set data breakpoints in the source program based on the written breakpoint address:
- Hwbrk_data[index].hbp register_wide_hw_breakpoint(&atribs, callback );
- the breakpoint is set at the corresponding position in the source program, which is convenient for the user to use.
- the breakpoint is The parameter can be a symbolic name or a parameter value.
- the read attribute of the data breakpoint file can also be set to perform some operation restrictions on the data breakpoint file.
- the specific implementation process is as follows:
- the breakpoint parameter that the user needs to monitor and the type of the breakpoint parameter to be monitored may be written into the data breakpoint file; and the corresponding break is found according to the breakpoint parameter and the type of the breakpoint parameter.
- Point address, and set a data breakpoint in the source program according to the breakpoint address, the type of the breakpoint parameter is: a readable type, a writable type, and a readable and writable type.
- the corresponding breakpoint address is searched, and the corresponding breakpoint address can be found in the corresponding table.
- the table may be a symbol table stored in an operating system.
- breakpoint parameter that the user needs to monitor and the range of the breakpoint parameter to be monitored may be written into the data breakpoint file; and the corresponding range is found according to the breakpoint parameter and the range of the breakpoint parameter.
- a breakpoint address, and a data breakpoint is set in the source program according to the breakpoint address.
- Breakpoints further facilitate the use of the user.
- the data breakpoint file when the data breakpoint file writes the breakpoint parameter and the range of the breakpoint parameter to be monitored, the data breakpoint file finds a breakpoint in the symbol table that meets the breakpoint parameter of the breakpoint parameter range. Address, and set data breakpoints in the source program based on the breakpoint address.
- a method for implementing a transitive data breakpoint according to an embodiment of the present invention is applied to a Linux ARM or Unix ARM system running an active program, wherein at least one data breakpoint is set in the source program, and the method is as shown in FIG. Show,
- S301 Cancel the data breakpoint when the source program runs to an instruction set with a data breakpoint.
- canceling the data breakpoint at the breakpoint of the source program can directly call the method of canceling the data breakpoint in the kernel.
- the method for implementing the transitive data breakpoint provided by the embodiment of the present invention cancels the data breakpoint of the trigger exception handler in the exception handler, saves the next instruction of the instruction that triggers the exception handler, and sets the next one.
- the instruction is an illegal instruction, so that the effect of implementing the breakpoint of the data is achieved, and the exception handler is not triggered again, causing the loop trigger, and the data breakpoint can be reused.
- the method for implementing a transitive data breakpoint as shown in FIG. 3, further includes
- S307. Create at least one data breakpoint file, where the data breakpoint file is used to record information of a breakpoint to be monitored.
- the process of creating a data breakpoint file may refer to step 106 in the foregoing embodiment.
- the breakpoint address to be monitored is written in the data breakpoint file, and the data breakpoint is set in the source program according to the breakpoint address in the data breakpoint file.
- the user needs The monitored breakpoint parameter is written into the data breakpoint file; the data breakpoint file searches for a corresponding breakpoint address according to the breakpoint parameter to a preset symbol table, and according to the breakpoint address Set data breakpoints in the source program.
- the data breakpoint file when the data breakpoint file is written into the data, the data is determined to be a breakpoint address or a breakpoint parameter, and when the data is a breakpoint address, the data breakpoint file sets the data at the corresponding position of the source program. a breakpoint, so that when the source program runs to the data breakpoint, the exception handler is triggered; when the data is a breakpoint parameter, the data breakpoint file finds the corresponding breakpoint address of the breakpoint parameter, and The data breakpoint is set at the breakpoint address to trigger the exception handler when the source program runs to the instruction having the breakpoint parameter, wherein the breakpoint parameter includes a symbol name or a parameter value.
- the data breakpoint can be set at the corresponding position in the source program by writing the breakpoint value or address to be monitored in the data breakpoint file, which is convenient for the user to use.
- the breakpoint parameter that the user needs to monitor and the type of the breakpoint parameter to be monitored may be written into the data breakpoint file; and the corresponding break is found according to the breakpoint parameter and the type of the breakpoint parameter.
- Point address, and set a data breakpoint in the source program according to the breakpoint address, the type of the breakpoint parameter is: a readable type, a writable type, and a readable and writable type.
- the corresponding breakpoint address is searched, and the corresponding breakpoint address can be found in the corresponding table.
- the table can be a symbol table stored in the operating system, when the data breaks the text
- the data breakpoint file finds the breakpoint address of the breakpoint parameter that matches the breakpoint parameter type in the symbol table, and according to the breakpoint address in the source program Set data breakpoints in .
- breakpoint parameter that the user needs to monitor and the range of the breakpoint parameter to be monitored may be written into the data breakpoint file; and the corresponding range is found according to the breakpoint parameter and the range of the breakpoint parameter.
- a breakpoint address, and a data breakpoint is set in the source program according to the breakpoint address.
- Breakpoints further facilitate the use of the user.
- the data breakpoint file when the data breakpoint file writes the breakpoint parameter and the range of the breakpoint parameter to be monitored, the data breakpoint file finds a breakpoint in the symbol table that meets the breakpoint parameter of the breakpoint parameter range. Address, and set data breakpoints in the source program based on the breakpoint address.
- a communication system provided by an embodiment of the present invention has a system structure diagram and a partial logic diagram as shown in FIG. 4a and FIG. 4b respectively.
- FIG. 4a includes three CPUs, namely, CPU1, CPU2, and CPU3, and the CPU accesses the memory through the bus.
- the communication system of the embodiment of the present invention may include a CPU, that is, a single CPU communication system, and may also include multiple CPUs, that is, multiple CPU (multi-core) communication systems. That is, the communication system of the embodiment of the present invention includes at least one CPU and a memory, the CPU runs an operating system, and the operating system runs on at least one application (also referred to as software) for executing a specific Wherein: '',' ⁇ , , , - the memory program is loaded with the source program and the exception handler, the source program is provided with at least one data breakpoint, when the source program runs to An exception handler is triggered when the instruction has a data breakpoint, and the exception handler is used to cancel the method of canceling the data breakpoint in the operating system when the source program runs to the instruction where the data breakpoint is set.
- the communication system of the embodiment of the present invention includes at least one CPU and a memory, the CPU runs an operating system, and the operating system runs on at least one application (also referred to as software) for
- the data breakpoint decoding the instruction with the data breakpoint set, and executing the decoded instruction, specifically, calling the corresponding method to execute; re-instructing the instruction with the data breakpoint Setting a data breakpoint; pointing the program counter PC pointer to the next instruction of the instruction set with a data breakpoint, wherein the program counter PC pointer is used to store the address of the next instruction to be executed.
- the communication system of the embodiment of the present invention further includes: a compiler (not shown in the figure), a schematic diagram of the principle of the compilation process of the application, as shown in FIG. 4c, the conventional compilation process includes: the source file (.c) is compiled by the compiler. The file is compiled into a target file (.0 file, that is, a binary file), and then multiple target files are linked into an executable file.
- the compiler compiles the source program, the user can set some traversal data breakpoints, so that when the source program runs to the instruction with the data breakpoint, the exception handler is triggered; the basic principle of the sci-fi data breakpoint is that The monitored data/instruction address is set to the debug register of the cpu.
- a data breakpoint is also set in the source program by providing a data breakpoint file, where the directory of the data breakpoint file is created in the kernel of the operating system; Creating at least one data breakpoint file in the point directory; the data breakpoint file is used to write a breakpoint address to be monitored, and set a data breakpoint in the source program according to the breakpoint address, so that In this file, the breakpoint address of the data breakpoint is written, and the data breakpoint can be set in the source program, which is convenient for the user to use.
- the data breakpoint file can also set the data by writing the breakpoint parameter. Breakpoints, and you can further set data breakpoints by writing breakpoint parameter types, and you can also set data breakpoints by writing breakpoint parameter ranges.
- the communication system of the embodiment of the present invention may specifically be a Linux arm system, or a Unix ARM system, or may be a Linux X86 system, a Unix-like system such as Solaris, aix, or the like.
- the CPU includes at least one arm architecture, and the CPU runs on the CPU.
- the Linux operating system runs at least one exception handler (the specific function is the same as above, so it will not be described again).
- the communication system provided by the embodiment of the present invention returns to the source program to execute the next instruction of the instruction that triggers the exception processing program after executing the instruction that triggers the exception processing program in the exception processing program, or cancels the trigger exception processing in the exception handling program.
- the data breakpoint of the program saves the next instruction of the instruction that triggered the exception handler and sets the next instruction as an illegal instruction, thereby achieving the effect of implementing the breakpoint of the traversing data, and does not trigger the trap exception handler again. , causing a loop trigger, and the data breakpoint can be reused.
- the communication system provided by the embodiment of the present invention may include a CPU, that is, a single CPU communication system, and may also include multiple CPUs, that is, a multi-CPU (multi-core) communication system. That is, the communication system of the embodiment of the present invention includes at least one CPU and an internal memory, and the operating system runs on the CPU, and at least one application (also referred to as software) runs on the operating system for executing a specific a task, the application includes a source program and at least one exception handler associated therewith, where: the active program and the exception handler are loaded in the memory, and at least one data is set in the source program a breakpoint, triggering an exception handler when the source program runs to an instruction having a data breakpoint, the exception handler is further configured to cancel when the source program runs to an instruction set with a data breakpoint The data breakpoint; backing up the next instruction of the instruction with the data breakpoint as the backup instruction; modifying the next instruction of the instruction with the data breakpoint as an illegal instruction; performing the setting with the data
- the communication system of the embodiment of the present invention further includes: a compiler (not shown in the figure), a schematic diagram of the principle of the compilation process of the application, as shown in FIG. 4c, the conventional compilation process includes: the source file (.c) is compiled by the compiler. The file is compiled into a target file (.0 file, that is, a binary file), and then multiple target files are linked into an executable file.
- the compiler compiles the source program, the user can set some traversal data breakpoints, so that when the source program runs to the instruction with the data breakpoint, the exception handler is triggered; the basic principle of the sci-fi data breakpoint is that The monitored data/instruction address is set to the debug register of the cpu.
- a data breakpoint is also set in the source program by providing a data breakpoint file, where the directory of the data breakpoint file is created in the kernel of the operating system; Creating at least one data breakpoint file in the point directory; the data breakpoint file is used to write a breakpoint address to be monitored, and set a data breakpoint in the source program according to the breakpoint address, so that In this file, the breakpoint address of the data breakpoint is written, and the data breakpoint can be set in the source program, which is convenient for the user to use.
- the data breakpoint file can also set the data by writing the breakpoint parameter. Breakpoints, and you can further set data breakpoints by writing breakpoint parameter types, and you can also set data breakpoints by writing breakpoint parameter ranges.
- the communication system of the embodiment of the present invention may specifically be a Linux arm system, or a Unix ARM system, or a Linux X86 system, a Unix system such as Solaris, aix, or the like.
- the CPU includes at least one arm architecture, and the CPU runs on the CPU.
- the Linux operating system runs at least one exception handler (the specific function is the same as above, so it will not be described again). .
- the communication system returns to the source program to execute the next instruction of the instruction that triggers the exception processing program after executing the instruction that triggers the exception processing program in the exception processing program, or cancels the trigger exception processing in the exception handling program.
- the data breakpoint of the program and saves the next instruction of the instruction that triggered the exception handler and sets the next instruction as an illegal instruction, thereby achieving the effect of implementing the breakpoint of the traversing data, and does not trigger the trap exception handler again. , causing a loop trigger, and the data breakpoint can be reused.
- An apparatus for implementing a transitive data breakpoint according to an embodiment of the present invention is applied to a Linux ARM or Unix ARM system running an active program, wherein at least one data breakpoint is set in the source program, as shown in FIG. , the device 50 includes:
- the first canceling module 501 is configured to cancel the data breakpoint when the source program runs to an instruction set with a data breakpoint.
- the decoding module 502 is configured to decode the instruction with the data breakpoint set.
- the first execution module 503 is configured to execute the decoded instruction.
- the setting module 504 is configured to re-set a data breakpoint at the instruction with the data breakpoint set.
- the pointing module 505 is configured to point the program counter PC pointer to the next instruction of the instruction set with the data breakpoint, wherein the program counter PC pointer is used to store the address of the next instruction to be executed.
- the device for implementing the transitive data breakpoint returns to the source program to execute the next instruction of the instruction that triggers the exception handler by executing the instruction that triggers the exception handler in the exception handler, thereby achieving The effect of passing data breakpoints is achieved, and the data breakpoints can be reused.
- the device for traversing data breakpoints 50 further includes: a create file module 506, configured to create at least one data breakpoint file.
- the write module 507 is configured to write a breakpoint address that the user needs to monitor into the data breakpoint file.
- the setting module 508 is configured to set a data breakpoint in the source program according to a breakpoint address in the data breakpoint file.
- the write module 507 writes a breakpoint address to be monitored in the data breakpoint file, and the setting module 508 sets a data breakpoint in the source program according to the breakpoint address in the data breakpoint file, and the same.
- the write module 507 can also write the breakpoint parameter that the user needs to monitor into the data breakpoint file; the setting module 508 searches the preset symbol table according to the breakpoint parameter to find the corresponding breakpoint address, And setting a data breakpoint in the source program according to the breakpoint address.
- the data breakpoint can be set at the corresponding position in the source program by writing the breakpoint value or address to be monitored in the data breakpoint file, which is convenient for the user to use.
- the writing module 507 can also write the breakpoint parameter that the user needs to monitor and the type of the breakpoint parameter to be monitored into the data breakpoint file; the setting module 508 according to the breakpoint parameter and the breakpoint.
- the type of the parameter finds the corresponding breakpoint address, and sets a data breakpoint in the source program according to the breakpoint address.
- the type of the breakpoint parameter is: a readable type, a writable type, and a readable and writable type.
- the table may be a symbol table stored in an operating system.
- the data breakpoint file writes a type of a breakpoint parameter and a breakpoint parameter
- the data breakpoint file is found in the symbol table to match the break.
- the breakpoint address of the breakpoint parameter of the point parameter type, and the data breakpoint is set in the source program according to the breakpoint address.
- the writing module 507 can also write the breakpoint parameter that the user needs to monitor and the range of the breakpoint parameter to be monitored into the data breakpoint file; the setting module 508 according to the breakpoint parameter and the break
- the range of point parameters finds the corresponding breakpoint address, and a data breakpoint is set in the source program according to the breakpoint address. In this way, not only can you write the breakpoint parameter to be monitored in the data breakpoint file, but also set the data at the corresponding position of the source program by writing the range of the breakpoint parameter to be monitored in the data breakpoint file. Breakpoints further facilitate the use of the user.
- the data breakpoint file when the data breakpoint file writes the breakpoint parameter and the range of the breakpoint parameter to be monitored, the data breakpoint file finds a breakpoint in the symbol table that meets the breakpoint parameter of the breakpoint parameter range. Address, and set data breakpoints in the source program based on the breakpoint address.
- An apparatus for implementing a transitive data breakpoint is provided in a Linux ARM or Unix ARM system running an active program, wherein at least one data breakpoint is set in the source program, the device 70, such as As shown in Figure 7, it includes:
- a second canceling module 701 configured to cancel the data breakpoint when the source program runs to an instruction set with a data breakpoint
- the backup module 702 is configured to back up the instruction that is set with a data breakpoint An instruction as a backup instruction
- a second execution module 704 configured to execute the instruction with a data breakpoint and the modified next instruction; and the recovery module 705 is configured to restore a data breakpoint at the instruction with the data breakpoint set; The replacement module 706 is configured to restore the modified next instruction to the backup instruction.
- the device for implementing the transitive data breakpoint provided by the embodiment of the present invention cancels the data breakpoint of the trigger exception handler in the exception handler, saves the next instruction of the instruction that triggers the exception handler, and sets the next one.
- the instruction is an illegal instruction.
- an illegal exception handler is triggered.
- the previous data breakpoint is restored and the saved instruction is replaced. This instruction, in this way, achieves the effect of implementing a transitive data breakpoint when the source program runs to the data breakpoint, and can also reuse the data breakpoint.
- the device 70 for passing data breakpoints further comprises:
- the write module 708 is configured to write a breakpoint address that the user needs to monitor into the data breakpoint file.
- the setting module 709 is configured to set a data breakpoint in the source program according to a breakpoint address in the data breakpoint file. Specifically, the created file module 707 provided by the preferred content is created by the file module 506 as shown in FIG. 6, the writing module 708 is written by the writing module 507, and the setting module 709 is set by the setting module 508. .
- the writing module 708 can write a breakpoint address to be monitored in the data breakpoint file, and the setting module 709 sets a data breakpoint in the source program according to the breakpoint address in the data breakpoint file.
- the write module 708 can also write the breakpoint parameter that the user needs to monitor into the data breakpoint file; the setting module 709 searches the preset symbol table according to the breakpoint parameter to find the corresponding breakpoint address. And set a data breakpoint in the source program according to the breakpoint address.
- the writing module 708 can also write the breakpoint parameter that the user needs to monitor and the type of the breakpoint parameter to be monitored into the data breakpoint file; the setting module 709 is configured according to the breakpoint parameter and the breakpoint
- the type of the parameter finds the corresponding breakpoint address, and sets a data breakpoint in the source program according to the breakpoint address.
- the type of the breakpoint parameter is: a readable type, a writable type, and a readable and writable type.
- the corresponding breakpoint address is searched, and the corresponding breakpoint address can be found in the corresponding table.
- the table may be a symbol table stored in an operating system.
- the data breakpoint file writes a type of a breakpoint parameter and a breakpoint parameter
- the data breakpoint file is found in the symbol table to match the break.
- the breakpoint address of the breakpoint parameter of the point parameter type, and the data breakpoint is set in the source program according to the breakpoint address.
- the writing module 708 can also write the breakpoint parameter that the user needs to monitor and the range of the breakpoint parameter to be monitored into the data breakpoint file; the setting module 709 according to the breakpoint parameter and the break
- the range of point parameters finds the corresponding breakpoint address, and a data breakpoint is set in the source program according to the breakpoint address. In this way, not only can you write the breakpoint parameter to be monitored in the data breakpoint file, but also set the data at the corresponding position of the source program by writing the range of the breakpoint parameter to be monitored in the data breakpoint file. Breakpoints further facilitate the use of the user.
- the data breakpoint file when the data breakpoint file writes the breakpoint parameter and the range of the breakpoint parameter to be monitored, the data breakpoint file finds a breakpoint in the symbol table that meets the breakpoint parameter of the breakpoint parameter range. Address, and set data breakpoints in the source program based on the breakpoint address.
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
The embodiment of the present invention provides a method, a device and a system for realizing a pass-by data breakpoint, relates to the field of computers, and is used for realizing the pass-by data breakpoint in a Linux ARM or Unix ARM system and simultaneously using the data breakpoint repeatedly. The method comprises: canceling the data breakpoint when a source program reaches an instruction provided with the data breakpoint; decoding the instruction provided with the data breakpoint; executing the instruction after decoding; re-setting the data breakpoint at the instruction provided with the data breakpoint; and enabling a program counter PC pointer to point to the next instruction relative to the instruction provided with the data breakpoint, wherein the program counter PC pointer is used for storing the address of the next instruction to be implemented. The embodiment of the present invention is used for realizing the pass-by data breakpoint.
Description
一种实现经过性数据断点的方法、 装置及系统 本申请要求于 2 01 2 年 04 月 1 7 日提交中国专利局、 申请号为 201 2 1 01 1 2766. X , 发明名称为 "一种实现经过性数据断点的方法、 装置及系统" 的中国专利申请的优先权, 其全部内容通过引用结合 在本申请中。 Method, device and system for realizing transitive data breakpoints The present application claims to be filed on the Chinese Patent Office on April 17, 2001, the application number is 201 2 1 01 1 2766. X , the invention name is "a kind of The priority of the Chinese Patent Application, which is hereby incorporated by reference in its entirety in its entirety in its entirety in the the the the the the the the the
技术领域 Technical field
本发明涉及计算机领域, 尤其涉及一种实现经过性数据断点的方法、 装置及系统。 The present invention relates to the field of computers, and in particular, to a method, device and system for implementing transitive data breakpoints.
背景技术 Background technique
经过性数据断点是软件定位数据或指令后, 进行改写的必要功能。 经 过性数据断点的基本原理是将要监控的数据或指令地址设置到 CPU 的调 试寄存器中,当 CPU访问被监控的数据或指令地址时就会触发一个 trap(陷 阱)异常处理程序, 处理完该 trap异常处理程序后会恢复到触发该 trap异 常处理程序的上下文, 继续执行。 整个过程不影响原系统的状态。 The pass-through data breakpoint is a necessary function for rewriting after the software locates the data or instructions. The basic principle of the data breakpoint is to set the data or instruction address to be monitored to the debug register of the CPU. When the CPU accesses the monitored data or instruction address, a trap exception handler is triggered. After the trap exception handler, it will return to the context that triggered the trap exception handler and continue execution. The entire process does not affect the state of the original system.
但是,现有的 Linux ARM或 Unix ARM系统实现断点处理时有如下问 题: However, existing Linux ARM or Unix ARM systems have the following problems when implementing breakpoint processing:
当源程序运行到被监控的数据或指令的地址处时, CPU 会触发一个 trap异常处理程序, 在 Linux ARM或 Unix ARM系统中, 由于这个 trap为 同步异常, 所以在执行完 trap异常处理程序后, 会重新执行那条触发 trap 的指令。 这样一来, 又会再次触发 trap异常处理程序, 结果造成循环触发, 无法实现经过性数据断点, 进而导致中断现有软件系统的业务的问题。 发明内容 When the source program runs to the address of the monitored data or instruction, the CPU will trigger a trap exception handler. In Linux ARM or Unix ARM systems, since the trap is a synchronous exception, after executing the trap exception handler, , will re-execute the instruction that triggered the trap. In this way, the trap exception handler is triggered again, resulting in a loop trigger, which fails to implement the traversal data breakpoint, which in turn leads to the interruption of the service of the existing software system. Summary of the invention
本发明的实施例提供一种实现经过性数据断点的方法、装置及系统, 用以在 linux ARM或 Unix ARM系统中实现经过性数据断点。 为达到上述目的, 本发明的实施例采用如下技术方案: Embodiments of the present invention provide a method, apparatus, and system for implementing transitive data breakpoints for implementing transitive data breakpoints in a Linux ARM or Unix ARM system. In order to achieve the above object, the embodiment of the present invention adopts the following technical solutions:
一方面, 提供一种实现经过性数据断点的方法, 应用在运行有源程 序的 Linux ARM或 Unix ARM系统中, 所述源程序中设置有至少一个数
据断点; 所述方法包括: 当所述源程序运行到设置有数据断点的指令处时, 取消所述数据断 点; In one aspect, a method for implementing a transitive data breakpoint is provided, which is applied to a Linux ARM or Unix ARM system running an active program, wherein at least one number is set in the source program. According to the breakpoint; the method includes: canceling the data breakpoint when the source program runs to an instruction set with a data breakpoint;
对所述设置有数据断点的指令进行解码; 执行所述解码后的指令; Decoding the instruction with the data breakpoint set; executing the decoded instruction;
重新在所述设置有数据断点的指令处设定数据断点; 将程序计数器 PC 指针指向所述设置有数据断点的指令的下一条指 令, 其中, 所述程序计数器 PC指针用于存放将要执行的下一条指令的地 址。 Resetting the data breakpoint at the instruction set with the data breakpoint; pointing the program counter PC pointer to the next instruction of the instruction set with the data breakpoint, wherein the program counter PC pointer is used to store the The address of the next instruction executed.
一方面, 提供一种实现经过性数据断点的方法, 应用在运行有源程 序的 Linux ARM或 Unix ARM系统中; 所述源程序中设置有至少一个数 据断点; 所述方法包括: 当所述源程序运行到设置有数据断点的指令处时, 取消所述数据断 点; In one aspect, a method for implementing a transitive data breakpoint is provided for use in a Linux ARM or Unix ARM system running an active program; the source program is provided with at least one data breakpoint; the method includes: When the source program runs to an instruction set with a data breakpoint, the data breakpoint is canceled;
备份所述设置有数据断点的指令的下一条指令, 作为备份指令; 将所述设置有数据断点的指令的下一条指令修改为非法指令; 执行所述设置有数据断点的指令以及所述修改后的下一条指令; 恢复所述设置有数据断点的指令处的数据断点; Backing up the next instruction of the instruction with the data breakpoint as the backup instruction; modifying the next instruction of the instruction with the data breakpoint as an illegal instruction; executing the instruction and the data breakpoint setting Describe the modified next instruction; recover the data breakpoint at the instruction with the data breakpoint set;
将所述修改后的下一条指令恢复为所述备份指令。 The modified next instruction is restored to the backup instruction.
一方面, 提供一种通信系统, 所述通信系统包括内存和至少一个 In one aspect, a communication system is provided, the communication system including a memory and at least one
CPU; CPU;
所述 CPU中运行有操作系统, 所述操作系统之上运行有至少一种应 序; 所述内存中载入有所述源程序和所述异常处理程序, 所述源程序中 设置有至少一个数据断点, 当所述源程序运行到具有数据断点的指令处 时触发所述异常处理程序, 所述异常处理程序还用于, An operating system is running in the CPU, and at least one sequence is run on the operating system; the source program and the exception handling program are loaded in the memory, and at least one of the source program is set a data breakpoint, the exception handler is triggered when the source program runs to an instruction having a data breakpoint, the exception handler is further used,
当所述源程序运行到设置有数据断点的指令处时, 取消所述数据断 点.
对所述设置有数据断点的指令进行解码; 执行所述解码后的指令; The data breakpoint is canceled when the source program runs to an instruction set with a data breakpoint. Decoding the instruction with the data breakpoint set; executing the decoded instruction;
重新在所述设置有数据断点的指令处设定数据断点; 将程序计数器 PC 指针指向所述设置有数据断点的指令的下一条指 令, 其中, 所述程序计数器 PC指针用于存放将要执行的下一条指令的地 址。 Resetting the data breakpoint at the instruction set with the data breakpoint; pointing the program counter PC pointer to the next instruction of the instruction set with the data breakpoint, wherein the program counter PC pointer is used to store the The address of the next instruction executed.
一方面, 提供一种通信系统, 所述通信系统包括内存和至少一个 In one aspect, a communication system is provided, the communication system including a memory and at least one
CPU; 所述 CPU中运行有操作系统, 所述操作系统之上运行有至少一种应 序; 所述内存中载入有所述源程序和所述异常处理程序, 所述源程序中 设置有至少一个数据断点, 当所述源程序运行到具有数据断点的指令处 时触发异常处理程序, 所述异常处理程序还用于, An operating system is run in the CPU, and at least one sequence is run on the operating system; the source program and the exception processing program are loaded in the memory, and the source program is set At least one data breakpoint, triggering an exception handler when the source program runs to an instruction having a data breakpoint, the exception handler also being used,
当所述源程序运行到设置有数据断点的指令处时, 取消所述数据断 点; The data breakpoint is canceled when the source program runs to an instruction set with a data breakpoint;
备份所述设置有数据断点的指令的下一条指令, 作为备份指令; 将所述设置有数据断点的指令的下一条指令修改为非法指令; 执行所述设置有数据断点的指令以及所述修改后的下一条指令; 恢复所述设置有数据断点的指令处的数据断点; Backing up the next instruction of the instruction with the data breakpoint as the backup instruction; modifying the next instruction of the instruction with the data breakpoint as an illegal instruction; executing the instruction and the data breakpoint setting Describe the modified next instruction; recover the data breakpoint at the instruction with the data breakpoint set;
将所述修改后的下一条指令恢复为所述备份指令。 The modified next instruction is restored to the backup instruction.
一方面, 提供一种实现经过性数据断点的装置, 应用在运行有源程 序的 Linux ARM或 Unix ARM系统中, 所述源程序中设置有至少一个数 据断点, 其特征在于, 所述经过性数据断点的装置包括: 第一取消模块, 用于当所述源程序运行到设置有数据断点的指令处 时, 取消所述数据断点; In one aspect, a device for implementing a transitive data breakpoint is provided for use in a Linux ARM or Unix ARM system running an active program, wherein the source program is provided with at least one data breakpoint, wherein the The device for breaking the data data includes: a first canceling module, configured to cancel the data breakpoint when the source program runs to an instruction set with a data breakpoint;
解码模块, 用于对所述设置有数据断点的指令进行解码; 第一执行模块, 用于执行所述解码后的指令;
设定模块,用于重新在所述设置有数据断点的指令处设定数据断点; 指向模块, 用于将程序计数器 PC 指针指向所述设置有数据断点的 指令的下一条指令, 其中, 所述程序计数器 PC指针用于存放将要执行的 下一条指令的地址。 a decoding module, configured to decode the instruction with a data breakpoint; a first execution module, configured to execute the decoded instruction; a setting module, configured to re-set a data breakpoint at the instruction with the data breakpoint set; a pointing module, configured to point the program counter PC pointer to the next instruction of the instruction set with the data breakpoint, wherein The program counter PC pointer is used to store the address of the next instruction to be executed.
一方面, 提供一种实现经过性数据断点的装置, 应用在运行有源程 序的 Linux ARM或 Unix ARM系统中; 所述源程序中设置有至少一个数 据断点, 其特征在于, 所述经过性数据断点的装置包括: In one aspect, a device for implementing a transitive data breakpoint is provided for use in a Linux ARM or Unix ARM system running an active program; the source program is provided with at least one data breakpoint, wherein the Devices for sexual data breakpoints include:
第二取消模块, 用于当所述源程序运行到设置有数据断点的指令处 时, 取消所述数据断点; 备份模块, 用于备份所述设置有数据断点的指令的下一条指令, 作 为备份指令; 修改模块, 用于将所述设置有数据断点的指令的下一条指令修改为 非法指令; a second canceling module, configured to cancel the data breakpoint when the source program runs to an instruction set with a data breakpoint; and a backup module, configured to back up the next instruction of the instruction with a data breakpoint , as a backup instruction; a modification module, configured to modify the next instruction of the instruction with the data breakpoint to be an illegal instruction;
第二执行模块, 用于执行所述设置有数据断点的指令以及所述修改 后的下一条指令; 恢复模块, 用于恢复所述设置有数据断点的指令处的数据断点; 替换模块, 用于将所述修改后的下一条指令恢复为所述备份指令。 本发明实施例提供的实现经过性数据断点的方法、 装置及系统, 通过在异 常处理程序中仿真执行触发异常处理程序的指令后返回源程序执行触发异 常处理程序的指令的下一条指令, 或者在异常处理程序中取消该触发异常 处理程序的数据断点, 并保存触发该异常处理程序的指令的下一条指令及 设置该下一条指令为非法指令, 从而达到了实现经过性数据断点的效果, 并且不会再次触发异常处理程序, 造成循环触发, 同时还可以重复使用该 数据断点。 a second execution module, configured to execute the instruction with a data breakpoint and the modified next instruction; and a recovery module, configured to recover a data breakpoint at the instruction with the data breakpoint set; And for restoring the modified next instruction to the backup instruction. The method, device and system for implementing a transitive data breakpoint provided by an embodiment of the present invention, after executing an instruction for triggering an exception handler in an exception handler, returning to the source program to execute a next instruction of an instruction that triggers the exception handler, or The data breakpoint of the trigger exception handler is canceled in the exception handler, and the next instruction of the instruction that triggered the exception handler is saved, and the next instruction is set as an illegal instruction, thereby achieving the effect of implementing the breakpoint of the traversing data. , and the exception handler is not triggered again, causing a loop trigger, and the data breakpoint can be reused.
附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将 对实施例或现有技术描述中所需要使用的附图作筒单地介绍, 显而易见 地, 下面描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技 术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得
其他的附图。 图 1为本发明实施例提供的一种实现经过性数据断点的方法; 图 2为本发明实施例提供的另一种实现经过性数据断点的方法; 图 3为本发明实施例提供的又一种实现经过性数据断点的方法; 图 4a为本发明实施例的通信系统的一种结构示意图; BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art description will be briefly described below, and obviously, in the following description The drawings are only some embodiments of the present invention, and those skilled in the art can obtain the drawings according to the drawings without any creative work. Other drawings. FIG. 1 is a schematic diagram of a method for implementing a transitive data breakpoint according to an embodiment of the present invention; FIG. 2 is a schematic diagram of another method for implementing a transitive data breakpoint according to an embodiment of the present invention; Another method for implementing a breakpoint of a transitive data; FIG. 4a is a schematic structural diagram of a communication system according to an embodiment of the present invention;
图 4b为本发明实施例的通信系统的局部逻辑示意图; 4b is a partial schematic diagram of a communication system according to an embodiment of the present invention;
图 4c为一种传统的应用程序的编译过程的原理示意图; Figure 4c is a schematic diagram of the principle of a conventional application compilation process;
图 5为本发明实施例提供的一种实现经过性数据断点的装置; 图 6为本发明实施例提供的另一种实现经过性数据断点的装置; 图 7为本发明实施例提供的又一种实现经过性数据断点的装置。 具体实施方式 下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案 进行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实 施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术 人员在没有做出创造性劳动前提下所获得的所有其他实施例, 都属于本 发明保护的范围。 FIG. 5 is a schematic diagram of an apparatus for implementing a transitive data breakpoint according to an embodiment of the present invention; FIG. 6 is a schematic diagram of another apparatus for implementing a transitive data breakpoint according to an embodiment of the present invention; Yet another device that implements breakpoints in transit data. The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. example. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例提供的实现经过性数据断点的方法, 应用在运行有源 程序的 Linux ARM或 Unix ARM系统中, 所述源程序中设置有至少一个 数据断点; 该方法如图 1所示, 包括: The method for implementing the transitive data breakpoint provided by the embodiment of the present invention is applied to a Linux ARM or Unix ARM system running an active program, wherein at least one data breakpoint is set in the source program; the method is as shown in FIG. , including:
5101、 当所述源程序运行到设置有数据断点的指令处时, 取消所述 数据断点。 5101. When the source program runs to an instruction set with a data breakpoint, cancel the data breakpoint.
具体的, 取消源程序的断点处的数据断点可以直接调用操作系统中 取消数据断点的方法。 Specifically, canceling the data breakpoint at the breakpoint of the source program can directly invoke the method of canceling the data breakpoint in the operating system.
5102、 对所述设置有数据断点的指令进行解码。 5102. Decode the instruction with the data breakpoint set.
具体的, 由于 CPU在源程序中执行到数据断点处时, 触发异常程序 后, 都会保存该触发异常处理程序的指令的上下文信息, 以使得 CPU在 执行完异常处理程序后会恢复到被中断的源程序的上下文继续执行, 该 过程可以通过现有技术实现, 在此不再赘述。
该步骤中通过保存的触发异常处理程序的指令的上下文信息, 查找 出该指令, 由于该指令是不可预知的机器语言, 所以此时需要解码该指 令以得到该指令的信息, 为下一步操作奠定基础。 Specifically, when the CPU executes the data breakpoint in the source program, after the abnormal program is triggered, the context information of the instruction that triggers the exception handler is saved, so that the CPU will resume the interrupt after executing the exception handler. The context of the source program continues to be implemented, and the process can be implemented by the prior art, and details are not described herein again. In this step, the instruction is found by the saved context information of the instruction that triggers the exception handler. Since the instruction is an unpredictable machine language, the instruction needs to be decoded at this time to obtain the information of the instruction, which lays the next step for the operation. basis.
5103、 执行所述解码后的指令。 具体的, 根据上步骤中解码出的触发异常处理程序的指令, 调用相 应的方法来执行。 5103. Perform the decoded instruction. Specifically, according to the instruction of the trigger exception handler decoded in the previous step, the corresponding method is called to execute.
5104、 重新在所述设置有数据断点的指令处设定数据断点。 5104. Set a data breakpoint again at the instruction with the data breakpoint set.
具体的, 可以在该异常程序中直接调用内核提供的设置数据断点的 方法进行设置。 Specifically, the method for setting data breakpoints provided by the kernel can be directly called in the abnormal program to be set.
5105、 将程序计数器 PC 指针指向所述设置有数据断点的指令的下 一条指令, 其中, 所述程序计数器 PC指针用于存放将要执行的下一条指 令的地址。 5105. Point the program counter PC pointer to the next instruction of the instruction set with a data breakpoint, wherein the program counter PC pointer is used to store the address of the next instruction to be executed.
具体的, 在执行触发异常处理程序前, 由于没有执行设置有数据断 点的指令,所以程序计数器 PC指针还是会指向所述设置有数据断点的指 令, 这时, 为了保证 CPU在执行完异常程序后, 返回源程序时, 执行触 发所述异常处理程序的指令的下一条指令,就需要将 PC指针指向所述设 置有数据断点的指令的下一条指令, 示例性的, 可以将 PC 指针指向 PC=PC+4的位置, 并且, 由异常处理程序返回到所述源程序中的过程可 以通过现有技术可以实现, 此处不再赘述。 本发明实施例提供的实现经过性数据断点的方法, 通过在异常处理 程序中仿真执行触发异常处理程序的指令后返回源程序执行触发异常处 理程序的指令的下一条指令, 从而达到了实现经过性数据断点的效果, 并且不会再次触发异常处理程序, 造成循环触发, 同时还可以重复使用 该数据断点。 Specifically, before the execution of the trigger exception handler, since the instruction with the data breakpoint is not executed, the program counter PC pointer still points to the instruction with the data breakpoint set. In this case, in order to ensure that the CPU is executing the exception. After the program returns to the source program, the next instruction that executes the instruction that triggered the exception handler needs to point the PC pointer to the next instruction of the instruction with the data breakpoint set. For example, the PC pointer can be used. The location of the PC=PC+4, and the process of returning to the source program by the exception handler can be implemented by the prior art, and details are not described herein again. The method for implementing the traversal data breakpoint provided by the embodiment of the present invention achieves the implementation of the instruction that triggers the exception handler by executing the instruction that triggers the exception handler in the exception handler and then returns to the source program to execute the next instruction that triggers the exception handler. The effect of the data breakpoint, and will not trigger the exception handler again, causing a loop trigger, and the data breakpoint can be reused.
优选的, 如图 2所示, 所述实现经过性数据断点的方法还包括, Preferably, as shown in FIG. 2, the method for implementing a transitive data breakpoint further includes:
5106、 创建至少一个数据断点文件, 所述数据断点文件用于记录要 监控的断点的信息。 具体的, 创建数据断点文件的过程为: 5106. Create at least one data breakpoint file, where the data breakpoint file is used to record information of a breakpoint to be monitored. Specifically, the process of creating a data breakpoint file is:
首先, 创建数据断点文件目录, 该步骤可以通过调用 Linux 系统中
的 kernel_kobj属性来创建数据断点目录, 示例性的, 创建 hwbrk这个目 录, 通过下列一段程序实现: First, create a data breakpoint file directory, this step can be invoked by calling the Linux system. The kernel_kobj property to create a data breakpoint directory, exemplarily, create the hwbrk directory, which is implemented by the following program:
hw_breakpoint_kobj=kobject_create_and_add(" hwbrk", kernel_kobj); if ( !hw_breakpoint_kobj) Hw_breakpoint_kobj=kobject_create_and_add(" hwbrk", kernel_kobj); if ( !hw_breakpoint_kobj)
return -ENOMEM; 其次, 在所述数据断点目录中创建至少一个数据断点文件, 该过程 通过调用 Linux 系统内核提供的函数来创建文件, 如 sysfs_create_group 等, 示例性的, 在 hwbrk数据断点目录下创建数据断点的文件, 可以通 过以下程序代码实现: retval = sysfs_create_group(hw_breakpoint_kobj, &attr_group); Return -ENOMEM; Secondly, create at least one data breakpoint file in the data breakpoint directory, the process creates a file by calling a function provided by the Linux system kernel, such as sysfs_create_group, etc., in the hwbrk data breakpoint directory The file that creates the data breakpoint can be implemented by the following program code: retval = sysfs_create_group(hw_breakpoint_kobj, &attr_group);
if (retval) If (retval)
kobject_put(hw_breakpoint_kobj); Kobject_put(hw_breakpoint_kobj);
printk( " Hardware Breakpoint Manager init...\n"); Printk( " Hardware Breakpoint Manager init...\n");
return retval; 需要说明的是, 可以通过在数据断点文件的写属性中调用 Linux 系 统内核提供的与数据断点相关的函数来实现在源程序中设置数据断点。 Return retval; It should be noted that data breakpoints can be set in the source program by calling the data breakpoint-related functions provided by the Linux system kernel in the write attribute of the data breakpoint file.
具体的, 在该数据断点文件中写入要监控的断点地址, 根据所述数 据断点文件中的断点地址在所述源程序中设置数据断点, 同样的, 还可 以将用户需要监控的断点参数写入所述数据断点文件中; 所述数据断点 文件根据所述断点参数到预先设置的符号表中去查找相应的断点地址, 并根据所述断点地址在源程序中设置数据断点。 Specifically, the breakpoint address to be monitored is written in the data breakpoint file, and the data breakpoint is set in the source program according to the breakpoint address in the data breakpoint file. Similarly, the user needs The monitored breakpoint parameter is written into the data breakpoint file; the data breakpoint file searches for a corresponding breakpoint address according to the breakpoint parameter to a preset symbol table, and according to the breakpoint address Set data breakpoints in the source program.
其中, 当该数据断点文件写入数据后, 会判断该数据为断点地址还 是断点参数, 当该数据为断点地址时, 该数据断点文件会在源程序的相 应位置处设置数据断点, 以使源程序运行到该数据断点处时, 触发异常 处理程序; 当该数据为断点参数时, 该数据断点文件会查找出该断点参 数相应的断点地址, 并在该断点地址处设置数据断点, 以使源程序运行 到具有该断点参数的指令处时, 触发异常处理程序, 其中, 该断点参数
更具体的, 可以通过以下程序代码实现根据写入的断点地址在源程 序中设置数据断点: Wherein, when the data breakpoint file is written into the data, the data is determined to be a breakpoint address or a breakpoint parameter, and when the data is a breakpoint address, the data breakpoint file sets the data at the corresponding position of the source program. a breakpoint, so that when the source program runs to the data breakpoint, the exception handler is triggered; when the data is a breakpoint parameter, the data breakpoint file finds the corresponding breakpoint address of the breakpoint parameter, and Setting a data breakpoint at the breakpoint address to trigger an exception handler when the source program runs to an instruction having the breakpoint parameter, wherein the breakpoint parameter More specifically, the following program code can be used to set data breakpoints in the source program based on the written breakpoint address:
static ssize_t symbol_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) Static ssize_t symbol_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
{ /*初始化数据断点 */ { / * Initialize data breakpoints * /
hw_breakpoint_init(&atribs); sscanf(buf, "%s", hwbrk_data[index] .symbol); Hw_breakpoint_init(&atribs); sscanf(buf, "%s", hwbrk_data[index] .symbol);
/*判断用户输入的是地址还是断点参数 */ / * Determine whether the user entered the address or breakpoint parameters * /
if (hwbrk_data[index] .symbol[0] == Ό' && (hwbrk_data[index] .symbol [ 1 ] == 'x' II hwbrk_data[index] .symbol[ 1 ] == 'X')) { sscanf(hwbrk_data[index]. symbol, "%Lx",&atribs.bp_addr); If (hwbrk_data[index] .symbol[0] == Ό' && (hwbrk_data[index] .symbol [ 1 ] == 'x' II hwbrk_data[index] .symbol[ 1 ] == 'X')) { sscanf (hwbrk_data[index]. symbol, "%Lx",&atribs.bp_addr);
else { /*若是断点参数则到符号表中去查找相应的地址 */ atribs.bp_addr=kallsyms_lookup_name(hwbrk_data[index]. symbol); Else { / * If it is a breakpoint parameter, go to the symbol table to find the corresponding address */ atribs.bp_addr=kallsyms_lookup_name(hwbrk_data[index]. symbol);
atribs.bp_len = sizeof(long); atribs.bp_type = hwbrk_data[index] .type = hwbrk_type;Atribs.bp_len = sizeof(long); atribs.bp_type = hwbrk_data[index] .type = hwbrk_type;
//HW_B EAKPOINT_W is default //HW_B EAKPOINT_W is default
if (atribs.bp_addr > 0) { hwbrk_data[index] .addr = atribs.bp_addr; hwbrk_data[index] .value = *((u32*)(atribs.bp_addr)); If (atribs.bp_addr > 0) { hwbrk_data[index] .addr = atribs.bp_addr; hwbrk_data[index] .value = *((u32*)(atribs.bp_addr));
/*注册数据断点及回调函数 callback*/ /*Register data breakpoints and callbacks callback*/
hwbrk_data[index].hbp=register_wide_hw_breakpoint(&atribs, callback
); Hwbrk_data[index].hbp=register_wide_hw_breakpoint(&atribs, callback );
if (IS_ERR((void― force *)hwbrk_data[index] .hbp)) { ret = PTR_ERR((void― force *)hwbrk_data[index] .hbp); goto fail; If (IS_ERR((void― force *)hwbrk_data[index] .hbp)) { ret = PTR_ERR((void― force *)hwbrk_data[index] .hbp); goto fail;
return ret; Return ret;
这样, 可以通过在该数据断点文件中写入要监控的断点参数或断点 地址, 以在源程序中相应位置处设置数据断点, 方便了用户使用, 需要 说明的是, 该断点参数可以是符号名或者参数值。 In this way, by writing the breakpoint parameter or the breakpoint address to be monitored in the data breakpoint file, the data breakpoint is set at the corresponding position in the source program, which is convenient for the user to use. It should be noted that the breakpoint is The parameter can be a symbolic name or a parameter value.
需要说明的是, 还可以设置数据断点文件的读属性, 来对该数据断 点文件进行一些操作限制, 具体实现过程为: It should be noted that the read attribute of the data breakpoint file can also be set to perform some operation restrictions on the data breakpoint file. The specific implementation process is as follows:
static ssize_t symbol_show(struct kobject *kobj, struct kobj_attribute *attr,char *buf) Static ssize_t symbol_show(struct kobject *kobj, struct kobj_attribute *attr,char *buf)
short index = 0; ssize_t len = 0; index = get_brk_index(attr); if (hwbrk_data[index] .symbol[0] == '\0') return sprintf(buf, "Breakpoint not set\n"); else { len = sprintf(buf, "Debug symbol %s and has value 0x%d\n", hwbrk_data[index] .symbol, hwbrk_data[index] .value); len += printBreakpointType(buf+len);
return len; Sm_fk_index[att]; { len = sprintf(buf, "Debug symbol %s and has value 0x%d\n", hwbrk_data[index] .symbol, hwbrk_data[index] .value); len += printBreakpointType(buf+len); Return len;
进一步的, 还可以将用户需要监控的断点参数以及要监控的断点参 数的类型写入所述数据断点文件中; 根据所述断点参数和所述断点参数 的类型查找相应的断点地址, 并根据所述断点地址在源程序中设置数据 断点, 该断点参数的类型为: 可读类型, 可写类型以及可读可写类型。 Further, the breakpoint parameter that the user needs to monitor and the type of the breakpoint parameter to be monitored may be written into the data breakpoint file; and the corresponding break is found according to the breakpoint parameter and the type of the breakpoint parameter. Point address, and set a data breakpoint in the source program according to the breakpoint address, the type of the breakpoint parameter is: a readable type, a writable type, and a readable and writable type.
这样, 不仅可以通过在数据断点文件中写入要监控断点参数, 还可 以通过在该数据断点文件写入要监控的断点参数的类型, 以在源程序相 应位置处设置数据断点, 进一步方便了用户使用。 需要说明的是, 根据所述断点参数和所述断点参数的类型查找相应 的断点地址, 可以通过在相应表中查找相应的断点地址, 该过程为现有 技术, 此处不再赘述。 示例性的, 该表可以为操作系统中存储的符号表, 当该数据断点文 件写入断点参数和断点参数的类型后, 该数据断点文件会在符号表中查 找出符合该断点参数类型的断点参数的断点地址, 并根据该断点地址在 源程序中设置数据断点。 In this way, not only can you write the breakpoint parameter to be monitored in the data breakpoint file, but you can also set the data breakpoint at the corresponding position of the source program by writing the type of the breakpoint parameter to be monitored in the data breakpoint file. , further convenient for users to use. It should be noted that, according to the breakpoint parameter and the type of the breakpoint parameter, the corresponding breakpoint address is searched, and the corresponding breakpoint address can be found in the corresponding table. The process is prior art, and is no longer here. Narration. Exemplarily, the table may be a symbol table stored in an operating system. When the data breakpoint file writes a type of a breakpoint parameter and a breakpoint parameter, the data breakpoint file is found in the symbol table to match the break. The breakpoint address of the breakpoint parameter of the point parameter type, and the data breakpoint is set in the source program according to the breakpoint address.
更进一步的, 还可以将用户需要监控的断点参数以及要监控的断点 参数的范围写入所述数据断点文件中; 根据所述断点参数和所述断点参 数的范围查找相应的断点地址, 并根据所述断点地址在所述源程序中设 置数据断点。 Further, the breakpoint parameter that the user needs to monitor and the range of the breakpoint parameter to be monitored may be written into the data breakpoint file; and the corresponding range is found according to the breakpoint parameter and the range of the breakpoint parameter. A breakpoint address, and a data breakpoint is set in the source program according to the breakpoint address.
这样, 不仅可以通过在数据断点文件中写入要监控的断点参数, 还 可以通过在该数据断点文件中写入要监控的断点参数的范围, 以在源程 序相应位置处设置数据断点, 又进一步的方便了用户的使用。 In this way, not only can you write the breakpoint parameter to be monitored in the data breakpoint file, but also set the data at the corresponding position of the source program by writing the range of the breakpoint parameter to be monitored in the data breakpoint file. Breakpoints further facilitate the use of the user.
示例性的, 当该数据断点文件写入断点参数和要监控的断点参数范 围后, 该数据断点文件会在符号表中查找出符合该断点参数范围的断点 参数的断点地址, 并根据该断点地址在源程序中设置数据断点。 Exemplarily, when the data breakpoint file writes the breakpoint parameter and the range of the breakpoint parameter to be monitored, the data breakpoint file finds a breakpoint in the symbol table that meets the breakpoint parameter of the breakpoint parameter range. Address, and set data breakpoints in the source program based on the breakpoint address.
需要说明的是, 当数据断点文件只写入了上述内容的断点参数, 断 点地址, 断点参数的类型和断点参数范围中的任意一个或多个, 则其他 为默认值, 显然, 这样能够更加灵活的通过该数据断点文件在源程序中
设置数据断点。 It should be noted that when the data breakpoint file only writes the breakpoint parameter of the above content, the breakpoint address, the type of the breakpoint parameter, and any one or more of the breakpoint parameter ranges, the others are default values, obviously , which makes it more flexible to pass the data breakpoint file in the source program. Set data breakpoints.
本发明实施例提供的实现经过性数据断点的方法, 应用在运行有源 程序的 Linux ARM或 Unix ARM系统中, 所述源程序中设置有至少一个 数据断点, 所述方法如图 3所示, A method for implementing a transitive data breakpoint according to an embodiment of the present invention is applied to a Linux ARM or Unix ARM system running an active program, wherein at least one data breakpoint is set in the source program, and the method is as shown in FIG. Show,
在所述异常处理程序中进行以下操作: Do the following in the exception handler:
5301、 当所述源程序运行到设置有数据断点的指令处时, 取消所述 数据断点。 S301: Cancel the data breakpoint when the source program runs to an instruction set with a data breakpoint.
具体的, 取消源程序的断点处的数据断点可以直接调用内核中取消 数据断点的方法。 Specifically, canceling the data breakpoint at the breakpoint of the source program can directly call the method of canceling the data breakpoint in the kernel.
5302、 备份所述设置有数据断点的指令的下一条指令, 作为备份指 令。 5302. Back up the next instruction of the instruction with the data breakpoint set as the backup instruction.
具体的, 该过程可以通过现有技术实现, 此处不再赘述。 Specifically, the process can be implemented by using the prior art, and details are not described herein again.
5303、将所述设置有数据断点的指令的下一条指令修改为非法指令。 5303. Modify the next instruction of the instruction with the data breakpoint to an illegal instruction.
5304、 执行所述设置有数据断点的指令以及所述修改后的下一条指 令。 5304. Execute the instruction for setting a data breakpoint and the modified next instruction.
需要说明的是, 在执行完步骤 303后, 还需要仿真执行设置有数据 断点的指令, 在执行完该设置有数据断点的指令后, 需要返回到源程序 中, 执行修改后的下一条指令, 在该过程中, 本领域技术人员可以根据 本发明实施例的描述, 具体完成上述过程, 在此不再赘述。 It should be noted that, after executing step 303, an emulation execution instruction with a data breakpoint is required, and after executing the instruction with the data breakpoint set, it is necessary to return to the source program, and execute the modified next one. In the process, a person skilled in the art can specifically complete the foregoing process according to the description of the embodiments of the present invention, and details are not described herein again.
5305、 恢复所述设置有数据断点的指令处的数据断点。 具体的, 该过程可以通过调用内核提供的设置数据断点的方法重新 设置断点处的数据断点。 5305. Restore a data breakpoint at the instruction where the data breakpoint is set. Specifically, the process can reset the data breakpoint at the breakpoint by calling the set data breakpoint provided by the kernel.
5306、 将所述修改后的下一条指令恢复为所述备份指令。 5306. Restore the modified next instruction to the backup instruction.
本发明实施例提供的实现经过性数据断点的方法, 通过在异常处理 程序中取消该触发异常处理程序的数据断点, 并保存触发该异常处理程 序的指令的下一条指令及设置该下一条指令为非法指令, 从而达到了实 现经过性数据断点的效果, 并且不会再次触发异常处理程序, 造成循环 触发, 同时还可以重复使用该数据断点。
优选的, 该实现经过性数据断点的方法, 如图 3所示, 还包括, The method for implementing the transitive data breakpoint provided by the embodiment of the present invention cancels the data breakpoint of the trigger exception handler in the exception handler, saves the next instruction of the instruction that triggers the exception handler, and sets the next one. The instruction is an illegal instruction, so that the effect of implementing the breakpoint of the data is achieved, and the exception handler is not triggered again, causing the loop trigger, and the data breakpoint can be reused. Preferably, the method for implementing a transitive data breakpoint, as shown in FIG. 3, further includes
S307、 创建至少一个数据断点文件, 所述数据断点文件用于记录要 监控的断点的信息。 其中, 创建数据断点文件的过程可以参考上述实施例中的步骤 106。 具体的, 在该数据断点文件中写入要监控的断点地址, 根据所述数 据断点文件中的断点地址在所述源程序中设置数据断点, 同样的, 还可 以将用户需要监控的断点参数写入所述数据断点文件中; 所述数据断点 文件根据所述断点参数到预先设置的符号表中去查找相应的断点地址, 并根据所述断点地址在源程序中设置数据断点。 S307. Create at least one data breakpoint file, where the data breakpoint file is used to record information of a breakpoint to be monitored. The process of creating a data breakpoint file may refer to step 106 in the foregoing embodiment. Specifically, the breakpoint address to be monitored is written in the data breakpoint file, and the data breakpoint is set in the source program according to the breakpoint address in the data breakpoint file. Similarly, the user needs The monitored breakpoint parameter is written into the data breakpoint file; the data breakpoint file searches for a corresponding breakpoint address according to the breakpoint parameter to a preset symbol table, and according to the breakpoint address Set data breakpoints in the source program.
其中, 当该数据断点文件写入数据后, 会判断该数据为断点地址还 是断点参数, 当该数据为断点地址时, 该数据断点文件会在源程序的相 应位置处设置数据断点, 以使源程序运行到该数据断点处时, 触发异常 处理程序; 当该数据为断点参数时, 该数据断点文件会查找出该断点参 数相应的断点地址, 并在该断点地址处设置数据断点, 以使源程序运行 到具有该断点参数的指令处时, 触发异常处理程序, 其中, 该断点参数 包括符号名或参数值。 这样, 可以通过在该数据断点文件中写入要监控的断点值或地址, 以在源程序中相应位置处设置数据断点, 方便了用户使用。 进一步的, 还可以将用户需要监控的断点参数以及要监控的断点参 数的类型写入所述数据断点文件中; 根据所述断点参数和所述断点参数 的类型查找相应的断点地址, 并根据所述断点地址在源程序中设置数据 断点, 该断点参数的类型为: 可读类型, 可写类型以及可读可写类型。 Wherein, when the data breakpoint file is written into the data, the data is determined to be a breakpoint address or a breakpoint parameter, and when the data is a breakpoint address, the data breakpoint file sets the data at the corresponding position of the source program. a breakpoint, so that when the source program runs to the data breakpoint, the exception handler is triggered; when the data is a breakpoint parameter, the data breakpoint file finds the corresponding breakpoint address of the breakpoint parameter, and The data breakpoint is set at the breakpoint address to trigger the exception handler when the source program runs to the instruction having the breakpoint parameter, wherein the breakpoint parameter includes a symbol name or a parameter value. In this way, the data breakpoint can be set at the corresponding position in the source program by writing the breakpoint value or address to be monitored in the data breakpoint file, which is convenient for the user to use. Further, the breakpoint parameter that the user needs to monitor and the type of the breakpoint parameter to be monitored may be written into the data breakpoint file; and the corresponding break is found according to the breakpoint parameter and the type of the breakpoint parameter. Point address, and set a data breakpoint in the source program according to the breakpoint address, the type of the breakpoint parameter is: a readable type, a writable type, and a readable and writable type.
这样, 不仅可以通过在数据断点文件中写入要监控断点参数, 还可 以通过在该数据断点文件写入要监控的断点参数的类型, 以在源程序相 应位置处设置数据断点, 进一步方便了用户使用。 In this way, not only can you write the breakpoint parameter to be monitored in the data breakpoint file, but you can also set the data breakpoint at the corresponding position of the source program by writing the type of the breakpoint parameter to be monitored in the data breakpoint file. , further convenient for users to use.
需要说明的是, 根据所述断点参数和所述断点参数的类型查找相应 的断点地址, 可以通过在相应表中查找相应的断点地址, 该过程为现有 技术, 此处不再赘述。 示例性的, 该表可以为操作系统中存储的符号表, 当该数据断点文
件写入断点参数和断点参数的类型后, 该数据断点文件会在符号表中查 找出符合该断点参数类型的断点参数的断点地址, 并根据该断点地址在 源程序中设置数据断点。 It should be noted that, according to the breakpoint parameter and the type of the breakpoint parameter, the corresponding breakpoint address is searched, and the corresponding breakpoint address can be found in the corresponding table. The process is prior art, and is no longer here. Narration. Exemplarily, the table can be a symbol table stored in the operating system, when the data breaks the text After writing the breakpoint parameter and the type of the breakpoint parameter, the data breakpoint file finds the breakpoint address of the breakpoint parameter that matches the breakpoint parameter type in the symbol table, and according to the breakpoint address in the source program Set data breakpoints in .
更进一步的, 还可以将用户需要监控的断点参数以及要监控的断点 参数的范围写入所述数据断点文件中; 根据所述断点参数和所述断点参 数的范围查找相应的断点地址, 并根据所述断点地址在所述源程序中设 置数据断点。 Further, the breakpoint parameter that the user needs to monitor and the range of the breakpoint parameter to be monitored may be written into the data breakpoint file; and the corresponding range is found according to the breakpoint parameter and the range of the breakpoint parameter. A breakpoint address, and a data breakpoint is set in the source program according to the breakpoint address.
这样, 不仅可以通过在数据断点文件中写入要监控的断点参数, 还 可以通过在该数据断点文件中写入要监控的断点参数的范围, 以在源程 序相应位置处设置数据断点, 又进一步的方便了用户的使用。 In this way, not only can you write the breakpoint parameter to be monitored in the data breakpoint file, but also set the data at the corresponding position of the source program by writing the range of the breakpoint parameter to be monitored in the data breakpoint file. Breakpoints further facilitate the use of the user.
示例性的, 当该数据断点文件写入断点参数和要监控的断点参数范 围后, 该数据断点文件会在符号表中查找出符合该断点参数范围的断点 参数的断点地址, 并根据该断点地址在源程序中设置数据断点。 Exemplarily, when the data breakpoint file writes the breakpoint parameter and the range of the breakpoint parameter to be monitored, the data breakpoint file finds a breakpoint in the symbol table that meets the breakpoint parameter of the breakpoint parameter range. Address, and set data breakpoints in the source program based on the breakpoint address.
需要说明的是, 当数据断点文件只写入了上述内容的断点参数, 断 点地址, 断点参数的类型和断点参数范围中的任意一个或多个, 则其他 为默认值, 显然, 这样能够更加灵活的通过该数据断点文件在源程序中 设置数据断点。 本发明实施例提供的一种通信系统, 其系统结构示意图以及局部逻 辑示意图分别如图 4a和 4b所示, 图 4a中包括三个 CPU , 即 CPU1 , CPU2 , CPU3 , 所述 CPU通过总线访问内存, 应当理解的是, 本发明实 施例的通信系统中可以包括一个 CPU , 即单 CPU的通信系统, 也可以包 括多个 CPU, 即多 CPU (多核) 的通信系统。 即本发明实施例的通信系 统, 包括至少一个 CPU和内存, 所述 CPU上运行有操作系统, 所述操作 系统之上运行有至少一种应用程序 (亦称为软件) , 用于执行特定的任 其中: ' '、 ' 一 、 、 、 - 所述内存中载入有所述源程序和所述异常处理程序, 所述源程序中 设置有至少一个数据断点, 当所述源程序运行到具有数据断点的指令处 时触发异常处理程序, 所述异常处理程序用于, 当所述源程序运行到设 置数据断点的指令处时, 通过调用操作系统中取消数据断点的方法取消
所述数据断点; 对所述所述设置有数据断点的指令进行解码, 并执行解 码后的指令, 具体的, 调用相应的方法来执行; 重新在所述设置有数据 断点的指令处设定数据断点;将程序计数器 PC指针指向所述设置有数据 断点的指令的下一条指令, 其中, 所述程序计数器 PC指针用于存放将要 执行的下一条指令的地址。 It should be noted that when the data breakpoint file only writes the breakpoint parameter of the above content, the breakpoint address, the type of the breakpoint parameter, and any one or more of the breakpoint parameter ranges, the others are default values, obviously This makes it more flexible to set data breakpoints in the source program through the data breakpoint file. A communication system provided by an embodiment of the present invention has a system structure diagram and a partial logic diagram as shown in FIG. 4a and FIG. 4b respectively. FIG. 4a includes three CPUs, namely, CPU1, CPU2, and CPU3, and the CPU accesses the memory through the bus. It should be understood that the communication system of the embodiment of the present invention may include a CPU, that is, a single CPU communication system, and may also include multiple CPUs, that is, multiple CPU (multi-core) communication systems. That is, the communication system of the embodiment of the present invention includes at least one CPU and a memory, the CPU runs an operating system, and the operating system runs on at least one application (also referred to as software) for executing a specific Wherein: '','一, , , - the memory program is loaded with the source program and the exception handler, the source program is provided with at least one data breakpoint, when the source program runs to An exception handler is triggered when the instruction has a data breakpoint, and the exception handler is used to cancel the method of canceling the data breakpoint in the operating system when the source program runs to the instruction where the data breakpoint is set. The data breakpoint; decoding the instruction with the data breakpoint set, and executing the decoded instruction, specifically, calling the corresponding method to execute; re-instructing the instruction with the data breakpoint Setting a data breakpoint; pointing the program counter PC pointer to the next instruction of the instruction set with a data breakpoint, wherein the program counter PC pointer is used to store the address of the next instruction to be executed.
本发明实施例的通信系统进一步包括: 编译器 (图中未示意出) , 应用程序的编译过程的原理示意图,如图 4c所示,传统的编译过程包括: 通过编译器将源文件 (.c 文件) 编译成目标文件 (.0 文件, 即二进制文 件) , 再将多个目标文件链接成可执行文件。 编译器在编译源程序之前, 用户可以设置一些经过性数据断点, 这样, 源程序运行到具有数据断点 的指令处时, 就会触发异常处理程序; 经过性数据断点的基本原理是将 要监控的数据 /指令地址设置到 cpu的 debug寄存器中, 当 cpu访问被监 控的数据 /指令地址时就出触发一个异常处理程序, 处理完异常处理程序 后会恢复到触发异常处理程序的上下文, 继续执行, 整个过程不影响原 系统的状态, 达到 "经过性数据断点" 的效果。 在本发明实施例中还通过提供一种数据断点文件来在源程序中设置 经过性数据断点, 具体方法是, 在操作系统的内核中创建数据断点文件 的目录; 在所述数据断点目录中创建至少一个数据断点文件; 所述数据 断点文件用于写入要监控的断点地址, 并根据所述断点地址在源程序中 设置数据断点, 这样一来, 通过在该文件中写入数据断点的断点地址, 就可以在源程序中设置数据断点, 方便了用户使用, 除此之外, 该数据 断点文件还可以通过写入断点参数来设置数据断点, 并且还可以通过写 入断点参数类型来进一步设置数据断点, 而且还可以通过写入断点参数 范围来设置数据断点。 The communication system of the embodiment of the present invention further includes: a compiler (not shown in the figure), a schematic diagram of the principle of the compilation process of the application, as shown in FIG. 4c, the conventional compilation process includes: the source file (.c) is compiled by the compiler. The file is compiled into a target file (.0 file, that is, a binary file), and then multiple target files are linked into an executable file. Before the compiler compiles the source program, the user can set some traversal data breakpoints, so that when the source program runs to the instruction with the data breakpoint, the exception handler is triggered; the basic principle of the sci-fi data breakpoint is that The monitored data/instruction address is set to the debug register of the cpu. When the cpu accesses the monitored data/instruction address, an exception handler is triggered. After the exception handler is processed, the context of the trigger exception handler is restored. Execution, the whole process does not affect the state of the original system, and achieves the effect of "passing data breakpoints". In the embodiment of the present invention, a data breakpoint is also set in the source program by providing a data breakpoint file, where the directory of the data breakpoint file is created in the kernel of the operating system; Creating at least one data breakpoint file in the point directory; the data breakpoint file is used to write a breakpoint address to be monitored, and set a data breakpoint in the source program according to the breakpoint address, so that In this file, the breakpoint address of the data breakpoint is written, and the data breakpoint can be set in the source program, which is convenient for the user to use. In addition, the data breakpoint file can also set the data by writing the breakpoint parameter. Breakpoints, and you can further set data breakpoints by writing breakpoint parameter types, and you can also set data breakpoints by writing breakpoint parameter ranges.
应当理解的是, 本发明实施例通信系统具体可以是 Linux arm系统, 或者 Unix ARM系统, 也可以是 Linux X86系统、 Solaris、 aix等类 Unix 系统等等。 例如, 在 Linux arm系统下, 包括至少一个 arm架构的 CPU, CPU上运行有 Linux操作系统, 所述 Linux操作系统之上运行有至少一 少一个异常处理程序 (具体功能同上, 故不再赘述) 。
本发明实施例提供的通信系统, 通过在异常处理程序中仿真执行触 发异常处理程序的指令后返回源程序执行触发异常处理程序的指令的下 一条指令, 或者在异常处理程序中取消该触发异常处理程序的数据断点, 并保存触发该异常处理程序的指令的下一条指令及设置该下一条指令为 非法指令, 从而达到了实现经过性数据断点的效果, 并且不会再次触发 trap异常处理程序, 造成循环触发, 同时还可以重复使用该数据断点。 It should be understood that the communication system of the embodiment of the present invention may specifically be a Linux arm system, or a Unix ARM system, or may be a Linux X86 system, a Unix-like system such as Solaris, aix, or the like. For example, in the Linux arm system, the CPU includes at least one arm architecture, and the CPU runs on the CPU. The Linux operating system runs at least one exception handler (the specific function is the same as above, so it will not be described again). . The communication system provided by the embodiment of the present invention returns to the source program to execute the next instruction of the instruction that triggers the exception processing program after executing the instruction that triggers the exception processing program in the exception processing program, or cancels the trigger exception processing in the exception handling program. The data breakpoint of the program, and saves the next instruction of the instruction that triggered the exception handler and sets the next instruction as an illegal instruction, thereby achieving the effect of implementing the breakpoint of the traversing data, and does not trigger the trap exception handler again. , causing a loop trigger, and the data breakpoint can be reused.
本发明实施例提供的一种通信系统,该信系统中可以包括一个 CPU, 即单 CPU的通信系统, 也可以包括多个 CPU, 即多 CPU (多核) 的通信 系统。即本发明实施例的通信系统,包括至少一个 CPU和内存,所述 CPU 上运行有操作系统, 所述操作系统之上运行有至少一种应用程序 (亦称 为软件) , 用于执行特定的任务, 所述应用程序包括源程序以及与之关 联的至少一个异常处理程序, 其中: 所述内存中载入所述有源程序和所述异常处理程序, 所述源程序中 设置有至少一个数据断点, 当所述源程序运行到具有数据断点的指令处 时触发异常处理程序, 所述异常处理程序还用于, 当所述源程序运行到 设置有数据断点的指令处时, 取消所述数据断点; 备份所述设置有数据 断点的指令的下一条指令, 作为备份指令; 将所述设置有数据断点的指 令的下一条指令修改为非法指令; 执行所述设置有数据断点的指令以及 所述修改后的下一条指令; 恢复所述设置有数据断点的指令处的数据断 点; 将所述修改后的下一条指令恢复为所述备份指令。 The communication system provided by the embodiment of the present invention may include a CPU, that is, a single CPU communication system, and may also include multiple CPUs, that is, a multi-CPU (multi-core) communication system. That is, the communication system of the embodiment of the present invention includes at least one CPU and an internal memory, and the operating system runs on the CPU, and at least one application (also referred to as software) runs on the operating system for executing a specific a task, the application includes a source program and at least one exception handler associated therewith, where: the active program and the exception handler are loaded in the memory, and at least one data is set in the source program a breakpoint, triggering an exception handler when the source program runs to an instruction having a data breakpoint, the exception handler is further configured to cancel when the source program runs to an instruction set with a data breakpoint The data breakpoint; backing up the next instruction of the instruction with the data breakpoint as the backup instruction; modifying the next instruction of the instruction with the data breakpoint as an illegal instruction; performing the setting with the data a breakpoint instruction and the modified next instruction; restoring the data breakpoint at the instruction with the data breakpoint set; Modifying the next instruction after said restore the backup instruction.
本发明实施例的通信系统进一步包括: 编译器 (图中未示意出) , 应用程序的编译过程的原理示意图,如图 4c所示,传统的编译过程包括: 通过编译器将源文件 (.c 文件) 编译成目标文件 (.0 文件, 即二进制文 件) , 再将多个目标文件链接成可执行文件。 编译器在编译源程序之前, 用户可以设置一些经过性数据断点, 这样, 源程序运行到具有数据断点 的指令处时, 就会触发异常处理程序; 经过性数据断点的基本原理是将 要监控的数据 /指令地址设置到 cpu的 debug寄存器中, 当 cpu访问被监 控的数据 /指令地址时就出触发一个异常处理程序, 处理完异常处理程序 后会恢复到触发异常处理程序的上下文, 继续执行, 整个过程不影响原 系统的状态, 达到 "经过性数据断点" 的效果。
在本发明实施例中还通过提供一种数据断点文件来在源程序中设置 经过性数据断点, 具体方法是, 在操作系统的内核中创建数据断点文件 的目录; 在所述数据断点目录中创建至少一个数据断点文件; 所述数据 断点文件用于写入要监控的断点地址, 并根据所述断点地址在源程序中 设置数据断点, 这样一来, 通过在该文件中写入数据断点的断点地址, 就可以在源程序中设置数据断点, 方便了用户使用, 除此之外, 该数据 断点文件还可以通过写入断点参数来设置数据断点, 并且还可以通过写 入断点参数类型来进一步设置数据断点, 而且还可以通过写入断点参数 范围来设置数据断点。 The communication system of the embodiment of the present invention further includes: a compiler (not shown in the figure), a schematic diagram of the principle of the compilation process of the application, as shown in FIG. 4c, the conventional compilation process includes: the source file (.c) is compiled by the compiler. The file is compiled into a target file (.0 file, that is, a binary file), and then multiple target files are linked into an executable file. Before the compiler compiles the source program, the user can set some traversal data breakpoints, so that when the source program runs to the instruction with the data breakpoint, the exception handler is triggered; the basic principle of the sci-fi data breakpoint is that The monitored data/instruction address is set to the debug register of the cpu. When the cpu accesses the monitored data/instruction address, an exception handler is triggered. After the exception handler is processed, the context of the trigger exception handler is restored. Execution, the whole process does not affect the state of the original system, and achieves the effect of "passing data breakpoints". In the embodiment of the present invention, a data breakpoint is also set in the source program by providing a data breakpoint file, where the directory of the data breakpoint file is created in the kernel of the operating system; Creating at least one data breakpoint file in the point directory; the data breakpoint file is used to write a breakpoint address to be monitored, and set a data breakpoint in the source program according to the breakpoint address, so that In this file, the breakpoint address of the data breakpoint is written, and the data breakpoint can be set in the source program, which is convenient for the user to use. In addition, the data breakpoint file can also set the data by writing the breakpoint parameter. Breakpoints, and you can further set data breakpoints by writing breakpoint parameter types, and you can also set data breakpoints by writing breakpoint parameter ranges.
应当理解的是, 本发明实施例通信系统具体可以是 Linux arm系统, 或者 Unix ARM系统, 也可以是 Linux X86系统、 Solaris、 aix等类 Unix 系统等等。 例如, 在 Linux arm系统下, 包括至少一个 arm架构的 CPU, CPU上运行有 Linux操作系统, 所述 Linux操作系统之上运行有至少一 少一个异常处理程序 (具体功能同上, 故不再赘述) 。 It should be understood that the communication system of the embodiment of the present invention may specifically be a Linux arm system, or a Unix ARM system, or a Linux X86 system, a Unix system such as Solaris, aix, or the like. For example, in the Linux arm system, the CPU includes at least one arm architecture, and the CPU runs on the CPU. The Linux operating system runs at least one exception handler (the specific function is the same as above, so it will not be described again). .
本发明实施例提供的通信系统, 通过在异常处理程序中仿真执行触 发异常处理程序的指令后返回源程序执行触发异常处理程序的指令的下 一条指令, 或者在异常处理程序中取消该触发异常处理程序的数据断点, 并保存触发该异常处理程序的指令的下一条指令及设置该下一条指令为 非法指令, 从而达到了实现经过性数据断点的效果, 并且不会再次触发 trap异常处理程序, 造成循环触发, 同时还可以重复使用该数据断点。 The communication system provided by the embodiment of the present invention returns to the source program to execute the next instruction of the instruction that triggers the exception processing program after executing the instruction that triggers the exception processing program in the exception processing program, or cancels the trigger exception processing in the exception handling program. The data breakpoint of the program, and saves the next instruction of the instruction that triggered the exception handler and sets the next instruction as an illegal instruction, thereby achieving the effect of implementing the breakpoint of the traversing data, and does not trigger the trap exception handler again. , causing a loop trigger, and the data breakpoint can be reused.
本发明实施例提供的一种实现经过性数据断点的装置, 应用在运行 有源程序的 Linux ARM或 Unix ARM系统中, 所述源程序中设置有至少 一个数据断点, 如图 5所示, 该装置 50包括: An apparatus for implementing a transitive data breakpoint according to an embodiment of the present invention is applied to a Linux ARM or Unix ARM system running an active program, wherein at least one data breakpoint is set in the source program, as shown in FIG. , the device 50 includes:
第一取消模块 501 , 用于当所述源程序运行到设置有数据断点的指 令处时, 取消所述数据断点。 解码模块 502 , 用于对所述设置有数据断点的指令进行解码。 The first canceling module 501 is configured to cancel the data breakpoint when the source program runs to an instruction set with a data breakpoint. The decoding module 502 is configured to decode the instruction with the data breakpoint set.
第一执行模块 503 , 用于执行所述解码后的指令。 The first execution module 503 is configured to execute the decoded instruction.
设定模块 504 , 用于重新在所述设置有数据断点的指令处设定数据 断点。
指向模块 505 , 用于将程序计数器 PC指针指向所述设置有数据断点 的指令的下一条指令, 其中, 所述程序计数器 PC指针用于存放将要执行 的下一条指令的地址。 The setting module 504 is configured to re-set a data breakpoint at the instruction with the data breakpoint set. The pointing module 505 is configured to point the program counter PC pointer to the next instruction of the instruction set with the data breakpoint, wherein the program counter PC pointer is used to store the address of the next instruction to be executed.
本发明实施例提供的实现经过性数据断点的装置, 通过在异常处理 程序中仿真执行触发异常处理程序的指令后返回源程序执行触发异常处 理程序的指令的下一条指令, 这样一来, 达到了实现经过性数据断点的 效果, 并且还可以重复使用该数据断点。 优选的, 如图 6所示, 该经过性数据断点的装置 50还包括: 创建文件模块 506 , 用于创建至少一个数据断点文件。 The device for implementing the transitive data breakpoint provided by the embodiment of the present invention returns to the source program to execute the next instruction of the instruction that triggers the exception handler by executing the instruction that triggers the exception handler in the exception handler, thereby achieving The effect of passing data breakpoints is achieved, and the data breakpoints can be reused. Preferably, as shown in FIG. 6, the device for traversing data breakpoints 50 further includes: a create file module 506, configured to create at least one data breakpoint file.
写入模块 507 , 用于将用户需要监控的断点地址写入所述数据断点 文件中。 The write module 507 is configured to write a breakpoint address that the user needs to monitor into the data breakpoint file.
设置模块 508 , 用于根据所述数据断点文件中的断点地址在所述源 程序中设置数据断点。 The setting module 508 is configured to set a data breakpoint in the source program according to a breakpoint address in the data breakpoint file.
具体的,写入模块 507在该数据断点文件中写入要监控的断点地址, 设置模块 508 根据所述数据断点文件中的断点地址在所述源程序中设置 数据断点, 同样的, 写入模块 507 还可以将用户需要监控的断点参数写 入所述数据断点文件中; 设置模块 508 根据所述断点参数到预先设置的 符号表中去查找相应的断点地址, 并根据所述断点地址在源程序中设置 数据断点。 Specifically, the write module 507 writes a breakpoint address to be monitored in the data breakpoint file, and the setting module 508 sets a data breakpoint in the source program according to the breakpoint address in the data breakpoint file, and the same. The write module 507 can also write the breakpoint parameter that the user needs to monitor into the data breakpoint file; the setting module 508 searches the preset symbol table according to the breakpoint parameter to find the corresponding breakpoint address, And setting a data breakpoint in the source program according to the breakpoint address.
这样, 可以通过在该数据断点文件中写入要监控的断点值或地址, 以在源程序中相应位置处设置数据断点, 方便了用户使用。 进一步的, 写入模块 507还可以将用户需要监控的断点参数以及要 监控的断点参数的类型写入所述数据断点文件中; 设置模块 508 根据所 述断点参数和所述断点参数的类型查找相应的断点地址, 并根据所述断 点地址在源程序中设置数据断点, 该断点参数的类型为: 可读类型, 可 写类型以及可读可写类型。 这样, 不仅可以通过在数据断点文件中写入要监控断点参数, 还可 以通过在该数据断点文件写入要监控的断点参数的类型, 以在源程序相 应位置处设置数据断点, 进一步方便了用户使用。
需要说明的是, 根据所述断点参数和所述断点参数的类型查找相应 的断点地址, 可以通过在相应表中查找相应的断点地址, 该过程为现有 技术, 此处不再赘述。 In this way, the data breakpoint can be set at the corresponding position in the source program by writing the breakpoint value or address to be monitored in the data breakpoint file, which is convenient for the user to use. Further, the writing module 507 can also write the breakpoint parameter that the user needs to monitor and the type of the breakpoint parameter to be monitored into the data breakpoint file; the setting module 508 according to the breakpoint parameter and the breakpoint The type of the parameter finds the corresponding breakpoint address, and sets a data breakpoint in the source program according to the breakpoint address. The type of the breakpoint parameter is: a readable type, a writable type, and a readable and writable type. In this way, not only can you write the breakpoint parameter to be monitored in the data breakpoint file, but you can also set the data breakpoint at the corresponding position of the source program by writing the type of the breakpoint parameter to be monitored in the data breakpoint file. , further convenient for users to use. It should be noted that, according to the breakpoint parameter and the type of the breakpoint parameter, the corresponding breakpoint address is searched, and the corresponding breakpoint address can be found in the corresponding table. The process is prior art, and is no longer here. Narration.
示例性的, 该表可以为操作系统中存储的符号表, 当该数据断点文 件写入断点参数和断点参数的类型后, 该数据断点文件会在符号表中查 找出符合该断点参数类型的断点参数的断点地址, 并根据该断点地址在 源程序中设置数据断点。 Exemplarily, the table may be a symbol table stored in an operating system. When the data breakpoint file writes a type of a breakpoint parameter and a breakpoint parameter, the data breakpoint file is found in the symbol table to match the break. The breakpoint address of the breakpoint parameter of the point parameter type, and the data breakpoint is set in the source program according to the breakpoint address.
更进一步的, 写入模块 507还可以将用户需要监控的断点参数以及 要监控的断点参数的范围写入所述数据断点文件中; 设置模块 508 根据 所述断点参数和所述断点参数的范围查找相应的断点地址, 并根据所述 断点地址在所述源程序中设置数据断点。 这样, 不仅可以通过在数据断点文件中写入要监控的断点参数, 还 可以通过在该数据断点文件中写入要监控的断点参数的范围, 以在源程 序相应位置处设置数据断点, 又进一步的方便了用户的使用。 Further, the writing module 507 can also write the breakpoint parameter that the user needs to monitor and the range of the breakpoint parameter to be monitored into the data breakpoint file; the setting module 508 according to the breakpoint parameter and the break The range of point parameters finds the corresponding breakpoint address, and a data breakpoint is set in the source program according to the breakpoint address. In this way, not only can you write the breakpoint parameter to be monitored in the data breakpoint file, but also set the data at the corresponding position of the source program by writing the range of the breakpoint parameter to be monitored in the data breakpoint file. Breakpoints further facilitate the use of the user.
示例性的, 当该数据断点文件写入断点参数和要监控的断点参数范 围后, 该数据断点文件会在符号表中查找出符合该断点参数范围的断点 参数的断点地址, 并根据该断点地址在源程序中设置数据断点。 Exemplarily, when the data breakpoint file writes the breakpoint parameter and the range of the breakpoint parameter to be monitored, the data breakpoint file finds a breakpoint in the symbol table that meets the breakpoint parameter of the breakpoint parameter range. Address, and set data breakpoints in the source program based on the breakpoint address.
需要说明的是, 当数据断点文件只写入了上述内容的断点参数, 断 点地址, 断点参数的类型和断点参数范围中的任意一个或多个, 则其他 为默认值, 显然, 这样能够更加灵活的通过该数据断点文件在源程序中 设置数据断点。 It should be noted that when the data breakpoint file only writes the breakpoint parameter of the above content, the breakpoint address, the type of the breakpoint parameter, and any one or more of the breakpoint parameter ranges, the others are default values, obviously This makes it more flexible to set data breakpoints in the source program through the data breakpoint file.
本发明实施例提供的一种实现经过性数据断点的装置, 应用在运行 有源程序的 Linux ARM或 Unix ARM系统中, 所述源程序中设置有至少 一个数据断点, 该装置 70, 如图 7所示, 包括: An apparatus for implementing a transitive data breakpoint is provided in a Linux ARM or Unix ARM system running an active program, wherein at least one data breakpoint is set in the source program, the device 70, such as As shown in Figure 7, it includes:
第二取消模块 701 , 用于当所述源程序运行到设置有数据断点的指 令处时, 取消所述数据断点; 备份模块 702 , 用于备份所述设置有数据断点的指令的下一条指令, 作为备份指令; 修改模块 703 , 用于将所述设置有数据断点的指令的下一条指令修
改为非法指令; a second canceling module 701, configured to cancel the data breakpoint when the source program runs to an instruction set with a data breakpoint; and the backup module 702 is configured to back up the instruction that is set with a data breakpoint An instruction as a backup instruction; a modification module 703, configured to repair the next instruction of the instruction with the data breakpoint Changed to an illegal order;
第二执行模块 704 , 用于执行所述设置有数据断点的指令以及所述 修改后的下一条指令; 恢复模块 705 , 用于恢复所述设置有数据断点的指令处的数据断点; 替换模块 706 , 用于将所述修改后的下一条指令恢复为所述备份指 令。 a second execution module 704, configured to execute the instruction with a data breakpoint and the modified next instruction; and the recovery module 705 is configured to restore a data breakpoint at the instruction with the data breakpoint set; The replacement module 706 is configured to restore the modified next instruction to the backup instruction.
本发明实施例提供的实现经过性数据断点的装置, 通过在异常处理 程序中取消该触发异常处理程序的数据断点, 并保存触发该异常处理程 序的指令的下一条指令及设置该下一条指令为非法指令, 当源程序运行 到触发该异常处理程序的指令的下一条指令时, 会触发非法异常处理程 序, 在该非法异常处理程序中, 恢复先前的数据断点并将保存的指令替 换本条指令, 这样, 当源程序运行到该数据断点处时达到了实现经过性 数据断点的效果, 并且还可以重复使用该数据断点。 The device for implementing the transitive data breakpoint provided by the embodiment of the present invention cancels the data breakpoint of the trigger exception handler in the exception handler, saves the next instruction of the instruction that triggers the exception handler, and sets the next one. The instruction is an illegal instruction. When the source program runs to the next instruction of the instruction that triggered the exception handler, an illegal exception handler is triggered. In the illegal exception handler, the previous data breakpoint is restored and the saved instruction is replaced. This instruction, in this way, achieves the effect of implementing a transitive data breakpoint when the source program runs to the data breakpoint, and can also reuse the data breakpoint.
优选的, 该经过性数据断点的装置 70还包括: Preferably, the device 70 for passing data breakpoints further comprises:
创建文件模块 707 , 用于创建至少一个数据断点文件。 写入模块 708 , 用于将用户需要监控的断点地址写入所述数据断点 文件中。 Create a file module 707 for creating at least one data breakpoint file. The write module 708 is configured to write a breakpoint address that the user needs to monitor into the data breakpoint file.
设置模块 709 , 用于根据所述数据断点文件中的断点地址在所述源 程序中设置数据断点。 具体的该优选的内容提供的创建文件模块 707如图 6所示的创建文 件模块 506 , 写入模块 708如图 6所示的写入模块 507 , 设置模块 709如 图 6所示的设置模块 508。 The setting module 709 is configured to set a data breakpoint in the source program according to a breakpoint address in the data breakpoint file. Specifically, the created file module 707 provided by the preferred content is created by the file module 506 as shown in FIG. 6, the writing module 708 is written by the writing module 507, and the setting module 709 is set by the setting module 508. .
具体的, 写入模块 708可以在该数据断点文件中写入要监控的断点 地址, 设置模块 709根据所述数据断点文件中的断点地址在所述源程序 中设置数据断点, 同样的, 写入模块 708 还可以将用户需要监控的断点 参数写入所述数据断点文件中; 设置模块 709根据所述断点参数到预先 设置的符号表中去查找相应的断点地址, 并根据所述断点地址在源程序 中设置数据断点。 Specifically, the writing module 708 can write a breakpoint address to be monitored in the data breakpoint file, and the setting module 709 sets a data breakpoint in the source program according to the breakpoint address in the data breakpoint file. Similarly, the write module 708 can also write the breakpoint parameter that the user needs to monitor into the data breakpoint file; the setting module 709 searches the preset symbol table according to the breakpoint parameter to find the corresponding breakpoint address. And set a data breakpoint in the source program according to the breakpoint address.
这样, 可以通过在该数据断点文件中写入要监控的断点值或地址,
以在源程序中相应位置处设置数据断点, 方便了用户使用。 进一步的, 写入模块 708还可以将用户需要监控的断点参数以及要 监控的断点参数的类型写入所述数据断点文件中; 设置模块 709根据所 述断点参数和所述断点参数的类型查找相应的断点地址, 并根据所述断 点地址在源程序中设置数据断点, 该断点参数的类型为: 可读类型, 可 写类型以及可读可写类型。 这样, 不仅可以通过在数据断点文件中写入要监控断点参数, 还可 以通过在该数据断点文件写入要监控的断点参数的类型, 以在源程序相 应位置处设置数据断点, 进一步方便了用户使用。 In this way, you can write the breakpoint value or address to be monitored in the data breakpoint file. It is convenient for the user to set the data breakpoint at the corresponding position in the source program. Further, the writing module 708 can also write the breakpoint parameter that the user needs to monitor and the type of the breakpoint parameter to be monitored into the data breakpoint file; the setting module 709 is configured according to the breakpoint parameter and the breakpoint The type of the parameter finds the corresponding breakpoint address, and sets a data breakpoint in the source program according to the breakpoint address. The type of the breakpoint parameter is: a readable type, a writable type, and a readable and writable type. In this way, not only can you write the breakpoint parameter to be monitored in the data breakpoint file, but you can also set the data breakpoint at the corresponding position of the source program by writing the type of the breakpoint parameter to be monitored in the data breakpoint file. , further convenient for users to use.
需要说明的是, 根据所述断点参数和所述断点参数的类型查找相应 的断点地址, 可以通过在相应表中查找相应的断点地址, 该过程为现有 技术, 此处不再赘述。 示例性的, 该表可以为操作系统中存储的符号表, 当该数据断点文 件写入断点参数和断点参数的类型后, 该数据断点文件会在符号表中查 找出符合该断点参数类型的断点参数的断点地址, 并根据该断点地址在 源程序中设置数据断点。 It should be noted that, according to the breakpoint parameter and the type of the breakpoint parameter, the corresponding breakpoint address is searched, and the corresponding breakpoint address can be found in the corresponding table. The process is prior art, and is no longer here. Narration. Exemplarily, the table may be a symbol table stored in an operating system. When the data breakpoint file writes a type of a breakpoint parameter and a breakpoint parameter, the data breakpoint file is found in the symbol table to match the break. The breakpoint address of the breakpoint parameter of the point parameter type, and the data breakpoint is set in the source program according to the breakpoint address.
更进一步的, 写入模块 708还可以将用户需要监控的断点参数以及 要监控的断点参数的范围写入所述数据断点文件中; 设置模块 709根据 所述断点参数和所述断点参数的范围查找相应的断点地址, 并根据所述 断点地址在所述源程序中设置数据断点。 这样, 不仅可以通过在数据断点文件中写入要监控的断点参数, 还 可以通过在该数据断点文件中写入要监控的断点参数的范围, 以在源程 序相应位置处设置数据断点, 又进一步的方便了用户的使用。 Further, the writing module 708 can also write the breakpoint parameter that the user needs to monitor and the range of the breakpoint parameter to be monitored into the data breakpoint file; the setting module 709 according to the breakpoint parameter and the break The range of point parameters finds the corresponding breakpoint address, and a data breakpoint is set in the source program according to the breakpoint address. In this way, not only can you write the breakpoint parameter to be monitored in the data breakpoint file, but also set the data at the corresponding position of the source program by writing the range of the breakpoint parameter to be monitored in the data breakpoint file. Breakpoints further facilitate the use of the user.
示例性的, 当该数据断点文件写入断点参数和要监控的断点参数范 围后, 该数据断点文件会在符号表中查找出符合该断点参数范围的断点 参数的断点地址, 并根据该断点地址在源程序中设置数据断点。 Exemplarily, when the data breakpoint file writes the breakpoint parameter and the range of the breakpoint parameter to be monitored, the data breakpoint file finds a breakpoint in the symbol table that meets the breakpoint parameter of the breakpoint parameter range. Address, and set data breakpoints in the source program based on the breakpoint address.
需要说明的是, 当数据断点文件只写入了上述内容的断点参数, 断 点地址, 断点参数的类型和断点参数范围中的任意一个或多个, 则其他 为默认值, 显然, 这样能够更加灵活的通过该数据断点文件在源程序中 设置数据断点。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局 限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可 轻易想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明 的保护范围应以所述权利要求的保护范围为准。
It should be noted that when the data breakpoint file only writes the breakpoint parameter of the above content, the breakpoint address, the type of the breakpoint parameter, and any one or more of the breakpoint parameter ranges, the others are default values, obviously This makes it more flexible to set data breakpoints in the source program through the data breakpoint file. The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the present invention. It should be covered by the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the appended claims.
Claims
1、 一种实现经过性数据断点的方法, 应用在运行有源程序的 Linux ARM或 Unix ARM系统中, 所述源程序中设置有至少一个数据断点; 其 特征在于, 所述方法包括: A method for implementing a transitive data breakpoint, which is applied to a Linux ARM or Unix ARM system running an active program, wherein the source program is provided with at least one data breakpoint; wherein the method comprises:
当所述源程序运行到设置有数据断点的指令处时, 取消所述数据断 点; The data breakpoint is canceled when the source program runs to an instruction set with a data breakpoint;
对所述设置有数据断点的指令进行解码; Decoding the instruction with the data breakpoint set;
执行所述解码后的指令; Executing the decoded instruction;
重新在所述设置有数据断点的指令处设定数据断点; Resetting the data breakpoint at the instruction with the data breakpoint set;
将程序计数器 PC 指针指向所述设置有数据断点的指令的下一条指 令, 其中, 所述程序计数器 PC指针用于存放将要执行的下一条指令的地 址。 The program counter PC pointer is directed to the next instruction of the instruction set with a data breakpoint, wherein the program counter PC pointer is used to store the address of the next instruction to be executed.
2、 根据权利要去 1所述的方法, 其特征在于, 还包括: 2. The method of claim 1, further comprising:
创建至少一个数据断点文件,所述数据断点文件用于记录要监控的断 点的信息。 At least one data breakpoint file is created, the data breakpoint file being used to record information about the breakpoint to be monitored.
3、 根据权利要求 2所述的方法, 其特征在于, 还包括: 3. The method according to claim 2, further comprising:
将用户需要监控的断点地址写入所述数据断点文件中; Write a breakpoint address that the user needs to monitor into the data breakpoint file;
根据所述数据断点文件中的断点地址在所述源程序中设置数据断点。 A data breakpoint is set in the source program based on a breakpoint address in the data breakpoint file.
4、 根据权利要求 2所述的方法, 其特征在于, 还包括: 4. The method according to claim 2, further comprising:
将用户需要监控的断点参数写入所述数据断点文件中; Write a breakpoint parameter that the user needs to monitor into the data breakpoint file;
根据所述断点参数到预先设置的符号表中去查找相应的断点地址,并 根据所述断点地址在源程序中设置数据断点。 And searching for a corresponding breakpoint address according to the breakpoint parameter to a preset symbol table, and setting a data breakpoint in the source program according to the breakpoint address.
5、 根据权利要 2所述的方法, 其特征在于, 还包括: 5. The method of claim 2, further comprising:
将用户需要监控的断点参数以及要监控的断点参数的类型写入所述 数据断点文件中; Write the breakpoint parameter that the user needs to monitor and the type of the breakpoint parameter to be monitored into the data breakpoint file;
根据所述断点参数和所述断点参数的类型查找相应的断点地址,并根 据所述断点地址在源程序中设置数据断点。 Finding a corresponding breakpoint address according to the breakpoint parameter and the type of the breakpoint parameter, and setting a data breakpoint in the source program according to the breakpoint address.
6、 根据权利要求 2所述的方法, 其特征在于, 还包括: 6. The method according to claim 2, further comprising:
将用户需要监控的断点参数以及要监控的断点参数的范围写入所述 数据断点文件中; Write the breakpoint parameter that the user needs to monitor and the range of the breakpoint parameter to be monitored into the data breakpoint file;
根据所述断点参数和所述断点参数的范围查找相应的断点地址,并根 据所述断点地址在所述源程序中设置数据断点。
And searching for a corresponding breakpoint address according to the range of the breakpoint parameter and the breakpoint parameter, and setting a data breakpoint in the source program according to the breakpoint address.
7、 一种实现经过性数据断点的方法, 应用在运行有源程序的 Linux ARM或 Unix ARM系统中; 所述源程序中设置有至少一个数据断点; 其 特征在于, 所述方法包括: A method for implementing a transitive data breakpoint, which is applied to a Linux ARM or Unix ARM system running an active program; the source program is provided with at least one data breakpoint; and the method includes:
当所述源程序运行到设置有数据断点的指令处时, 取消所述数据断 点; The data breakpoint is canceled when the source program runs to an instruction set with a data breakpoint;
备份所述设置有数据断点的指令的下一条指令, 作为备份指令; 将所述设置有数据断点的指令的下一条指令修改为非法指令; 执行所述设置有数据断点的指令以及所述修改后的下一条指令; 恢复所述设置有数据断点的指令处的数据断点; Backing up the next instruction of the instruction with the data breakpoint as the backup instruction; modifying the next instruction of the instruction with the data breakpoint as an illegal instruction; executing the instruction and the data breakpoint setting Describe the modified next instruction; recover the data breakpoint at the instruction with the data breakpoint set;
将所述修改后的下一条指令恢复为所述备份指令。 The modified next instruction is restored to the backup instruction.
8、 根据权利要求 7所述的实现经过性数据断点的方法, 其特征在于, 还包括: The method for implementing a transitive data breakpoint according to claim 7, further comprising:
创建至少一个数据断点文件,所述数据断点文件用于记录要监控的断 点的信息。 At least one data breakpoint file is created, the data breakpoint file being used to record information about the breakpoint to be monitored.
9、 根据权利要求 8所述的实现经过性数据断点的方法, 其特征在于, 还包括: The method for implementing a transitive data breakpoint according to claim 8, further comprising:
将用户需要监控的断点地址写入所述数据断点文件中; Write a breakpoint address that the user needs to monitor into the data breakpoint file;
根据所述数据断点文件中的断点地址在所述源程序中设置数据断点。 A data breakpoint is set in the source program based on a breakpoint address in the data breakpoint file.
10、根据权利要求 8所述的实现经过性数据断点的方法,其特征在于, 还包括: The method for implementing a transitive data breakpoint according to claim 8, further comprising:
将用户需要监控的断点参数写入所述数据断点文件中; Write a breakpoint parameter that the user needs to monitor into the data breakpoint file;
根据所述断点参数到预先设置的符号表中去查找相应的断点地址,并 根据所述断点地址在源程序中设置数据断点。 And searching for a corresponding breakpoint address according to the breakpoint parameter to a preset symbol table, and setting a data breakpoint in the source program according to the breakpoint address.
11、根据权利要求 8所述的实现经过性数据断点的方法,其特征在于, 还包括: The method for implementing a transitive data breakpoint according to claim 8, further comprising:
将用户需要监控的断点参数以及要监控的断点参数的类型写入所述 数据断点文件中; Write the breakpoint parameter that the user needs to monitor and the type of the breakpoint parameter to be monitored into the data breakpoint file;
根据所述断点参数和所述断点参数的类型查找相应的断点地址,并根 据所述断点地址在源程序中设置数据断点。 Finding a corresponding breakpoint address according to the breakpoint parameter and the type of the breakpoint parameter, and setting a data breakpoint in the source program according to the breakpoint address.
12、根据权利要求 8所述的实现经过性数据断点的方法,其特征在于, 还包括: The method for implementing a transitive data breakpoint according to claim 8, further comprising:
将用户需要监控的断点参数以及要监控的断点参数的范围写入所述
数据断点文件中; Write the breakpoint parameters that the user needs to monitor and the range of breakpoint parameters to be monitored. Data breakpoint file;
根据所述断点参数和所述断点参数的范围查找相应的断点地址,并根 据所述断点地址在所述源程序中设置数据断点。 And searching for a corresponding breakpoint address according to the range of the breakpoint parameter and the breakpoint parameter, and setting a data breakpoint in the source program according to the breakpoint address.
13、 一种通信系统, 所述通信系统包括内存和至少一个 CPU; 13. A communication system, the communication system comprising a memory and at least one CPU;
所述 CPU 中运行有操作系统, 所述操作系统之上运行有至少一种应 序; 所述内存中载入有所述源程序和所述异常处理程序, 所述源程序中设 置有至少一个数据断点, 当所述源程序运行到具有数据断点的指令处时触 发所述异常处理程序, 其特征在于, 所述异常处理程序还用于, An operating system is run in the CPU, and at least one sequence is run on the operating system; the source program and the exception handling program are loaded in the memory, and at least one of the source programs is set a data breakpoint, the exception handler is triggered when the source program runs to an instruction having a data breakpoint, wherein the exception handler is further configured to:
当所述源程序运行到设置有数据断点的指令处时, 取消所述数据断 点; The data breakpoint is canceled when the source program runs to an instruction set with a data breakpoint;
对所述设置有数据断点的指令进行解码; Decoding the instruction with the data breakpoint set;
执行所述解码后的指令; Executing the decoded instruction;
重新在所述设置有数据断点的指令处设定数据断点; Resetting the data breakpoint at the instruction with the data breakpoint set;
将程序计数器 PC 指针指向所述设置有数据断点的指令的下一条指 令, 其中, 所述程序计数器 PC指针用于存放将要执行的下一条指令的地 址。 The program counter PC pointer is directed to the next instruction of the instruction set with a data breakpoint, wherein the program counter PC pointer is used to store the address of the next instruction to be executed.
14、 根据权利要求 13所述的通信系统, 其特征在于, 所述异常处理 程序还用于, 14. The communication system according to claim 13, wherein the exception handling program is further configured to:
创建至少一个数据断点文件;将用户需要监控的断点地址写入所述数 据断点文件中; Creating at least one data breakpoint file; writing a breakpoint address that the user needs to monitor into the data breakpoint file;
根据所述数据断点文件中的断点地址在所述源程序中设置数据断点。 A data breakpoint is set in the source program based on a breakpoint address in the data breakpoint file.
15、 一种通信系统, 其特征在于, 所述通信系统包括内存和至少一个15. A communication system, characterized in that said communication system comprises a memory and at least one
CPU; CPU;
所述 CPU 中运行有操作系统, 所述操作系统之上运行有至少一种应 序; 所述内存中载入有所述源程序和所述异常处理程序, 所述源程序中设 置有至少一个数据断点, 当所述源程序运行到具有数据断点的指令处时触 发异常处理程序, 其特征在于, 所述异常处理程序还用于, An operating system is run in the CPU, and at least one sequence is run on the operating system; the source program and the exception handling program are loaded in the memory, and at least one of the source programs is set a data breakpoint, triggering an exception handler when the source program runs to an instruction having a data breakpoint, wherein the exception handler is further configured to:
当所述源程序运行到设置有数据断点的指令处时, 取消所述数据断 点;
备份所述设置有数据断点的指令的下一条指令, 作为备份指令; 将所述设置有数据断点的指令的下一条指令修改为非法指令; 执行所述设置有数据断点的指令以及所述修改后的下一条指令; 恢复所述设置有数据断点的指令处的数据断点; Deactivating the data breakpoint when the source program runs to an instruction set with a data breakpoint; Backing up the next instruction of the instruction with the data breakpoint as the backup instruction; modifying the next instruction of the instruction with the data breakpoint as an illegal instruction; executing the instruction and the data breakpoint setting Describe the modified next instruction; recover the data breakpoint at the instruction with the data breakpoint set;
将所述修改后的下一条指令恢复为所述备份指令。 The modified next instruction is restored to the backup instruction.
16、 根据权利要求 15所述的通信系统, 其特征在于, 所述异常处理 程序还用于, The communication system according to claim 15, wherein said exception handling program is further configured to:
创建至少一个数据断点文件;将用户需要监控的断点地址写入所述数 据断点文件中; Creating at least one data breakpoint file; writing a breakpoint address that the user needs to monitor into the data breakpoint file;
根据所述数据断点文件中的断点地址在所述源程序中设置数据断点。 A data breakpoint is set in the source program based on a breakpoint address in the data breakpoint file.
17、 一种实现经过性数据断点的装置, 应用在运行有源程序的 Linux ARM或 Unix ARM系统中, 所述源程序中设置有至少一个数据断点, 其 特征在于, 所述经过性数据断点的装置包括: 17. A device for implementing a transitive data breakpoint, in a Linux ARM or Unix ARM system running an active program, wherein the source program is provided with at least one data breakpoint, wherein the transitive data Breakpoint devices include:
第一取消模块, 用于当所述源程序运行到设置有数据断点的指令处 时, 取消所述数据断点; a first canceling module, configured to cancel the data breakpoint when the source program runs to an instruction set with a data breakpoint;
解码模块, 用于对所述设置有数据断点的指令进行解码; a decoding module, configured to decode the instruction with a data breakpoint set;
第一执行模块, 用于执行所述解码后的指令; a first execution module, configured to execute the decoded instruction;
设定模块, 用于重新在所述设置有数据断点的指令处设定数据断点; 指向模块, 用于将程序计数器 PC指针指向所述设置有数据断点的指 令的下一条指令, 其中, 所述程序计数器 PC指针用于存放将要执行的下 一条指令的地址。 a setting module, configured to re-set a data breakpoint at the instruction with the data breakpoint set; a pointing module, configured to point the program counter PC pointer to the next instruction of the instruction with the data breakpoint set, where The program counter PC pointer is used to store the address of the next instruction to be executed.
18、 根据权利要求 17所述的实现经过性数据断点的装置, 其特征在 于, 所述实现经过性数据断点的装置还包括: The device for implementing a transitive data breakpoint according to claim 17, wherein the means for implementing the transitive data breakpoint further comprises:
创建文件模块, 用于创建至少一个数据断点文件; Creating a file module for creating at least one data breakpoint file;
写入模块, 用于将用户需要监控的断点地址写入所述数据断点文件 中; a write module, configured to write a breakpoint address that the user needs to monitor into the data breakpoint file;
设置模块,用于根据所述数据断点文件中的断点地址在所述源程序中 设置数据断点。 And a setting module, configured to set a data breakpoint in the source program according to a breakpoint address in the data breakpoint file.
19、 一种实现经过性数据断点的装置, 应用在运行有源程序的 Linux ARM或 Unix ARM系统中; 所述源程序中设置有至少一个数据断点, 其 特征在于, 所述经过性数据断点的装置包括: 19. A device for implementing a transitive data breakpoint, applied to a Linux ARM or Unix ARM system running an active program; wherein the source program is provided with at least one data breakpoint, wherein the transitive data Breakpoint devices include:
第二取消模块, 用于当所述源程序运行到设置有数据断点的指令处
时, 取消所述数据断点; a second canceling module, configured to: when the source program runs to an instruction set with a data breakpoint When the data breakpoint is canceled;
备份模块, 用于备份所述设置有数据断点的指令的下一条指令, 作为 备份指令; a backup module, configured to back up the next instruction of the instruction with a data breakpoint as a backup instruction;
修改模块,用于将所述设置有数据断点的指令的下一条指令修改为非 法指令; a modifying module, configured to modify the next instruction of the instruction with the data breakpoint to be an illegal instruction;
第二执行模块,用于执行所述设置有数据断点的指令以及所述修改后 的下一条指令; a second execution module, configured to execute the instruction with a data breakpoint and the modified next instruction;
恢复模块, 用于恢复所述设置有数据断点的指令处的数据断点; 替换模块, 用于将所述修改后的下一条指令恢复为所述备份指令。 And a recovery module, configured to restore the data breakpoint at the instruction with the data breakpoint set; and a replacement module, configured to restore the modified next instruction to the backup instruction.
20、 根据权利要求 19所述的实现经过性数据断点的装置, 其特征在 于, 所述实现经过性数据断点的装置还包括: The device for implementing a transitive data breakpoint according to claim 19, wherein the means for implementing the transitive data breakpoint further comprises:
创建文件模块, 用于创建至少一个数据断点文件; Creating a file module for creating at least one data breakpoint file;
写入模块, 用于将用户需要监控的断点地址写入所述数据断点文件 中; a write module, configured to write a breakpoint address that the user needs to monitor into the data breakpoint file;
设置模块, 用于根据所述数据断点文件中的断点地址在所述源程序中 设置数据断点。
And a setting module, configured to set a data breakpoint in the source program according to a breakpoint address in the data breakpoint file.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210112766.X | 2012-04-17 | ||
CN201210112766.XA CN102662845B (en) | 2012-04-17 | 2012-04-17 | A kind of method, Apparatus and system realized through property data breakpoint |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2013155822A1 true WO2013155822A1 (en) | 2013-10-24 |
Family
ID=46772342
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2012/083108 WO2013155822A1 (en) | 2012-04-17 | 2012-10-17 | Method, device and system for realizing pass-by data breakpoint |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN102662845B (en) |
WO (1) | WO2013155822A1 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102662845B (en) * | 2012-04-17 | 2016-03-30 | 华为技术有限公司 | A kind of method, Apparatus and system realized through property data breakpoint |
CN103019865B (en) * | 2012-12-28 | 2015-07-15 | 北京神州绿盟信息安全科技股份有限公司 | Virtual machine monitoring method and system |
CN104461806A (en) * | 2013-09-16 | 2015-03-25 | 中兴通讯股份有限公司 | Data breakpoint monitoring method and device and debugger |
CN115878363A (en) * | 2023-02-02 | 2023-03-31 | 北京紫光芯能科技有限公司 | Method, apparatus and computer readable storage medium for resolving processor exceptions |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2557688A1 (en) * | 2006-08-30 | 2008-02-29 | Research In Motion Limited | System and method for implementing software breakpoints in an interpreter |
CN101339581A (en) * | 2008-08-29 | 2009-01-07 | 北京中星微电子有限公司 | Embedded system on-line debugging emulation method based on communication interruption |
CN102214137A (en) * | 2010-04-06 | 2011-10-12 | 华为技术有限公司 | Debugging method and debugging equipment |
CN102662845A (en) * | 2012-04-17 | 2012-09-12 | 华为技术有限公司 | Method, device and system for realizing pass-by data breakpoint |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101154183B (en) * | 2006-09-29 | 2011-12-28 | 上海海尔集成电路有限公司 | Microcontroller built-in type on-line simulation debugging system |
CN102096629B (en) * | 2009-12-14 | 2013-09-25 | 华为技术有限公司 | Method and device for setting pass-by breakpoint and method and device for debugging pass-by breakpoint |
-
2012
- 2012-04-17 CN CN201210112766.XA patent/CN102662845B/en not_active Expired - Fee Related
- 2012-10-17 WO PCT/CN2012/083108 patent/WO2013155822A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2557688A1 (en) * | 2006-08-30 | 2008-02-29 | Research In Motion Limited | System and method for implementing software breakpoints in an interpreter |
CN101339581A (en) * | 2008-08-29 | 2009-01-07 | 北京中星微电子有限公司 | Embedded system on-line debugging emulation method based on communication interruption |
CN102214137A (en) * | 2010-04-06 | 2011-10-12 | 华为技术有限公司 | Debugging method and debugging equipment |
CN102662845A (en) * | 2012-04-17 | 2012-09-12 | 华为技术有限公司 | Method, device and system for realizing pass-by data breakpoint |
Also Published As
Publication number | Publication date |
---|---|
CN102662845A (en) | 2012-09-12 |
CN102662845B (en) | 2016-03-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10761966B2 (en) | Generating program analysis data for analysing the operation of a computer program | |
Long et al. | Automatic runtime error repair and containment via recovery shepherding | |
Saito | Jockey: a user-space library for record-replay debugging | |
US10331545B2 (en) | Debugging system | |
Srinivasan et al. | Flashback: A lightweight extension for rollback and deterministic replay for software debugging | |
US9268666B2 (en) | System and method for debugging of computer programs | |
US8261243B2 (en) | Selective execution of trace mechanisms for applications having different bit structures | |
WO2012016438A1 (en) | Debugger and debugging method thereof | |
US11366740B2 (en) | Debugging shared memory errors | |
US10599541B2 (en) | Efficient breakpoint detection via caches | |
O'Callahan et al. | Engineering record and replay for deployability: Extended technical report | |
WO2013155822A1 (en) | Method, device and system for realizing pass-by data breakpoint | |
Shields | Anti-debugging–a developers view | |
Dovgalyuk et al. | Don't panic: reverse debugging of kernel drivers | |
EP2600252B1 (en) | System and method for debugging of computer programs | |
Gao et al. | Debugging classification and anti-debugging strategies | |
Holl et al. | Kernel-assisted debugging of linux applications | |
Dolev et al. | Stabilization enabling technology | |
Cagnin | LLDBagility: practical macOS kernel debugging | |
Leija | Leveraging System Call Interposition for Low-Level Process Manipulation | |
Gerhorst | Flexible and Low-Overhead System-Call Aggregation using BPF | |
Sharma et al. | Hardware trace reconstruction of runtime compiled code | |
Mistry et al. | Imitate: Recording multi-threaded programs for trace analysis and deterministic replay | |
Kedia | Efficient deterministic replay through dynamic binary translation | |
Joshi | Analysis and Debugging of OEM's |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 12874527 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 12874527 Country of ref document: EP Kind code of ref document: A1 |