From 5937492e93559e249c570abe9aadc081c49ce455 Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Thu, 4 Apr 2019 11:05:06 +0200 Subject: [PATCH] base-foc: map debug cap through the correct index * necessary for enabling the kernel debugging facilities on base-foc (outstring, fiasco_tbuf_log_3val and friends) * disabled by default related to issue #3260 --- repos/base-foc/src/core/platform_pd.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/repos/base-foc/src/core/platform_pd.cc b/repos/base-foc/src/core/platform_pd.cc index 28a851271..6c15fba0a 100644 --- a/repos/base-foc/src/core/platform_pd.cc +++ b/repos/base-foc/src/core/platform_pd.cc @@ -72,8 +72,13 @@ bool Platform_pd::bind_thread(Platform_thread &thread) /* if it's no core-thread we have to map parent and pager gate cap */ if (!thread.core_thread()) { _task.map(_task.local.data()->kcap()); - // FIXME: there is no debug cap anymore - // _debug.map(_task.local.data()->kcap()); + + /* + * Set true low level debugging through the kernel debugger interface + */ + constexpr bool map_debug_cap = false; + if (map_debug_cap) + _debug.map(_task.local.data()->kcap()); } /* inform thread about binding */ @@ -115,11 +120,12 @@ void Platform_pd::flush(addr_t, size_t size, Core_local_addr core_local) } -static Core_cap_index * debug_cap() +static Native_capability debug_cap() { unsigned long const id = platform_specific().cap_id_alloc().alloc(); static Cap_index * idx = cap_map().insert(id, DEBUG_CAP); - return reinterpret_cast(idx); + static Native_capability debug_cap(reinterpret_cast(idx)); + return debug_cap; } Platform_pd::Platform_pd(Core_cap_index &ci)