Set context debuggable when debugging is enabled

Related-to: NEO-6896
Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
This commit is contained in:
Yates, Brandon
2022-05-17 01:26:26 +00:00
committed by Compute-Runtime-Automation
parent 5b297ba860
commit adc51c1b47
6 changed files with 39 additions and 9 deletions

View File

@ -7,6 +7,8 @@
#include "shared/source/os_interface/windows/os_context_win.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/os_interface/windows/wddm/wddm.h"
#include "shared/source/os_interface/windows/wddm/wddm_interface.h"
@ -26,6 +28,10 @@ OsContextWin::OsContextWin(Wddm &wddm, uint32_t contextId, const EngineDescripto
residencyController(wddm, contextId) {}
void OsContextWin::initializeContext() {
if (wddm.getRootDeviceEnvironment().executionEnvironment.isDebuggingEnabled()) {
debuggableContext = wddm.getRootDeviceEnvironment().osInterface->isDebugAttachAvailable() && !isInternalEngine();
}
auto wddmInterface = wddm.getWddmInterface();
UNRECOVERABLE_IF(!wddm.createContext(*this));

View File

@ -35,6 +35,7 @@ class OsContextWin : public OsContext {
MOCKABLE_VIRTUAL WddmResidencyController &getResidencyController() { return residencyController; }
static OsContext *create(OSInterface *osInterface, uint32_t contextId, const EngineDescriptor &engineDescriptor);
void reInitializeContext() override;
MOCKABLE_VIRTUAL bool isDebuggableContext() { return debuggableContext; };
protected:
void initializeContext() override;
@ -43,5 +44,6 @@ class OsContextWin : public OsContext {
HardwareQueue hardwareQueue;
Wddm &wddm;
WddmResidencyController residencyController;
bool debuggableContext = false;
};
} // namespace NEO