本文整理匯總了Golang中github.com/derekparker/delve/service.Client.ClearBreakpoint方法的典型用法代碼示例。如果您正苦於以下問題:Golang Client.ClearBreakpoint方法的具體用法?Golang Client.ClearBreakpoint怎麽用?Golang Client.ClearBreakpoint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/derekparker/delve/service.Client
的用法示例。
在下文中一共展示了Client.ClearBreakpoint方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: clearAll
func clearAll(client service.Client, args ...string) error {
breakPoints, err := client.ListBreakpoints()
if err != nil {
return err
}
for _, bp := range breakPoints {
_, err := client.ClearBreakpoint(bp.ID)
if err != nil {
fmt.Printf("Couldn't delete breakpoint %d at %#v %s:%d: %s\n", bp.ID, bp.Addr, shortenFilePath(bp.File), bp.Line, err)
}
fmt.Printf("Breakpoint %d cleared at %#v for %s %s:%d\n", bp.ID, bp.Addr, bp.FunctionName, shortenFilePath(bp.File), bp.Line)
}
return nil
}
示例2: clear
func clear(client service.Client, args ...string) error {
if len(args) == 0 {
return fmt.Errorf("not enough arguments")
}
id, err := strconv.Atoi(args[0])
if err != nil {
return err
}
bp, err := client.ClearBreakpoint(id)
if err != nil {
return err
}
fmt.Printf("Breakpoint %d cleared at %#v for %s %s:%d\n", bp.ID, bp.Addr, bp.FunctionName, shortenFilePath(bp.File), bp.Line)
return nil
}