[Lldb-commits] [PATCH] D13022: Use fcntl.h to retrieve the O_CREAT and O_RDRW constants.

2015-09-21 Thread Vasileios Kalintiris via lldb-commits
vkalintiris created this revision.
vkalintiris added a reviewer: clayborg.
vkalintiris added a subscriber: lldb-commits.

Normally, these macros are defined in . However, GLIBC exposes
their definition through  too. This change allows us to compile
LLDB with non-GLIBC C libraries.

http://reviews.llvm.org/D13022

Files:
  source/Core/ConnectionSharedMemory.cpp

Index: source/Core/ConnectionSharedMemory.cpp
===
--- source/Core/ConnectionSharedMemory.cpp
+++ source/Core/ConnectionSharedMemory.cpp
@@ -16,9 +16,9 @@
 #ifdef _WIN32
 #include "lldb/Host/windows/windows.h"
 #else
-#include 
 #include 
 #include 
+#include 
 #include 
 #endif
 


Index: source/Core/ConnectionSharedMemory.cpp
===
--- source/Core/ConnectionSharedMemory.cpp
+++ source/Core/ConnectionSharedMemory.cpp
@@ -16,9 +16,9 @@
 #ifdef _WIN32
 #include "lldb/Host/windows/windows.h"
 #else
-#include 
 #include 
 #include 
+#include 
 #include 
 #endif
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13022: Use fcntl.h to retrieve the O_CREAT and O_RDRW constants.

2015-09-21 Thread Vasileios Kalintiris via lldb-commits
vkalintiris updated this revision to Diff 35258.
vkalintiris updated the summary for this revision.
vkalintiris added a comment.

Use fcntl.h instead of sys/fcntl.h.


http://reviews.llvm.org/D13022

Files:
  source/Core/ConnectionSharedMemory.cpp

Index: source/Core/ConnectionSharedMemory.cpp
===
--- source/Core/ConnectionSharedMemory.cpp
+++ source/Core/ConnectionSharedMemory.cpp
@@ -16,10 +16,10 @@
 #ifdef _WIN32
 #include "lldb/Host/windows/windows.h"
 #else
-#include 
 #include 
 #include 
 #include 
+#include 
 #endif
 
 // C++ Includes


Index: source/Core/ConnectionSharedMemory.cpp
===
--- source/Core/ConnectionSharedMemory.cpp
+++ source/Core/ConnectionSharedMemory.cpp
@@ -16,10 +16,10 @@
 #ifdef _WIN32
 #include "lldb/Host/windows/windows.h"
 #else
-#include 
 #include 
 #include 
 #include 
+#include 
 #endif
 
 // C++ Includes
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13022: Use fcntl.h to retrieve the O_CREAT and O_RDRW constants.

2015-09-21 Thread Vasileios Kalintiris via lldb-commits
vkalintiris added a comment.

In http://reviews.llvm.org/D13022#249823, @emaste wrote:

> Although it ought to remain on the same line, no?


It shouldn't matter in this case. I just followed the order of the headers in 
the synopsis section of shm_open(3) on my system.
However, I noticed that we should use fcntl.h instead of sys/fcntl.h. The 
former is POSIX-compatible while the latter (based on my understanding) is 
being used to expose additional kernel-defines in some systems. Does this look 
good to you?


http://reviews.llvm.org/D13022



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D13019: Do not use pthread_{get, set}name_np() if we don't have GLIBC.

2015-09-21 Thread Vasileios Kalintiris via lldb-commits
vkalintiris created this revision.
vkalintiris added reviewers: clayborg, ovyalov.
vkalintiris added a subscriber: lldb-commits.

pthread_{get,set}name_np() are nonstandard GNU extensions which are
included only when _GNU_SOURCE is defined under GLIBC.

http://reviews.llvm.org/D13019

Files:
  source/Host/linux/HostThreadLinux.cpp

