From: mortimer Date: Tue, 9 Feb 2021 21:35:45 +0000 (+0000) Subject: Fix lldb. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=972f549b71a24bab39c35c97f14ab2f72eae5e8d;p=openbsd 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@ --- 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)