Files
compute-runtime/shared/source/debugger/debugger.h
Daniel Bermond e0362a7c39 build: add missing headers for GCC 15
For using fixed width integer types[1], the `<cstdint>`[2]
C++ header needs to be explicitly included with GCC 15 due
to changes[3] in libstdc++.

For details, see the documentation[4] about porting to GCC 15.

[1] https://en.cppreference.com/w/cpp/types/integer
[2] https://en.cppreference.com/w/cpp/header/cstdint
[3] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84
[4] https://gcc.gnu.org/gcc-15/porting_to.html#cxx

Signed-off-by: Daniel Bermond <dbermond@archlinux.org>
2025-05-19 15:31:32 +02:00

66 lines
1.6 KiB
C++

/*
* Copyright (C) 2020-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <cstdint>
#include <memory>
namespace NEO {
struct HardwareInfo;
class LinearStream;
class IndirectHeap;
struct DebugData;
class GraphicsAllocation;
struct RootDeviceEnvironment;
class Debugger {
public:
struct SbaAddresses {
constexpr static size_t trackedAddressCount = 6;
uint64_t generalStateBaseAddress = 0;
uint64_t surfaceStateBaseAddress = 0;
uint64_t dynamicStateBaseAddress = 0;
uint64_t indirectObjectBaseAddress = 0;
uint64_t instructionBaseAddress = 0;
uint64_t bindlessSurfaceStateBaseAddress = 0;
uint64_t bindlessSamplerStateBaseAddress = 0;
};
virtual ~Debugger() = default;
virtual void captureStateBaseAddress(NEO::LinearStream &cmdStream, SbaAddresses sba, bool useFirstLevelBB) = 0;
virtual size_t getSbaTrackingCommandsSize(size_t trackedAddressCount) = 0;
void *getDebugSurfaceReservedSurfaceState(IndirectHeap &ssh);
inline static bool isDebugEnabled(bool internalUsage) {
return !internalUsage;
}
};
enum class DebuggingMode : uint32_t {
disabled,
online,
offline
};
inline DebuggingMode getDebuggingMode(uint32_t programDebugging) {
switch (programDebugging) {
case 1: {
return DebuggingMode::online;
}
case 2: {
return DebuggingMode::offline;
}
case 0:
default: {
return DebuggingMode::disabled;
}
}
}
static_assert(std::is_standard_layout<Debugger::SbaAddresses>::value);
} // namespace NEO