Skip to content

[lldb] Remove more mentions of ASLLogCallback #112639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions lldb/tools/debugserver/source/RNBRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ void append_hexified_string(std::ostream &ostrm, const std::string &string) {
}
}

extern void ASLLogCallback(void *baton, uint32_t flags, const char *format,
va_list args);

// from System.framework/Versions/B/PrivateHeaders/sys/codesign.h
extern "C" {
#define CS_OPS_STATUS 0 /* return status */
Expand Down Expand Up @@ -1773,8 +1770,6 @@ static std::string get_value(std::string &line) {

extern void FileLogCallback(void *baton, uint32_t flags, const char *format,
va_list args);
extern void ASLLogCallback(void *baton, uint32_t flags, const char *format,
va_list args);

rnb_err_t RNBRemote::HandlePacket_qRcmd(const char *p) {
const char *c = p + strlen("qRcmd,");
Expand Down Expand Up @@ -1809,8 +1804,8 @@ rnb_err_t RNBRemote::HandlePacket_qRcmd(const char *p) {
static_cast<uint32_t>(strtoul(value.c_str(), &end, 0));
if (errno == 0 && end && *end == '\0') {
DNBLogSetLogMask(logmask);
if (!DNBLogGetLogCallback())
DNBLogSetLogCallback(ASLLogCallback, NULL);
if (auto log_callback = OsLogger::GetLogFunction())
DNBLogSetLogCallback(log_callback, nullptr);
return SendPacket("OK");
}
errno = 0;
Expand Down Expand Up @@ -2177,13 +2172,8 @@ rnb_err_t set_logging(const char *p) {
// Enable DNB logging.
// Use the existing log callback if one was already configured.
if (!DNBLogGetLogCallback()) {
// Use the os_log()-based logger if available; otherwise,
// fallback to ASL.
auto log_callback = OsLogger::GetLogFunction();
if (log_callback)
if (auto log_callback = OsLogger::GetLogFunction())
DNBLogSetLogCallback(log_callback, nullptr);
else
DNBLogSetLogCallback(ASLLogCallback, nullptr);
}

// Update logging to use the configured log channel bitmask.
Expand Down
8 changes: 0 additions & 8 deletions lldb/tools/debugserver/source/libdebugserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,6 @@ RNBRunLoopMode RNBRunLoopInferiorExecuting(RNBRemoteSP &remote) {
return mode;
}

void ASLLogCallback(void *baton, uint32_t flags, const char *format,
va_list args) {
#if 0
vprintf(format, args);
#endif
}

extern "C" int debug_server_main(int fd) {
#if 1
g_isatty = 0;
Expand All @@ -327,7 +320,6 @@ extern "C" int debug_server_main(int fd) {
DNBLogSetDebug(1);
DNBLogSetVerbose(1);
DNBLogSetLogMask(-1);
DNBLogSetLogCallback(ASLLogCallback, NULL);
#endif

signal(SIGPIPE, signal_handler);
Expand Down
Loading