Is there a way to set breakpoints on all references in one click like we do in OllyDBG "Set breakpoint on every reference" ?

E.g: after locating CreateFileA API and pressing "x" to see all references, we can see where all calls for this function are ... but is there a way to set bps on all calls in one click ?

1 Answer 1


I don't know about existence of such an ability in IDA, but you can do it with IDAPython as follows:

#I didn't check this code, use carefully, beware of errors

import idc
import idaapi
import idautils

def set_breakpoints_on_calls(ea):
    print "Setting breakpoints on ", hex(ea)
    for ref in idautils.CodeRefsTo(ea, 0):
        print "Adding bpt on ", hex(ref)

def set_breakpoints_on_screen_ea():
    print "Started"

idaapi.add_hotkey("Alt-Z", set_breakpoints_on_screen_ea)

By running this code from execute script window you are adding hotkey Alt-Z which sets breakpoints to all calls to the address where cursor is located. You can add this code to idapythonrc.py file in IDA root folder to make this shortcut persistent (you'll need to rerun IDA after it).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.