<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 30, 2020, at 8:50 AM, Vangelis Tsiatsianas via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello,<div class=""><br class=""></div><div class="">I would like to ask a question regarding <font face="SFMono-Regular" class="">"BreakpointHitCallback"</font>, which is declared as such:</div><div class=""><br class=""></div><div class=""><font face="SFMono-Regular" class="">bool (*BreakpointHitCallback)(void *baton,<br class=""> StoppointCallbackContext *context,<br class=""> lldb::user_id_t break_id,<br class=""> lldb::user_id_t break_loc_id);</font></div><div class=""><font face="SFProText-Regular" class=""><br class=""></font></div><div class=""><font face="SFProText-Regular" class="">Is there any particular reason that </font><font face="SFMono-Regular" class="">"break_id"</font><font face="SFProText-Regular" class=""> and </font><font face="SFMono-Regular" class="">"break_loc_id"</font><font face="SFProText-Regular" class=""> are of type "</font><font face="SFMono-Regular" class=""><span style="caret-color: rgb(0, 0, 0);" class="">user_id_t"</span></font><font face="SFProText-Regular" class=""> (64-bit unsigned) instead of </font><font face="SFMono-Regular" class="">"break_id_t"</font><font face="SFProText-Regular" class=""> (32-bit signed), which is used both for </font><span style="caret-color: rgb(0, 0, 0); font-family: SFMono-Regular;" class="">"Stoppoint::m_bid"</span><span style="font-family: SFProText-Regular;" class=""> and </span><span style="caret-color: rgb(0, 0, 0); font-family: SFMono-Regular;" class="">"StoppointLocation::m_loc_id"</span><span style="font-family: SFProText-Regular;" class="">?</span></div></div></div></blockquote><div><br class=""></div>I believe this callback predated the time when we added break_id and break_loc_id, and since arguments are part of the signature of C++ functions, we didn't change it in order to keep the public API from changing. Or this could have just been a mistake. Either way, we have a stable API and can't really change it.<br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><font face="SFProText-Regular" class=""><br class=""></font></div><div class="">This causes an issue mainly with internal breakpoints, since the callback of an internal breakpoint with <font face="SFMono-Regular" class="">(ID == 0xfffffffe)</font> is called with <font face="SFMono-Regular" class="">(break_id == 0xfffffffffffffffe)</font>, 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.</div><div class=""><br class=""></div><div class="">A small example attempting to illustrate the problem: <a href="https://godbolt.org/z/y8LbK2" class="">https://godbolt.org/z/y8LbK2</a></div></div></div></blockquote><div><br class=""></div></div>Sorry for the issue, but I think we are stuck with it now.<div class=""><br class=""></div><div class=""><br class=""></div></body></html>