32 static ConstString module_name(
"libsystem_kernel.dylib");
33 static ConstString sym_name(
"__abort_with_payload");
39 std::make_shared<AbortWithPayloadFrameRecognizer>(), module_name,
50 static constexpr llvm::StringLiteral namespace_key(
"namespace");
51 static constexpr llvm::StringLiteral code_key(
"code");
52 static constexpr llvm::StringLiteral payload_addr_key(
"payload_addr");
53 static constexpr llvm::StringLiteral payload_size_key(
"payload_size");
54 static constexpr llvm::StringLiteral reason_key(
"reason");
55 static constexpr llvm::StringLiteral flags_key(
"flags");
56 static constexpr llvm::StringLiteral info_key(
"abort_with_payload");
61 LLDB_LOG(log,
"abort_with_payload recognizer: invalid frame.");
65 Thread *thread = frame_sp->GetThread().get();
67 LLDB_LOG(log,
"abort_with_payload recognizer: invalid thread.");
73 LLDB_LOG(log,
"abort_with_payload recognizer: invalid process.");
79 LLDB_LOG(log,
"abort_with_payload recognizer: invalid scratch typesystem.");
91 Value input_value_void_ptr;
92 Value input_value_char_ptr;
119 arg_values.
PushValue(input_value_void_ptr);
121 arg_values.
PushValue(input_value_char_ptr);
125 bool success = abi_sp->GetArgumentValues(*thread, arg_values);
133 auto add_to_arguments = [&](llvm::StringRef name,
Value *value,
143 cur_valobj_sp = dyn_valobj_sp;
145 arguments_sp->Append(cur_valobj_sp);
150 uint32_t namespace_val = 0;
152 add_to_arguments(namespace_key, cur_value,
false);
155 uint32_t code_val = 0;
157 add_to_arguments(code_key, cur_value,
false);
162 add_to_arguments(payload_addr_key, cur_value,
true);
165 uint32_t payload_size = 0;
167 add_to_arguments(payload_size_key, cur_value,
false);
172 add_to_arguments(reason_key, cur_value,
false);
176 std::string reason_string;
182 reason_string =
"<error fetching reason string>";
185 uint32_t flags_val = 0;
187 add_to_arguments(flags_key, cur_value,
false);
193 abort_dict_sp->AddIntegerItem(namespace_key, namespace_val);
194 abort_dict_sp->AddIntegerItem(code_key, code_val);
195 abort_dict_sp->AddIntegerItem(payload_addr_key, payload_addr);
196 abort_dict_sp->AddIntegerItem(payload_size_key, payload_size);
197 abort_dict_sp->AddStringItem(reason_key, reason_string);
198 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, Mangled::NamePreference symbol_mangling, bool first_instruction_only=true)
Add a new recognizer that triggers on a given symbol name.
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