[Lldb-commits] [PATCH] D27305: Replace __ANDROID_NDK__ with simply ANDROID

2016-12-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I've tried to unify this slightly, but sometimes further unification would make 
things inconsistent with surrounding preprocessor directives.

I was suprised by the presence of some of these ifdefs as well -- some of them 
seem completely unnecessary. I think that at some point I'll have to make 
another pass at this and clean them up.


https://reviews.llvm.org/D27305



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


[Lldb-commits] [lldb] r288494 - Replace __ANDROID_NDK__ with __ANDROID__

2016-12-02 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri Dec  2 05:15:15 2016
New Revision: 288494

URL: http://llvm.org/viewvc/llvm-project?rev=288494=rev
Log:
Replace __ANDROID_NDK__ with __ANDROID__

Summary:
This replaces all the uses of the __ANDROID_NDK__ define with __ANDROID__. This
is a preparatory step to remove our custom android toolchain file and rely on
the standard android NDK one instead, which does not provide this define.
Instead I rely, on __ANDROID__, which is set by the compiler.

I haven't yet removed the cmake variable with the same name, as we will need to
do something completely different there -- NDK toolchain defines
CMAKE_SYSTEM_NAME to Android, while our current one pretends it's linux.

Reviewers: tberghammer, zturner

Subscribers: danalbert, srhines, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D27305

Modified:
lldb/trunk/cmake/platforms/Android.cmake
lldb/trunk/include/lldb/Core/RegularExpression.h
lldb/trunk/include/lldb/Host/Config.h
lldb/trunk/include/lldb/Host/Editline.h
lldb/trunk/include/lldb/Host/Host.h
lldb/trunk/include/lldb/Host/HostInfo.h
lldb/trunk/include/lldb/Host/Time.h
lldb/trunk/include/lldb/Host/linux/Personality.h
lldb/trunk/include/lldb/Host/posix/Fcntl.h
lldb/trunk/source/Host/common/Host.cpp
lldb/trunk/source/Host/common/Socket.cpp
lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp
lldb/trunk/source/Host/posix/HostInfoPosix.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp

lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp

lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
lldb/trunk/source/Utility/PseudoTerminal.cpp
lldb/trunk/tools/driver/Driver.cpp

Modified: lldb/trunk/cmake/platforms/Android.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/platforms/Android.cmake?rev=288494=288493=288494=diff
==
--- lldb/trunk/cmake/platforms/Android.cmake (original)
+++ lldb/trunk/cmake/platforms/Android.cmake Fri Dec  2 05:15:15 2016
@@ -33,8 +33,7 @@ set( CMAKE_SYSTEM_NAME Linux )
 include( CMakeForceCompiler )
 
 # flags and definitions
-remove_definitions( -DANDROID -D__ANDROID__ )
-add_definitions( -DANDROID -D__ANDROID_NDK__ -DLLDB_DISABLE_LIBEDIT )
+add_definitions( -DANDROID -DLLDB_DISABLE_LIBEDIT )
 set( ANDROID True )
 set( __ANDROID_NDK__ True )
 set( LLDB_DEFAULT_DISABLE_LIBEDIT True )

Modified: lldb/trunk/include/lldb/Core/RegularExpression.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/RegularExpression.h?rev=288494=288493=288494=diff
==
--- lldb/trunk/include/lldb/Core/RegularExpression.h (original)
+++ lldb/trunk/include/lldb/Core/RegularExpression.h Fri Dec  2 05:15:15 2016
@@ -31,7 +31,7 @@ inline int regexec(const llvm_regex_t *a
 
 inline void regfree(llvm_regex_t *a) { llvm_regfree(a); }
 #else
-#if __ANDROID_NDK__
+#ifdef __ANDROID__
 #include 
 #endif
 #include 

Modified: lldb/trunk/include/lldb/Host/Config.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h?rev=288494=288493=288494=diff
==
--- lldb/trunk/include/lldb/Host/Config.h (original)
+++ lldb/trunk/include/lldb/Host/Config.h Fri Dec  2 05:15:15 2016
@@ -14,7 +14,7 @@
 
 #include "lldb/Host/macosx/Config.h"
 
-#elif defined(__ANDROID_NDK__)
+#elif defined(__ANDROID__)
 
 #include "lldb/Host/android/Config.h"
 

Modified: lldb/trunk/include/lldb/Host/Editline.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Editline.h?rev=288494=288493=288494=diff
==
--- lldb/trunk/include/lldb/Host/Editline.h (original)
+++ lldb/trunk/include/lldb/Host/Editline.h Fri Dec  2 05:15:15 2016
@@ -55,11 +55,9 @@
 
 #if defined(_WIN32)
 #include "lldb/Host/windows/editlinewin.h"
-#else
-#if !defined(__ANDROID_NDK__)
+#elif !defined(__ANDROID__)
 #include 
 #endif
-#endif
 
 #include 
 #include 

Modified: lldb/trunk/include/lldb/Host/Host.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Host.h?rev=288494=288493=288494=diff
==
--- lldb/trunk/include/lldb/Host/Host.h (original)
+++ lldb/trunk/include/lldb/Host/Host.h Fri Dec  2 05:15:15 2016
@@ -209,9 +209,9 @@ public:
 
   static bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo _info);
 
-#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) ||
\
-defined(__GLIBC__) || defined(__NetBSD__)
-#if !defined(__ANDROID__) && !defined(__ANDROID_NDK__)
+#if (defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) ||   
\
+ defined(__GLIBC__) || defined(__NetBSD__)) &&  

[Lldb-commits] [PATCH] D27305: Replace __ANDROID_NDK__ with simply ANDROID

2016-12-02 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 80047.
labath added a comment.

