@@ -16,18 +16,27 @@ def test_disassemble(self):
1616 program = self .getBuildArtifact ("a.out" )
1717 self .build_and_launch (program )
1818 source = "main.c"
19- self .set_source_breakpoints (source , [line_number (source , "// breakpoint 1" )])
19+ bp_line_no = line_number (source , "// breakpoint 1" )
20+ self .set_source_breakpoints (source , [bp_line_no ])
2021 self .continue_to_next_stop ()
2122
2223 insts_with_bp , pc_with_bp_assembly = self .disassemble (frameIndex = 0 )
24+ self .assertIn ("location" , pc_with_bp_assembly , "Source location missing." )
25+ self .assertEqual (
26+ pc_with_bp_assembly ["line" ], bp_line_no , "Expects the same line number"
27+ )
2328 no_bp = self .set_source_breakpoints (source , [])
24- self .assertEqual (len (no_bp ), 0 , "expect no breakpoints." )
29+ self .assertEqual (len (no_bp ), 0 , "Expects no breakpoints." )
2530 self .assertIn (
2631 "instruction" , pc_with_bp_assembly , "Assembly instruction missing."
2732 )
2833
29- # the disassembly instructions should be the same even if there is a breakpoint;
3034 insts_no_bp , pc_no_bp_assembly = self .disassemble (frameIndex = 0 )
35+ self .assertIn ("location" , pc_no_bp_assembly , "Source location missing." )
36+ self .assertEqual (
37+ pc_with_bp_assembly ["line" ], bp_line_no , "Expects the same line number"
38+ )
39+ # the disassembly instructions should be the same with breakpoint and no breakpoint;
3140 self .assertDictEqual (
3241 insts_with_bp ,
3342 insts_no_bp ,
0 commit comments