The drmgr_bb_cb_add() and drmgr_bb_cb_remove() functions had become unwieldy over time, with very long lists of parameters and complex conditionals. This makes it difficult to add new callbacks. Here we refactor them to take in helpers to set key fields while sharing all of the other code.
A new has_pair field is also added. This fixes a bug where drmgr_register_opcode_instrumentation_event() incorrectly increased the pair count.
Issue: #4865 (closed)