This is used by various system routines (the capabilities checker and dyld to name a few) to add extra color to an abort. This patch adds a frame recognizer so people can easily see the details, and also adds the information to the ExtendedCrashInformation dictionary. I also had to rework how the dictionary is held; previously it was created on demand, but that was inconvenient since it meant all the entries had to be produced at that same time. That didn't work for the recognizer.
39 lines
1.3 KiB
C++
39 lines
1.3 KiB
C++
//===-- AbortWithPayloadFrameRecognizer.h -----------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
#ifndef LLDB_MACOSX_ABORTWITHPAYLOADFRAMERECOGNIZER_H
|
|
#define LLDB_MACOSX_ABORTWITHPAYLOADFRAMERECOGNIZER_H
|
|
|
|
#include "lldb/Target/Process.h"
|
|
#include "lldb/Target/StackFrameRecognizer.h"
|
|
#include "lldb/Utility/ConstString.h"
|
|
#include "lldb/Utility/FileSpec.h"
|
|
|
|
#include <tuple>
|
|
|
|
namespace lldb_private {
|
|
|
|
void RegisterAbortWithPayloadFrameRecognizer(Process *process);
|
|
|
|
class AbortWithPayloadRecognizedStackFrame : public RecognizedStackFrame {
|
|
public:
|
|
AbortWithPayloadRecognizedStackFrame(lldb::StackFrameSP &frame_sp,
|
|
lldb::ValueObjectListSP &args_sp);
|
|
};
|
|
|
|
class AbortWithPayloadFrameRecognizer : public StackFrameRecognizer {
|
|
public:
|
|
std::string GetName() override {
|
|
return "abort_with_payload StackFrame Recognizer";
|
|
}
|
|
lldb::RecognizedStackFrameSP
|
|
RecognizeFrame(lldb::StackFrameSP frame_sp) override;
|
|
};
|
|
} // namespace lldb_private
|
|
|
|
#endif // LLDB_MACOSX_ABORTWITHPAYLOADFRAMERECOGNIZER_H
|