IP Library Granted Patent US 8,555,256
Granted Patent B2
US 8,555,256 · App. 13/523,279 · Granted Oct 8, 2013

Pass-by breakpoint setting and debugging method and device

Inventors: Xiangbin Liu (Shenzhen, CN); Luoying Yin (Shenzhen, CN); Sen Zhang (Shenzhen, CN)
Assignee: Huawei Technologies, Co., Ltd.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,555,256
App. No.
13/523,279
Granted
Oct 8, 2013
Kind
B2
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.

Claims (39)

1. 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.

2. The method according to claim 1 , wherein storing the relative jump instruction and the instruction next to the relative jump instruction in the instruction duplicate comprises one of:

storing the instruction directly prior to the instruction at the breakpoint, the instruction at the breakpoint and the instruction next to the instruction at the breakpoint in the instruction duplicate; or

storing the instruction directly prior to the instruction at the breakpoint and the instruction at the breakpoint in the instruction duplicate in a case that the instruction directly prior to the instruction at the breakpoint is the relative jump instruction; or

storing the instruction at the breakpoint and the instruction next to the instruction at the breakpoint in the instruction duplicate in a case that the instruction at the breakpoint is the relative jump instruction.

3. The method according to claim 2 , wherein setting an instruction duplicate further comprises one of:

setting a third valid instruction next to the instruction at the breakpoint in the instruction duplicate as a third abnormal instruction in a case that the instruction duplicate comprises the instruction next to the instruction at the breakpoint; or

setting a second valid instruction next to the instruction at the breakpoint in the instruction duplicate as a third abnormal instruction in a case that the instruction duplicate does not comprise the instruction next to the instruction at the breakpoint.

4. The method according to claim 1 , further comprising:

setting an instruction duplicate for the instruction at the breakpoint in a case that none of the instruction at the breakpoint and the instruction directly prior to the instruction at the breakpoint is the relative jump instruction,

wherein setting an instruction duplicate for the instruction at the breakpoint comprises: storing the instruction at the breakpoint in the instruction duplicate, and setting a valid instruction next to the instruction at the breakpoint in the instruction duplicate as a second abnormal instruction.

5. The method according to claim 1 , wherein the breakpoint setting command comprises a breakpoint position information, or comprises a breakpoint position information and a breakpoint attribute information, the breakpoint attribute information including one or more of a condition for obtaining site information, a condition for outputting site information, information as to whether a task should be suspended after a breakpoint causes an abnormality, and output path information of site information.

6. 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.

7. The device according to claim 6 , wherein the first setting module comprises:

a determining sub-module that determines whether one of the instruction at the breakpoint and the instruction directly prior to the instruction at the breakpoint is a relative jump instruction; and

a first setting sub-module that sets an instruction duplicate for the instruction directly prior to the instruction at the breakpoint, the instruction at the breakpoint and the instruction next to the instruction at the breakpoint in a case that the determining sub-module determines that one of the instruction at the breakpoint and the instruction directly prior to the instruction at the breakpoint is the relative jump instruction, and setting the instruction at the breakpoint in the source program code as a first abnormal instruction; or

a second setting sub-module that sets an instruction duplicate for the instruction directly prior to the instruction at the breakpoint and the instruction at the breakpoint in a case that the determining sub-module determines that the instruction directly prior to the instruction at the breakpoint is the relative jump instruction, and setting the instruction at the breakpoint in the source program code as a first abnormal instruction; or

a third setting sub-module that sets an instruction duplicate for the instruction at the breakpoint and the instruction next to the instruction at the breakpoint in a case that the determining sub-module determines that the instruction at the breakpoint is the relative jump instruction, and setting the instruction at the breakpoint in the source program code as a first abnormal instruction.

8. The device according to claim 7 , wherein

the operation for the first setting sub-module or the third setting sub-module to set an instruction duplicate further comprises setting a third valid instruction next to the instruction at the breakpoint in the instruction duplicate as a third abnormal instruction; or

the operation for the second setting sub-module to set an instruction duplicate further comprises setting a second valid instruction next to the instruction at the breakpoint in the instruction duplicate as a third abnormal instruction.

9. The device according to claim 7 , wherein the first setting module further comprises a fourth setting sub-module that sets an instruction duplicate for the instruction at the breakpoint in a case that none of the instruction at the breakpoint and the instruction directly prior to the instruction at the breakpoint is the relative jump instruction, and

setting an instruction duplicate for the instruction at the breakpoint comprises storing the instruction at the breakpoint in the instruction duplicate, and setting a valid instruction next to the instruction at the breakpoint in the instruction duplicate as a second abnormal instruction.

10. 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.

11. The apparatus according to claim 10 , wherein

the pass-by breakpoint setting device is further used to set a third valid instruction next to the instruction at the breakpoint in the instruction duplicate as a third abnormal instruction in a case that the instruction duplicate comprises the instruction next to the instruction at the breakpoint, setting a second valid instruction next to the instruction at the breakpoint in the instruction duplicate as a third abnormal instruction in a case that the instruction duplicate does not comprise the instruction next to the instruction at the breakpoint, and

the pass-by breakpoint debugging device is further used to instruct to execute a third instruction next to the instruction at the breakpoint in the source program code if it is determined that the breakpoint abnormality is caused by a third abnormal instruction.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 10, 2022
From: HUAWEI TECHNOLOGIES CO., LTD.
To: XFUSION DIGITAL TECHNOLOGIES CO., LTD.
Reel/Frame 058682/0312 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 4, 2013
From: LIU, XIANGBIN; YIN, LUOYING; ZHANG, SEN
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 031134/0894 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 14, 2012
From: LIU, XIANGBIN; YIN, LUOYING; ZHANG, SEN
To: HISILICON TECHNOLOGIES CO., LTD.
Reel/Frame 028377/0929 →
Priority Claims (1)
CN 2009 1 0242373 · Dec 14, 2009 · national
Continuity (2)
Continuation PCTCH2010078866 · Nov 18, 2010
Related Publication 20120254666A1 · Oct 4, 2012