Hi Antonio,

This is in regards to https://reviews.llvm.org/D64013 , specifically this code 
in ProcessGDBRemote::GetImageInfoAddress:

  if (addr == LLDB_INVALID_ADDRESS) {
    llvm::Expected<LoadedModuleInfoList> list = GetLoadedModuleList();
    if (!list) {
      Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
      LLDB_LOG_ERROR(log, list.takeError(), "Failed to read module list: {0}");
    } else {
      addr = list->m_link_map;
    }
  }

If LLVM_ENABLE_ABI_BREAKING_CHECKS is set to 1 (which is true when asserts are 
enabled), llvm::Expected will call abort() if there is an error.
GetLoadedModuleList() has many reasons to set an error, including when XML is 
not available, or when the stub doesn't support remote modules.

I don't think we ever want to crash LLDB if the remote stub doesn't support 
something. I don't think llvm::Expected is the right solution here, and I think 
it should be removed.

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

Reply via email to