static void ReportError(std::string message, std::optional< lldb::user_id_t > debugger_id=std::nullopt, std::once_flag *>
Report error events.
lldb::ThreadSP GetThreadSP() const
Get accessor that creates a strong reference from the weak thread reference contained in this object.
lldb::ProcessSP GetProcessSP() const
Get accessor that creates a strong reference from the weak process reference contained in this object...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void Append(const FileSpec &file)
Append a FileSpec object to the list.
bool AnySet(ValueType mask) const
Test one or more flags.
A collection class for Module objects.
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
size_t GetSize() const
Gets the size of the module list.
A command line option parsing protocol class.
std::vector< Option > m_getopt_table
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static lldb::OptionValuePropertiesSP GetSettingForPlatformPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool CreateSettingForStructuredDataPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
static bool UnregisterPlugin(ABICreateInstance create_callback)
Environment & GetEnvironment()
ArchSpec & GetArchitecture()
A plug-in interface definition class for debugging a process.
void BroadcastStructuredData(const StructuredData::ObjectSP &object_sp, const lldb::StructuredDataPluginSP &plugin_sp)
Broadcasts the given structured data object from the given plugin.
uint32_t GetUniqueID() const
Target & GetTarget()
Get the target object pointer for this module.
lldb::OptionValuePropertiesSP m_collection_sp
virtual lldb::OptionValueSP GetPropertyValue(const ExecutionContext *exe_ctx, llvm::StringRef property_path, Status &error) const
T GetPropertyAtIndexAs(uint32_t idx, T default_value, const ExecutionContext *exe_ctx=nullptr) const
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
ExecutionContextRef exe_ctx_ref
const char * GetData() const
void Flush() override
Flush the stream.
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
size_t Write(const void *src, size_t src_len)
Output character bytes to the stream.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
virtual void Flush()=0
Flush the stream.
Status GetDescription(const StructuredData::ObjectSP &object_sp, lldb_private::Stream &stream) override
Get a human-readable description of the contents of the data.
static void DebuggerInitialize(Debugger &debugger)
lldb::user_id_t m_breakpoint_id
void DumpTimestamp(Stream &stream, uint64_t timestamp)
static bool InitCompletionHookCallback(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
void AddInitCompletionHook(Process &process)
StructuredDataDarwinLog(const lldb::ProcessWP &process_wp)
std::mutex m_added_breakpoint_mutex
size_t HandleDisplayOfEvent(const StructuredData::Dictionary &event, Stream &stream)
void HandleArrivalOfStructuredData(Process &process, llvm::StringRef type_name, const StructuredData::ObjectSP &object_sp) override
Handle the arrival of asynchronous structured data from the process.
static lldb::StructuredDataPluginSP CreateInstance(Process &process)
bool m_recorded_first_timestamp
static llvm::StringRef GetStaticPluginName()
static Status FilterLaunchInfo(ProcessLaunchInfo &launch_info, Target *target)
void EnableNow()
Call the enable command again, using whatever settings were initially made.
size_t DumpHeader(Stream &stream, const StructuredData::Dictionary &event)
void ModulesDidLoad(Process &process, ModuleList &module_list) override
Allow the plugin to do work related to modules that loaded in the the corresponding process.
~StructuredDataDarwinLog() override
void SetEnabled(bool enabled)
bool GetEnabled(llvm::StringRef type_name) const override
Returns whether the plugin's features are enabled.
bool SupportsStructuredDataType(llvm::StringRef type_name) override
Return whether this plugin supports the given StructuredData feature.
uint64_t m_first_timestamp_seen
lldb::ProcessSP GetProcess() const
StructuredDataPlugin(const lldb::ProcessWP &process_wp)
static void InitializeBasePluginForDebugger(Debugger &debugger)
Derived classes must call this before attempting to hook up commands to the 'plugin structured-data' ...
bool ForEach(std::function< bool(Object *object)> const &foreach_callback) const
void AddBooleanItem(llvm::StringRef key, bool value)
bool GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const
bool GetValueForKeyAsString(llvm::StringRef key, llvm::StringRef &result) const
void AddStringItem(llvm::StringRef key, llvm::StringRef value)
bool GetValueForKeyAsArray(llvm::StringRef key, Array *&result) const
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
Debugger & GetDebugger() const
const lldb::ProcessSP & GetProcessSP() const
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, uint32_t column, lldb::addr_t offset, LazyBool check_inlines, LazyBool skip_prologue, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
const ArchSpec & GetArchitecture() const
This thread plan calls a function object when the current function exits.
std::function< void()> Callback
Definition for the callback made when the currently executing thread finishes executing its function.
Provides the darwin-log base command.
BaseCommand(CommandInterpreter &interpreter)
EnableCommand(CommandInterpreter &interpreter, bool enable, const char *name, const char *help, const char *syntax)
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
void AppendStrictSourcesWarning(CommandReturnObject &result, const char *source_name)
EnableOptionsSP m_options_sp
bool GetDisplayActivityChain() const
Status ParseFilterRule(llvm::StringRef rule_text)
bool GetDisplayTimestampRelative() const
bool GetEchoToStdErr() const
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
bool GetIncludeInfoLevel() const
bool GetDisplaySubsystem() const
bool m_include_info_level
int MatchAttributeIndex(llvm::StringRef attribute_name) const
bool GetBroadcastEvents() const
bool m_include_any_process
bool m_filter_fall_through_accepts
const FilterRules & GetFilterRules() const
bool m_include_debug_level
bool m_display_timestamp_relative
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
FilterRules m_filter_rules
StructuredData::DictionarySP BuildConfigurationData(bool enabled)
bool m_display_activity_chain
bool GetFallthroughAccepts() const
void OptionParsingStarting(ExecutionContext *execution_context) override
bool GetDisplayAnyHeaderFields() const
bool GetIncludeDebugLevel() const
bool GetDisplayCategory() const
const std::string m_match_text
static llvm::StringRef StaticGetOperation()
static void RegisterOperation()
static FilterRuleSP CreateOperation(bool accept, size_t attribute_index, const std::string &op_arg, Status &error)
void DoSerialization(StructuredData::Dictionary &dict) const override
void Dump(Stream &stream) const override
ExactMatchFilterRule(bool accept, size_t attribute_index, const std::string &match_text)
virtual ~FilterRule()=default
static void RegisterOperation(llvm::StringRef operation, const OperationCreationFunc &creation_func)
bool GetMatchAccepts() const
static CreationFuncMap & GetCreationFuncMap()
llvm::StringMap< OperationCreationFunc > CreationFuncMap
llvm::StringRef GetOperationType() const
std::function< FilterRuleSP(bool accept, size_t attribute_index, const std::string &op_arg, Status &error)> OperationCreationFunc
FilterRule(bool accept, size_t attribute_index, llvm::StringRef operation)
virtual void Dump(Stream &stream) const =0
const char * GetFilterAttribute() const
virtual void DoSerialization(StructuredData::Dictionary &dict) const =0
static FilterRuleSP CreateRule(bool match_accepts, size_t attribute, llvm::StringRef operation, const std::string &op_arg, Status &error)
StructuredData::ObjectSP Serialize() const
const llvm::StringRef m_operation
const size_t m_attribute_index
static llvm::StringRef StaticGetOperation()
static void RegisterOperation()
const std::string m_regex_text
static FilterRuleSP CreateOperation(bool accept, size_t attribute_index, const std::string &op_arg, Status &error)
void DoSerialization(StructuredData::Dictionary &dict) const override
RegexFilterRule(bool accept, size_t attribute_index, const std::string ®ex_text)
void Dump(Stream &stream) const override
Provides the status command.
StatusCommand(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
static llvm::StringRef GetSettingName()
const char * GetLoggingModuleName() const
StructuredDataDarwinLogProperties()
bool GetEnableOnStartup() const
llvm::StringRef GetAutoEnableOptions() const
~StructuredDataDarwinLogProperties() override=default
#define LLDB_INVALID_BREAK_ID
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.
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
std::shared_ptr< lldb_private::Platform > PlatformSP
@ eLanguageTypeC
Non-standardized C, such as K&R.
std::shared_ptr< lldb_private::StructuredDataPlugin > StructuredDataPluginSP
std::weak_ptr< lldb_private::Debugger > DebuggerWP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Debugger > DebuggerSP
@ eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishNoResult
std::weak_ptr< lldb_private::Process > ProcessWP
const uint64_t NANOS_PER_MILLI
EnableOptionsSP GetGlobalEnableOptions(const DebuggerSP &debugger_sp)
const uint64_t NANOS_PER_SECOND
static OptionsMap & GetGlobalOptionsMap()
const char *const s_filter_attributes[]
std::vector< FilterRuleSP > FilterRules
bool RunEnableCommand(CommandInterpreter &interpreter)
static llvm::StringRef GetLogEventType()
void SetGlobalEnableOptions(const DebuggerSP &debugger_sp, const EnableOptionsSP &options_sp)
static bool s_is_explicitly_enabled
Global, sticky enable switch.
const uint64_t NANOS_PER_HOUR
static bool DEFAULT_FILTER_FALLTHROUGH_ACCEPTS
static std::mutex & GetGlobalOptionsMapLock()
const uint64_t NANOS_PER_MINUTE
std::shared_ptr< FilterRule > FilterRuleSP
std::shared_ptr< EnableOptions > EnableOptionsSP
const uint64_t NANOS_PER_MICRO
static llvm::StringRef GetDarwinLogTypeName()
std::map< DebuggerWP, EnableOptionsSP, std::owner_less< DebuggerWP > > OptionsMap
static constexpr OptionDefinition g_enable_option_table[]
Provides the main on-off switch for enabling darwin logging.
static StructuredDataDarwinLogProperties & GetGlobalProperties()
static void RegisterFilterOperations()
EnableOptionsSP ParseAutoEnableOptions(Status &error, Debugger &debugger)
static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr)