32 static ConstString module_name(
"libsystem_kernel.dylib");
33 static ConstString sym_name(
"__abort_with_payload");
39 std::make_shared<AbortWithPayloadFrameRecognizer>(), module_name,
49 static constexpr llvm::StringLiteral namespace_key(
"namespace");
50 static constexpr llvm::StringLiteral code_key(
"code");
51 static constexpr llvm::StringLiteral payload_addr_key(
"payload_addr");
52 static constexpr llvm::StringLiteral payload_size_key(
"payload_size");
53 static constexpr llvm::StringLiteral reason_key(
"reason");
54 static constexpr llvm::StringLiteral flags_key(
"flags");
55 static constexpr llvm::StringLiteral info_key(
"abort_with_payload");
60 LLDB_LOG(log,
"abort_with_payload recognizer: invalid frame.");
64 Thread *thread = frame_sp->GetThread().get();
66 LLDB_LOG(log,
"abort_with_payload recognizer: invalid thread.");
72 LLDB_LOG(log,
"abort_with_payload recognizer: invalid process.");
78 LLDB_LOG(log,
"abort_with_payload recognizer: invalid scratch typesystem.");
90 Value input_value_void_ptr;
91 Value input_value_char_ptr;
118 arg_values.
PushValue(input_value_void_ptr);
120 arg_values.
PushValue(input_value_char_ptr);
124 bool success = abi_sp->GetArgumentValues(*thread, arg_values);
132 auto add_to_arguments = [&](llvm::StringRef name,
Value *value,
142 cur_valobj_sp = dyn_valobj_sp;
144 arguments_sp->Append(cur_valobj_sp);
149 uint32_t namespace_val = 0;
151 add_to_arguments(namespace_key, cur_value,
false);
154 uint32_t code_val = 0;
156 add_to_arguments(code_key, cur_value,
false);
161 add_to_arguments(payload_addr_key, cur_value,
true);
164 uint32_t payload_size = 0;
166 add_to_arguments(payload_size_key, cur_value,
false);
171 add_to_arguments(reason_key, cur_value,
false);
175 std::string reason_string;
181 reason_string =
"<error fetching reason string>";
184 uint32_t flags_val = 0;
186 add_to_arguments(flags_key, cur_value,
false);
192 abort_dict_sp->AddIntegerItem(namespace_key, namespace_val);
193 abort_dict_sp->AddIntegerItem(code_key, code_val);
194 abort_dict_sp->AddIntegerItem(payload_addr_key, payload_addr);
195 abort_dict_sp->AddIntegerItem(payload_size_key, payload_size);
196 abort_dict_sp->AddStringItem(reason_key, reason_string);
197 abort_dict_sp->AddIntegerItem(flags_key, flags_val);
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
lldb::RecognizedStackFrameSP RecognizeFrame(lldb::StackFrameSP frame_sp) override
AbortWithPayloadRecognizedStackFrame(lldb::StackFrameSP &frame_sp, lldb::ValueObjectListSP &args_sp)
Generic representation of a type in a programming language.
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
A uniqued constant string class.
A plug-in interface definition class for debugging a process.
size_t ReadCStringFromMemory(lldb::addr_t vm_addr, char *cstr, size_t cstr_max_len, Status &error)
Read a NULL terminated C string from memory.
StructuredData::DictionarySP GetExtendedCrashInfoDict()
Fetch extended crash information held by the process.
const lldb::ABISP & GetABI()
Target & GetTarget()
Get the target object pointer for this module.
This class provides extra information about a stack frame that was provided by a specific stack frame...
lldb::ValueObjectListSP m_arguments
unsigned int UInt(unsigned int fail_value=0) const
unsigned long long ULongLong(unsigned long long fail_value=0) const
static lldb::TypeSystemClangSP GetForTarget(Target &target, std::optional< IsolatedASTKind > ast_kind=DefaultAST, bool create_on_demand=true)
Returns the scratch TypeSystemClang for the given target.
void AddRecognizer(lldb::StackFrameRecognizerSP recognizer, ConstString module, llvm::ArrayRef< ConstString > symbols, bool first_instruction_only=true)
This base class provides an interface to stack frames.
std::shared_ptr< Dictionary > DictionarySP
StackFrameRecognizerManager & GetFrameRecognizerManager()
lldb::ProcessSP GetProcess() const
void PushValue(const Value &value)
Value * GetValueAtIndex(size_t idx)
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
A collection of ValueObject values that.
static lldb::ValueObjectSP Create(ValueObject &parent, lldb::ValueType type)
const Scalar & GetScalar() const
@ Scalar
A raw scalar value.
void SetCompilerType(const CompilerType &compiler_type)
void SetValueType(ValueType value_type)
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
void RegisterAbortWithPayloadFrameRecognizer(Process *process)
std::shared_ptr< lldb_private::ABI > ABISP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::RecognizedStackFrame > RecognizedStackFrameSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ValueObjectList > ValueObjectListSP
@ eEncodingUint
unsigned integer
std::shared_ptr< lldb_private::TypeSystemClang > TypeSystemClangSP
@ eValueTypeVariableArgument
function argument variables