2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2021-01-13 22:39:25 +08:00
|
|
|
* Copyright (C) 2017-2021 Intel Corporation
|
2019-02-27 18:39:32 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/debug_helpers.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
#include <assert.h>
|
|
|
|
#include <cstdio>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
void debugBreak(int line, const char *file) {
|
|
|
|
if (DebugManager.flags.EnableDebugBreak.get()) {
|
|
|
|
printf("Assert was called at %d line in file:\n%s\n", line, file);
|
2021-01-13 22:39:25 +08:00
|
|
|
fflush(stdout);
|
2017-12-21 07:45:38 +08:00
|
|
|
assert(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void abortUnrecoverable(int line, const char *file) {
|
|
|
|
printf("Abort was called at %d line in file:\n%s\n", line, file);
|
2021-01-13 22:39:25 +08:00
|
|
|
fflush(stdout);
|
2017-12-21 07:45:38 +08:00
|
|
|
abortExecution();
|
|
|
|
}
|
2019-09-05 15:35:56 +08:00
|
|
|
} // namespace NEO
|