Pass-by breakpoint setting and debugging method and device
AssigneeHuawei Technologies Co., Ltd.
InventorsXiangbin Liu, Luoying Yin, Sen Zhang
Life of this patent
Estimating the term…
Abstract
A method and device for pass-by breakpoint setting and debugging. The pass-by breakpoint setting method comprises: receiving a breakpoint setting command; determining an instruction at a breakpoint in a source program code according to the breakpoint setting command; if one of the instruction at the breakpoint and an instruction prior to the instruction at the breakpoint is a relative jump instruction, setting an instruction duplicate, and setting the instruction at the breakpoint in the source program code as a first abnormal instruction.
Claims11
A processor-implemented pass-by breakpoint setting and debugging method, comprising:
- receiving a breakpoint setting command;
- determining an instruction at a breakpoint in a source program code according to the breakpoint setting command;
- if one of the instruction at the breakpoint and an instruction directly prior to the instruction at the breakpoint is a relative jump instruction, setting an instruction duplicate for the relative jump instruction and an instruction next to the relative jump instruction, and setting the instruction at the breakpoint in the source program code as a first abnormal instruction,
- wherein setting an instruction duplicate comprises:
- storing the relative jump instruction and the instruction next to the relative jump instruction in the instruction duplicate, a jump relative offset of the relative jump instruction in the instruction duplicate being set according to a storage position of an absolute jump instruction in the instruction duplicate, a jump absolute offset of the absolute jump instruction being an original jump relative offset of the relative jump instruction, setting a second valid instruction next to the relative jump instruction in the instruction duplicate as a second abnormal instruction, and setting an instruction next to the absolute jump instruction as an invalid instruction;
- and determining an abnormal instruction that causes a breakpoint abnormality, and obtaining and outputting a site information of the breakpoint abnormality.
A pass-by breakpoint setting and debugging device having a processor, comprising:
- a receiving module that receives a breakpoint setting command;
- a determining module that determines an instruction at a breakpoint in a source program code according to the breakpoint setting command;
- a first setting module that sets, if one of the instruction at the breakpoint and an instruction directly prior to the instruction at the breakpoint is a relative jump instruction, an instruction duplicate for the relative jump instruction and an instruction next to the relative jump instruction, and setting the instruction at the breakpoint in the source program code as a first abnormal instruction;
- wherein setting an instruction duplicate comprises:
- storing the relative jump instruction and the instruction next to the relative jump instruction in the instruction duplicate, a jump relative offset of the relative jump instruction in the instruction duplicate being set according to a storage position of an absolute jump instruction in the instruction duplicate, a jump absolute offset of the absolute jump instruction being an original jump relative offset of the relative jump instruction, setting a second valid instruction next to the relative jump instruction in the instruction duplicate as a second abnormal instruction, and setting an instruction next to the absolute jump instruction as an invalid instruction;
- and
- a pass-by break point debugging module that determines an abnormal instruction that causes a breakpoint abnormality, and obtaining and outputting a site information of the breakpoint abnormality.
A program debugging apparatus having a processor, comprising:
- a pass-by breakpoint setting device that receives a breakpoint setting command, determining an instruction at a breakpoint in a source program code according to the breakpoint setting command, if one of the instruction at the breakpoint and an instruction directly prior to the instruction at the breakpoint is a relative jump instruction, setting an instruction duplicate for the relative jump instruction and an instruction next to the relative jump instruction, and setting the instruction at the breakpoint in the source program code as a first abnormal instruction, wherein setting the instruction duplicate comprises:
- storing the relative jump instruction and the instruction next to the relative jump instruction in the instruction duplicate, a jump relative offset of the relative jump instruction in the instruction duplicate being set according to a storage position of an absolute jump instruction in the instruction duplicate, a jump absolute offset of the absolute jump instruction being an original jump relative offset of the relative jump instruction, setting a second valid instruction next to the relative jump instruction in the instruction duplicate as a second abnormal instruction, and setting an instruction next to the absolute jump instruction as an invalid instruction;
- and
- a pass-by breakpoint debugging device that determines an abnormal instruction that causes a breakpoint abnormality, obtaining and outputting a site information of the breakpoint abnormality if the breakpoint abnormality is caused by a first abnormal instruction, instructing to execute an instruction directly prior to an instruction at the breakpoint in an instruction duplicate when the breakpoint abnormality is occurred in a delay slot, and instructing to execute the instruction at the breakpoint in the instruction duplicate when the breakpoint abnormality is not occurred in the delay slot, and if the breakpoint abnormality is caused by a second abnormal instruction, instructing to execute an instruction next to the instruction at the breakpoint in source program code when the breakpoint abnormality is occurred in the delay slot, and instructing to execute a second instruction next to the instruction at the breakpoint in the source program code when the breakpoint abnormality is not occurred in the delay slot.
Dependencies are inferred from the claim text.