summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authormortimer <mortimer@cvs.openbsd.org>2021-02-09 21:35:46 +0000
committermortimer <mortimer@cvs.openbsd.org>2021-02-09 21:35:46 +0000
commit323fad325ad92406fd0eaad96af7c788ef136961 (patch)
treea3746dc99e92e22bf423afc780abe08068b8b6a7 /gnu
parent8cc02c5726e9355c728a5c0cbb652817a32e91df (diff)
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@
Diffstat (limited to 'gnu')
-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)