A bit more cleanup.


https://reviews.llvm.org/D27305

Files:
  cmake/platforms/Android.cmake
  include/lldb/Core/RegularExpression.h
  include/lldb/Host/Config.h
  include/lldb/Host/Editline.h
  include/lldb/Host/Host.h
  include/lldb/Host/HostInfo.h
  include/lldb/Host/Time.h
  include/lldb/Host/linux/Personality.h
  include/lldb/Host/posix/Fcntl.h
  source/Host/common/Host.cpp
  source/Host/common/Socket.cpp
  source/Host/linux/ProcessLauncherLinux.cpp
  source/Host/posix/HostInfoPosix.cpp
  source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
  source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
  source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
  source/Utility/PseudoTerminal.cpp
  tools/driver/Driver.cpp

Index: tools/driver/Driver.cpp
===
--- tools/driver/Driver.cpp
+++ tools/driver/Driver.cpp
@@ -19,8 +19,6 @@
 #if defined(_WIN32)
 #include 
 #include 
-#elif defined(__ANDROID_NDK__)
-#include 
 #else
 #include 
 #endif
Index: source/Utility/PseudoTerminal.cpp
===
--- source/Utility/PseudoTerminal.cpp
+++ source/Utility/PseudoTerminal.cpp
@@ -20,7 +20,7 @@
 
 #include "lldb/Host/PosixApi.h"
 
-#if defined(__ANDROID_NDK__)
+#if defined(__ANDROID__)
 int posix_openpt(int flags);
 #endif
 
Index: source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
===
--- source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
+++ source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
@@ -120,7 +120,7 @@
 // the same bytes size as "double"
 #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__) &&   \
 !defined(_MSC_VER) && !defined(__mips__) && !defined(__powerpc__) &&   \
-!defined(__ANDROID_NDK__)
+!defined(__ANDROID__)
 case sizeof(long double):
   if (sizeof(long double) == sizeof(uint32_t)) {
 value.SetUInt32(reg_value, RegisterValue::eTypeLongDouble);
Index: source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
===
--- source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -9,7 +9,7 @@
 
 #include "ObjectContainerBSDArchive.h"
 
-#if defined(_WIN32) || defined(__ANDROID_NDK__)
+#if defined(_WIN32) || defined(__ANDROID__)
 // Defines from ar, missing on Windows
 #define ARMAG "!\n"
 #define SARMAG 8
Index: source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
===
--- source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
+++ source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
@@ -20,20 +20,15 @@
 #include "lldb/DataFormatters/StringPrinter.h"
 #include "lldb/DataFormatters/TypeSummary.h"
 #include "lldb/Host/Endian.h"
+#include "lldb/Host/Time.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Target/SectionLoadList.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 #include "lldb/Utility/ProcessStructReader.h"
 
 #include 
 
-#if __ANDROID_NDK__
-#include 
-#endif
-
-#include "lldb/Host/Time.h"
-
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::formatters;
Index: source/Host/posix/HostInfoPosix.cpp
===
--- source/Host/posix/HostInfoPosix.cpp
+++ source/Host/posix/HostInfoPosix.cpp
@@ -48,7 +48,7 @@
   return false;
 }
 
-#ifdef __ANDROID_NDK__
+#ifdef __ANDROID__
 #include 
 #endif
 #if defined(__ANDROID_API__) && __ANDROID_API__ < 21
Index: source/Host/linux/ProcessLauncherLinux.cpp
===
--- source/Host/linux/ProcessLauncherLinux.cpp
+++ source/Host/linux/ProcessLauncherLinux.cpp
@@ -26,7 +26,7 @@
 using namespace lldb_private;
 
 static void FixupEnvironment(Args ) {
-#ifdef __ANDROID_NDK__
+#ifdef __ANDROID__
   // If there is no PATH variable specified inside the environment then set the
   // path to /system/bin. It is required because the default path used by
   // execve() is wrong on android.
Index: source/Host/common/Socket.cpp
===
--- source/Host/common/Socket.cpp
+++ source/Host/common/Socket.cpp
@@ -33,7 +33,7 @@
 #include "lldb/Host/linux/AbstractSocket.h"
 #endif
 
-#ifdef __ANDROID_NDK__
+#ifdef __ANDROID__
 #include 
 #include 
 #include 
@@ -44,7 +44,7 @@
 #include 
 #include 
 #endif // ANDROID_ARM_BUILD_STATIC || ANDROID_MIPS_BUILD_STATIC
-#endif // __ANDROID_NDK__
+#endif // __ANDROID__
 
 using namespace lldb;
 using namespace lldb_private;
Index: source/Host/common/Host.cpp

[Lldb-commits] [PATCH] D27305: Replace __ANDROID_NDK__ with simply ANDROID

2016-12-02 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL288494: Replace __ANDROID_NDK__ with __ANDROID__ (authored 
by labath).

Changed prior to commit:
  https://reviews.llvm.org/D27305?vs=80047=80048#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D27305

Files:
  lldb/trunk/cmake/platforms/Android.cmake
  lldb/trunk/include/lldb/Core/RegularExpression.h
  lldb/trunk/include/lldb/Host/Config.h
  lldb/trunk/include/lldb/Host/Editline.h
  lldb/trunk/include/lldb/Host/Host.h
  lldb/trunk/include/lldb/Host/HostInfo.h
  lldb/trunk/include/lldb/Host/Time.h
  lldb/trunk/include/lldb/Host/linux/Personality.h
  lldb/trunk/include/lldb/Host/posix/Fcntl.h
  lldb/trunk/source/Host/common/Host.cpp
  lldb/trunk/source/Host/common/Socket.cpp
  lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp
  lldb/trunk/source/Host/posix/HostInfoPosix.cpp
  lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
  
lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
  
lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
  lldb/trunk/source/Utility/PseudoTerminal.cpp
  lldb/trunk/tools/driver/Driver.cpp

Index: lldb/trunk/cmake/platforms/Android.cmake
===
--- lldb/trunk/cmake/platforms/Android.cmake
+++ lldb/trunk/cmake/platforms/Android.cmake
@@ -33,8 +33,7 @@
 include( CMakeForceCompiler )
 
 # flags and definitions
-remove_definitions( -DANDROID -D__ANDROID__ )
-add_definitions( -DANDROID -D__ANDROID_NDK__ -DLLDB_DISABLE_LIBEDIT )
+add_definitions( -DANDROID -DLLDB_DISABLE_LIBEDIT )
 set( ANDROID True )
 set( __ANDROID_NDK__ True )
 set( LLDB_DEFAULT_DISABLE_LIBEDIT True )
Index: lldb/trunk/source/Host/common/Socket.cpp
===
--- lldb/trunk/source/Host/common/Socket.cpp
+++ lldb/trunk/source/Host/common/Socket.cpp
@@ -33,7 +33,7 @@
 #include "lldb/Host/linux/AbstractSocket.h"
 #endif
 
-#ifdef __ANDROID_NDK__
+#ifdef __ANDROID__
 #include 
 #include 
 #include 
@@ -44,7 +44,7 @@
 #include 
 #include 
 #endif // ANDROID_ARM_BUILD_STATIC || ANDROID_MIPS_BUILD_STATIC
-#endif // __ANDROID_NDK__
+#endif // __ANDROID__
 
 using namespace lldb;
 using namespace lldb_private;
Index: lldb/trunk/source/Host/common/Host.cpp
===
--- lldb/trunk/source/Host/common/Host.cpp
+++ lldb/trunk/source/Host/common/Host.cpp
@@ -29,7 +29,7 @@
 
 #if defined(__linux__) || defined(__FreeBSD__) ||  \
 defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__NetBSD__)
