pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lldb-netbsd: clang-format
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Thu Apr 13 00:39:44 2017 +0200
Changeset: 9d0357d1320e319e5f70757d89d0d79a045e3e69
Modified Files:
lldb-netbsd/distinfo
lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp
lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h
lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
Log Message:
lldb-netbsd: clang-format
Style fixes.
Sponsored by <The NetBSD Foundation>
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=9d0357d1320e319e5f70757d89d0d79a045e3e69
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
lldb-netbsd/distinfo | 8 +--
..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp | 41 ++++++++------
...NetBSD_NativeRegisterContextNetBSD__x86__64.cpp | 64 ++++++++++------------
...s_NetBSD_NativeRegisterContextNetBSD__x86__64.h | 8 +--
...e_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp | 4 +-
5 files changed, 64 insertions(+), 61 deletions(-)
diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index ee64ad359a..8641a0804f 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -12,11 +12,11 @@ Size (libcxx-3.6.2.src.tar.xz) = 944020 bytes
SHA1 (llvm-3.6.2.src.tar.xz) = 7a00257eb2bc9431e4c77c3a36b033072c54bc7e
RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 007a39df150ccb8eaf081e1628487326c5af004d
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = e29554252e70fc9e1cb62b40ce32f93fad24d71b
SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp) = abeb0ceb532831404f692f2e25532f81f2a83163
SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h) = 30ef94fb108271313ec61cf4d293fe5d9709948b
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp) = f1db97759b1e32cf328ba4573b314f7a823d5c52
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h) = 81a90bb14b267b22566903ec33e9e072ecf113e8
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = 6bcf4b7fafe63e74e5f6127d5dc816e95070e7c6
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp) = b85fb334d5fdbfa55705a3a2a36b4b8ecef23054
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h) = 21d5cd9cb1632ed2bbd696f0c3bec68eebf0be83
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = d788ea7d92ffa31f2d6477e11129fc9b9fd0b8eb
SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = d2586e2ecdc2c979c59fc1a6a569e7870d3334ba
SHA1 (patch-source_Plugins_Process_Utility_RegisterInfos__x86__64.h) = 47d7dc03b7da83ff7f02b684b2188da53bf269d3
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
index 940c000d56..cc38861118 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
@@ -2,7 +2,7 @@ $NetBSD$
--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig 2017-03-30 22:14:30.000000000 +0000
+++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -224,36 +224,78 @@ void NativeProcessNetBSD::MonitorSIGTRAP
+@@ -224,36 +224,83 @@ void NativeProcessNetBSD::MonitorSIGTRAP
PtraceWrapper(PT_GET_SIGINFO, pid, &info, sizeof(info));
// Get details on the signal raised.
@@ -47,8 +47,11 @@ $NetBSD$
+ case TRAP_DBREG: {
+ // If a watchpoint was hit, report it
+ uint32_t wp_index;
-+ Error error = static_pointer_cast<NativeThreadNetBSD>(m_threads[info.psi_lwpid])->GetRegisterContext()->GetWatchpointHitIndex(
-+ wp_index, (uintptr_t)info.psi_siginfo.si_addr);
++ Error error =
++ static_pointer_cast<NativeThreadNetBSD>(m_threads[info.psi_lwpid])
++ ->GetRegisterContext()
++ ->GetWatchpointHitIndex(wp_index,
++ (uintptr_t)info.psi_siginfo.si_addr);
+ if (error.Fail())
+ LLDB_LOG(log,
+ "received error while checking for watchpoint hits, pid = "
@@ -60,7 +63,7 @@ $NetBSD$
- ->SetStoppedByBreakpoint();
- FixupBreakpointPCAsNeeded(
- *static_pointer_cast<NativeThreadNetBSD>(thread_sp));
-+ ->SetStoppedByWatchpoint(wp_index);
++ ->SetStoppedByWatchpoint(wp_index);
}
SetState(StateType::eStateStopped, true);
break;
@@ -69,8 +72,10 @@ $NetBSD$
+
+ // If a breakpoint was hit, report it
+ uint32_t bp_index;
-+ error = static_pointer_cast<NativeThreadNetBSD>(m_threads[info.psi_lwpid])->GetRegisterContext()->GetHardwareBreakHitIndex(
-+ bp_index, (uintptr_t)info.psi_siginfo.si_addr);
++ error = static_pointer_cast<NativeThreadNetBSD>(m_threads[info.psi_lwpid])
++ ->GetRegisterContext()
++ ->GetHardwareBreakHitIndex(bp_index,
++ (uintptr_t)info.psi_siginfo.si_addr);
+ if (error.Fail())
+ LLDB_LOG(log,
+ "received error while checking for hardware "
@@ -101,7 +106,7 @@ $NetBSD$
}
}
-@@ -328,8 +370,8 @@ Error NativeProcessNetBSD::FixupBreakpoi
+@@ -328,8 +375,8 @@ Error NativeProcessNetBSD::FixupBreakpoi
return error;
} else
LLDB_LOG(log, "breakpoint size: {0}", breakpoint_size);
@@ -112,7 +117,7 @@ $NetBSD$
const lldb::addr_t initial_pc_addr =
context_sp->GetPCfromBreakpointLocation();
lldb::addr_t breakpoint_addr = initial_pc_addr;
-@@ -439,7 +481,7 @@ Error NativeProcessNetBSD::Resume(const
+@@ -439,7 +486,7 @@ Error NativeProcessNetBSD::Resume(const
llvm_unreachable("Unexpected state");
default:
@@ -121,7 +126,7 @@ $NetBSD$
"for pid %" PRIu64 ", tid %" PRIu64,
__FUNCTION__, StateAsCString(action->state), GetID(),
thread_sp->GetID());
-@@ -540,8 +582,8 @@ Error NativeProcessNetBSD::GetMemoryRegi
+@@ -540,8 +587,8 @@ Error NativeProcessNetBSD::GetMemoryRegi
"descending memory map entries detected, unexpected");
prev_base_address = proc_entry_info.GetRange().GetRangeBase();
UNUSED_IF_ASSERT_DISABLED(prev_base_address);
@@ -132,7 +137,7 @@ $NetBSD$
if (load_addr < proc_entry_info.GetRange().GetRangeBase()) {
range_info.GetRange().SetRangeBase(load_addr);
range_info.GetRange().SetByteSize(
-@@ -561,9 +603,8 @@ Error NativeProcessNetBSD::GetMemoryRegi
+@@ -561,9 +608,8 @@ Error NativeProcessNetBSD::GetMemoryRegi
}
// If we made it here, we didn't find an entry that contained the given
// address. Return the
@@ -144,7 +149,7 @@ $NetBSD$
range_info.GetRange().SetRangeBase(load_addr);
range_info.GetRange().SetRangeEnd(LLDB_INVALID_ADDRESS);
range_info.SetReadable(MemoryRegionInfo::OptionalBool::eNo);
-@@ -722,8 +763,8 @@ Error NativeProcessNetBSD::LaunchInferio
+@@ -722,8 +768,8 @@ Error NativeProcessNetBSD::LaunchInferio
LLDB_LOG(log, "waitpid for inferior failed with %s", error);
// Mark the inferior as invalid.
@@ -155,29 +160,31 @@ $NetBSD$
SetState(StateType::eStateInvalid);
return error;
-@@ -766,6 +807,10 @@ Error NativeProcessNetBSD::LaunchInferio
+@@ -766,6 +812,11 @@ Error NativeProcessNetBSD::LaunchInferio
return error;
}
+ for (const auto &thread_sp : m_threads) {
-+ static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(SIGSTOP);
++ static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(
++ SIGSTOP);
+ }
+
/* Set process stopped */
SetState(StateType::eStateStopped);
-@@ -894,6 +939,10 @@ NativeThreadNetBSDSP NativeProcessNetBSD
+@@ -894,6 +945,11 @@ NativeThreadNetBSDSP NativeProcessNetBSD
return -1;
}
-+ for (const auto &thread_sp : m_threads) {
-+ static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(SIGSTOP);
++ for (const auto &thread_sp : m_threads) {
++ static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(
++ SIGSTOP);
+ }
+
// Let our process instance know the thread has stopped.
SetState(StateType::eStateStopped);
-@@ -1007,7 +1056,6 @@ Error NativeProcessNetBSD::ReinitializeT
+@@ -1007,7 +1063,6 @@ Error NativeProcessNetBSD::ReinitializeT
// Reinitialize from scratch threads and register them in process
while (info.pl_lwpid != 0) {
NativeThreadNetBSDSP thread_sp = AddThread(info.pl_lwpid);
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp
index 0f1836748d..a8c090f2f9 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp
@@ -87,28 +87,27 @@ $NetBSD$
}
if (WriteRegisterSet(set) != 0)
-@@ -480,4 +518,227 @@ Error NativeRegisterContextNetBSD_x86_64
+@@ -480,4 +518,223 @@ Error NativeRegisterContextNetBSD_x86_64
return error;
}
+Error NativeRegisterContextNetBSD_x86_64::IsWatchpointHit(uint32_t wp_index,
-+ bool &is_hit) {
++ bool &is_hit) {
+ if (wp_index >= NumSupportedHardwareWatchpoints())
+ return Error("Watchpoint index out of range");
-+
++
+ RegisterValue reg_value;
-+ const RegisterInfo *const reg_info =
-+ GetRegisterInfoAtIndex(lldb_dr6_x86_64);
++ const RegisterInfo *const reg_info = GetRegisterInfoAtIndex(lldb_dr6_x86_64);
+ Error error = ReadRegister(reg_info, reg_value);
+ if (error.Fail()) {
+ is_hit = false;
+ return error;
-+ }
-+
++ }
++
+ uint64_t status_bits = reg_value.GetAsUInt64();
-+
++
+ is_hit = status_bits & (1 << wp_index);
-+
++
+ return error;
+}
+
@@ -130,23 +129,22 @@ $NetBSD$
+}
+
+Error NativeRegisterContextNetBSD_x86_64::IsWatchpointVacant(uint32_t wp_index,
-+ bool &is_vacant) {
++ bool &is_vacant) {
+ if (wp_index >= NumSupportedHardwareWatchpoints())
+ return Error("Watchpoint index out of range");
+
+ RegisterValue reg_value;
-+ const RegisterInfo *const reg_info =
-+ GetRegisterInfoAtIndex(lldb_dr7_x86_64);
++ const RegisterInfo *const reg_info = GetRegisterInfoAtIndex(lldb_dr7_x86_64);
+ Error error = ReadRegister(reg_info, reg_value);
+ if (error.Fail()) {
+ is_vacant = false;
+ return error;
+ }
-+
++
+ uint64_t control_bits = reg_value.GetAsUInt64();
+
+ is_vacant = !(control_bits & (1 << (2 * wp_index)));
-+
++
+ return error;
+}
+
@@ -162,23 +160,23 @@ $NetBSD$
+ // hit.
+ if (watch_flags == 0x2)
+ watch_flags = 0x3;
-+
-+ if (watch_flags != 0x1 && watch_flags != 0x3)
++
++ if (watch_flags != 0x1 && watch_flags != 0x3)
+ return Error("Invalid read/write bits for watchpoint");
+
+ if (size != 1 && size != 2 && size != 4 && size != 8)
+ return Error("Invalid size for watchpoint");
-+
++
+ bool is_vacant;
+ Error error = IsWatchpointVacant(wp_index, is_vacant);
+ if (error.Fail())
+ return error;
-+ if (!is_vacant)
++ if (!is_vacant)
+ return Error("Watchpoint index not vacant");
+
+ RegisterValue reg_value;
+ const RegisterInfo *const reg_info_dr7 =
-+ GetRegisterInfoAtIndex(lldb_dr7_x86_64);
++ GetRegisterInfoAtIndex(lldb_dr7_x86_64);
+ error = ReadRegister(reg_info_dr7, reg_value);
+ if (error.Fail())
+ return error;
@@ -194,7 +192,7 @@ $NetBSD$
+ // set bits 18-19, 22-23, 26-27, or 30-31
+ // with 0b00, 0b01, 0b10, or 0b11
+ // for 1, 2, 8 (if supported), or 4 bytes, respectively
-+ uint64_t size_bits = (size == 8 ? 0x2 : size - 1) << (18 + 4 * wp_index);
++ uint64_t size_bits = (size == 8 ? 0x2 : size - 1) << (18 + 4 * wp_index);
+
+ uint64_t bit_mask = (0x3 << (2 * wp_index)) | (0xF << (16 + 4 * wp_index));
+
@@ -203,13 +201,12 @@ $NetBSD$
+ control_bits |= enable_bit | rw_bits | size_bits;
+
+ const RegisterInfo *const reg_info_drN =
-+ GetRegisterInfoAtIndex(lldb_dr0_x86_64 + wp_index);
++ GetRegisterInfoAtIndex(lldb_dr0_x86_64 + wp_index);
+ error = WriteRegister(reg_info_drN, RegisterValue(addr));
+ if (error.Fail())
+ return error;
+
-+ error =
-+ WriteRegister(reg_info_dr7, RegisterValue(control_bits));
++ error = WriteRegister(reg_info_dr7, RegisterValue(control_bits));
+ if (error.Fail())
+ return error;
+
@@ -223,11 +220,11 @@ $NetBSD$
+ return false;
+
+ RegisterValue reg_value;
-+
++
+ // for watchpoints 0, 1, 2, or 3, respectively,
+ // clear bits 0, 1, 2, or 3 of the debug status register (DR6)
+ const RegisterInfo *const reg_info_dr6 =
-+ GetRegisterInfoAtIndex(lldb_dr6_x86_64);
++ GetRegisterInfoAtIndex(lldb_dr6_x86_64);
+ Error error = ReadRegister(reg_info_dr6, reg_value);
+ if (error.Fail())
+ return false;
@@ -236,19 +233,18 @@ $NetBSD$
+ error = WriteRegister(reg_info_dr6, RegisterValue(status_bits));
+ if (error.Fail())
+ return false;
-+
++
+ // for watchpoints 0, 1, 2, or 3, respectively,
+ // clear bits {0-1,16-19}, {2-3,20-23}, {4-5,24-27}, or {6-7,28-31}
+ // of the debug control register (DR7)
+ const RegisterInfo *const reg_info_dr7 =
-+ GetRegisterInfoAtIndex(lldb_dr7_x86_64);
++ GetRegisterInfoAtIndex(lldb_dr7_x86_64);
+ error = ReadRegister(reg_info_dr7, reg_value);
+ if (error.Fail())
+ return false;
+ bit_mask = (0x3 << (2 * wp_index)) | (0xF << (16 + 4 * wp_index));
+ uint64_t control_bits = reg_value.GetAsUInt64() & ~bit_mask;
-+ return WriteRegister(reg_info_dr7, RegisterValue(control_bits))
-+ .Success();
++ return WriteRegister(reg_info_dr7, RegisterValue(control_bits)).Success();
+}
+
+Error NativeRegisterContextNetBSD_x86_64::ClearAllHardwareWatchpoints() {
@@ -256,7 +252,7 @@ $NetBSD$
+
+ // clear bits {0-4} of the debug status register (DR6)
+ const RegisterInfo *const reg_info_dr6 =
-+ GetRegisterInfoAtIndex(lldb_dr6_x86_64);
++ GetRegisterInfoAtIndex(lldb_dr6_x86_64);
+ Error error = ReadRegister(reg_info_dr6, reg_value);
+ if (error.Fail())
+ return error;
@@ -265,10 +261,10 @@ $NetBSD$
+ error = WriteRegister(reg_info_dr6, RegisterValue(status_bits));
+ if (error.Fail())
+ return error;
-+
++
+ // clear bits {0-7,16-31} of the debug control register (DR7)
+ const RegisterInfo *const reg_info_dr7 =
-+ GetRegisterInfoAtIndex(lldb_dr7_x86_64);
++ GetRegisterInfoAtIndex(lldb_dr7_x86_64);
+ error = ReadRegister(reg_info_dr7, reg_value);
+ if (error.Fail())
+ return error;
@@ -303,11 +299,11 @@ $NetBSD$
+ return LLDB_INVALID_ADDRESS;
+ RegisterValue reg_value;
+ const RegisterInfo *const reg_info_drN =
-+ GetRegisterInfoAtIndex(lldb_dr0_x86_64 + wp_index);
++ GetRegisterInfoAtIndex(lldb_dr0_x86_64 + wp_index);
+ if (ReadRegister(reg_info_drN, reg_value).Fail())
+ return LLDB_INVALID_ADDRESS;
+ return reg_value.GetAsUInt64();
-+}
++}
+
+uint32_t NativeRegisterContextNetBSD_x86_64::NumSupportedHardwareWatchpoints() {
+ // Available debug address registers: dr0, dr1, dr2, dr3
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h
index b6dc32d854..2d8e7a9cb4 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h
@@ -7,7 +7,7 @@ $NetBSD$
Error WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
+ Error IsWatchpointHit(uint32_t wp_index, bool &is_hit) override;
-+
++
+ Error GetWatchpointHitIndex(uint32_t &wp_index,
+ lldb::addr_t trap_addr) override;
+
@@ -15,11 +15,11 @@ $NetBSD$
+
+ bool ClearHardwareWatchpoint(uint32_t wp_index) override;
+
-+ Error ClearAllHardwareWatchpoints() override;
-+
++ Error ClearAllHardwareWatchpoints() override;
++
+ Error SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size,
+ uint32_t watch_flags, uint32_t wp_index);
-+
++
+ uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size,
+ uint32_t watch_flags) override;
+
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
index 8d9cd97c18..6da4e546b5 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
@@ -26,9 +26,9 @@ $NetBSD$
+ ostr << wp_index;
+
+ ostr << " " << GetRegisterContext()->GetWatchpointHitAddress(wp_index);
-+
++
+ m_stop_description = ostr.str();
-+
++
+ m_stop_info.reason = StopReason::eStopReasonWatchpoint;
+ m_stop_info.details.signal.signo = SIGTRAP;
+}
Home |
Main Index |
Thread Index |
Old Index