forked from OSchip/llvm-project
Revert unwanted changes in lldb when updating llvm::Error()
My script updated lldb::Errors, and I failed to fix it entirely before pushing. This restore everything in lldb as it was before r286561. llvm-svn: 286565
This commit is contained in:
parent
e25e6da917
commit
665be50e37
|
@ -31,7 +31,7 @@ Error fileLock(HANDLE file_handle, DWORD flags, const uint64_t start,
|
|||
if (!::GetOverlappedResult(file_handle, &overlapped, &bytes, TRUE))
|
||||
return Error(::GetLastError(), eErrorTypeWin32);
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -74,5 +74,5 @@ Error LockFileWindows::DoUnlock() {
|
|||
if (!::GetOverlappedResult(m_file, &overlapped, &bytes, TRUE))
|
||||
return Error(::GetLastError(), eErrorTypeWin32);
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ Error PipeWindows::OpenNamedPipe(llvm::StringRef name,
|
|||
ZeroMemory(&m_write_overlapped, sizeof(m_write_overlapped));
|
||||
}
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
int PipeWindows::GetReadFileDescriptor() const { return m_read_fd; }
|
||||
|
@ -217,7 +217,7 @@ void PipeWindows::Close() {
|
|||
CloseWriteFileDescriptor();
|
||||
}
|
||||
|
||||
Error PipeWindows::Delete(llvm::StringRef name) { return Error::success(); }
|
||||
Error PipeWindows::Delete(llvm::StringRef name) { return Error(); }
|
||||
|
||||
bool PipeWindows::CanRead() const { return (m_read != INVALID_HANDLE_VALUE); }
|
||||
|
||||
|
@ -273,7 +273,7 @@ Error PipeWindows::ReadWithTimeout(void *buf, size_t size,
|
|||
return Error(::GetLastError(), eErrorTypeWin32);
|
||||
|
||||
bytes_read = sys_bytes_read;
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error PipeWindows::Write(const void *buf, size_t num_bytes,
|
||||
|
@ -291,5 +291,5 @@ Error PipeWindows::Write(const void *buf, size_t num_bytes,
|
|||
&sys_bytes_written, TRUE);
|
||||
if (!result)
|
||||
return Error(::GetLastError(), eErrorTypeWin32);
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ Error ProcessFreeBSD::DoResume() {
|
|||
else
|
||||
m_monitor->Resume(GetID(), m_resume_signo);
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
bool ProcessFreeBSD::UpdateThreadList(ThreadList &old_thread_list,
|
||||
|
|
|
@ -1364,13 +1364,13 @@ Error NativeProcessLinux::SetupSoftwareSingleStepping(
|
|||
// If setting the breakpoint fails because next_pc is out of
|
||||
// the address space, ignore it and let the debugee segfault.
|
||||
if (error.GetError() == EIO || error.GetError() == EFAULT) {
|
||||
return Error::success();
|
||||
return Error();
|
||||
} else if (error.Fail())
|
||||
return error;
|
||||
|
||||
m_threads_stepping_with_breakpoint.insert({thread.GetID(), next_pc});
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
bool NativeProcessLinux::SupportHardwareSingleStepping() const {
|
||||
|
@ -1453,7 +1453,7 @@ Error NativeProcessLinux::Resume(const ResumeActionList &resume_actions) {
|
|||
}
|
||||
}
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error NativeProcessLinux::Halt() {
|
||||
|
@ -1553,7 +1553,7 @@ Error NativeProcessLinux::Interrupt() {
|
|||
|
||||
StopRunningThreads(deferred_signal_thread_sp->GetID());
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error NativeProcessLinux::Kill() {
|
||||
|
@ -1677,7 +1677,7 @@ ParseMemoryRegionInfoFromProcMapsLine(const std::string &maps_line,
|
|||
if (name)
|
||||
memory_region_info.SetName(name);
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error NativeProcessLinux::GetMemoryRegionInfo(lldb::addr_t load_addr,
|
||||
|
@ -1841,7 +1841,7 @@ Error NativeProcessLinux::AllocateMemory(size_t size, uint32_t permissions,
|
|||
if (InferiorCallMmap(this, addr, 0, size, prot,
|
||||
eMmapFlagsAnon | eMmapFlagsPrivate, -1, 0)) {
|
||||
m_addr_to_mmap_size[addr] = size;
|
||||
return Error::success();
|
||||
return Error();
|
||||
} else {
|
||||
addr = LLDB_INVALID_ADDRESS;
|
||||
return Error("unable to allocate %" PRIu64
|
||||
|
@ -1886,11 +1886,11 @@ Error NativeProcessLinux::GetSoftwareBreakpointPCOffset(
|
|||
case llvm::Triple::x86:
|
||||
case llvm::Triple::x86_64:
|
||||
actual_opcode_size = static_cast<uint32_t>(sizeof(g_i386_opcode));
|
||||
return Error::success();
|
||||
return Error();
|
||||
|
||||
case llvm::Triple::systemz:
|
||||
actual_opcode_size = static_cast<uint32_t>(sizeof(g_s390x_opcode));
|
||||
return Error::success();
|
||||
return Error();
|
||||
|
||||
case llvm::Triple::arm:
|
||||
case llvm::Triple::aarch64:
|
||||
|
@ -1900,7 +1900,7 @@ Error NativeProcessLinux::GetSoftwareBreakpointPCOffset(
|
|||
case llvm::Triple::mipsel:
|
||||
// On these architectures the PC don't get updated for breakpoint hits
|
||||
actual_opcode_size = 0;
|
||||
return Error::success();
|
||||
return Error();
|
||||
|
||||
default:
|
||||
assert(false && "CPU type not supported!");
|
||||
|
@ -1935,18 +1935,18 @@ Error NativeProcessLinux::GetSoftwareBreakpointTrapOpcode(
|
|||
case llvm::Triple::aarch64:
|
||||
trap_opcode_bytes = g_aarch64_opcode;
|
||||
actual_opcode_size = sizeof(g_aarch64_opcode);
|
||||
return Error::success();
|
||||
return Error();
|
||||
|
||||
case llvm::Triple::arm:
|
||||
switch (trap_opcode_size_hint) {
|
||||
case 2:
|
||||
trap_opcode_bytes = g_thumb_breakpoint_opcode;
|
||||
actual_opcode_size = sizeof(g_thumb_breakpoint_opcode);
|
||||
return Error::success();
|
||||
return Error();
|
||||
case 4:
|
||||
trap_opcode_bytes = g_arm_breakpoint_opcode;
|
||||
actual_opcode_size = sizeof(g_arm_breakpoint_opcode);
|
||||
return Error::success();
|
||||
return Error();
|
||||
default:
|
||||
assert(false && "Unrecognised trap opcode size hint!");
|
||||
return Error("Unrecognised trap opcode size hint!");
|
||||
|
@ -1956,24 +1956,24 @@ Error NativeProcessLinux::GetSoftwareBreakpointTrapOpcode(
|
|||
case llvm::Triple::x86_64:
|
||||
trap_opcode_bytes = g_i386_opcode;
|
||||
actual_opcode_size = sizeof(g_i386_opcode);
|
||||
return Error::success();
|
||||
return Error();
|
||||
|
||||
case llvm::Triple::mips:
|
||||
case llvm::Triple::mips64:
|
||||
trap_opcode_bytes = g_mips64_opcode;
|
||||
actual_opcode_size = sizeof(g_mips64_opcode);
|
||||
return Error::success();
|
||||
return Error();
|
||||
|
||||
case llvm::Triple::mipsel:
|
||||
case llvm::Triple::mips64el:
|
||||
trap_opcode_bytes = g_mips64el_opcode;
|
||||
actual_opcode_size = sizeof(g_mips64el_opcode);
|
||||
return Error::success();
|
||||
return Error();
|
||||
|
||||
case llvm::Triple::systemz:
|
||||
trap_opcode_bytes = g_s390x_opcode;
|
||||
actual_opcode_size = sizeof(g_s390x_opcode);
|
||||
return Error::success();
|
||||
return Error();
|
||||
|
||||
default:
|
||||
assert(false && "CPU type not supported!");
|
||||
|
@ -2156,7 +2156,7 @@ Error NativeProcessLinux::ReadMemory(lldb::addr_t addr, void *buf, size_t size,
|
|||
success ? "Success" : strerror(errno));
|
||||
|
||||
if (success)
|
||||
return Error::success();
|
||||
return Error();
|
||||
// else
|
||||
// the call failed for some reason, let's retry the read using ptrace
|
||||
// api.
|
||||
|
@ -2207,7 +2207,7 @@ Error NativeProcessLinux::ReadMemory(lldb::addr_t addr, void *buf, size_t size,
|
|||
|
||||
if (log)
|
||||
ProcessPOSIXLog::DecNestLevel();
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error NativeProcessLinux::ReadMemoryWithoutTrap(lldb::addr_t addr, void *buf,
|
||||
|
@ -2303,7 +2303,7 @@ Error NativeProcessLinux::GetEventMessage(lldb::tid_t tid,
|
|||
|
||||
Error NativeProcessLinux::Detach(lldb::tid_t tid) {
|
||||
if (tid == LLDB_INVALID_THREAD_ID)
|
||||
return Error::success();
|
||||
return Error();
|
||||
|
||||
return PtraceWrapper(PTRACE_DETACH, tid);
|
||||
}
|
||||
|
@ -2414,7 +2414,7 @@ Error NativeProcessLinux::FixupBreakpointPCAsNeeded(NativeThreadLinux &thread) {
|
|||
"NativeProcessLinux::%s pid %" PRIu64
|
||||
" no lldb breakpoint found at current pc with adjustment: 0x%" PRIx64,
|
||||
__FUNCTION__, GetID(), breakpoint_addr);
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
// If the breakpoint is not a software breakpoint, nothing to do.
|
||||
|
@ -2424,7 +2424,7 @@ Error NativeProcessLinux::FixupBreakpointPCAsNeeded(NativeThreadLinux &thread) {
|
|||
" breakpoint found at 0x%" PRIx64
|
||||
", not software, nothing to adjust",
|
||||
__FUNCTION__, GetID(), breakpoint_addr);
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -2440,7 +2440,7 @@ Error NativeProcessLinux::FixupBreakpointPCAsNeeded(NativeThreadLinux &thread) {
|
|||
" breakpoint found at 0x%" PRIx64
|
||||
", it is software, but the size is zero, nothing to do (unexpected)",
|
||||
__FUNCTION__, GetID(), breakpoint_addr);
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
// Change the program counter.
|
||||
|
@ -2488,7 +2488,7 @@ Error NativeProcessLinux::GetLoadedModuleFileSpec(const char *module_path,
|
|||
return Error("Module file (%s) not found in /proc/%" PRIu64 "/maps file!",
|
||||
module_file_spec.GetFilename().AsCString(), GetID());
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error NativeProcessLinux::GetFileLoadAddress(const llvm::StringRef &file_name,
|
||||
|
|
|
@ -263,7 +263,7 @@ Error NativeRegisterContextLinux_arm::WriteRegister(
|
|||
if (error.Fail())
|
||||
return error;
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
return Error("failed - register wasn't recognized to be a GPR or an FPR, "
|
||||
|
@ -679,7 +679,7 @@ Error NativeRegisterContextLinux_arm::ClearAllHardwareWatchpoints() {
|
|||
}
|
||||
}
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
uint32_t NativeRegisterContextLinux_arm::GetWatchpointSize(uint32_t wp_index) {
|
||||
|
@ -730,12 +730,12 @@ Error NativeRegisterContextLinux_arm::GetWatchpointHitIndex(
|
|||
if (WatchpointIsEnabled(wp_index) && trap_addr >= watch_addr &&
|
||||
trap_addr < watch_addr + watch_size) {
|
||||
m_hwp_regs[wp_index].hit_addr = trap_addr;
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
}
|
||||
|
||||
wp_index = LLDB_INVALID_INDEX32;
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
lldb::addr_t
|
||||
|
@ -774,7 +774,7 @@ Error NativeRegisterContextLinux_arm::ReadHardwareDebugInfo() {
|
|||
Error error;
|
||||
|
||||
if (!m_refresh_hwdebug_info) {
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
unsigned int cap_val;
|
||||
|
@ -862,7 +862,7 @@ Error NativeRegisterContextLinux_arm::DoReadRegisterValue(
|
|||
return error;
|
||||
|
||||
value.SetUInt32(m_gpr_arm[offset / sizeof(uint32_t)]);
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error NativeRegisterContextLinux_arm::DoWriteRegisterValue(
|
||||
|
|
|
@ -276,7 +276,7 @@ Error NativeRegisterContextLinux_arm64::WriteRegister(
|
|||
if (error.Fail())
|
||||
return error;
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
return Error("failed - register wasn't recognized to be a GPR or an FPR, "
|
||||
|
@ -671,7 +671,7 @@ Error NativeRegisterContextLinux_arm64::ClearAllHardwareWatchpoints() {
|
|||
}
|
||||
}
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
@ -722,12 +722,12 @@ Error NativeRegisterContextLinux_arm64::GetWatchpointHitIndex(
|
|||
if (WatchpointIsEnabled(wp_index) && trap_addr >= watch_addr &&
|
||||
trap_addr < watch_addr + watch_size) {
|
||||
m_hwp_regs[wp_index].hit_addr = trap_addr;
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
}
|
||||
|
||||
wp_index = LLDB_INVALID_INDEX32;
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
lldb::addr_t
|
||||
|
@ -764,7 +764,7 @@ NativeRegisterContextLinux_arm64::GetWatchpointHitAddress(uint32_t wp_index) {
|
|||
|
||||
Error NativeRegisterContextLinux_arm64::ReadHardwareDebugInfo() {
|
||||
if (!m_refresh_hwdebug_info) {
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
::pid_t tid = m_thread.GetID();
|
||||
|
|
|
@ -932,7 +932,7 @@ Error NativeRegisterContextLinux_mips64::GetWatchpointHitIndex(
|
|||
}
|
||||
}
|
||||
wp_index = LLDB_INVALID_INDEX32;
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error NativeRegisterContextLinux_mips64::IsWatchpointVacant(uint32_t wp_index,
|
||||
|
|
|
@ -222,7 +222,7 @@ Error NativeRegisterContextLinux_s390x::ReadRegister(
|
|||
assert(false && "Unhandled data size.");
|
||||
return Error("unhandled byte size: %" PRIu32, reg_info->byte_size);
|
||||
}
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
if (IsFPR(reg)) {
|
||||
|
@ -245,7 +245,7 @@ Error NativeRegisterContextLinux_s390x::ReadRegister(
|
|||
assert(false && "Unhandled data size.");
|
||||
return Error("unhandled byte size: %" PRIu32, reg_info->byte_size);
|
||||
}
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
if (reg == lldb_last_break_s390x) {
|
||||
|
@ -255,7 +255,7 @@ Error NativeRegisterContextLinux_s390x::ReadRegister(
|
|||
return error;
|
||||
|
||||
reg_value.SetUInt64(last_break);
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
if (reg == lldb_system_call_s390x) {
|
||||
|
@ -265,7 +265,7 @@ Error NativeRegisterContextLinux_s390x::ReadRegister(
|
|||
return error;
|
||||
|
||||
reg_value.SetUInt32(system_call);
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
return Error("failed - register wasn't recognized");
|
||||
|
@ -511,7 +511,7 @@ Error NativeRegisterContextLinux_s390x::IsWatchpointHit(uint32_t wp_index,
|
|||
|
||||
if (m_watchpoint_addr == LLDB_INVALID_ADDRESS) {
|
||||
is_hit = false;
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error error = PeekUserArea(offsetof(user_regs_struct, per_info.lowcore),
|
||||
|
@ -531,7 +531,7 @@ Error NativeRegisterContextLinux_s390x::IsWatchpointHit(uint32_t wp_index,
|
|||
sizeof(per_lowcore));
|
||||
}
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error NativeRegisterContextLinux_s390x::GetWatchpointHitIndex(
|
||||
|
@ -548,7 +548,7 @@ Error NativeRegisterContextLinux_s390x::GetWatchpointHitIndex(
|
|||
}
|
||||
}
|
||||
wp_index = LLDB_INVALID_INDEX32;
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error NativeRegisterContextLinux_s390x::IsWatchpointVacant(uint32_t wp_index,
|
||||
|
@ -558,7 +558,7 @@ Error NativeRegisterContextLinux_s390x::IsWatchpointVacant(uint32_t wp_index,
|
|||
|
||||
is_vacant = m_watchpoint_addr == LLDB_INVALID_ADDRESS;
|
||||
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
bool NativeRegisterContextLinux_s390x::ClearHardwareWatchpoint(
|
||||
|
@ -589,7 +589,7 @@ bool NativeRegisterContextLinux_s390x::ClearHardwareWatchpoint(
|
|||
|
||||
Error NativeRegisterContextLinux_s390x::ClearAllHardwareWatchpoints() {
|
||||
if (ClearHardwareWatchpoint(0))
|
||||
return Error::success();
|
||||
return Error();
|
||||
return Error("Clearing all hardware watchpoints failed.");
|
||||
}
|
||||
|
||||
|
|
|
@ -626,7 +626,7 @@ Error NativeRegisterContextLinux_x86_64::WriteRegister(
|
|||
if (!CopyMPXtoXSTATE(reg_index))
|
||||
return Error("CopyMPXtoXSTATE() failed");
|
||||
}
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
return Error("failed - register wasn't recognized to be a GPR or an FPR, "
|
||||
"write strategy unknown");
|
||||
|
@ -1035,7 +1035,7 @@ Error NativeRegisterContextLinux_x86_64::GetWatchpointHitIndex(
|
|||
}
|
||||
}
|
||||
wp_index = LLDB_INVALID_INDEX32;
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error NativeRegisterContextLinux_x86_64::IsWatchpointVacant(uint32_t wp_index,
|
||||
|
|
|
@ -167,7 +167,7 @@ Error NativeThreadLinux::SetWatchpoint(lldb::addr_t addr, size_t size,
|
|||
if (!hardware)
|
||||
return Error("not implemented");
|
||||
if (m_state == eStateLaunching)
|
||||
return Error::success();
|
||||
return Error();
|
||||
Error error = RemoveWatchpoint(addr);
|
||||
if (error.Fail())
|
||||
return error;
|
||||
|
@ -176,17 +176,17 @@ Error NativeThreadLinux::SetWatchpoint(lldb::addr_t addr, size_t size,
|
|||
if (wp_index == LLDB_INVALID_INDEX32)
|
||||
return Error("Setting hardware watchpoint failed.");
|
||||
m_watchpoint_index_map.insert({addr, wp_index});
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
Error NativeThreadLinux::RemoveWatchpoint(lldb::addr_t addr) {
|
||||
auto wp = m_watchpoint_index_map.find(addr);
|
||||
if (wp == m_watchpoint_index_map.end())
|
||||
return Error::success();
|
||||
return Error();
|
||||
uint32_t wp_index = wp->second;
|
||||
m_watchpoint_index_map.erase(wp);
|
||||
if (GetRegisterContext()->ClearHardwareWatchpoint(wp_index))
|
||||
return Error::success();
|
||||
return Error();
|
||||
return Error("Clearing hardware watchpoint failed.");
|
||||
}
|
||||
|
||||
|
|
|
@ -427,7 +427,7 @@ Error ProcessWindowsLive::DoDetach(bool keep_stopped) {
|
|||
WINDOWS_LOG_PROCESS,
|
||||
"DoDetach called while state = %u, but there is no active session.",
|
||||
private_state);
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
debugger_thread = m_session_data->m_debugger;
|
||||
|
@ -477,7 +477,7 @@ Error ProcessWindowsLive::DoDestroy() {
|
|||
WINDOWS_LOG_PROCESS,
|
||||
"DoDestroy called while state = %u, but there is no active session.",
|
||||
private_state);
|
||||
return Error::success();
|
||||
return Error();
|
||||
}
|
||||
|
||||
debugger_thread = m_session_data->m_debugger;
|
||||
|
|
|
@ -587,7 +587,7 @@ void ProcessWinMiniDump::RefreshStateAfterStop() {
|
|||
return m_impl_up->RefreshStateAfterStop();
|
||||
}
|
||||
|
||||
Error ProcessWinMiniDump::DoDestroy() { return Error::success(); }
|
||||
Error ProcessWinMiniDump::DoDestroy() { return Error(); }
|
||||
|
||||
bool ProcessWinMiniDump::IsAlive() { return true; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue