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