[Lldb-commits] [PATCH] D147482: [lldb] Add an overload to SetModuleLoadAddress that takes an unsigned value

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 6 09:46:33 PDT 2023


JDevlieghere added a comment.

In D147482#4248858 <https://reviews.llvm.org/D147482#4248858>, @jasonmolenda wrote:

> LGTM.  We can detect this  This is one of those cases where I'd like to mark SBTarget::SetModuleLoadAddress as deprecated.  I like that you detect this situation in SBTarget::SetLoadAddress - we could cast to unsigned and do the right thing, or would the compiler get unhappy? - but when I've seen these kinds of mistakes in the past, python detects a too-large unsigned value being passed to a signed argument and throws an error before we even get to the SetModuleLoadAddress, so it doesn't help much I expect for Python SB API users.

Yeah, what you described is exactly what would happen before this patch, the function will "just work" from C++ but not from Python. I added the check to discourage C++ users from relying on the old function, but it does change the SB API's behavior.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147482/new/

https://reviews.llvm.org/D147482



More information about the lldb-commits mailing list