[lldb-dev] Question regarding argument types of "BreakpointHitCallback"

Vangelis Tsiatsianas via lldb-dev lldb-dev at lists.llvm.org
Thu Apr 30 08:50:02 PDT 2020


Hello,

I would like to ask a question regarding "BreakpointHitCallback", which is declared as such:

bool (*BreakpointHitCallback)(void *baton,
                              StoppointCallbackContext *context,
                              lldb::user_id_t break_id,
                              lldb::user_id_t break_loc_id);

Is there any particular reason that "break_id" and "break_loc_id" are of type "user_id_t" (64-bit unsigned) instead of "break_id_t" (32-bit signed), which is used both for "Stoppoint::m_bid" and "StoppointLocation::m_loc_id"?

This causes an issue mainly with internal breakpoints, since the callback of an internal breakpoint with (ID == 0xfffffffe) is called with (break_id == 0xfffffffffffffffe), forcing the callback to cast the argument back to a 32-bit signed in order to use it correctly, e.g. when the IDs are stored and need to be looked up.

A small example attempting to illustrate the problem: https://godbolt.org/z/y8LbK2 <https://godbolt.org/z/nJM9Li>


― Vangelis


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20200430/d6f77116/attachment.html>


More information about the lldb-dev mailing list