-#if !defined(__ANDROID__) && !defined(__ANDROID_NDK__)
+#if !defined(__ANDROID__)
 #include 
 #endif
 #include 
@@ -320,7 +320,7 @@
   return thread_self;
 #elif defined(__FreeBSD__)
   return lldb::tid_t(pthread_getthreadid_np());
-#elif defined(__ANDROID_NDK__)
+#elif defined(__ANDROID__)
   return lldb::tid_t(gettid());
 #elif defined(__linux__)
   return lldb::tid_t(syscall(SYS_gettid));
@@ -454,7 +454,7 @@
 
 FileSpec Host::GetModuleFileSpecForHostAddress(const void *host_addr) {
   FileSpec module_filespec;
-#if !defined(__ANDROID__) && !defined(__ANDROID_NDK__)
+#if !defined(__ANDROID__)
   Dl_info info;
   if (::dladdr(host_addr, )) {
 if (info.dli_fname)
@@ -622,7 +622,7 @@
 
 #if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) ||\
 defined(__GLIBC__) || defined(__NetBSD__)
-#if !defined(__ANDROID__) && !defined(__ANDROID_NDK__)
+#if !defined(__ANDROID__)
 // this method needs to be visible to macosx/Host.cpp and
 // common/Host.cpp.
 
@@ -956,7 +956,7 @@
   }
   return error.Success();
 }
-#endif // !defined(__ANDROID__) && !defined(__ANDROID_NDK__)
+#endif // !defined(__ANDROID__)
 #endif // defined (__APPLE__) || defined (__linux__) || defined (__FreeBSD__) ||
// defined (__GLIBC__) || defined(__NetBSD__)
 
Index: lldb/trunk/source/Host/posix/HostInfoPosix.cpp
===
--- lldb/trunk/source/Host/posix/HostInfoPosix.cpp
+++ lldb/trunk/source/Host/posix/HostInfoPosix.cpp
@@ -48,7 +48,7 @@
   return false;
 }
 
-#ifdef __ANDROID_NDK__
+#ifdef __ANDROID__
 #include 
 #endif
 #if defined(__ANDROID_API__) && __ANDROID_API__ < 21
