summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormortimer <mortimer@openbsd.org>2021-02-09 21:35:45 +0000
committermortimer <mortimer@openbsd.org>2021-02-09 21:35:45 +0000
commit972f549b71a24bab39c35c97f14ab2f72eae5e8d (patch)
tree96693cefd25aab1fa0b96078e6a627f3d0740251
parentThese regress tests expect coredumps to be written so run them with (diff)
downloadwireguard-openbsd-972f549b71a24bab39c35c97f14ab2f72eae5e8d.tar.xz
wireguard-openbsd-972f549b71a24bab39c35c97f14ab2f72eae5e8d.zip
Fix lldb.
Map deliberately invalid signal to zero when passing to PT_STEP and P_CONTINUE. Also clean up getting Environment so setting LLDB_DEBUGSERVER env vars works again. ok patrick@
-rw-r--r--gnu/llvm/lldb/source/Host/openbsd/Host.cpp13
-rw-r--r--gnu/llvm/lldb/source/Plugins/Process/OpenBSD/NativeProcessOpenBSD.cpp5
2 files changed, 4 insertions, 14 deletions
diff --git a/gnu/llvm/lldb/source/Host/openbsd/Host.cpp b/gnu/llvm/lldb/source/Host/openbsd/Host.cpp
index c5d42334804..776202f23d6 100644
--- a/gnu/llvm/lldb/source/Host/openbsd/Host.cpp
+++ b/gnu/llvm/lldb/source/Host/openbsd/Host.cpp
@@ -41,18 +41,7 @@ namespace lldb_private {
class ProcessLaunchInfo;
}
-Environment Host::GetEnvironment() {
- Environment env;
- char *v;
- char **var = environ;
- for (; var != NULL && *var != NULL; ++var) {
- v = strchr(*var, (int)'-');
- if (v == NULL)
- continue;
- env.insert(v);
- }
- return env;
-}
+Environment Host::GetEnvironment() { return Environment(environ); }
static bool
GetOpenBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
diff --git a/gnu/llvm/lldb/source/Plugins/Process/OpenBSD/NativeProcessOpenBSD.cpp b/gnu/llvm/lldb/source/Plugins/Process/OpenBSD/NativeProcessOpenBSD.cpp
index ae5812118e5..c0b0aaafacf 100644
--- a/gnu/llvm/lldb/source/Plugins/Process/OpenBSD/NativeProcessOpenBSD.cpp
+++ b/gnu/llvm/lldb/source/Plugins/Process/OpenBSD/NativeProcessOpenBSD.cpp
@@ -239,12 +239,13 @@ Status NativeProcessOpenBSD::Resume(const ResumeActionList &resume_actions) {
}
Status error;
+ int signal = action->signal != LLDB_INVALID_SIGNAL_NUMBER ? action->signal : 0;
switch (action->state) {
case eStateRunning: {
// Run the thread, possibly feeding it the signal.
error = NativeProcessOpenBSD::PtraceWrapper(PT_CONTINUE, GetID(), (void *)1,
- action->signal);
+ signal);
if (!error.Success())
return error;
for (const auto &thread : m_threads)
@@ -256,7 +257,7 @@ Status NativeProcessOpenBSD::Resume(const ResumeActionList &resume_actions) {
#ifdef PT_STEP
// Run the thread, possibly feeding it the signal.
error = NativeProcessOpenBSD::PtraceWrapper(PT_STEP, GetID(), (void *)1,
- action->signal);
+ signal);
if (!error.Success())
return error;
for (const auto &thread : m_threads)