blob: 37a83f7ef04a7942e0a3f8109ad40d2f2f459035 [file] [log] [blame]
Austin Schuh75263e32022-02-22 18:05:32 -08001// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#include <atomic>
6
7#include "wpi/StackTrace.h"
8
9static std::atomic<std::string (*)(int offset)> gStackTraceImpl{
10 wpi::GetStackTraceDefault};
11
12std::string wpi::GetStackTrace(int offset) {
13 return (gStackTraceImpl.load())(offset);
14}
15
16void wpi::SetGetStackTraceImpl(std::string (*func)(int offset)) {
17 gStackTraceImpl = func ? func : wpi::GetStackTraceDefault;
18}