Index: lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp
===
--- lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp
+++ lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp
@@ -26,7 +26,7 @@
 using namespace lldb_private;
 
 static void FixupEnvironment(Args ) {
-#ifdef __ANDROID_NDK__
+#ifdef __ANDROID__
   // If there is no PATH variable specified inside the environment then set the
   // path to /system/bin. It is required because the default path used by
   // execve() is wrong on android.
Index: lldb/trunk/source/Utility/PseudoTerminal.cpp

[Lldb-commits] [PATCH] D27289: Return "thread-pcs" in jstopinfo on Linux/Android.

2016-12-02 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In https://reviews.llvm.org/D27289#611082, @jasonmolenda wrote:

> @labath ah I see I hadn't looked at the lldb-server packets so I didn't know 
> you had jThreadsInfo, good to hear.  Yes, if your target is built mostly 
> -fomit-frame-pointer, lldb-server won't be able to do a stack walk without 
> reading eh_frame or the arm unwind info that Tamas added a year or so ago.  
> We've always avoided having lldb-server/debugserver know anything about files 
> and symbols else the memory footprint will grow and we need these stubs to 
> run in low-memory environments; I'm not sure how it could do a stalk walk.  
> It's a pretty big perf hit for lldb to walk to stacks of modern apps that 
> have tens of threads on every public stop. :(


I definitely don't want to add dwarf parsing code to lldb-server. We care a lot 
about the size of the binary as well.

Android studio does not crawl the stack of every thread after a stop -- it only 
displays the current one. What I was considering sending just K bytes of stack 
(for some reasonable value of K) around the SP of every thread, so that lldb 
does not need to do a memory read when computing the first frame of every 
thread (which I think we even if noone has asked that). But I'm talking in 
pretty vague terms now, as I haven't looked at this seriously yet. Last time I 
did a protocol profile, memory reads did not come up as a big problem, so I 
have not investigated this in details.

> Agree with not sending the registers in the jstopinfo kv pair in the T/? 
> packet - \it's such a space-inefficient encoding compared to the usual kv 
> pairs of info in the T packet, as weirdly as they're formatted.  JSON 
> requires we use base 10 for numbers, and then ascii-hex encoding it doubles 
> it (I played with the idea of using base64 for jstopinfo originally, but 
> instead worked on including the smallest amount of info we needed).
> 
> If we were going to be serious about the T packet format, I think we'd add a 
> new JT packet (or whatever) which is all the information in straight JSON, 
> and some request from lldb to enable JT packets instead of T packets.  But it 
> doesn't seem like a pressing concern, and the more we deviate from standard 
> gdb-remote protocol (even if it's optional deviation with fallback to 
> standard packets), I think it makes lldb more fragile for interop.

I'd support switching to a new stop-reply format, the current one has a lot of 
ad-hoc hacks glued onto it.


https://reviews.llvm.org/D27289



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


[Lldb-commits] [PATCH] D27305: Replace __ANDROID_NDK__ with simply ANDROID

2016-12-02 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 80043.
labath added a comment.

Update to use __ANDROID__


https://reviews.llvm.org/D27305

Files:
  cmake/platforms/Android.cmake
  include/lldb/Core/RegularExpression.h
  include/lldb/Host/Config.h
  include/lldb/Host/Editline.h
  include/lldb/Host/Host.h
  include/lldb/Host/HostInfo.h
  include/lldb/Host/Time.h
  include/lldb/Host/linux/Personality.h
  include/lldb/Host/posix/Fcntl.h
  source/Host/common/Host.cpp
  source/Host/common/Socket.cpp
  source/Host/linux/ProcessLauncherLinux.cpp
  source/Host/posix/HostInfoPosix.cpp
  source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
  source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
  source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
  source/Utility/PseudoTerminal.cpp
  tools/driver/Driver.cpp

Index: tools/driver/Driver.cpp
===
--- tools/driver/Driver.cpp
+++ tools/driver/Driver.cpp
@@ -19,7 +19,7 @@
 #if defined(_WIN32)
 #include 
 #include 
-#elif defined(__ANDROID_NDK__)
+#elif defined(__ANDROID__)
 #include 
 #else
 #include 
Index: source/Utility/PseudoTerminal.cpp
===
--- source/Utility/PseudoTerminal.cpp
+++ source/Utility/PseudoTerminal.cpp
@@ -20,7 +20,7 @@
 
 #include "lldb/Host/PosixApi.h"
 
-#if defined(__ANDROID_NDK__)
+#if defined(__ANDROID__)
 int posix_openpt(int flags);
 #endif
 
Index: source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
===
--- source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
+++ source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
@@ -120,7 +120,7 @@
 // the same bytes size as "double"
 #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__) &&   \
 !defined(_MSC_VER) && !defined(__mips__) && !defined(__powerpc__) &&   \
-!defined(__ANDROID_NDK__)
+!defined(__ANDROID__)
 case sizeof(long double):
   if (sizeof(long double) == sizeof(uint32_t)) {
 value.SetUInt32(reg_value, RegisterValue::eTypeLongDouble);
Index: source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
===
--- source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -9,7 +9,7 @@
 
 #include "ObjectContainerBSDArchive.h"
 
-#if defined(_WIN32) || defined(__ANDROID_NDK__)
+#if defined(_WIN32) || defined(__ANDROID__)
 // Defines from ar, missing on Windows
 #define ARMAG "!\n"
 #define SARMAG 8
Index: source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
===
--- source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
+++ source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
@@ -28,7 +28,7 @@
 
 #include 
 
-#if __ANDROID_NDK__
+#ifdef __ANDROID__
 #include 
 #endif
 
Index: source/Host/posix/HostInfoPosix.cpp
===
--- source/Host/posix/HostInfoPosix.cpp
+++ source/Host/posix/HostInfoPosix.cpp
@@ -48,7 +48,7 @@
   return false;
 }
 
-#ifdef __ANDROID_NDK__
+#ifdef __ANDROID__
 #include 
 #endif
 #if defined(__ANDROID_API__) && __ANDROID_API__ < 21
Index: source/Host/linux/ProcessLauncherLinux.cpp
===
--- source/Host/linux/ProcessLauncherLinux.cpp
+++ source/Host/linux/ProcessLauncherLinux.cpp
@@ -26,7 +26,7 @@
 using namespace lldb_private;
 
 static void FixupEnvironment(Args ) {
-#ifdef __ANDROID_NDK__
+#ifdef __ANDROID__
   // If there is no PATH variable specified inside the environment then set the
   // path to /system/bin. It is required because the default path used by
   // execve() is wrong on android.
Index: source/Host/common/Socket.cpp
===
--- source/Host/common/Socket.cpp
+++ source/Host/common/Socket.cpp
@@ -33,7 +33,7 @@
 #include "lldb/Host/linux/AbstractSocket.h"
 #endif
 
-#ifdef __ANDROID_NDK__
+#ifdef __ANDROID__
 #include 
 #include 
 #include 
@@ -44,7 +44,7 @@
 #include 
 #include 
 #endif // ANDROID_ARM_BUILD_STATIC || ANDROID_MIPS_BUILD_STATIC
-#endif // __ANDROID_NDK__
+#endif // __ANDROID__
 
 using namespace lldb;
 using namespace lldb_private;
Index: source/Host/common/Host.cpp
===
--- source/Host/common/Host.cpp
+++ source/Host/common/Host.cpp
@@ -29,7 +29,7 @@
 
 #if defined(__linux__) || defined(__FreeBSD__) ||  \
 defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__NetBSD__)
-#if !defined(__ANDROID__) && !defined(__ANDROID_NDK__)
+#if !defined(__ANDROID__)
 #include 
 #endif
 #include 
@@ -320,7 +320,7 @@
   return 

[Lldb-commits] [PATCH] D27305: Replace __ANDROID_NDK__ with simply ANDROID

2016-12-02 Thread Tamas Berghammer via Phabricator via lldb-commits
tberghammer added inline comments.



Comment at: include/lldb/Core/RegularExpression.h:34
 #else
-#if __ANDROID_NDK__
+#if ANDROID
 #include 

In most case you use "#ifdef". It would be nice to uniformalize



Comment at: source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp:31
 
-#if __ANDROID_NDK__
+#if ANDROID
 #include 

In most case you use "#ifdef". It would be nice to uniformalize



Comment at: 
source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp:123
 !defined(_MSC_VER) && !defined(__mips__) && !defined(__powerpc__) &&   
\
-!defined(__ANDROID_NDK__)
+!defined(ANDROID)
 case sizeof(long double):

(unrelated): What does an ANDROID specific define do in a MacOSX specific file?


https://reviews.llvm.org/D27305



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


Re: [Lldb-commits] [lldb] r288542 - Update test expectations after AddressSanitizer text descriptions changed in r288535.

2016-12-02 Thread Tim Hammerquist via lldb-commits
Thanks, Kuba!

On Fri, Dec 2, 2016 at 2:11 PM, Kuba Mracek via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: kuba.brecka
> Date: Fri Dec  2 16:11:26 2016
> New Revision: 288542
>
> URL: http://llvm.org/viewvc/llvm-project?rev=288542=rev
> Log:
> Update test expectations after AddressSanitizer text descriptions changed
> in r288535.
>
>
> Modified:
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/
> TestMemoryHistory.py
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/
> TestReportData.py
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/
> TestMemoryHistory.py
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/
> Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py?rev=
> 288542=288541=288542=diff
> 
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
> (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
> Fri Dec  2 16:11:26 2016
> @@ -121,7 +121,7 @@ class AsanTestCase(TestBase):
>  "Process should be stopped due to ASan report",
>  substrs=[
>  'stopped',
> -'stop reason = Use of deallocated memory detected'])
> +'stop reason = Use of deallocated memory'])
>
>  # make sure the 'memory history' command still works even when
> we're
>  # generating a report now
>
> Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/
> TestReportData.py
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/
> Python/lldbsuite/test/functionalities/asan/TestReportData.py?rev=288542&
> r1=288541=288542=diff
> 
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
> (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
> Fri Dec  2 16:11:26 2016
> @@ -56,7 +56,7 @@ class AsanTestReportDataCase(TestBase):
>  "Process should be stopped due to ASan report",
>  substrs=[
>  'stopped',
> -'stop reason = Use of deallocated memory detected'])
> +'stop reason = Use of deallocated memory'])
>
>  self.assertEqual(
>  self.dbg.GetSelectedTarget().process.GetSelectedThread().
> GetStopReason(),
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>



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


[Lldb-commits] [PATCH] D27380: [lldb] Update the check for Linux or FreeBSD in SymbolFileDWARF::FindFunctions.

2016-12-02 Thread Alexander Shaposhnikov via Phabricator via lldb-commits
alexshap created this revision.
alexshap added reviewers: clayborg, spyffe.
alexshap added a subscriber: lldb-commits.
alexshap set the repository for this revision to rL LLVM.

This diff

1. Adds a comment to ObjectFileELF.cpp about the current

approach to determining the OS.

2. Replaces the check in SymbolFileDWARF.cpp with a more robust one.

Test plan:

1. Checked that the build is green.
2. Built (on Linux) a test binary linked to a c++ shared library

which contains just an implementation of a function TestFunction,
the library (the binary itself) doesn't contain ELF notes and EI_OSABI is set 
to System V.
Checked in lldb that now "p TestFunction()" works fine (and doesn't work 
without this patch).


Repository:
  rL LLVM

https://reviews.llvm.org/D27380

Files:
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp


Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2586,7 +2586,7 @@
   if (sc_list.GetSize() == original_size) {
 ArchSpec arch;
 if (!parent_decl_ctx && GetObjectFile()->GetArchitecture(arch) &&
-(arch.GetTriple().isOSFreeBSD() || arch.GetTriple().isOSLinux() ||
+(arch.GetTriple().isOSBinFormatELF() ||
  arch.GetMachine() == llvm::Triple::hexagon)) {
   SymbolContextList temp_sc_list;
   FindFunctions(name, m_function_basename_index, include_inlines,
Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1513,8 +1513,14 @@
 const uint32_t sub_type = subTypeFromElfHeader(header);
 arch_spec.SetArchitecture(eArchTypeELF, header.e_machine, sub_type,
   header.e_ident[EI_OSABI]);
-//
-// Validate if it is ok to remove GetOsFromOSABI
+
+// Validate if it is ok to remove GetOsFromOSABI.
+// Note, that now the OS is determined based on EI_OSABI flag and
+// the info extracted from ELF notes (see RefineModuleDetailsFromNote).
+// However in some cases that still might be not enough: for example
+// a shared library might not have any notes at all
+// and have EI_OSABI flag set to System V,
+// as result the OS will be set to UnknownOS.
 GetOsFromOSABI(header.e_ident[EI_OSABI], ostype);
 spec_ostype = arch_spec.GetTriple().getOS();
 assert(spec_ostype == ostype);


Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2586,7 +2586,7 @@
   if (sc_list.GetSize() == original_size) {
 ArchSpec arch;
 if (!parent_decl_ctx && GetObjectFile()->GetArchitecture(arch) &&
-(arch.GetTriple().isOSFreeBSD() || arch.GetTriple().isOSLinux() ||
+(arch.GetTriple().isOSBinFormatELF() ||
  arch.GetMachine() == llvm::Triple::hexagon)) {
   SymbolContextList temp_sc_list;
   FindFunctions(name, m_function_basename_index, include_inlines,
Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1513,8 +1513,14 @@
 const uint32_t sub_type = subTypeFromElfHeader(header);
 arch_spec.SetArchitecture(eArchTypeELF, header.e_machine, sub_type,
   header.e_ident[EI_OSABI]);
-//
-// Validate if it is ok to remove GetOsFromOSABI
+
+// Validate if it is ok to remove GetOsFromOSABI.
+// Note, that now the OS is determined based on EI_OSABI flag and
+// the info extracted from ELF notes (see RefineModuleDetailsFromNote).
+// However in some cases that still might be not enough: for example
+// a shared library might not have any notes at all
+// and have EI_OSABI flag set to System V,
+// as result the OS will be set to UnknownOS.
 GetOsFromOSABI(header.e_ident[EI_OSABI], ostype);
 spec_ostype = arch_spec.GetTriple().getOS();
 assert(spec_ostype == ostype);
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D27017: Support more report types in AddressSanitizerRuntime.cpp

2016-12-02 Thread Filipe Cabecinhas via Phabricator via lldb-commits
filcab accepted this revision.
filcab added a comment.

LGTM

(I commented on a minor nit. It might just be me, so feel free to keep the 
current wording if you feel it's preferred)


https://reviews.llvm.org/D27017



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


[Lldb-commits] [PATCH] D27017: Support more report types in AddressSanitizerRuntime.cpp

2016-12-02 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL288535: Support more report types in 
AddressSanitizerRuntime.cpp, re-word existing ones. (authored by kuba.brecka).

Changed prior to commit:
  https://reviews.llvm.org/D27017?vs=79611=80123#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D27017

Files:
  
lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp


Index: 
lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
===
--- 
lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
+++ 
lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
@@ -26,6 +26,8 @@
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 
+#include "llvm/ADT/StringSwitch.h"
+
 using namespace lldb;
 using namespace lldb_private;
 
@@ -194,32 +196,45 @@
 ->GetValueForKey("description")
 ->GetAsString()
 ->GetValue();
-  if (description == "heap-use-after-free") {
-return "Use of deallocated memory detected";
-  } else if (description == "heap-buffer-overflow") {
-return "Heap buffer overflow detected";
-  } else if (description == "stack-buffer-underflow") {
-return "Stack buffer underflow detected";
-  } else if (description == "initialization-order-fiasco") {
-return "Initialization order problem detected";
-  } else if (description == "stack-buffer-overflow") {
-return "Stack buffer overflow detected";
-  } else if (description == "stack-use-after-return") {
-return "Use of returned stack memory detected";
-  } else if (description == "use-after-poison") {
-return "Use of poisoned memory detected";
-  } else if (description == "container-overflow") {
-return "Container overflow detected";
-  } else if (description == "stack-use-after-scope") {
-return "Use of out-of-scope stack memory detected";
-  } else if (description == "global-buffer-overflow") {
-return "Global buffer overflow detected";
-  } else if (description == "unknown-crash") {
-return "Invalid memory access detected";
-  }
-
-  // for unknown report codes just show the code
-  return description;
+  return llvm::StringSwitch(description)
+  .Case("heap-use-after-free", "Use of deallocated memory")
+  .Case("heap-buffer-overflow", "Heap buffer overflow")
+  .Case("stack-buffer-underflow", "Stack buffer underflow")
+  .Case("initialization-order-fiasco", "Initialization order problem")
+  .Case("stack-buffer-overflow", "Stack buffer overflow")
+  .Case("stack-use-after-return", "Use of stack memory after return")
+  .Case("use-after-poison", "Use of poisoned memory")
+  .Case("container-overflow", "Container overflow")
+  .Case("stack-use-after-scope", "Use of out-of-scope stack memory")
+  .Case("global-buffer-overflow", "Global buffer overflow")
+  .Case("unknown-crash", "Invalid memory access")
+  .Case("stack-overflow", "Stack space exhausted")
+  .Case("null-deref", "Dereference of null pointer")
+  .Case("wild-jump", "Jump to non-executable address")
+  .Case("wild-addr-write", "Write through wild pointer")
+  .Case("wild-addr-read", "Read from wild pointer")
+  .Case("wild-addr", "Access through wild pointer")
+  .Case("signal", "Deadly signal")
+  .Case("double-free", "Deallocation of freed memory")
+  .Case("new-delete-type-mismatch",
+"Deallocation size different from allocation size")
+  .Case("bad-free", "Deallocation of non-allocated memory")
+  .Case("alloc-dealloc-mismatch",
+"Mismatch between allocation and deallocation APIs")
+  .Case("bad-malloc_usable_size", "Invalid argument to malloc_usable_size")
+  .Case("bad-__sanitizer_get_allocated_size",
+"Invalid argument to __sanitizer_get_allocated_size")
+  .Case("param-overlap",
+"Call to function disallowing overlapping memory ranges")
+  .Case("negative-size-param", "Negative size used when accessing memory")
+  .Case("bad-__sanitizer_annotate_contiguous_container",
+"Invalid argument to __sanitizer_annotate_contiguous_container")
+  .Case("odr-violation", "Symbol defined in multiple translation units")
+  .Case(
+  "invalid-pointer-pair",
+  "Comparison or arithmetic on pointers from different memory regions")
+  // for unknown report codes just show the code
+  .Default("AddressSanitizer detected: " + description);
 }
 
 bool AddressSanitizerRuntime::NotifyBreakpointHit(


Index: lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
===
--- 

[Lldb-commits] [PATCH] D27017: Support more report types in AddressSanitizerRuntime.cpp

2016-12-02 Thread Kuba (Brecka) Mracek via Phabricator via lldb-commits
kubabrecka added a comment.

Thanks for reviewing this!


Repository:
  rL LLVM

https://reviews.llvm.org/D27017



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


[Lldb-commits] [PATCH] D27017: Support more report types in AddressSanitizerRuntime.cpp

2016-12-02 Thread Kuba (Brecka) Mracek via Phabricator via lldb-commits
kubabrecka added a comment.

In https://reviews.llvm.org/D27017#611894, @filcab wrote:

> LGTM
>
> (I commented on a minor nit. It might just be me, so feel free to keep the 
> current wording if you feel it's preferred)


I'm not seeing this comment.  Can you post it again?


https://reviews.llvm.org/D27017



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


Re: [Lldb-commits] [PATCH] D27017: Support more report types in AddressSanitizerRuntime.cpp

2016-12-02 Thread Filipe Cabecinhas via lldb-commits
 .Case("stack-use-after-return", "Use of returned stack memory")


Maybe "Use of stack memory after (function) return"? (i couldn't decide
whether to include "function". Either delete it or delete the parens.
This is a very minor nit, so I'm ok with keeping the current wording if you
prefer that.


On Fri, 2 Dec 2016 at 20:04, Kuba (Brecka) Mracek via Phabricator <
revi...@reviews.llvm.org> wrote:

> kubabrecka added a comment.
>
>
>
> In https://reviews.llvm.org/D27017#611894, @filcab wrote:
>
>
>
> > LGTM
>
> >
>
> > (I commented on a minor nit. It might just be me, so feel free to keep
> the current wording if you feel it's preferred)
>
>
>
>
>
> I'm not seeing this comment.  Can you post it again?
>
>
>
>
>
> https://reviews.llvm.org/D27017
>
>
>
>
>
>
>
>
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D27289: Return "thread-pcs" in jstopinfo on Linux/Android.

2016-12-02 Thread Jim Ingham via lldb-commits

> On Dec 2, 2016, at 2:47 AM, Pavel Labath via Phabricator via lldb-commits 
>  wrote:
> 
> labath added a comment.
> 
> In https://reviews.llvm.org/D27289#611082, @jasonmolenda wrote:
> 
>> @labath ah I see I hadn't looked at the lldb-server packets so I didn't know 
>> you had jThreadsInfo, good to hear.  Yes, if your target is built mostly 
>> -fomit-frame-pointer, lldb-server won't be able to do a stack walk without 
>> reading eh_frame or the arm unwind info that Tamas added a year or so ago.  
>> We've always avoided having lldb-server/debugserver know anything about 
>> files and symbols else the memory footprint will grow and we need these 
>> stubs to run in low-memory environments; I'm not sure how it could do a 
>> stalk walk.  It's a pretty big perf hit for lldb to walk to stacks of modern 
>> apps that have tens of threads on every public stop. :(
> 
> 
> I definitely don't want to add dwarf parsing code to lldb-server. We care a 
> lot about the size of the binary as well.
> 
> Android studio does not crawl the stack of every thread after a stop -- it 
> only displays the current one. What I was considering sending just K bytes of 
> stack (for some reasonable value of K) around the SP of every thread, so that 
> lldb does not need to do a memory read when computing the first frame of 
> every thread (which I think we even if noone has asked that). But I'm talking 
> in pretty vague terms now, as I haven't looked at this seriously yet. Last 
> time I did a protocol profile, memory reads did not come up as a big problem, 
> so I have not investigated this in details.

I don't think trying to accelerate a complete stack walk in the stop packet is 
desirable.  You would only use that information on a public stop, which are 
~10-20% of the total number of stops.  So you would be computing and sending 
over a bunch of information that wasn't needed most of the time.  And I agree 
that putting the code required to do an accurate stack walk into lldb-server is 
not a good idea.

However, every time you stop (not just public stops) threads that have 
non-trivial thread plans will generally need to find the current frame and its 
caller.  I try really hard not to ask for more information than I need to do 
the job, but that's generally the minimum I can get away with.  And we don't 
ask for this information for any threads that the user isn't stepping on, so we 
really only ask for the caller frame for one or two threads per stop.  

Note,  that much of the packet optimization Jason did was successful in cutting 
down the packet count, but was not all that significant when debugging to an 
iOS device where you have a decently fast connection to debugserver.  OTOH, 
even this level of optimization was significant for watchOS, which talks over 
bluetooth and the per packet cost is quite high for that communication channel. 
 I don't know what environments you are supporting, but it's something to keep 
in mind.

Jim

> 
>> Agree with not sending the registers in the jstopinfo kv pair in the T/? 
>> packet - \it's such a space-inefficient encoding compared to the usual kv 
>> pairs of info in the T packet, as weirdly as they're formatted.  JSON 
>> requires we use base 10 for numbers, and then ascii-hex encoding it doubles 
>> it (I played with the idea of using base64 for jstopinfo originally, but 
>> instead worked on including the smallest amount of info we needed).
>> 
>> If we were going to be serious about the T packet format, I think we'd add a 
>> new JT packet (or whatever) which is all the information in straight JSON, 
>> and some request from lldb to enable JT packets instead of T packets.  But 
>> it doesn't seem like a pressing concern, and the more we deviate from 
>> standard gdb-remote protocol (even if it's optional deviation with fallback 
>> to standard packets), I think it makes lldb more fragile for interop.
> 
> I'd support switching to a new stop-reply format, the current one has a lot 
> of ad-hoc hacks glued onto it.
> 
> 
> https://reviews.llvm.org/D27289
> 
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

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


[Lldb-commits] [PATCH] D27289: Return "thread-pcs" in jstopinfo on Linux/Android.

2016-12-02 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

@labath intersting idea, sending a blob of stack memory above the current stack 
pointer reg value to accelerate an unwind.  If you have a lot of small stack 
frames, it could be a performance benefit.  Common/simple methods do their work 
in 32-64 bytes of stack space (IMO) so we could look at the perf implications 
of sending up the 64 bytes of stack above $sp in the T packet.  We're locked 
into ascii for the T packet so we're talking about 128 characters plus 16 for 
the address.  It would only be needed on platforms where a frame pointer 
register is not used by default.  If you look at your packet logs, I bet lldb 
is doing a memory read on private stops as it tries to figure out what the 
caller function is - you could eliminate that packet with this, assuming 
smallish stack frames.

As mentioned, for wireless gdb-remote protocol (bluetooth, wifi) the 
performance characteristics are very different than for wired connections, but 
if we sent up that blob of stack data only on platforms without a fp reg used 
by default, it wouldn't impact the apple environments.

Agreed, I think we're all waiting for the addition of one more thing to the T 
packet to finally push us off of it, and to make up a new stop packet.  Greg's 
addition of jstopinfo almost did it for me personally. :)  The only thing I 
don't like about data sent in JSON is the base 10 requirement for numbers.  If 
we want to send up 64 bytes of stack memory, should we send that as an array of 
bytes?  Or an array of 64-bit ints that have been byteswapped by debugserver to 
big-endian format?  Right now debugserver sends up two words of memory at the 
frame pointer value - so 16 bytes on a 64-bit process - in native endian order, 
like

memory:0x7fff5fbffa90=a0fabf5fff7fad95588fff7f;


https://reviews.llvm.org/D27289



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


Re: [Lldb-commits] [PATCH] D27017: Support more report types in AddressSanitizerRuntime.cpp

2016-12-02 Thread Tim Hammerquist via lldb-commits
This commit is causing tests to fail in Darwin:

TestReportData.AsanTestReportDataCase
TestMemoryHistory.AsanTestCase

http://lab.llvm.org:8080/green/job/lldb_build_test/22768/
http://lab.llvm.org:8080/green/job/lldb_build_test/22769/

FAIL: test_dwarf (TestReportData.AsanTestReportDataCase)
--
Traceback (most recent call last):
  File 
"/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/packages/Python/lldbsuite/test/lldbtest.py",
line 1723, in dwarf_test_method
return attrvalue(self)
  File 
"/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/packages/Python/lldbsuite/test/decorators.py",
line 110, in wrapper
func(*args, **kwargs)
  File 
"/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/packages/Python/lldbsuite/test/decorators.py",
line 140, in wrapper
func(*args, **kwargs)
  File 
"/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/packages/Python/lldbsuite/test/decorators.py",
line 140, in wrapper
func(*args, **kwargs)
  File 
"/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/packages/Python/lldbsuite/test/decorators.py",
line 110, in wrapper
func(*args, **kwargs)
  File 
"/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py",
line 30, in test
self.asan_tests()
  File 
"/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py",
line 59, in asan_tests
'stop reason = Use of deallocated memory detected'])
  File 
"/Users/buildslave/jenkins/sharedspace/lldb@2/lldb/packages/Python/lldbsuite/test/lldbtest.py",
line 2247, in expect
msg if msg else EXP_MSG(str, output, exe))
AssertionError: False is not True : Process should be stopped due to ASan
report
Config=x86_64-/Users/buildslave/jenkins/sharedspace/lldb@2
/host-compiler/bin/clang-4.0




On Fri, Dec 2, 2016 at 1:12 PM, Kuba (Brecka) Mracek via Phabricator via
lldb-commits  wrote:

> kubabrecka added a comment.
>
> Thanks for reviewing this!
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D27017
>
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>



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


[Lldb-commits] [lldb] r288542 - Update test expectations after AddressSanitizer text descriptions changed in r288535.

2016-12-02 Thread Kuba Mracek via lldb-commits
Author: kuba.brecka
Date: Fri Dec  2 16:11:26 2016
New Revision: 288542

URL: http://llvm.org/viewvc/llvm-project?rev=288542=rev
Log:
Update test expectations after AddressSanitizer text descriptions changed in 
r288535.


Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py?rev=288542=288541=288542=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
 Fri Dec  2 16:11:26 2016
@@ -121,7 +121,7 @@ class AsanTestCase(TestBase):
 "Process should be stopped due to ASan report",
 substrs=[
 'stopped',
-'stop reason = Use of deallocated memory detected'])
+'stop reason = Use of deallocated memory'])
 
 # make sure the 'memory history' command still works even when we're
 # generating a report now

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py?rev=288542=288541=288542=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
 Fri Dec  2 16:11:26 2016
@@ -56,7 +56,7 @@ class AsanTestReportDataCase(TestBase):
 "Process should be stopped due to ASan report",
 substrs=[
 'stopped',
-'stop reason = Use of deallocated memory detected'])
+'stop reason = Use of deallocated memory'])
 
 self.assertEqual(
 
self.dbg.GetSelectedTarget().process.GetSelectedThread().GetStopReason(),


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