[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-24 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1e5d5261e2b6: [lldb] Add SystemLogHandler for emitting log messages to the system log (authored by JDevlieghere). Herald added a project: LLDB.

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-24 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. @labath Any chance I can nerd-snipe you into adding support for syslog (or whatever the modern equivalent is) on linux? :-) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128321/new/ https://reviews.llvm.org/D128321

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-24 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done. JDevlieghere added a comment. In D128321#3607935 , @labath wrote: > In D128321#3605592 , @JDevlieghere > wrote: > >> I also considered that, but that just delays

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-24 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked 2 inline comments as done. JDevlieghere added inline comments. Comment at: lldb/source/Host/common/Host.cpp:110 +#if !defined(__APPLE__) +void Host::SystemLog(const std::string ) { + fprintf(stderr, "%s", message.c_str()); labath wrote: >

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-24 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments. Comment at: lldb/source/Host/common/Host.cpp:110 +#if !defined(__APPLE__) +void Host::SystemLog(const std::string ) { + fprintf(stderr, "%s", message.c_str()); labath wrote: > Why std::string? I'd expect StringRef (as that's what

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-24 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision. labath added a comment. This revision is now accepted and ready to land. In D128321#3605592 , @JDevlieghere wrote: > I also considered that, but that just delays the problem until I want to > enable this handler for the

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-23 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 439588. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128321/new/ https://reviews.llvm.org/D128321 Files: lldb/include/lldb/Host/Host.h lldb/source/Host/common/Host.cpp lldb/source/Host/macosx/objcxx/Host.mm Index:

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-23 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 439583. JDevlieghere added a comment. - Move SystemLogHandler into Host - Create a new SystemLog helper function CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128321/new/ https://reviews.llvm.org/D128321 Files: lldb/include/lldb/Host/Host.h

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-23 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. In D128321#3606172 , @clayborg wrote: > So it seems like we are catering to our code organization here instead of > doing the right thing and relying on the host layer. I would rather move the > log code into the host

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-23 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. If we do add plug-ins, you could make an Apple specific plug-in named "darwin-os-log" or something that would only be compiled in for Apple builds, or we can do a generic "os-log" plug-in that uses the host layer. CHANGES SINCE LAST ACTION

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-23 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. So it seems like we are catering to our code organization here instead of doing the right thing and relying on the host layer. I would rather move the log code into the host layer or make log handlers actual plug-ins so that we can do the right thing here. If we can

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-23 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. In D128321#3603947 , @labath wrote: > In D128321#3603007 , @JDevlieghere > wrote: > >> In D128321#3602129 , @clayborg >> wrote: >> >>> I

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-23 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D128321#3603007 , @JDevlieghere wrote: > In D128321#3602129 , @clayborg > wrote: > >> I think we should allow this class to always exist and not conditionally >> compile it in or

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-22 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done. JDevlieghere added inline comments. Comment at: lldb/source/Utility/Log.cpp:406 + if (__builtin_available(macos 10.12, iOS 10, tvOS 10, watchOS 3, *)) { +os_log(g_os_log, "%{public}s", str.c_str()); + } else {

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-22 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked 2 inline comments as done. JDevlieghere added inline comments. Comment at: lldb/source/Utility/Log.cpp:406 + if (__builtin_available(macos 10.12, iOS 10, tvOS 10, watchOS 3, *)) { +os_log(g_os_log, "%{public}s", str.c_str()); + } else {

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-22 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments. Comment at: lldb/include/lldb/Utility/Log.h:98 +class SystemLogHandler : public LogHandler { +public: Doxygen comment? Comment at: lldb/source/Utility/Log.cpp:406 + if (__builtin_available(macos 10.12, iOS 10,

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-22 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 439164. JDevlieghere marked 5 inline comments as done. JDevlieghere added a comment. Address remaining code review feedback CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128321/new/ https://reviews.llvm.org/D128321 Files:

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-22 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. In D128321#3602129 , @clayborg wrote: > I think we should allow this class to always exist and not conditionally > compile it in or out. Then we add a new Host.h method to emit a log message > in "lldb/Host/Host.h" and

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-22 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment. I think we should allow this class to always exist and not conditionally compile it in or out. Then we add a new Host.h method to emit a log message in "lldb/Host/Host.h" and allow each host OS to emit a message. Maybe there is a default implementation that emits the

[Lldb-commits] [PATCH] D128321: [lldb] Add OSLog log handler

2022-06-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision. JDevlieghere added reviewers: aprantl, labath, clayborg. Herald added a project: All. JDevlieghere requested review of this revision. Add an OSLog log handler on macOS. These log messages end up in Console.app and will be part of a sysdiagnose.