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


_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to