@@ -1488,7 +1488,7 @@ func (d *Debugger) traverse(t proc.ValidTargets, f *proc.Function, depth int, fo
14881488 if err != nil {
14891489 return false , fmt .Errorf ("failed to disassemble instruction: %w" , err )
14901490 }
1491-
1491+
14921492 // Extract address from the decoded instruction's destination location
14931493 var addr uint64
14941494 if len (disasm ) > 0 && disasm [0 ].DestLoc != nil {
@@ -1516,9 +1516,9 @@ func (d *Debugger) traverse(t proc.ValidTargets, f *proc.Function, depth int, fo
15161516 }
15171517 return false , nil
15181518 }
1519- for _ , dynbrklet_i := range dynbp .Breaklets {
1520- dynbrklet_i .SetCallBack (dynCallback )
1521- }
1519+ for _ , dynbrklet_i := range dynbp .Breaklets {
1520+ dynbrklet_i .SetCallBack (dynCallback )
1521+ }
15221522 }
15231523
15241524 if instr .IsCall () && instr .DestLoc != nil && instr .DestLoc .Fn != nil {
@@ -1545,9 +1545,9 @@ func createFnTracepoint(d *Debugger, fname string, rootstr string, followCalls i
15451545
15461546 tbp , err1 := d .createBreakpointInternal (& api.Breakpoint {FunctionName : fname , Tracepoint : true , RootFuncName : rootstr , Stacktrace : 20 , TraceFollowCalls : followCalls }, "" , nil , false )
15471547 if tbp == nil {
1548- if err1 != nil && strings .Contains (err1 .Error (), "Breakpoint exists" ) {
1548+ if _ , exists := err1 .(proc. BreakpointExistsError ); exists { // ; err1 != nil && strings.Contains(err1.Error(), "Breakpoint exists") {
15491549 // This is expected
1550- } else {
1550+ } else if err1 != nil {
15511551 return nil , fmt .Errorf ("error creating breakpoint at function %s" , fname )
15521552 }
15531553 }
@@ -1556,7 +1556,7 @@ func createFnTracepoint(d *Debugger, fname string, rootstr string, followCalls i
15561556 for i := range raddrs {
15571557 rtbp , err := d .createBreakpointInternal (& api.Breakpoint {Addr : raddrs [i ], TraceReturn : true , RootFuncName : rootstr , Stacktrace : 20 , TraceFollowCalls : followCalls }, "" , nil , false )
15581558 if rtbp == nil {
1559- if err != nil && strings .Contains (err .Error (), "Breakpoint exists" ) {
1559+ if _ , exists := err .(proc. BreakpointExistsError ); exists { // != nil && strings.Contains(err.Error(), "Breakpoint exists") {
15601560 // This is expected
15611561 } else {
15621562 return nil , fmt .Errorf ("error creating breakpoint at function return %s" , fname )
0 commit comments