Index: source/Host/linux/HostThreadLinux.cpp
===
--- source/Host/linux/HostThreadLinux.cpp
+++ source/Host/linux/HostThreadLinux.cpp
@@ -30,18 +30,28 @@
 void
 HostThreadLinux::SetName(lldb::thread_t thread, llvm::StringRef name)
 {
+#if defined(__GLIBC__) && defined(_GNU_SOURCE)
 ::pthread_setname_np(thread, name.data());
+#else
+(void) thread;
+(void) name;
+#endif
 }
 
 void
 HostThreadLinux::GetName(lldb::thread_t thread, llvm::SmallVectorImpl 
&name)
 {
+#if defined(__GLIBC__) && defined(_GNU_SOURCE)
 // Read /proc/$TID/comm file.
 lldb::DataBufferSP buf_sp = 
process_linux::ProcFileReader::ReadIntoDataBuffer(thread, "comm");
 const char *comm_str = (const char *)buf_sp->GetBytes();
 const char *cr_str = ::strchr(comm_str, '\n');
 size_t length = cr_str ? (cr_str - comm_str) : strlen(comm_str);
 
 name.clear();
 name.append(comm_str, comm_str + length);
+#else
+(void) thread;
+(void) name;
+#endif
 }


Index: source/Host/linux/HostThreadLinux.cpp
===
--- source/Host/linux/HostThreadLinux.cpp
+++ source/Host/linux/HostThreadLinux.cpp
@@ -30,18 +30,28 @@
 void
 HostThreadLinux::SetName(lldb::thread_t thread, llvm::StringRef name)
 {
+#if defined(__GLIBC__) && defined(_GNU_SOURCE)
 ::pthread_setname_np(thread, name.data());
+#else
+(void) thread;
+(void) name;
+#endif
 }
 
 void
 HostThreadLinux::GetName(lldb::thread_t thread, llvm::SmallVectorImpl &name)
 {
+#if defined(__GLIBC__) && defined(_GNU_SOURCE)
 // Read /proc/$TID/comm file.
 lldb::DataBufferSP buf_sp = process_linux::ProcFileReader::ReadIntoDataBuffer(thread, "comm");
 const char *comm_str = (const char *)buf_sp->GetBytes();
 const char *cr_str = ::strchr(comm_str, '\n');
 size_t length = cr_str ? (cr_str - comm_str) : strlen(comm_str);
 
 name.clear();
 name.append(comm_str, comm_str + length);
+#else
+(void) thread;
+(void) name;
+#endif
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13022: Use fcntl.h to retrieve the O_CREAT and O_RDRW constants.

2015-09-22 Thread Vasileios Kalintiris via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL248255: Use fcntl.h to retrieve the O_CREAT and O_RDWR 
constants. (authored by vkalintiris).

Changed prior to commit:
  http://reviews.llvm.org/D13022?vs=35258&id=35352#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13022

Files:
  lldb/trunk/source/Core/ConnectionSharedMemory.cpp

Index: lldb/trunk/source/Core/ConnectionSharedMemory.cpp
===
--- lldb/trunk/source/Core/ConnectionSharedMemory.cpp
+++ lldb/trunk/source/Core/ConnectionSharedMemory.cpp
@@ -16,10 +16,10 @@
 #ifdef _WIN32
 #include "lldb/Host/windows/windows.h"
 #else
-#include 
 #include 
 #include 
 #include 
+#include 
 #endif
 
 // C++ Includes


Index: lldb/trunk/source/Core/ConnectionSharedMemory.cpp
===
--- lldb/trunk/source/Core/ConnectionSharedMemory.cpp
+++ lldb/trunk/source/Core/ConnectionSharedMemory.cpp
@@ -16,10 +16,10 @@
 #ifdef _WIN32
 #include "lldb/Host/windows/windows.h"
 #else
-#include 
 #include 
 #include 
 #include 
+#include 
 #endif
 
 // C++ Includes
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r248255 - Use fcntl.h to retrieve the O_CREAT and O_RDWR constants.

2015-09-22 Thread Vasileios Kalintiris via lldb-commits
Author: vkalintiris
Date: Tue Sep 22 04:46:35 2015
New Revision: 248255

URL: http://llvm.org/viewvc/llvm-project?rev=248255&view=rev
Log:
Use fcntl.h to retrieve the O_CREAT and O_RDWR constants.

Summary:
Normally, these macros are defined in fnctl.h. However, GLIBC exposes their
definition through  too. This change allows us to compile
LLDB with non-GLIBC C libraries.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13022

Modified:
lldb/trunk/source/Core/ConnectionSharedMemory.cpp

Modified: lldb/trunk/source/Core/ConnectionSharedMemory.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionSharedMemory.cpp?rev=248255&r1=248254&r2=248255&view=diff
==
--- lldb/trunk/source/Core/ConnectionSharedMemory.cpp (original)
+++ lldb/trunk/source/Core/ConnectionSharedMemory.cpp Tue Sep 22 04:46:35 2015
@@ -16,10 +16,10 @@
 #ifdef _WIN32
 #include "lldb/Host/windows/windows.h"
 #else
-#include 
 #include 
 #include 
 #include 
+#include 
 #endif
 
 // C++ Includes


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r248256 - Check for GLIBC before including execinfo.h

2015-09-22 Thread Vasileios Kalintiris via lldb-commits
Author: vkalintiris
Date: Tue Sep 22 04:53:30 2015
New Revision: 248256

URL: http://llvm.org/viewvc/llvm-project?rev=248256&view=rev
Log:
Check for GLIBC before including execinfo.h

Reviewers: ovyalov, clayborg

Subscribers: tberghammer, danalbert, llvm-commits, srhines

Differential Revision: http://reviews.llvm.org/D13016

Modified:
lldb/trunk/source/Host/linux/Host.cpp

Modified: lldb/trunk/source/Host/linux/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/Host.cpp?rev=248256&r1=248255&r2=248256&view=diff
==
--- lldb/trunk/source/Host/linux/Host.cpp (original)
+++ lldb/trunk/source/Host/linux/Host.cpp Tue Sep 22 04:53:30 2015
@@ -14,7 +14,7 @@
 #include 
 #include 
 #include 
-#ifndef __ANDROID__
+#if defined(__GLIBC__)
 #include 
 #endif
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13019: Do not use pthread_{get, set}name_np() if we don't have GLIBC.

2015-09-22 Thread Vasileios Kalintiris via lldb-commits
vkalintiris updated this revision to Diff 35357.
vkalintiris added a comment.
Herald added subscribers: srhines, danalbert, tberghammer.

Addressed reviewers comments.


http://reviews.llvm.org/D13019

Files:
  source/Host/linux/HostThreadLinux.cpp

Index: source/Host/linux/HostThreadLinux.cpp
===
--- source/Host/linux/HostThreadLinux.cpp
+++ source/Host/linux/HostThreadLinux.cpp
@@ -30,7 +30,12 @@
 void
 HostThreadLinux::SetName(lldb::thread_t thread, llvm::StringRef name)
 {
+#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || defined(__ANDROID__)
 ::pthread_setname_np(thread, name.data());
+#else
+(void) thread;
+(void) name;
+#endif
 }
 
 void


Index: source/Host/linux/HostThreadLinux.cpp
===
--- source/Host/linux/HostThreadLinux.cpp
+++ source/Host/linux/HostThreadLinux.cpp
@@ -30,7 +30,12 @@
 void
 HostThreadLinux::SetName(lldb::thread_t thread, llvm::StringRef name)
 {
+#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || defined(__ANDROID__)
 ::pthread_setname_np(thread, name.data());
+#else
+(void) thread;
+(void) name;
+#endif
 }
 
 void
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r248268 - Remove unused header .

2015-09-22 Thread Vasileios Kalintiris via lldb-commits
Author: vkalintiris
Date: Tue Sep 22 07:43:23 2015
New Revision: 248268

URL: http://llvm.org/viewvc/llvm-project?rev=248268&view=rev
Log:
Remove unused header .

Modified:
lldb/trunk/source/Host/linux/Host.cpp

Modified: lldb/trunk/source/Host/linux/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/Host.cpp?rev=248268&r1=248267&r2=248268&view=diff
==
--- lldb/trunk/source/Host/linux/Host.cpp (original)
+++ lldb/trunk/source/Host/linux/Host.cpp Tue Sep 22 07:43:23 2015
@@ -14,9 +14,6 @@
 #include 
 #include 
 #include 
-#if defined(__GLIBC__)
-#include 
-#endif
 
 // C++ Includes
 // Other libraries and framework includes


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13019: Do not use pthread_{get, set}name_np() if we don't have GLIBC.

2015-09-22 Thread Vasileios Kalintiris via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL248280: Do not use pthread_setname_np() if we don't have 
GLIBC or Android. (authored by vkalintiris).

Changed prior to commit:
  http://reviews.llvm.org/D13019?vs=35357&id=35374#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13019

Files:
  lldb/trunk/source/Host/linux/HostThreadLinux.cpp

Index: lldb/trunk/source/Host/linux/HostThreadLinux.cpp
===
--- lldb/trunk/source/Host/linux/HostThreadLinux.cpp
+++ lldb/trunk/source/Host/linux/HostThreadLinux.cpp
@@ -30,7 +30,12 @@
 void
 HostThreadLinux::SetName(lldb::thread_t thread, llvm::StringRef name)
 {
+#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || defined(__ANDROID__)
 ::pthread_setname_np(thread, name.data());
+#else
+(void) thread;
+(void) name;
+#endif
 }
 
 void


Index: lldb/trunk/source/Host/linux/HostThreadLinux.cpp
===
--- lldb/trunk/source/Host/linux/HostThreadLinux.cpp
+++ lldb/trunk/source/Host/linux/HostThreadLinux.cpp
@@ -30,7 +30,12 @@
 void
 HostThreadLinux::SetName(lldb::thread_t thread, llvm::StringRef name)
 {
+#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || defined(__ANDROID__)
 ::pthread_setname_np(thread, name.data());
+#else
+(void) thread;
+(void) name;
+#endif
 }
 
 void
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r248280 - Do not use pthread_setname_np() if we don't have GLIBC or Android.

2015-09-22 Thread Vasileios Kalintiris via lldb-commits
Author: vkalintiris
Date: Tue Sep 22 09:52:31 2015
New Revision: 248280

URL: http://llvm.org/viewvc/llvm-project?rev=248280&view=rev
Log:
Do not use pthread_setname_np() if we don't have GLIBC or Android.

Summary:
pthread_setname_np() is a nonstandard GNU extension and isn't available
in every C library. Check before it's usage that GLIBC is available or
that we are targeting Android.

Reviewers: clayborg, ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13019

Modified:
lldb/trunk/source/Host/linux/HostThreadLinux.cpp

Modified: lldb/trunk/source/Host/linux/HostThreadLinux.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/HostThreadLinux.cpp?rev=248280&r1=248279&r2=248280&view=diff
==
--- lldb/trunk/source/Host/linux/HostThreadLinux.cpp (original)
+++ lldb/trunk/source/Host/linux/HostThreadLinux.cpp Tue Sep 22 09:52:31 2015
@@ -30,7 +30,12 @@ HostThreadLinux::HostThreadLinux(lldb::t
 void
 HostThreadLinux::SetName(lldb::thread_t thread, llvm::StringRef name)
 {
+#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || defined(__ANDROID__)
 ::pthread_setname_np(thread, name.data());
+#else
+(void) thread;
+(void) name;
+#endif
 }
 
 void


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits