[Lldb-commits] [PATCH] D86355: Consume error for valid return from Target::GetEntryPointAddress()

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 21 09:39:00 PDT 2020


JDevlieghere added inline comments.


================
Comment at: lldb/source/Target/Target.cpp:2408-2446
 llvm::Expected<lldb_private::Address> Target::GetEntryPointAddress() {
   Module *exe_module = GetExecutableModulePointer();
   llvm::Error error = llvm::Error::success();
   assert(!error); // Check the success value when assertions are enabled.
 
   if (!exe_module || !exe_module->GetObjectFile()) {
     error = llvm::make_error<llvm::StringError>("No primary executable found",
----------------
I'm not particularly happy with the error handling in this function. The patch seems correct, but as I've demonstrated it's easy to get this wrong. I think we can rewrite the method as suggested to eliminate the issue. What do you think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86355



More information about the lldb-commits mailing list