35 #define DARWIN_LOG_TYPE_VALUE "DarwinLog"
43 #pragma mark Anonymous Namespace
67 std::map<DebuggerWP, EnableOptionsSP, std::owner_less<DebuggerWP>>;
75 static std::mutex s_options_map_lock;
76 return s_options_map_lock;
85 DebuggerWP debugger_wp(debugger_sp);
86 auto find_it = options_map.find(debugger_wp);
87 if (find_it != options_map.end())
88 return find_it->second;
97 DebuggerWP debugger_wp(debugger_sp);
98 auto find_it = options_map.find(debugger_wp);
99 if (find_it != options_map.end())
100 find_it->second = options_sp;
102 options_map.insert(std::make_pair(debugger_wp, options_sp));
106 #pragma mark Settings Handling
110 #define LLDB_PROPERTIES_darwinlog
111 #include "StructuredDataDarwinLogProperties.inc"
114 #define LLDB_PROPERTIES_darwinlog
115 #include "StructuredDataDarwinLogPropertiesEnum.inc"
122 return g_setting_name;
126 m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName());
127 m_collection_sp->Initialize(g_darwinlog_properties);
133 const uint32_t idx = ePropertyEnableOnStartup;
134 return m_collection_sp->GetPropertyAtIndexAsBoolean(
135 nullptr, idx, g_darwinlog_properties[idx].default_uint_value != 0);
139 const uint32_t idx = ePropertyAutoEnableOptions;
140 return m_collection_sp->GetPropertyAtIndexAsString(
141 nullptr, idx, g_darwinlog_properties[idx].default_cstr_value);
183 std::function<
FilterRuleSP(
bool accept,
size_t attribute_index,
188 GetCreationFuncMap().insert(std::make_pair(operation, creation_func));
195 auto map = GetCreationFuncMap();
196 auto find_it = map.find(operation);
197 if (find_it == map.end()) {
198 error.SetErrorStringWithFormat(
"unknown filter operation \""
204 return find_it->second(match_accepts, attribute, op_arg,
error);
220 dict_p->
AddStringItem(
"type", GetOperationType().GetCString());
223 DoSerialization(*dict_p);
228 virtual void Dump(
Stream &stream)
const = 0;
234 : m_accept(accept), m_attribute_index(attribute_index),
235 m_operation(operation) {}
263 FilterRule::RegisterOperation(StaticGetOperation(), CreateOperation);
267 stream.
Printf(
"%s %s regex %s", GetMatchAccepts() ?
"accept" :
"reject",
268 GetFilterAttribute(), m_regex_text.c_str());
281 if (op_arg.empty()) {
282 error.SetErrorString(
"regex filter type requires a regex "
306 :
FilterRule(accept, attribute_index, StaticGetOperation()),
307 m_regex_text(regex_text) {}
315 FilterRule::RegisterOperation(StaticGetOperation(), CreateOperation);
319 stream.
Printf(
"%s %s match %s", GetMatchAccepts() ?
"accept" :
"reject",
320 GetFilterAttribute(), m_match_text.c_str());
332 if (op_arg.empty()) {
333 error.SetErrorString(
"exact match filter type requires an "
334 "argument containing the text that must "
335 "match the specified message attribute.");
351 :
FilterRule(accept, attribute_index, StaticGetOperation()),
352 m_match_text(match_text) {}
358 ExactMatchFilterRule::RegisterOperation();
359 RegexFilterRule::RegisterOperation();
377 "Specifies log messages from other related processes should be "
381 "Specifies debug-level log messages should be included. Specifying"
382 " --debug implies --info."},
385 "Specifies info-level log messages should be included."},
392 "Appends a filter rule to the log message filter chain. Multiple "
393 "rules may be added by specifying this option multiple times, "
394 "once per filter rule. Filter rules are processed in the order "
395 "they are specified, with the --no-match-accepts setting used "
396 "for any message that doesn't match one of the rules.\n"
398 " Filter spec format:\n"
400 " --filter \"{action} {attribute} {op}\"\n"
407 " activity | // message's most-derived activity\n"
408 " activity-chain | // message's {parent}:{child} activity\n"
409 " category | // message's category\n"
410 " message | // message's expanded contents\n"
411 " subsystem | // message's subsystem\n"
414 " match {exact-match-text} |\n"
415 " regex {search-regex}\n"
417 "The regex flavor used is the C++ std::regex ECMAScript format. "
418 "Prefer character classes like [[:digit:]] to \\d and the like, as "
419 "getting the backslashes escaped through properly is error-prone."},
422 "Specify whether logging events are live-streamed or buffered. "
423 "True indicates live streaming, false indicates buffered. The "
424 "default is true (live streaming). Live streaming will deliver "
425 "log messages with less delay, but buffered capture mode has less "
426 "of an observer effect."},
429 "Specify whether a log message that doesn't match any filter rule "
430 "is accepted or rejected, where true indicates accept. The "
434 "Specify whether os_log()/NSLog() messages are echoed to the "
435 "target program's stderr. When DarwinLog is enabled, we shut off "
436 "the mirroring of os_log()/NSLog() to the program's stderr. "
437 "Setting this flag to true will restore the stderr mirroring."
438 "The default is false."},
441 "Specify if the plugin should broadcast events. Broadcasting "
442 "log events is a requirement for displaying the log entries in "
443 "LLDB command-line. It is also required if LLDB clients want to "
444 "process log events. The default is true."},
447 OptionParser::eNoArgument,
nullptr, {}, 0,
eArgTypeNone,
448 "Include timestamp in the message header when printing a log "
449 "message. The timestamp is relative to the first displayed "
453 "Include the subsystem in the message header when displaying "
457 "Include the category in the message header when displaying "
461 "Include the activity parent-child chain in the message header "
462 "when displaying a log message. The activity hierarchy is "
463 "displayed as {grandparent-activity}:"
464 "{parent-activity}:{activity}[:...]."},
467 "Shortcut to specify that all header fields should be displayed."}};
477 m_include_debug_level =
false;
478 m_include_info_level =
false;
479 m_include_any_process =
false;
481 m_echo_to_stderr =
false;
482 m_display_timestamp_relative =
false;
483 m_display_subsystem =
false;
484 m_display_category =
false;
485 m_display_activity_chain =
false;
486 m_broadcast_events =
true;
487 m_live_stream =
true;
488 m_filter_rules.clear();
495 const int short_option = m_getopt_table[option_idx].val;
496 switch (short_option) {
498 m_include_any_process =
true;
502 m_display_timestamp_relative =
true;
503 m_display_category =
true;
504 m_display_subsystem =
true;
505 m_display_activity_chain =
true;
510 OptionArgParser::ToBoolean(option_arg,
true,
nullptr);
514 m_display_category =
true;
518 m_display_activity_chain =
true;
522 m_include_debug_level =
true;
526 m_echo_to_stderr = OptionArgParser::ToBoolean(option_arg,
false,
nullptr);
530 return ParseFilterRule(option_arg);
533 m_include_info_level =
true;
537 m_live_stream = OptionArgParser::ToBoolean(option_arg,
false,
nullptr);
541 m_filter_fall_through_accepts =
542 OptionArgParser::ToBoolean(option_arg,
true,
nullptr);
546 m_display_timestamp_relative =
true;
550 m_display_subsystem =
true;
554 error.SetErrorStringWithFormat(
"unsupported option '%c'", short_option);
567 config_sp->AddBooleanItem(
"enabled", enabled);
574 auto source_flags_sp =
576 config_sp->AddItem(
"source-flags", source_flags_sp);
578 source_flags_sp->AddBooleanItem(
"any-process", m_include_any_process);
579 source_flags_sp->AddBooleanItem(
"debug-level", m_include_debug_level);
581 source_flags_sp->AddBooleanItem(
"info-level", m_include_info_level ||
582 m_include_debug_level);
583 source_flags_sp->AddBooleanItem(
"live-stream", m_live_stream);
586 config_sp->AddBooleanItem(
"filter-fall-through-accepts",
587 m_filter_fall_through_accepts);
590 if (!m_filter_rules.empty()) {
591 auto json_filter_rules_sp =
593 config_sp->AddItem(
"filter-rules", json_filter_rules_sp);
594 for (
auto &rule_sp : m_filter_rules) {
597 json_filter_rules_sp->AddItem(rule_sp->Serialize());
607 return m_include_info_level || m_include_debug_level;
617 return m_display_timestamp_relative;
625 return m_display_timestamp_relative || m_display_activity_chain ||
626 m_display_subsystem || m_display_category;
635 if (rule_text.empty()) {
636 error.SetErrorString(
"invalid rule_text");
661 auto action_end_pos = rule_text.find(
' ');
662 if (action_end_pos == std::string::npos) {
663 error.SetErrorStringWithFormat(
"could not parse filter rule "
664 "action from \"%s\"",
665 rule_text.str().c_str());
668 auto action = rule_text.substr(0, action_end_pos);
670 if (action ==
"accept")
672 else if (action ==
"reject")
675 error.SetErrorString(
"filter action must be \"accept\" or \"deny\"");
680 auto attribute_end_pos = rule_text.find(
" ", action_end_pos + 1);
681 if (attribute_end_pos == std::string::npos) {
682 error.SetErrorStringWithFormat(
"could not parse filter rule "
683 "attribute from \"%s\"",
684 rule_text.str().c_str());
687 auto attribute = rule_text.substr(action_end_pos + 1,
688 attribute_end_pos - (action_end_pos + 1));
689 auto attribute_index = MatchAttributeIndex(attribute);
690 if (attribute_index < 0) {
691 error.SetErrorStringWithFormat(
"filter rule attribute unknown: "
693 attribute.str().c_str());
698 auto operation_end_pos = rule_text.find(
" ", attribute_end_pos + 1);
699 auto operation = rule_text.substr(
700 attribute_end_pos + 1, operation_end_pos - (attribute_end_pos + 1));
703 auto rule_sp = FilterRule::CreateRule(
707 if (rule_sp &&
error.Success())
708 m_filter_rules.push_back(rule_sp);
715 if (attribute_name == Item.value())
723 bool m_include_debug_level =
false;
724 bool m_include_info_level =
false;
725 bool m_include_any_process =
false;
727 bool m_echo_to_stderr =
false;
728 bool m_display_timestamp_relative =
false;
729 bool m_display_subsystem =
false;
730 bool m_display_category =
false;
731 bool m_display_activity_chain =
false;
732 bool m_broadcast_events =
true;
733 bool m_live_stream =
true;
740 const char *help,
const char *syntax)
746 const char *source_name) {
756 stream.
Printf(
"darwin-log source settings specify to exclude "
757 "%s messages, but setting "
758 "'plugin.structured-data.darwin-log."
759 "strict-sources' is disabled. This process will "
760 "automatically have %s messages included. Enable"
761 " the property and relaunch the target binary to have"
762 " these messages excluded.",
763 source_name, source_name);
777 DebuggerSP debugger_sp =
778 GetCommandInterpreter().GetDebugger().shared_from_this();
784 Target &target = GetSelectedOrDummyTarget();
796 if (!process_sp->IsAlive()) {
804 if (!plugin_sp || (plugin_sp->GetPluginName() !=
805 StructuredDataDarwinLog::GetStaticPluginName())) {
806 result.
AppendError(
"failed to get StructuredDataPlugin for "
824 auto config_sp = m_options_sp->BuildConfigurationData(m_enable);
829 if (!
error.Success()) {
844 return m_enable ? m_options_sp.get() :
nullptr;
857 "Show whether Darwin log supported is available"
859 "plugin structured-data darwin-log status") {}
867 Target &target = GetSelectedOrDummyTarget();
870 stream.PutCString(
"Availability: unknown (requires process)\n");
871 stream.PutCString(
"Enabled: not applicable "
872 "(requires process)\n");
876 stream.Printf(
"Availability: %s\n",
877 plugin_sp ?
"available" :
"unavailable");
878 llvm::StringRef plugin_name = StructuredDataDarwinLog::GetStaticPluginName();
880 plugin_sp ? plugin_sp->GetEnabled(
ConstString(plugin_name)) :
false;
881 stream.Printf(
"Enabled: %s\n", enabled ?
"true" :
"false");
885 DebuggerSP debugger_sp =
886 GetCommandInterpreter().GetDebugger().shared_from_this();
895 stream.PutCString(
"DarwinLog filter rules:\n");
899 if (options_sp->GetFilterRules().empty()) {
901 stream.PutCString(
"none\n");
905 for (
auto rule_sp : options_sp->GetFilterRules()) {
911 stream.Printf(
"%02d: ", rule_number);
912 rule_sp->Dump(stream);
913 stream.PutChar(
'\n');
920 stream.Printf(
"no-match behavior: %s\n",
921 options_sp->GetFallthroughAccepts() ?
"accept" :
"reject");
933 "Commands for configuring Darwin os_log "
937 auto enable_help =
"Enable Darwin log collection, or re-enable "
938 "with modified configuration.";
939 auto enable_syntax =
"plugin structured-data darwin-log enable";
940 auto enable_cmd_sp = CommandObjectSP(
943 "enable", enable_help, enable_syntax));
944 LoadSubCommand(
"enable", enable_cmd_sp);
947 auto disable_help =
"Disable Darwin log collection.";
948 auto disable_syntax =
"plugin structured-data darwin-log disable";
949 auto disable_cmd_sp = CommandObjectSP(
952 "disable", disable_help, disable_syntax));
953 LoadSubCommand(
"disable", disable_cmd_sp);
956 auto status_cmd_sp = CommandObjectSP(
new StatusCommand(interpreter));
957 LoadSubCommand(
"status", status_cmd_sp);
972 options_sp->NotifyOptionParsingStarting(&exe_ctx);
977 auto options_property_sp =
979 "auto-enable-options",
981 if (!
error.Success())
983 if (!options_property_sp) {
984 error.SetErrorString(
"failed to find option setting for "
985 "plugin.structured-data.darwin-log.");
989 const char *enable_options =
990 options_property_sp->GetAsString()->GetCurrentValue();
991 Args args(enable_options);
996 if (first_arg && (strcmp(first_arg,
"--") == 0))
1000 bool require_validation =
false;
1001 llvm::Expected<Args> args_or =
1002 options_sp->Parse(args, &exe_ctx, PlatformSP(), require_validation);
1005 log, args_or.takeError(),
1006 "Parsing plugin.structured-data.darwin-log.auto-enable-options value "
1011 if (!options_sp->VerifyOptions(result))
1021 command_stream <<
"plugin structured-data darwin-log enable";
1023 if (!enable_options.empty()) {
1024 command_stream <<
' ';
1025 command_stream << enable_options;
1038 #pragma mark Public static API
1042 void StructuredDataDarwinLog::Initialize() {
1044 PluginManager::RegisterPlugin(
1045 GetStaticPluginName(),
"Darwin os_log() and os_activity() support",
1046 &CreateInstance, &DebuggerInitialize, &FilterLaunchInfo);
1049 void StructuredDataDarwinLog::Terminate() {
1050 PluginManager::UnregisterPlugin(&CreateInstance);
1054 #pragma mark StructuredDataPlugin API
1058 bool StructuredDataDarwinLog::SupportsStructuredDataType(
1063 void StructuredDataDarwinLog::HandleArrivalOfStructuredData(
1070 object_sp->Dump(json_stream);
1073 LLDB_LOGF(log,
"StructuredDataDarwinLog::%s() called with json: %s",
1074 __FUNCTION__, json_stream.
GetData());
1080 "StructuredDataDarwinLog::%s() StructuredData object "
1089 "StructuredDataDarwinLog::%s() StructuredData type "
1090 "expected to be %s but was %s, ignoring",
1101 if (options_sp && options_sp->GetBroadcastEvents()) {
1102 LLDB_LOGF(log,
"StructuredDataDarwinLog::%s() broadcasting event",
1114 error.SetErrorString(
"Internal error: message not set.");
1119 object.Dump(object_stream);
1120 object_stream.
Flush();
1125 Status StructuredDataDarwinLog::GetDescription(
1130 error.SetErrorString(
"No structured data.");
1155 object_sp->Dump(stream);
1164 "'events' field, expected to be an array",
1177 auto event =
object->GetAsDictionary();
1186 if (!m_recorded_first_timestamp) {
1187 uint64_t timestamp = 0;
1188 if (event->GetValueForKeyAsInteger(
"timestamp", timestamp)) {
1189 m_first_timestamp_seen = timestamp;
1190 m_recorded_first_timestamp =
true;
1194 HandleDisplayOfEvent(*event, stream);
1202 bool StructuredDataDarwinLog::GetEnabled(
ConstString type_name)
const {
1204 return m_is_enabled;
1209 void StructuredDataDarwinLog::SetEnabled(
bool enabled) {
1210 m_is_enabled = enabled;
1213 void StructuredDataDarwinLog::ModulesDidLoad(
Process &process,
1216 LLDB_LOGF(log,
"StructuredDataDarwinLog::%s called (process uid %u)",
1225 "StructuredDataDarwinLog::%s not applicable, we're not "
1226 "enabled (process uid %u)",
1233 std::lock_guard<std::mutex> locker(m_added_breakpoint_mutex);
1234 if (m_added_breakpoint) {
1236 "StructuredDataDarwinLog::%s process uid %u's "
1237 "post-libtrace-init breakpoint is already set",
1246 const char *logging_module_cstr =
1248 if (!logging_module_cstr || (logging_module_cstr[0] == 0)) {
1251 "StructuredDataDarwinLog::%s no logging module name "
1252 "specified, we don't know where to set a breakpoint "
1262 bool found_logging_support_module =
false;
1263 for (
size_t i = 0; i < module_list.
GetSize(); ++i) {
1268 auto &file_spec = module_sp->GetFileSpec();
1269 found_logging_support_module =
1270 (file_spec.GetLastPathComponent() == logging_module_name);
1271 if (found_logging_support_module)
1275 if (!found_logging_support_module) {
1277 "StructuredDataDarwinLog::%s logging module %s "
1278 "has not yet been loaded, can't set a breakpoint "
1279 "yet (process uid %u)",
1280 __FUNCTION__, logging_module_name.
AsCString(),
1287 AddInitCompletionHook(process);
1289 "StructuredDataDarwinLog::%s post-init hook breakpoint "
1290 "set for logging module %s (process uid %u)",
1291 __FUNCTION__, logging_module_name.
AsCString(),
1306 StructuredDataDarwinLog::~StructuredDataDarwinLog() {
1308 ProcessSP process_sp(GetProcess());
1310 process_sp->GetTarget().RemoveBreakpointByID(m_breakpoint_id);
1317 #pragma mark Private instance methods
1321 StructuredDataDarwinLog::StructuredDataDarwinLog(
const ProcessWP &process_wp)
1323 m_first_timestamp_seen(0), m_is_enabled(false),
1324 m_added_breakpoint_mutex(), m_added_breakpoint(),
1329 StructuredDataPluginSP
1333 llvm::Triple::VendorType::Apple) {
1334 auto process_wp = ProcessWP(process.shared_from_this());
1337 return StructuredDataPluginSP();
1347 llvm::StringRef parent_command_text =
"plugin structured-data";
1348 auto parent_command =
1350 if (!parent_command) {
1356 auto command_name =
"darwin-log";
1357 auto command_sp = CommandObjectSP(
new BaseCommand(interpreter));
1358 bool result = parent_command->LoadSubCommand(command_name, command_sp);
1364 debugger, StructuredDataDarwinLogProperties::GetSettingName())) {
1365 const bool is_global_setting =
true;
1398 if (triple.getVendor() != llvm::Triple::Apple) {
1416 error.SetErrorString(
"requires a target to auto-enable DarwinLog.");
1420 DebuggerSP debugger_sp = target->
GetDebugger().shared_from_this();
1422 if (!options_sp && debugger_sp) {
1424 if (!options_sp || !
error.Success())
1432 if (!options_sp->GetEchoToStdErr()) {
1444 launch_info.
GetEnvironment()[
"IDE_DISABLED_OS_ACTIVITY_DT_MODE"] =
"1";
1449 const char *env_var_value;
1450 if (options_sp->GetIncludeDebugLevel())
1451 env_var_value =
"debug";
1452 else if (options_sp->GetIncludeInfoLevel())
1453 env_var_value =
"info";
1455 env_var_value =
"default";
1457 launch_info.
GetEnvironment()[
"OS_ACTIVITY_MODE"] = env_var_value;
1471 LLDB_LOGF(log,
"StructuredDataDarwinLog::%s() called", __FUNCTION__);
1476 "StructuredDataDarwinLog::%s() warning: no context, "
1486 "StructuredDataDarwinLog::%s() warning: invalid "
1487 "process in context, ignoring",
1491 LLDB_LOGF(log,
"StructuredDataDarwinLog::%s() call is for process uid %d",
1492 __FUNCTION__, process_sp->GetUniqueID());
1497 "StructuredDataDarwinLog::%s() warning: no plugin for "
1498 "feature %s in process uid %u",
1500 process_sp->GetUniqueID());
1505 bool called_enable_method =
false;
1506 const auto process_uid = process_sp->GetUniqueID();
1508 std::weak_ptr<StructuredDataPlugin> plugin_wp(plugin_sp);
1510 [plugin_wp, &called_enable_method, log, process_uid]() {
1512 "StructuredDataDarwinLog::post-init callback: "
1513 "called (process uid %u)",
1516 auto strong_plugin_sp = plugin_wp.lock();
1517 if (!strong_plugin_sp) {
1519 "StructuredDataDarwinLog::post-init callback: "
1520 "plugin no longer exists, ignoring (process "
1527 if (!called_enable_method) {
1529 "StructuredDataDarwinLog::post-init callback: "
1530 "calling EnableNow() (process uid %u)",
1534 called_enable_method =
true;
1539 "StructuredDataDarwinLog::post-init callback: "
1540 "skipping EnableNow(), already called by "
1541 "callback [we hit this more than once] "
1551 "StructuredDataDarwinLog::%s() warning: failed to "
1552 "retrieve the current thread from the execution "
1553 "context, nowhere to run the thread plan (process uid "
1555 __FUNCTION__, process_sp->GetUniqueID());
1560 auto thread_plan_sp =
1562 const bool abort_other_plans =
false;
1563 thread_sp->QueueThreadPlan(thread_plan_sp, abort_other_plans);
1565 "StructuredDataDarwinLog::%s() queuing thread plan on "
1566 "trace library init method entry (process uid %u)",
1567 __FUNCTION__, process_sp->GetUniqueID());
1575 LLDB_LOGF(log,
"StructuredDataDarwinLog::%s() called (process uid %u)",
1583 "StructuredDataDarwinLog::%s() ignoring request, "
1584 "breakpoint already set (process uid %u)",
1598 FileSpecList module_spec_list;
1599 auto module_file_spec =
1601 module_spec_list.Append(module_file_spec);
1604 FileSpecList *source_spec_list =
nullptr;
1606 const char *func_name =
"_libtrace_init";
1610 const bool internal =
true;
1611 const bool hardware =
false;
1614 &module_spec_list, source_spec_list, func_name, eFunctionNameTypeFull,
1616 if (!breakpoint_sp) {
1619 "StructuredDataDarwinLog::%s() failed to set "
1620 "breakpoint in module %s, function %s (process uid %u)",
1630 "StructuredDataDarwinLog::%s() breakpoint set in module %s,"
1631 "function %s (process uid %u)",
1637 uint64_t timestamp) {
1649 stream.
Printf(
"%02" PRIu64
":%02" PRIu64
":%02" PRIu64
".%09" PRIu64, hours,
1650 minutes, seconds, nanos_remaining);
1664 DebuggerSP debugger_sp =
1665 process_sp->GetTarget().GetDebugger().shared_from_this();
1678 if (!options_sp->GetDisplayAnyHeaderFields())
1683 int header_count = 0;
1684 if (options_sp->GetDisplayTimestampRelative()) {
1685 uint64_t timestamp = 0;
1692 if (options_sp->GetDisplayActivityChain()) {
1693 llvm::StringRef activity_chain;
1695 !activity_chain.empty()) {
1696 if (header_count > 0)
1707 if (options_sp->GetDisplaySubsystem()) {
1708 llvm::StringRef subsystem;
1710 !subsystem.empty()) {
1711 if (header_count > 0)
1719 if (options_sp->GetDisplayCategory()) {
1720 llvm::StringRef category;
1722 !category.empty()) {
1723 if (header_count > 0)
1750 size_t total_bytes = 0;
1758 const auto len =
message.size();
1767 total_bytes +=
sizeof(char);
1774 LLDB_LOGF(log,
"StructuredDataDarwinLog::%s() called", __FUNCTION__);
1781 "StructuredDataDarwinLog::%s() warning: failed to get "
1782 "valid process, skipping",
1786 LLDB_LOGF(log,
"StructuredDataDarwinLog::%s() call is for process uid %u",
1787 __FUNCTION__, process_sp->GetUniqueID());
1793 DebuggerSP debugger_sp =
1794 process_sp->GetTarget().GetDebugger().shared_from_this();
1797 "StructuredDataDarwinLog::%s() warning: failed to get "
1798 "debugger shared pointer, skipping (process uid %u)",
1799 __FUNCTION__, process_sp->GetUniqueID());
1807 auto &interpreter = debugger_sp->GetCommandInterpreter();
1812 "StructuredDataDarwinLog::%s() ran enable command "
1813 "successfully for (process uid %u)",
1814 __FUNCTION__, process_sp->GetUniqueID());
1817 "StructuredDataDarwinLog::%s() error: running "
1818 "enable command failed (process uid %u)",
1819 __FUNCTION__, process_sp->GetUniqueID());
1822 debugger_sp->GetID());
1828 auto config_sp = options_sp->BuildConfigurationData(
true);
1831 "StructuredDataDarwinLog::%s() warning: failed to "
1832 "build configuration data for enable options, skipping "
1834 __FUNCTION__, process_sp->GetUniqueID());
1844 if (!
error.Success()) {
1846 "StructuredDataDarwinLog::%s() "
1847 "ConfigureStructuredData() call failed "
1848 "(process uid %u): %s",
1849 __FUNCTION__, process_sp->GetUniqueID(),
error.AsCString());
1851 debugger_sp->GetID());
1856 "StructuredDataDarwinLog::%s() success via direct "
1857 "configuration (process uid %u)",
1858 __FUNCTION__, process_sp->GetUniqueID());