Debugger write interceptor
AssigneeRed Hat, Inc.
InventorsMartin Vecera, Jiri Pechanec
Life of this patent
Estimating the term…
Abstract
Methods, systems, and computer program products are included for executing one or more instructions of a program in a debugging session; receiving a command at a debugger, the command comprising an expression for the debugger to evaluate in the debugging session; evaluating the expression, at least in part by the debugger, the evaluating including attempting to perform a write operation to write a data value to a target; preventing the data value from being written to the target; and outputting, by the debugger, a result of the evaluating.
Claims18
A computer-implemented method for performing debugging of an application, the method comprising:
- executing one or more instructions of a program in a debugging session;
- receiving a command at a debugger, the command comprising an expression for the debugger to evaluate in the debugging session;
- evaluating the expression, at least in part by the debugger, the evaluating including attempting to perform a write operation to write a data value to a target;
- identifying, by the write operation, a memory page as the target;
- with a write interceptor, preventing the data value from being written to the target, the write interceptor being triggered by the debugger, wherein the write interceptor is structured as an extension of the debugger;
- copying contents of the memory page to a second memory page;
- writing the data value to the second memory page, the writing of the data value to the second memory page occurring during the evaluating of the expression;
- reading the data value from the second memory page;
- discarding the second memory page after the expression is evaluated;
- and
- outputting, by the debugger, a result of the evaluating.
A non-transitory computer-readable medium, comprising computer-readable instructions for debugging an application, the computer-readable instructions executable by a processor to cause the processor to:
- create a process for debugging a program, the process to execute instructions of the program;
- protect a target from being written to by the process;
- evaluate an expression, the evaluating including executing a write instruction corresponding to the process, wherein the write instruction identifies a data value to write to the target;
- identify, by the write instruction, a memory page as the target;
- with a write interceptor, prevent the data value from being written to the target, the write interceptor being triggered by the debugger, wherein the write interceptor that is structured as an extension of the debugger;
- receive a signal corresponding to the executing of the write instruction, the signal identifying that the process attempted to write to the target;
- copy contents of the memory page to a second memory page;
- write the data value to the second memory page, the writing of the data value to the second memory page occurring during the evaluating of the expression;
- read the data value from the second memory page;
- discard the second memory page after the expression is evaluated;
- and
- output, by the debugger, a result of the evaluating.
A system comprising:
- a processor and a memory;
- a debugger stored in the memory, the debugger executed by the processor to debug a program;
- a write interceptor that is structured as an extension of the debugger, the write interceptor to:
- during an expression evaluation by the debugger, detect an attempt to write a data value to a target, wherein the write is attempted by a process corresponding to the program;
- prevent the data value from being written to the target by the process, the write interceptor being triggered by the debugger;
- copy content of the target to an alternate target;
- write the data value to the alternate target, the writing of the data value to the second memory page occurring during the expression evaluation;
- access the data value at the alternate target to evaluate the expression;
- and
- discard the alternate target after the expression is evaluated.
Dependencies are inferred from the claim text.