<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thank you for the answer, Greg.<div class=""><br class=""></div><div class="">I personally managed to work around the problem, although it confused me a bit at first and took a while to figure out the cause. May I suggest the addition of a note in the documentation of <font face="SFMono-Regular" class="">"{Breakpoint, Watchpoint}::{Invoke, Set}Callback()"</font> and possibly other relevant functions as a warning to future developers that may stumble upon the same issue?<br class=""><div><br class=""></div><div>Regarding the public C++ API, would defining <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: SFMono-Regular;" class="">"break_id_t"</span> as <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: SFMono-Regular;" class="">"int64_t"</span> be a viable solution or that change would also break the API? It seems that making both types 64-bit alleviates the issue, despite the sign difference.</div><div><br class=""></div><div><br class=""></div><div>― Vangelis</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On 30 Apr 2020, at 22:22, Greg Clayton <<a href="mailto:clayborg@gmail.com" class="">clayborg@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><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 class=""><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 class=""><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></div></div></blockquote></div><br class=""></div></body></html>