Skip to content

Commit 6440b10

Browse files
[lldb] Remove PRIuFT macro and use LLDB_LOG instead (#146867)
We don't want this as part of the public API, and using LLDB_LOG avoids some warnings when compiling on Windows.
1 parent 10dc4e1 commit 6440b10

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

lldb/include/lldb/lldb-types.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ typedef unsigned thread_result_t; // Host thread result type
4848
typedef thread_result_t (*thread_func_t)(void *); // Host thread function type
4949
typedef void *pipe_t; // Host pipe type is HANDLE
5050

51-
// printf macro for file_t
52-
#define PRIuFT PRIuPTR
53-
5451
#else
5552

5653
#include <pthread.h>
@@ -66,9 +63,6 @@ typedef void *thread_result_t; // Host thread result type
6663
typedef void *(*thread_func_t)(void *); // Host thread function type
6764
typedef int pipe_t; // Host pipe type
6865

69-
// printf macro for file_t
70-
#define PRIuFT PRIi32
71-
7266
#endif // _WIN32
7367

7468
#define LLDB_INVALID_PROCESS ((lldb::process_t)-1)

lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,11 @@ size_t ConnectionFileDescriptor::Read(void *dst, size_t dst_len,
272272
error = m_io_sp->Read(dst, bytes_read);
273273

274274
if (log) {
275-
LLDB_LOGF(log,
276-
"%p ConnectionFileDescriptor::Read() fd = %" PRIuFT
277-
", dst = %p, dst_len = %" PRIu64 ") => %" PRIu64 ", error = %s",
278-
static_cast<void *>(this),
279-
static_cast<file_t>(m_io_sp->GetWaitableHandle()),
280-
static_cast<void *>(dst), static_cast<uint64_t>(dst_len),
281-
static_cast<uint64_t>(bytes_read), error.AsCString());
275+
LLDB_LOG(log,
276+
"{0} ConnectionFileDescriptor::Read() fd = {1}"
277+
", dst = {2}, dst_len = {3}) => {4}, error = {5}",
278+
this, m_io_sp->GetWaitableHandle(), dst, dst_len, bytes_read,
279+
error.AsCString());
282280
}
283281

284282
if (bytes_read == 0) {
@@ -376,13 +374,11 @@ size_t ConnectionFileDescriptor::Write(const void *src, size_t src_len,
376374
error = m_io_sp->Write(src, bytes_sent);
377375

378376
if (log) {
379-
LLDB_LOGF(log,
380-
"%p ConnectionFileDescriptor::Write(fd = %" PRIuFT
381-
", src = %p, src_len = %" PRIu64 ") => %" PRIu64 " (error = %s)",
382-
static_cast<void *>(this),
383-
static_cast<file_t>(m_io_sp->GetWaitableHandle()),
384-
static_cast<const void *>(src), static_cast<uint64_t>(src_len),
385-
static_cast<uint64_t>(bytes_sent), error.AsCString());
377+
LLDB_LOG(log,
378+
"{0} ConnectionFileDescriptor::Write(fd = {1}"
379+
", src = {2}, src_len = {3}) => {4} (error = {5})",
380+
this, m_io_sp->GetWaitableHandle(), src, src_len, bytes_sent,
381+
error.AsCString());
386382
}
387383

388384
if (error_ptr)

0 commit comments

Comments
 (0)