[Lldb-commits] [PATCH] D44342: Introduce a setting to disable Spotlight while running the test suite

2018-03-12 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Does that mean we can remove the `.noindex` thingy from the build folder name? 
(In any case, the change seems fine to me).


https://reviews.llvm.org/D44342



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


[Lldb-commits] [PATCH] D44139: Update selected thread after loading mach core

2018-03-12 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I'll leave the cpp change for others to approve (though it certainly looks 
simpler than the previous one). I just have a couple of drive-by comments on 
the test.




Comment at: 
packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/TestMachCore.py:32
+# Create core form YAML.
+self.yaml2obj("test.core.yaml", "test.core")
+

this should be `getBuildArtifact("test.core") `, so it does not end up in the 
test tree (we may also consider changing the interface of this function to make 
it harder to get wrong).



Comment at: 
packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/operating_system.py:1-2
+#!/usr/bin/python
+
+import lldb

It doesn't look like this is actually executable.


Repository:
  rL LLVM

https://reviews.llvm.org/D44139



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


[Lldb-commits] [PATCH] D42145: [lldb] Use vFlash commands when writing to target's flash memory regions

2018-03-12 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.

I like this a lot. That's the kind of change I wanted to do as a follow-up one 
day. Thank you.


https://reviews.llvm.org/D42145



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: krytarowski, zturner.
Herald added a subscriber: mgorny.

This patch consists of two relatively independent changes:

- first, I teach the standalone build to detect the case when llvm was built in 
the shared mode and set the appropriate cmake variables to make the 
add_llvm_*** family of functions link against the shared library. Without 
these, the we would end up linking against the constituent .a files while other 
parts of the build (e.g. clang) would pull in the libllvm.so, which resulted in 
multiply defined symbols.

- second, I add detection code for pthread and dl libraries. This is necessary, 
because we have direct calls to these libraries (instead of going through llvm) 
and in the standalone build we cannot rely on llvm to detect these for us. In a 
standalone non-dylib build this was accidentaly working because these libraries 
were pulled in as an interface dependency of the .a files, but in a dylib build 
these are no longer part of the link interface, and so we need to add them 
explicitly.


https://reviews.llvm.org/D44379

Files:
  cmake/modules/LLDBConfig.cmake
  cmake/modules/LLDBStandalone.cmake


Index: cmake/modules/LLDBStandalone.cmake
===
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -17,7 +17,9 @@
   "--includedir"
   "--prefix"
   "--src-root"
-  "--cmakedir")
+  "--cmakedir"
+  "--shared-mode"
+  )
 execute_process(
   COMMAND ${CONFIG_COMMAND}
   RESULT_VARIABLE HAD_ERROR
@@ -44,6 +46,7 @@
   list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
   list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
   list(GET CONFIG_OUTPUT 6 LLVM_CMAKE_PATH)
+  list(GET CONFIG_OUTPUT 7 SHARED_MODE)
 
   if(NOT MSVC_IDE)
 set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
@@ -72,6 +75,11 @@
 message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
   endif()
 
+  if(SHARED_MODE STREQUAL "shared")
+set(LLVM_LINK_LLVM_DYLIB ON)
+set(LLVM_DYLIB_COMPONENTS all)
+  endif()
+
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
   set(LLVM_LIBRARY_OUTPUT_INTDIR 
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -346,12 +346,15 @@
 
 endif()
 
-if (HAVE_LIBPTHREAD)
-  list(APPEND system_libs pthread)
-endif(HAVE_LIBPTHREAD)
-
-if (HAVE_LIBDL)
-  list(APPEND system_libs ${CMAKE_DL_LIBS})
+if(UNIX)
+  set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+  find_package(Threads REQUIRED)
+  list(APPEND system_libs ${CMAKE_THREAD_LIBS_INIT})
+
+  check_library_exists(dl dlopen "" HAVE_LIBDL)
+  if (HAVE_LIBDL)
+list(APPEND system_libs ${CMAKE_DL_LIBS})
+  endif()
 endif()
 
 # Figure out if lldb could use lldb-server.  If so, then we'll


Index: cmake/modules/LLDBStandalone.cmake
===
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -17,7 +17,9 @@
   "--includedir"
   "--prefix"
   "--src-root"
-  "--cmakedir")
+  "--cmakedir"
+  "--shared-mode"
+  )
 execute_process(
   COMMAND ${CONFIG_COMMAND}
   RESULT_VARIABLE HAD_ERROR
@@ -44,6 +46,7 @@
   list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
   list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
   list(GET CONFIG_OUTPUT 6 LLVM_CMAKE_PATH)
+  list(GET CONFIG_OUTPUT 7 SHARED_MODE)
 
   if(NOT MSVC_IDE)
 set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
@@ -72,6 +75,11 @@
 message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
   endif()
 
+  if(SHARED_MODE STREQUAL "shared")
+set(LLVM_LINK_LLVM_DYLIB ON)
+set(LLVM_DYLIB_COMPONENTS all)
+  endif()
+
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
   set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -346,12 +346,15 @@
 
 endif()
 
-if (HAVE_LIBPTHREAD)
-  list(APPEND system_libs pthread)
-endif(HAVE_LIBPTHREAD)
-
-if (HAVE_LIBDL)
-  list(APPEND system_libs ${CMAKE_DL_LIBS})
+if(UNIX)
+  set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+  find_package(Threads REQUIRED)
+  list(APPEND system_libs ${CMAKE_THREAD_LIBS_INIT})
+
+  check_library_exists(dl dlopen "" HAVE_LIBDL)
+  if (HAVE_LIBDL)
+list(APPEND system_libs ${CMAKE_DL_LIBS})
+  endif()
 endif()
 
 # Figure out if lldb could use lldb-server.  If so, then we'll
___
lldb-commits mailing list
lldb-commits@lists.llvm.org

[Lldb-commits] [PATCH] D44342: Introduce a setting to disable Spotlight while running the test suite

2018-03-12 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

I would rather see this done in a more generic fashion. Any platform should be 
able to enable/disable external symbol lookups. Maybe make this setting:

  (lldb) settings set symbols.enable-external-lookups false

On Darwin this would mean dSYM. Any other platform can skip any symbol lookups 
that aren't part of the object file or specified inside the object file.


https://reviews.llvm.org/D44342



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

I can't test this right now but please make sure not to break linking to split 
shared libraries without dylib.


https://reviews.llvm.org/D44379



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Ah, yes, another build mode :/. Are you doing a standalone build or not?
I am pretty sure this will be fine for an integrated build, but I have no idea 
what will it do in the standalone mode...


https://reviews.llvm.org/D44379



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

Yes, full standalone.


https://reviews.llvm.org/D44379



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


[Lldb-commits] [PATCH] D44139: Update selected thread after loading mach core

2018-03-12 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 137993.
JDevlieghere added a comment.

Thanks for the review @labath!


https://reviews.llvm.org/D44139

Files:
  
packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/TestMachCore.py
  
packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/operating_system.py
  
packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/test.core.yaml
  source/Target/Process.cpp

Index: source/Target/Process.cpp
===
--- source/Target/Process.cpp
+++ source/Target/Process.cpp
@@ -2857,10 +2857,10 @@
 // state.
 SetPrivateState(eStateStopped);
 
-// Wait indefinitely for a stopped event since we just posted one above...
+// Wait for a stopped event since we just posted one above...
 lldb::EventSP event_sp;
-listener_sp->GetEvent(event_sp, llvm::None);
-StateType state = ProcessEventData::GetStateFromEvent(event_sp.get());
+StateType state =
+WaitForProcessToStop(seconds(10), _sp, true, listener_sp);
 
 if (!StateIsStoppedState(state, false)) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
Index: packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/test.core.yaml
===
--- /dev/null
+++ packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/test.core.yaml
@@ -0,0 +1,853 @@
+--- !mach-o
+FileHeader:  
+  magic:   0xFEEDFACF
+  cputype: 0x0107
+  cpusubtype:  0x0003
+  filetype:0x0004
+  ncmds:   59
+  sizeofcmds:  4384
+  flags:   0x
+  reserved:0x
+LoadCommands:
+  - cmd: LC_THREAD
+cmdsize: 208
+PayloadBytes:
+  - 0x04
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x2A
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x01
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x80
+  - 0xF7
+  - 0xBF
+  - 0xEF
+  - 0xFE
+  - 0x7F
+  - 0x00
+  - 0x00
+  - 0x20
+  - 0xF6
+  - 0xBF
+  - 0xEF
+  - 0xFE
+  - 0x7F
+  - 0x00
+  - 0x00
+  - 0x01
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x10
+  - 0xF6
+  - 0xBF
+  - 0xEF
+  - 0xFE
+  - 0x7F
+  - 0x00
+  - 0x00
+  - 0xF0
+  - 0xF5
+  - 0xBF
+  - 0xEF
+  - 0xFE
+  - 0x7F
+  - 0x00
+  - 0x00
+  - 0xF0
+  - 0xF5
+  - 0xBF
+  - 0xEF
+  - 0xFE
+  - 0x7F
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0xFF
+  - 0xFF
+  - 0xFF
+  - 0xFF
+  - 0xC8
+  - 0xB0
+  - 0x70
+  - 0xA7
+  - 0xFF
+  - 0x7F
+  - 0x00
+  - 0x00
+  - 0xD0
+  - 0xB0
+  - 0x70
+  - 0xA7
+  - 0xFF
+  - 0x7F
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0xA0
+  - 0x0F
+  - 0x00
+  - 0x00
+  - 0x01
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x46
+  - 0x02
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x2B
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x06
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x04
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x03
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x00
+  - 0x10
+  - 0x00
+  - 0x02
+  - 0xA7
+  - 0xFF
+  - 0x7F
+  - 0x00
+  - 0x00
+  - cmd: LC_SEGMENT_64
+cmdsize: 72
+segname: ''
+vmaddr:  4294967296
+vmsize:  4096
+fileoff: 8192
+filesize:4096
+maxprot: 5
+initprot:5
+nsects:  0
+flags:   0
+  - cmd: LC_SEGMENT_64
+cmdsize:

[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added inline comments.



Comment at: cmake/modules/LLDBConfig.cmake:354
+
+  check_library_exists(dl dlopen "" HAVE_LIBDL)
+  if (HAVE_LIBDL)

A more portable form of this:

```
foreach(lib ${CMAKE_DL_LIBS})
list(APPEND system_libs -l${lib})
endforeach()
```

Haiku needs 2 libraries, other Unices can use `-lldl` or similar.


https://reviews.llvm.org/D44379



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


[Lldb-commits] [lldb] r327318 - Improve prologue handling to support functions with multiple entry points.

2018-03-12 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Mon Mar 12 12:21:59 2018
New Revision: 327318

URL: http://llvm.org/viewvc/llvm-project?rev=327318=rev
Log:
Improve prologue handling to support functions with multiple entry points.

https://reviews.llvm.org/D42582

Patch from Leandro Lupori.

Modified:
lldb/trunk/include/lldb/Core/Architecture.h
lldb/trunk/lit/lit.cfg
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
lldb/trunk/source/Plugins/Architecture/CMakeLists.txt
lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/include/lldb/Core/Architecture.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Architecture.h?rev=327318=327317=327318=diff
==
--- lldb/trunk/include/lldb/Core/Architecture.h (original)
+++ lldb/trunk/include/lldb/Core/Architecture.h Mon Mar 12 12:21:59 2018
@@ -33,6 +33,40 @@ public:
   //--
   virtual void OverrideStopInfo(Thread ) = 0;
 
+  //--
+  /// This method is used to get the number of bytes that should be
+  /// skipped, from function start address, to reach the first
+  /// instruction after the prologue. If overrode, it must return
+  /// non-zero only if the current address matches one of the known
+  /// function entry points.
+  ///
+  /// This method is called only if the standard platform-independent
+  /// code fails to get the number of bytes to skip, giving the plugin
+  /// a chance to try to find the missing info.
+  ///
+  /// This is specifically used for PPC64, where functions may have
+  /// more than one entry point, global and local, so both should
+  /// be compared with current address, in order to find out the
+  /// number of bytes that should be skipped, in case we are stopped
+  /// at either function entry point.
+  //--
+  virtual size_t GetBytesToSkip(Symbol , const Address _addr) const {
+return 0;
+  }
+
+  //--
+  /// Adjust function breakpoint address, if needed. In some cases,
+  /// the function start address is not the right place to set the
+  /// breakpoint, specially in functions with multiple entry points.
+  ///
+  /// This is specifically used for PPC64, for functions that have
+  /// both a global and a local entry point. In this case, the
+  /// breakpoint is adjusted to the first function address reached
+  /// by both entry points.
+  //--
+  virtual void AdjustBreakpointAddress(const Symbol ,
+   Address ) const {}
+
 private:
   Architecture(const Architecture &) = delete;
   void operator=(const Architecture &) = delete;

Modified: lldb/trunk/lit/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg?rev=327318=327317=327318=diff
==
--- lldb/trunk/lit/lit.cfg (original)
+++ lldb/trunk/lit/lit.cfg Mon Mar 12 12:21:59 2018
@@ -155,6 +155,8 @@ if re.search(r'ARM', llvm_config_output_
 config.available_features.add('arm')
 if re.search(r'Mips', llvm_config_output_list[2]):
 config.available_features.add('mips')
+if re.search(r'PowerPC', llvm_config_output_list[2]):
+config.available_features.add('powerpc')
 if re.search(r'X86', llvm_config_output_list[2]):
 config.available_features.add('x86')
 llvm_config_cmd.wait()

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=327318=327317=327318=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Mar 12 12:21:59 2018
@@ -712,6 +712,7 @@
49F811F31E931B2100F4E163 /* CPlusPlusNameParser.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 49F811EF1E931B1500F4E163 /* 
CPlusPlusNameParser.cpp */; };
4C0083401B9F9BA900D5CF24 /* UtilityFunction.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp 
*/; };
4C05332B1F62121E00DED368 /* SBBreakpointOptionCommon.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4C0533291F6211FB00DED368 /* 
SBBreakpointOptionCommon.cpp */; };
+   4C14CEF020570AA300DEEF94 /* ArchitecturePPC64.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 4C14CEEE20570AA300DEEF94 /* 
ArchitecturePPC64.cpp */; };
4C2479BD1BA39295009C9A7B /* FunctionCaller.cpp in 

[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Michał Górny via Phabricator via lldb-commits
mgorny added inline comments.



Comment at: cmake/modules/LLDBConfig.cmake:354
+
+  check_library_exists(dl dlopen "" HAVE_LIBDL)
+  if (HAVE_LIBDL)

krytarowski wrote:
> A more portable form of this:
> 
> ```
> foreach(lib ${CMAKE_DL_LIBS})
> list(APPEND system_libs -l${lib})
> endforeach()
> ```
> 
> Haiku needs 2 libraries, other Unices can use `-lldl` or similar.
Didn't this raise the problem of cmake using full paths on some systems? 


https://reviews.llvm.org/D44379



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


[Lldb-commits] [PATCH] D40466: DWZ 01/11: DWARFUnit split out of DWARFCompileUnit

2018-03-12 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

This is fine. Lets start with this and then worry about each next patch. 02/11 
next.


https://reviews.llvm.org/D40466



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added inline comments.



Comment at: cmake/modules/LLDBConfig.cmake:354
+
+  check_library_exists(dl dlopen "" HAVE_LIBDL)
+  if (HAVE_LIBDL)

krytarowski wrote:
> labath wrote:
> > krytarowski wrote:
> > > mgorny wrote:
> > > > krytarowski wrote:
> > > > > A more portable form of this:
> > > > > 
> > > > > ```
> > > > > foreach(lib ${CMAKE_DL_LIBS})
> > > > > list(APPEND system_libs -l${lib})
> > > > > endforeach()
> > > > > ```
> > > > > 
> > > > > Haiku needs 2 libraries, other Unices can use `-lldl` or similar.
> > > > Didn't this raise the problem of cmake using full paths on some 
> > > > systems? 
> > > No.
> > Do you have some reference for the portability claim? (mainly because I'm 
> > trying to learn more about how cmake works, but also because I'd rather let 
> > cmake figure out when to prepend -l instead of doing it myself).
> > 
> > I don't see how the "two libraries" thingy comes into play here. It could 
> > be a problem if we are mismatching lists and strings but I don't see why 
> > that would necessitate manually tagging with -l.
> dlopen(3)-like functions in `-ldl` is Linux; HPUX uses `-ldl`, Darwin/BSDs no 
> extra libraries, Haiku `-lroot -lbe` etc.
> 
> https://github.com/Kitware/CMake/search?p=2=CMAKE_DL_LIBS==%E2%9C%93
> 
> I know that we don't support multiple OSes as of today, but we can make it 
> compatible with every recognizable one with this change.
> 
> It looks like the proper syntax is to drop `-l` from my first proposal:
> 
> ```
> foreach(lib ${CMAKE_DL_LIBS})
> list(APPEND system_libs ${lib})
> endforeach()
> ```
Or perhaps even unconditional: `list(APPEND system_libs ${CMAKE_DL_LIBS})`


https://reviews.llvm.org/D44379



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added inline comments.



Comment at: cmake/modules/LLDBConfig.cmake:354
+
+  check_library_exists(dl dlopen "" HAVE_LIBDL)
+  if (HAVE_LIBDL)

mgorny wrote:
> krytarowski wrote:
> > A more portable form of this:
> > 
> > ```
> > foreach(lib ${CMAKE_DL_LIBS})
> > list(APPEND system_libs -l${lib})
> > endforeach()
> > ```
> > 
> > Haiku needs 2 libraries, other Unices can use `-lldl` or similar.
> Didn't this raise the problem of cmake using full paths on some systems? 
No.


https://reviews.llvm.org/D44379



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Pavel Labath via Phabricator via lldb-commits
labath planned changes to this revision.
labath added a comment.

Right, so this will not work for the BUILD_SHARED_LIBS case, and there doesn't 
seem to be an easy way to make it work from this end. I'm going to try fixing 
this from the llvm side and come back to this if we still need the pthread/dl 
fixes.




Comment at: cmake/modules/LLDBConfig.cmake:354
+
+  check_library_exists(dl dlopen "" HAVE_LIBDL)
+  if (HAVE_LIBDL)

krytarowski wrote:
> mgorny wrote:
> > krytarowski wrote:
> > > A more portable form of this:
> > > 
> > > ```
> > > foreach(lib ${CMAKE_DL_LIBS})
> > > list(APPEND system_libs -l${lib})
> > > endforeach()
> > > ```
> > > 
> > > Haiku needs 2 libraries, other Unices can use `-lldl` or similar.
> > Didn't this raise the problem of cmake using full paths on some systems? 
> No.
Do you have some reference for the portability claim? (mainly because I'm 
trying to learn more about how cmake works, but also because I'd rather let 
cmake figure out when to prepend -l instead of doing it myself).

I don't see how the "two libraries" thingy comes into play here. It could be a 
problem if we are mismatching lists and strings but I don't see why that would 
necessitate manually tagging with -l.


https://reviews.llvm.org/D44379



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added inline comments.



Comment at: cmake/modules/LLDBConfig.cmake:354
+
+  check_library_exists(dl dlopen "" HAVE_LIBDL)
+  if (HAVE_LIBDL)

labath wrote:
> krytarowski wrote:
> > mgorny wrote:
> > > krytarowski wrote:
> > > > A more portable form of this:
> > > > 
> > > > ```
> > > > foreach(lib ${CMAKE_DL_LIBS})
> > > > list(APPEND system_libs -l${lib})
> > > > endforeach()
> > > > ```
> > > > 
> > > > Haiku needs 2 libraries, other Unices can use `-lldl` or similar.
> > > Didn't this raise the problem of cmake using full paths on some systems? 
> > No.
> Do you have some reference for the portability claim? (mainly because I'm 
> trying to learn more about how cmake works, but also because I'd rather let 
> cmake figure out when to prepend -l instead of doing it myself).
> 
> I don't see how the "two libraries" thingy comes into play here. It could be 
> a problem if we are mismatching lists and strings but I don't see why that 
> would necessitate manually tagging with -l.
dlopen(3)-like functions in `-ldl` is Linux; HPUX uses `-ldl`, Darwin/BSDs no 
extra libraries, Haiku `-lroot -lbe` etc.

https://github.com/Kitware/CMake/search?p=2=CMAKE_DL_LIBS==%E2%9C%93

I know that we don't support multiple OSes as of today, but we can make it 
compatible with every recognizable one with this change.

It looks like the proper syntax is to drop `-l` from my first proposal:

```
foreach(lib ${CMAKE_DL_LIBS})
list(APPEND system_libs ${lib})
endforeach()
```


https://reviews.llvm.org/D44379



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


[Lldb-commits] [PATCH] D40466: DWZ 01/11: DWARFUnit split out of DWARFCompileUnit

2018-03-12 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.

This is No functional change, right (just code churn)? If so, LGTM.


https://reviews.llvm.org/D40466



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


[Lldb-commits] [PATCH] D40474: DWZ 09/11: Main functionality

2018-03-12 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

Too many changes to give the whole thing the OK to checkin. I will worry about 
each one as an individual patch. 02/11 next.


https://reviews.llvm.org/D40474



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


[Lldb-commits] [PATCH] D42892: DWZ 02/11: Move the codebase to use: DWARFCompileUnit -> DWARFUnit

2018-03-12 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

LGTM.


https://reviews.llvm.org/D42892



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: cmake/modules/LLDBConfig.cmake:354
+
+  check_library_exists(dl dlopen "" HAVE_LIBDL)
+  if (HAVE_LIBDL)

krytarowski wrote:
> krytarowski wrote:
> > labath wrote:
> > > krytarowski wrote:
> > > > mgorny wrote:
> > > > > krytarowski wrote:
> > > > > > A more portable form of this:
> > > > > > 
> > > > > > ```
> > > > > > foreach(lib ${CMAKE_DL_LIBS})
> > > > > > list(APPEND system_libs -l${lib})
> > > > > > endforeach()
> > > > > > ```
> > > > > > 
> > > > > > Haiku needs 2 libraries, other Unices can use `-lldl` or similar.
> > > > > Didn't this raise the problem of cmake using full paths on some 
> > > > > systems? 
> > > > No.
> > > Do you have some reference for the portability claim? (mainly because I'm 
> > > trying to learn more about how cmake works, but also because I'd rather 
> > > let cmake figure out when to prepend -l instead of doing it myself).
> > > 
> > > I don't see how the "two libraries" thingy comes into play here. It could 
> > > be a problem if we are mismatching lists and strings but I don't see why 
> > > that would necessitate manually tagging with -l.
> > dlopen(3)-like functions in `-ldl` is Linux; HPUX uses `-ldl`, Darwin/BSDs 
> > no extra libraries, Haiku `-lroot -lbe` etc.
> > 
> > https://github.com/Kitware/CMake/search?p=2=CMAKE_DL_LIBS==%E2%9C%93
> > 
> > I know that we don't support multiple OSes as of today, but we can make it 
> > compatible with every recognizable one with this change.
> > 
> > It looks like the proper syntax is to drop `-l` from my first proposal:
> > 
> > ```
> > foreach(lib ${CMAKE_DL_LIBS})
> > list(APPEND system_libs ${lib})
> > endforeach()
> > ```
> Or perhaps even unconditional: `list(APPEND system_libs ${CMAKE_DL_LIBS})`
I like that: :D


https://reviews.llvm.org/D44379



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski accepted this revision.
krytarowski added a comment.
This revision is now accepted and ready to land.

I cannot test it shortly on NetBSD, but if there are any issues left (probably 
none) - I will fix it in future.




Comment at: cmake/modules/LLDBConfig.cmake:349
 
-if (HAVE_LIBPTHREAD)
-  list(APPEND system_libs pthread)
-endif(HAVE_LIBPTHREAD)
-
-if (HAVE_LIBDL)
-  list(APPEND system_libs ${CMAKE_DL_LIBS})
+if(UNIX)
+  set(CMAKE_THREAD_PREFER_PTHREAD TRUE)

labath wrote:
> krytarowski wrote:
> > Why UNIX here?
> > 
> > Why CMAKE_THREAD_PREFER_PTHREAD? It looks like used only on IRIX and that 
> > one is not going anywhere nowadays. (And certainly similarly to other 
> > commercial OSes, due to legal work/removing not-owned code, it's not 
> > possible to push it to Open-Source).
> > 
> > Assuming that system_libs can accept "-pthreads", this patch looks good to 
> > me.
> For the second part, I copied it out of the llvm's build scripts without 
> looking at what it does (with the idea of trying to maintain a consistent 
> build). However, if it's only used at irix, then I guess I can remove that.
> 
> The UNIX part is also inspired by llvm, but I simplified it a bit (they use 
> CYGWIN OR NOT WINDOWS). I was assuming the idea was to make sure we use 
> native thread support and not pthreads (which are present there sometimes, I 
> think).
I see, I would use `CYGWIN OR NOT WINDOWS` without changing the logic.

Keeping here `CMAKE_THREAD_PREFER_PTHREAD` does not make harm. non-pthreading 
on UNIX systems is rather in extinct and remnant of 90ties (Minix has something 
like that.. and lack of pthreads).

The UNIX part looks correct.


https://reviews.llvm.org/D44379



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


[Lldb-commits] [PATCH] D42892: DWZ 02/11: Move the codebase to use: DWARFCompileUnit -> DWARFUnit

2018-03-12 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision.
clayborg added inline comments.



Comment at: source/Plugins/SymbolFile/DWARF/DWARFUnit.h:34
 class DWARFUnit {
+  friend class DWARFCompileUnit;
+

DWARFCompileUnit inherits from this class. This isn't needed right?


https://reviews.llvm.org/D42892



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


[Lldb-commits] [PATCH] D44342: Introduce a setting to disable Spotlight while running the test suite

2018-03-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

Thanks for the suggestion, Greg! I renamed to option to use a more generic name 
and removed the `#if APPLE` guards.


https://reviews.llvm.org/D44342



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


Re: [Lldb-commits] [lldb] r327318 - Improve prologue handling to support functions with multiple entry points.

2018-03-12 Thread Vedant Kumar via lldb-commits
Hi Jim,

I think this breaks the Xcode bot: 
http://green.lab.llvm.org/green/job/lldb-xcode/5430/ 
. The CMake build looks 
broken too. Mind taking a look or reverting?

CompileC 
build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.o
 source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp normal x86_64 c++ 
com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/buildslave/jenkins/workspace/lldb-xcode/lldb
export LANG=en_US.US-ASCII

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack 
-fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -Wno-trigraphs 
-fpascal-strings -Os -fno-common -Wmissing-field-initializers 
-Wno-missing-prototypes -Wunreachable-code -Wnon-virtual-dtor 
-Woverloaded-virtual -Wno-exit-time-destructors -Wmissing-braces -Wparentheses 
-Wswitch -Wunused-function -Wunused-label -Wno-unused-parameter 
-Wunused-variable -Wunused-value -Wempty-body -Wuninitialized 
-Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion 
-Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion 
-Wno-shorten-64-to-32 -Wnewline-eof -Wno-c++11-extensions 
-D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DLLDB_CONFIGURATION_RELEASE 
-DLLDB_VERSION_STRING=lldb-360.99.0 -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
 -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof 
-mmacosx-version-min=10.12 -g -Wno-sign-conversion -Wno-infinite-recursion 
-Wno-move -iquote 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-generated-files.hmap
 
-I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-own-target-headers.hmap
 
-I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-all-target-headers.hmap
 -iquote 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-project-headers.hmap
 -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/include 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm/include 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm/tools/clang/include
 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/include
 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/tools/clang/include
 
-iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/lib/Target/ARM
 -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/Release/include 
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2
 
-I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/DerivedSources/x86_64
 
-I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/DerivedSources
 -Wreorder -F/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/Release 
-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/PrivateFrameworks
 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
-fno-rtti -Wglobal-constructors -Wparentheses -DHAVE_LIBZ=1 
-Wimplicit-fallthrough -DLLDB_USE_BUILTIN_DEMANGLER -DLIBXML2_DEFINED -MMD -MT 
dependencies -MF 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.d
 --serialize-diagnostics 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.dia
 -c 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
 -o 
/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.o
clang: error: no such file or directory: 
'/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp'
clang: error: no input files

thanks,
vedant

> On Mar 12, 2018, at 12:21 PM, Jim Ingham via lldb-commits 
>  wrote:
> 
> Author: jingham
> Date: Mon Mar 12 12:21:59 2018
> New Revision: 327318
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=327318=rev
> Log:
> Improve prologue handling to support functions with multiple entry points.
> 
> https://reviews.llvm.org/D42582
> 
> Patch from Leandro Lupori.
> 
> Modified:
>lldb/trunk/include/lldb/Core/Architecture.h
>lldb/trunk/lit/lit.cfg
>

[Lldb-commits] [PATCH] D44342: Introduce a setting to disable Spotlight while running the test suite

2018-03-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

In https://reviews.llvm.org/D44342#1034514, @labath wrote:

> Does that mean we can remove the `.noindex` thingy from the build folder 
> name? (In any case, the change seems fine to me).


Yes, but we could still keep it for performance reasons. Perhaps only on Darwin.


https://reviews.llvm.org/D44342



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


[Lldb-commits] [PATCH] D44342: Introduce a setting to disable Spotlight while running the test suite

2018-03-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 138082.
aprantl added a comment.

Renamed option to something more general.


https://reviews.llvm.org/D44342

Files:
  include/lldb/Core/ModuleList.h
  lit/lit-lldb-init
  lit/lit.cfg
  packages/Python/lldbsuite/test/lldbtest.py
  source/Core/ModuleList.cpp
  source/Host/macosx/Symbols.cpp

Index: source/Host/macosx/Symbols.cpp
===
--- source/Host/macosx/Symbols.cpp
+++ source/Host/macosx/Symbols.cpp
@@ -23,6 +23,7 @@
 #include "Host/macosx/cfcpp/CFCData.h"
 #include "Host/macosx/cfcpp/CFCReleaser.h"
 #include "Host/macosx/cfcpp/CFCString.h"
+#include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Symbol/ObjectFile.h"
@@ -54,6 +55,13 @@
 
 int LocateMacOSXFilesUsingDebugSymbols(const ModuleSpec _spec,
ModuleSpec _module_spec) {
+  Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+  if (!ModuleList::GetGlobalModuleListProperties().GetEnableExternalLookup()) {
+if (log)
+  log->Printf("Spotlight lookup for .dSYM bundles is disabled.");
+return 0;
+  }
+  
   return_module_spec = module_spec;
   return_module_spec.GetFileSpec().Clear();
   return_module_spec.GetSymbolFileSpec().Clear();
@@ -79,7 +87,6 @@
   if (module_uuid_ref.get()) {
 CFCReleaser exec_url;
 const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
-Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
 if (exec_fspec) {
   char exec_cf_path[PATH_MAX];
   if (exec_fspec->GetPath(exec_cf_path, sizeof(exec_cf_path)))
Index: source/Core/ModuleList.cpp
===
--- source/Core/ModuleList.cpp
+++ source/Core/ModuleList.cpp
@@ -67,12 +67,17 @@
 namespace {
 
 PropertyDefinition g_properties[] = {
+// This option only makes sense when the host is macOS.
+{"enable-external-lookup", OptionValue::eTypeBoolean, true, true, nullptr,
+ nullptr,
+ "On macOS, use Spotlight to locate a matching .dSYM bundle based on the "
+ "UUID of the executable."},
 {"clang-modules-cache-path", OptionValue::eTypeFileSpec, true, 0, nullptr,
  nullptr,
  "The path to the clang modules cache directory (-fmodules-cache-path)."},
 {nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, nullptr, nullptr}};
 
-enum { ePropertyClangModulesCachePath };
+enum { ePropertyEnableExternalLookup, ePropertyClangModulesCachePath };
 
 } // namespace
 
@@ -85,6 +90,12 @@
   SetClangModulesCachePath(path);
 }
 
+bool ModuleListProperties::GetEnableExternalLookup() const {
+  const uint32_t idx = ePropertyEnableExternalLookup;
+  return m_collection_sp->GetPropertyAtIndexAsBoolean(
+  nullptr, idx, g_properties[idx].default_uint_value != 0);
+}
+
 FileSpec ModuleListProperties::GetClangModulesCachePath() const {
   return m_collection_sp
   ->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, false,
Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -1917,13 +1917,18 @@
 # decorators.
 Base.setUp(self)
 
-# Set the clang modules cache path.
 if self.child:
+# Set the clang modules cache path.
 assert(self.getDebugInfo() == 'default')
 mod_cache = os.path.join(self.getBuildDir(), "module-cache")
 self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
 % mod_cache)
 
+# Disable Spotlight lookup. The testsuite creates
+# different binaries with the same UUID, because they only
+# differ in the debug info, which is not being hashed.
+self.runCmd('settings set symbols.enable-external-lookup false')
+
 
 if "LLDB_MAX_LAUNCH_COUNT" in os.environ:
 self.maxLaunchCount = int(os.environ["LLDB_MAX_LAUNCH_COUNT"])
Index: lit/lit.cfg
===
--- lit/lit.cfg
+++ lit/lit.cfg
@@ -55,7 +55,8 @@
 config.substitutions.append(('%python', config.python_executable))
 
 debugserver = lit.util.which('debugserver', lldb_tools_dir)
-lldb = lit.util.which('lldb', lldb_tools_dir)
+lldb = "%s -S %s/lit-lldb-init" % (lit.util.which('lldb', lldb_tools_dir),
+   config.test_source_root)
 
 if not os.path.exists(config.cc):
 config.cc = lit.util.which(config.cc, config.environment['PATH'])
Index: lit/lit-lldb-init
===
--- /dev/null
+++ lit/lit-lldb-init
@@ -0,0 +1,2 @@
+# LLDB init file for the LIT tests.
+settings set symbols.enable-external-lookup false
Index: include/lldb/Core/ModuleList.h

[Lldb-commits] [PATCH] D44342: Introduce a setting to disable Spotlight while running the test suite

2018-03-12 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: source/Core/ModuleList.cpp:70
 PropertyDefinition g_properties[] = {
+// This option only makes sense when the host is macOS.
+{"enable-external-lookup", OptionValue::eTypeBoolean, true, true, nullptr,

Remove this comment? I can apply to any platform in the future that implements 
symbol lookups right?



Comment at: source/Core/ModuleList.cpp:73-74
+ nullptr,
+ "On macOS, use Spotlight to locate a matching .dSYM bundle based on the "
+ "UUID of the executable."},
 {"clang-modules-cache-path", OptionValue::eTypeFileSpec, true, 0, nullptr,

Maybe restate this a bit? Maybe something like:

```
"Disable using external tools or linked libraries to locate symbol files."
```


https://reviews.llvm.org/D44342



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


[Lldb-commits] [PATCH] D44342: Introduce a setting to disable Spotlight while running the test suite

2018-03-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 138086.
aprantl added a comment.

More review feedback.


https://reviews.llvm.org/D44342

Files:
  include/lldb/Core/ModuleList.h
  lit/lit-lldb-init
  lit/lit.cfg
  packages/Python/lldbsuite/test/lldbtest.py
  source/Core/ModuleList.cpp
  source/Host/macosx/Symbols.cpp

Index: source/Host/macosx/Symbols.cpp
===
--- source/Host/macosx/Symbols.cpp
+++ source/Host/macosx/Symbols.cpp
@@ -23,6 +23,7 @@
 #include "Host/macosx/cfcpp/CFCData.h"
 #include "Host/macosx/cfcpp/CFCReleaser.h"
 #include "Host/macosx/cfcpp/CFCString.h"
+#include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Symbol/ObjectFile.h"
@@ -54,6 +55,13 @@
 
 int LocateMacOSXFilesUsingDebugSymbols(const ModuleSpec _spec,
ModuleSpec _module_spec) {
+  Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+  if (!ModuleList::GetGlobalModuleListProperties().GetEnableExternalLookup()) {
+if (log)
+  log->Printf("Spotlight lookup for .dSYM bundles is disabled.");
+return 0;
+  }
+  
   return_module_spec = module_spec;
   return_module_spec.GetFileSpec().Clear();
   return_module_spec.GetSymbolFileSpec().Clear();
@@ -79,7 +87,6 @@
   if (module_uuid_ref.get()) {
 CFCReleaser exec_url;
 const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
-Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
 if (exec_fspec) {
   char exec_cf_path[PATH_MAX];
   if (exec_fspec->GetPath(exec_cf_path, sizeof(exec_cf_path)))
Index: source/Core/ModuleList.cpp
===
--- source/Core/ModuleList.cpp
+++ source/Core/ModuleList.cpp
@@ -67,12 +67,17 @@
 namespace {
 
 PropertyDefinition g_properties[] = {
+{"enable-external-lookup", OptionValue::eTypeBoolean, true, true, nullptr,
+ nullptr,
+ "Control the use of external tools or libraries to locate symbol files. "
+ "On macOS, Spotlight is used to locate a matching .dSYM bundle based on "
+ "the UUID of the executable."},
 {"clang-modules-cache-path", OptionValue::eTypeFileSpec, true, 0, nullptr,
  nullptr,
  "The path to the clang modules cache directory (-fmodules-cache-path)."},
 {nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, nullptr, nullptr}};
 
-enum { ePropertyClangModulesCachePath };
+enum { ePropertyEnableExternalLookup, ePropertyClangModulesCachePath };
 
 } // namespace
 
@@ -85,6 +90,12 @@
   SetClangModulesCachePath(path);
 }
 
+bool ModuleListProperties::GetEnableExternalLookup() const {
+  const uint32_t idx = ePropertyEnableExternalLookup;
+  return m_collection_sp->GetPropertyAtIndexAsBoolean(
+  nullptr, idx, g_properties[idx].default_uint_value != 0);
+}
+
 FileSpec ModuleListProperties::GetClangModulesCachePath() const {
   return m_collection_sp
   ->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, false,
Index: packages/Python/lldbsuite/test/lldbtest.py
===
--- packages/Python/lldbsuite/test/lldbtest.py
+++ packages/Python/lldbsuite/test/lldbtest.py
@@ -1917,13 +1917,18 @@
 # decorators.
 Base.setUp(self)
 
-# Set the clang modules cache path.
 if self.child:
+# Set the clang modules cache path.
 assert(self.getDebugInfo() == 'default')
 mod_cache = os.path.join(self.getBuildDir(), "module-cache")
 self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
 % mod_cache)
 
+# Disable Spotlight lookup. The testsuite creates
+# different binaries with the same UUID, because they only
+# differ in the debug info, which is not being hashed.
+self.runCmd('settings set symbols.enable-external-lookup false')
+
 
 if "LLDB_MAX_LAUNCH_COUNT" in os.environ:
 self.maxLaunchCount = int(os.environ["LLDB_MAX_LAUNCH_COUNT"])
Index: lit/lit.cfg
===
--- lit/lit.cfg
+++ lit/lit.cfg
@@ -55,7 +55,8 @@
 config.substitutions.append(('%python', config.python_executable))
 
 debugserver = lit.util.which('debugserver', lldb_tools_dir)
-lldb = lit.util.which('lldb', lldb_tools_dir)
+lldb = "%s -S %s/lit-lldb-init" % (lit.util.which('lldb', lldb_tools_dir),
+   config.test_source_root)
 
 if not os.path.exists(config.cc):
 config.cc = lit.util.which(config.cc, config.environment['PATH'])
Index: lit/lit-lldb-init
===
--- /dev/null
+++ lit/lit-lldb-init
@@ -0,0 +1,2 @@
+# LLDB init file for the LIT tests.
+settings set symbols.enable-external-lookup false
Index: include/lldb/Core/ModuleList.h

[Lldb-commits] [PATCH] D40474: DWZ 09/11: Main functionality

2018-03-12 Thread Pavel Labath via Phabricator via lldb-commits
labath added a reviewer: davide.
labath added a comment.

I think the most controversial issue here is the testing... davide may have 
some thoughts on that.




Comment at: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:4529
+SymbolFileDWARF::DWZCommonFile::DWZCommonFile(
+std::unique_ptr &_file,
+lldb::ObjectFileSP &_file, lldb::ModuleSP &)

the references are superfluous here (this just caught my eye because it's at 
the bottom of the patch).


https://reviews.llvm.org/D40474



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added inline comments.



Comment at: cmake/modules/LLDBConfig.cmake:349
 
-if (HAVE_LIBPTHREAD)
-  list(APPEND system_libs pthread)
-endif(HAVE_LIBPTHREAD)
-
-if (HAVE_LIBDL)
-  list(APPEND system_libs ${CMAKE_DL_LIBS})
+if(UNIX)
+  set(CMAKE_THREAD_PREFER_PTHREAD TRUE)

Why UNIX here?

Why CMAKE_THREAD_PREFER_PTHREAD? It looks like used only on IRIX and that one 
is not going anywhere nowadays. (And certainly similarly to other commercial 
OSes, due to legal work/removing not-owned code, it's not possible to push it 
to Open-Source).

Assuming that system_libs can accept "-pthreads", this patch looks good to me.


https://reviews.llvm.org/D44379



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


[Lldb-commits] [PATCH] D44379: [cmake] Fix standalone+LLVM_LINK_LLVM_DYLIB builds (pr36687)

2018-03-12 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: cmake/modules/LLDBConfig.cmake:349
 
-if (HAVE_LIBPTHREAD)
-  list(APPEND system_libs pthread)
-endif(HAVE_LIBPTHREAD)
-
-if (HAVE_LIBDL)
-  list(APPEND system_libs ${CMAKE_DL_LIBS})
+if(UNIX)
+  set(CMAKE_THREAD_PREFER_PTHREAD TRUE)

krytarowski wrote:
> Why UNIX here?
> 
> Why CMAKE_THREAD_PREFER_PTHREAD? It looks like used only on IRIX and that one 
> is not going anywhere nowadays. (And certainly similarly to other commercial 
> OSes, due to legal work/removing not-owned code, it's not possible to push it 
> to Open-Source).
> 
> Assuming that system_libs can accept "-pthreads", this patch looks good to me.
For the second part, I copied it out of the llvm's build scripts without 
looking at what it does (with the idea of trying to maintain a consistent 
build). However, if it's only used at irix, then I guess I can remove that.

The UNIX part is also inspired by llvm, but I simplified it a bit (they use 
CYGWIN OR NOT WINDOWS). I was assuming the idea was to make sure we use native 
thread support and not pthreads (which are present there sometimes, I think).


https://reviews.llvm.org/D44379



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


[Lldb-commits] [lldb] r327356 - [ExpressionParser] Fix crash when evaluating invalid expresssions.

2018-03-12 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Mar 12 18:40:00 2018
New Revision: 327356

URL: http://llvm.org/viewvc/llvm-project?rev=327356=rev
Log:
[ExpressionParser] Fix crash when evaluating invalid expresssions.

Typical example, illformed comparisons (operator== where LHS and
RHS are not compatible). If a symbol matched `operator==` in any
of the object files lldb inserted a generic function declaration
in the ASTContext on which Sema operates. Maintaining the AST
context invariants is fairly tricky and sometimes resulted in
crashes inside clang (or assertions hit).

The real reason why this feature exists in the first place is
that of allowing users to do something like:
(lldb) call printf("patatino")

even if the debug informations for printf() is not available.
Eventually, we might reconsider this feature in its
entirety, but for now we can't remove it as it would break
a bunch of users. Instead, try to limit it to non-C++ symbols,
where getting the invariants right is hopefully easier.

Now you can't do in lldb anymore
(lldb) call _Zsomethingsomething(1,2,3)

but that doesn't seem to be such a big loss.



Added:
lldb/trunk/lit/Expr/Inputs/basic.cpp
lldb/trunk/lit/Expr/TestCallCppSym.test
Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp

Added: lldb/trunk/lit/Expr/Inputs/basic.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/basic.cpp?rev=327356=auto
==
--- lldb/trunk/lit/Expr/Inputs/basic.cpp (added)
+++ lldb/trunk/lit/Expr/Inputs/basic.cpp Mon Mar 12 18:40:00 2018
@@ -0,0 +1,12 @@
+class Patatino {
+private:
+  long tinky;
+
+public:
+  Patatino(long tinky) { this->tinky = tinky; }
+};
+
+int main(void) {
+  Patatino *a = new Patatino(26);
+  return 0;
+}

Added: lldb/trunk/lit/Expr/TestCallCppSym.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/TestCallCppSym.test?rev=327356=auto
==
--- lldb/trunk/lit/Expr/TestCallCppSym.test (added)
+++ lldb/trunk/lit/Expr/TestCallCppSym.test Mon Mar 12 18:40:00 2018
@@ -0,0 +1,6 @@
+# RUN: %cxx %p/Inputs/basic.cpp -g -o %t && %lldb -b -s %s -- %t 2>&1 | 
FileCheck %s
+
+breakpoint set --file basic.cpp --line 12
+run
+call (int)_Znwm(23)
+# CHECK: error: use of undeclared identifier '_Znwm'

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp?rev=327356=327355=327356=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp 
Mon Mar 12 18:40:00 2018
@@ -2072,6 +2072,15 @@ void ClangExpressionDeclMap::AddOneFunct
   return;
 }
   } else if (symbol) {
+// Don't insert a generic function decl for C++ symbol names.
+// Creating a generic function decl is almost surely going to cause 
troubles
+// as it breaks Clang/Sema invariants and causes crashes in clang while
+// we're trying to evaluate the expression.
+// This means users can't call C++ functions by mangled name when there
+// are no debug info (as it happens for C symbol, e.g. printf()).
+if (CPlusPlusLanguage::IsCPPMangledName(
+symbol->GetMangled().GetMangledName().GetCString()))
+  return;
 fun_address = symbol->GetAddress();
 function_decl = context.AddGenericFunDecl();
 is_indirect_function = symbol->IsIndirect();


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


Re: [Lldb-commits] [lldb] r327356 - [ExpressionParser] Fix crash when evaluating invalid expresssions.

2018-03-12 Thread Davide Italiano via lldb-commits
On Mon, Mar 12, 2018 at 7:27 PM, Jason Molenda via lldb-commits
 wrote:
> FWIW, we'll definitely get pushback about
>
>> Now you can't do in lldb anymore
>> (lldb) call _Zsomethingsomething(1,2,3)
>
>
> There are clever users of lldb, often working at assembly language level 
> without any symbolic information, who are able to correctly call a C++ 
> mangled function by hand.  It's not something I'd want to do personally, but 
> I'd be mad at my debugger if it gave me an error message when I told it what 
> to do.
>
>

I understand your point. We had several discussions about this and I
was really reluctant to push this change to begin with.
I thought about alternatives and basically I ended up realizing that
maintaining the invariants that the AST wants Is crazytown.
You don't need to squint too hard to see that basically nobody using
clang does this.
All the clang tools prefer to insert text in a source file and reparse
it because modifying the AST in place is hard.
It's funny that they do that because the changes they make are
generally fairly localized, but nobody really understands what Sema
really wants (note, the invariants are hardcoded in the Sema path).
Injecting a generic decl in the context and crossing finger is not
really great IMHO. It causes crashes, which, from what I understand in
the lldb world are much worse than not being able to display
informations (from what I can see the mantra of lldb is "the debugger
should never crash").

So, yes, this patch is in some way picking one of two poisons. If we
want to take a look at this again (i.e. we consider it important
enough), then the interaction between debugger and compiler needs to
be rethought to inject something less terrible than a generic decl.
This is, needless to say, fairly hard because in this case you're
getting the symbols from a Mach-O object file, so all the state you
have is a mangled symbol name, which doesn't contain enough
information to reconstruct the whole context. In swift we can do
better because we have a fully-fledged type reconstruction mechanism
(swift::ide::GetTypeFromMangledSymbolName()), and even there, we
experienced a fair amount of pain because the path still has issues
that need to be shaken.

tl;dr if somebody wants to rewrite this, I'll be very happy to support
this , but I don't see a real reason to keep the feature in an
half-baked state.

Best,

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


[Lldb-commits] [PATCH] D44342: Introduce a setting to disable Spotlight while running the test suite

2018-03-12 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

This is great.  I think I'm supposed to complain that there isn't a positive 
test that this flag works.  This is in the testsuite, but that will just give a 
negative signal - that we aren't getting random failures that are maybe due to 
leaving built test products around on your indexed volumes somewhere.

If we weren't building in a .noindex hierarchy this would be as simple as 
building the dSYM variant, then moving the dSYM to a subdirectory and making 
sure we still don't read in the dSYM.  But that won't work in a .noindex build. 
 Not sure we should be copying files to people's desktops.  /tmp/ won't work 
because Spotlight doesn't index there.  We talked briefly about having an 
indexed directory for test products as well as a no index one, which you could 
then use for that purpose.

But I'm not sure that this switch is worth that effort.  This is fine by me as 
is.


Repository:
  rL LLVM

https://reviews.llvm.org/D44342



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


[Lldb-commits] [lldb] r327350 - [lit] `llvm-mc` is now a dependency to run tests.

2018-03-12 Thread Davide Italiano via lldb-commits
Author: davide
Date: Mon Mar 12 16:42:37 2018
New Revision: 327350

URL: http://llvm.org/viewvc/llvm-project?rev=327350=rev
Log:
[lit] `llvm-mc` is now a dependency to run tests.

Modified:
lldb/trunk/lit/CMakeLists.txt

Modified: lldb/trunk/lit/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=327350=327349=327350=diff
==
--- lldb/trunk/lit/CMakeLists.txt (original)
+++ lldb/trunk/lit/CMakeLists.txt Mon Mar 12 16:42:37 2018
@@ -41,6 +41,7 @@ set(LLDB_TEST_DEPS
   lldb
   lldb-test
   llvm-config
+  llvm-mc
   llvm-objcopy
   )
 


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


Re: [Lldb-commits] [lldb] r327356 - [ExpressionParser] Fix crash when evaluating invalid expresssions.

2018-03-12 Thread Jason Molenda via lldb-commits
FWIW, we'll definitely get pushback about

> Now you can't do in lldb anymore
> (lldb) call _Zsomethingsomething(1,2,3)


There are clever users of lldb, often working at assembly language level 
without any symbolic information, who are able to correctly call a C++ mangled 
function by hand.  It's not something I'd want to do personally, but I'd be mad 
at my debugger if it gave me an error message when I told it what to do.


J



> On Mar 12, 2018, at 6:40 PM, Davide Italiano via lldb-commits 
>  wrote:
> 
> Author: davide
> Date: Mon Mar 12 18:40:00 2018
> New Revision: 327356
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=327356=rev
> Log:
> [ExpressionParser] Fix crash when evaluating invalid expresssions.
> 
> Typical example, illformed comparisons (operator== where LHS and
> RHS are not compatible). If a symbol matched `operator==` in any
> of the object files lldb inserted a generic function declaration
> in the ASTContext on which Sema operates. Maintaining the AST
> context invariants is fairly tricky and sometimes resulted in
> crashes inside clang (or assertions hit).
> 
> The real reason why this feature exists in the first place is
> that of allowing users to do something like:
> (lldb) call printf("patatino")
> 
> even if the debug informations for printf() is not available.
> Eventually, we might reconsider this feature in its
> entirety, but for now we can't remove it as it would break
> a bunch of users. Instead, try to limit it to non-C++ symbols,
> where getting the invariants right is hopefully easier.
> 
> Now you can't do in lldb anymore
> (lldb) call _Zsomethingsomething(1,2,3)
> 
> but that doesn't seem to be such a big loss.
> 
> 
> 
> Added:
>lldb/trunk/lit/Expr/Inputs/basic.cpp
>lldb/trunk/lit/Expr/TestCallCppSym.test
> Modified:
>lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
> 
> Added: lldb/trunk/lit/Expr/Inputs/basic.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/Inputs/basic.cpp?rev=327356=auto
> ==
> --- lldb/trunk/lit/Expr/Inputs/basic.cpp (added)
> +++ lldb/trunk/lit/Expr/Inputs/basic.cpp Mon Mar 12 18:40:00 2018
> @@ -0,0 +1,12 @@
> +class Patatino {
> +private:
> +  long tinky;
> +
> +public:
> +  Patatino(long tinky) { this->tinky = tinky; }
> +};
> +
> +int main(void) {
> +  Patatino *a = new Patatino(26);
> +  return 0;
> +}
> 
> Added: lldb/trunk/lit/Expr/TestCallCppSym.test
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Expr/TestCallCppSym.test?rev=327356=auto
> ==
> --- lldb/trunk/lit/Expr/TestCallCppSym.test (added)
> +++ lldb/trunk/lit/Expr/TestCallCppSym.test Mon Mar 12 18:40:00 2018
> @@ -0,0 +1,6 @@
> +# RUN: %cxx %p/Inputs/basic.cpp -g -o %t && %lldb -b -s %s -- %t 2>&1 | 
> FileCheck %s
> +
> +breakpoint set --file basic.cpp --line 12
> +run
> +call (int)_Znwm(23)
> +# CHECK: error: use of undeclared identifier '_Znwm'
> 
> Modified: 
> lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp?rev=327356=327355=327356=diff
> ==
> --- 
> lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp 
> (original)
> +++ 
> lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp 
> Mon Mar 12 18:40:00 2018
> @@ -2072,6 +2072,15 @@ void ClangExpressionDeclMap::AddOneFunct
>   return;
> }
>   } else if (symbol) {
> +// Don't insert a generic function decl for C++ symbol names.
> +// Creating a generic function decl is almost surely going to cause 
> troubles
> +// as it breaks Clang/Sema invariants and causes crashes in clang while
> +// we're trying to evaluate the expression.
> +// This means users can't call C++ functions by mangled name when there
> +// are no debug info (as it happens for C symbol, e.g. printf()).
> +if (CPlusPlusLanguage::IsCPPMangledName(
> +symbol->GetMangled().GetMangledName().GetCString()))
> +  return;
> fun_address = symbol->GetAddress();
> function_decl = context.AddGenericFunDecl();
> is_indirect_function = symbol->IsIndirect();
> 
> 
> ___
> 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


Re: [Lldb-commits] [lldb] r327318 - Improve prologue handling to support functions with multiple entry points.

2018-03-12 Thread Vedant Kumar via lldb-commits
I needed to revert this in r327327 to get the bots going again.

vedant

> On Mar 12, 2018, at 1:26 PM, Vedant Kumar via lldb-commits 
>  wrote:
> 
> Hi Jim,
> 
> I think this breaks the Xcode bot: 
> http://green.lab.llvm.org/green/job/lldb-xcode/5430/ 
> . The CMake build looks 
> broken too. Mind taking a look or reverting?
> 
> CompileC 
> build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.o
>  source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp normal x86_64 c++ 
> com.apple.compilers.llvm.clang.1_0.compiler
> cd /Users/buildslave/jenkins/workspace/lldb-xcode/lldb
> export LANG=en_US.US-ASCII
> 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
>  -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack 
> -fmacro-backtrace-limit=0 -std=c++11 -stdlib=libc++ -Wno-trigraphs 
> -fpascal-strings -Os -fno-common -Wmissing-field-initializers 
> -Wno-missing-prototypes -Wunreachable-code -Wnon-virtual-dtor 
> -Woverloaded-virtual -Wno-exit-time-destructors -Wmissing-braces 
> -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wno-unused-parameter 
> -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized 
> -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion 
> -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion 
> -Wno-shorten-64-to-32 -Wnewline-eof -Wno-c++11-extensions 
> -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DLLDB_CONFIGURATION_RELEASE 
> -DLLDB_VERSION_STRING=lldb-360.99.0 -isysroot 
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
>  -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof 
> -mmacosx-version-min=10.12 -g -Wno-sign-conversion -Wno-infinite-recursion 
> -Wno-move -iquote 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-generated-files.hmap
>  
> -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-own-target-headers.hmap
>  
> -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-all-target-headers.hmap
>  -iquote 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/liblldb-core-project-headers.hmap
>  -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/include 
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source 
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm/include 
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm/tools/clang/include
>  
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/include
>  
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/tools/clang/include
>  
> -iquote/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/llvm-build/Release+Asserts/x86_64/lib/Target/ARM
>  -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/Release/include 
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2
>  
> -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/DerivedSources/x86_64
>  
> -I/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/DerivedSources
>  -Wreorder 
> -F/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/Release 
> -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/PrivateFrameworks
>  -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 
> -fno-rtti -Wglobal-constructors -Wparentheses -DHAVE_LIBZ=1 
> -Wimplicit-fallthrough -DLLDB_USE_BUILTIN_DEMANGLER -DLIBXML2_DEFINED -MMD 
> -MT dependencies -MF 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.d
>  --serialize-diagnostics 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.dia
>  -c 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
>  -o 
> /Users/buildslave/jenkins/workspace/lldb-xcode/lldb/build/lldb.build/Release/lldb-core.build/Objects-normal/x86_64/ArchitecturePPC64.o
> clang: error: no such file or directory: 
> '/Users/buildslave/jenkins/workspace/lldb-xcode/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp'
> clang: error: no input files
> 
> thanks,
> vedant
> 
>> On Mar 12, 2018, at 12:21 PM, Jim Ingham via lldb-commits 
>> > wrote:
>> 
>> Author: jingham
>> Date: 

[Lldb-commits] [lldb] r327327 - Revert "Improve prologue handling to support functions with multiple entry points."

2018-03-12 Thread Vedant Kumar via lldb-commits
Author: vedantk
Date: Mon Mar 12 13:35:33 2018
New Revision: 327327

URL: http://llvm.org/viewvc/llvm-project?rev=327327=rev
Log:
Revert "Improve prologue handling to support functions with multiple entry 
points."

This reverts commit r327318. It breaks the Xcode and CMake Darwin
builders:

clang: error: no such file or directory:
'.../source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp'
clang: error: no input files

More details are in https://reviews.llvm.org/D42582.

Modified:
lldb/trunk/include/lldb/Core/Architecture.h
lldb/trunk/lit/lit.cfg
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
lldb/trunk/source/Plugins/Architecture/CMakeLists.txt
lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/include/lldb/Core/Architecture.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Architecture.h?rev=327327=327326=327327=diff
==
--- lldb/trunk/include/lldb/Core/Architecture.h (original)
+++ lldb/trunk/include/lldb/Core/Architecture.h Mon Mar 12 13:35:33 2018
@@ -33,40 +33,6 @@ public:
   //--
   virtual void OverrideStopInfo(Thread ) = 0;
 
-  //--
-  /// This method is used to get the number of bytes that should be
-  /// skipped, from function start address, to reach the first
-  /// instruction after the prologue. If overrode, it must return
-  /// non-zero only if the current address matches one of the known
-  /// function entry points.
-  ///
-  /// This method is called only if the standard platform-independent
-  /// code fails to get the number of bytes to skip, giving the plugin
-  /// a chance to try to find the missing info.
-  ///
-  /// This is specifically used for PPC64, where functions may have
-  /// more than one entry point, global and local, so both should
-  /// be compared with current address, in order to find out the
-  /// number of bytes that should be skipped, in case we are stopped
-  /// at either function entry point.
-  //--
-  virtual size_t GetBytesToSkip(Symbol , const Address _addr) const {
-return 0;
-  }
-
-  //--
-  /// Adjust function breakpoint address, if needed. In some cases,
-  /// the function start address is not the right place to set the
-  /// breakpoint, specially in functions with multiple entry points.
-  ///
-  /// This is specifically used for PPC64, for functions that have
-  /// both a global and a local entry point. In this case, the
-  /// breakpoint is adjusted to the first function address reached
-  /// by both entry points.
-  //--
-  virtual void AdjustBreakpointAddress(const Symbol ,
-   Address ) const {}
-
 private:
   Architecture(const Architecture &) = delete;
   void operator=(const Architecture &) = delete;

Modified: lldb/trunk/lit/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg?rev=327327=327326=327327=diff
==
--- lldb/trunk/lit/lit.cfg (original)
+++ lldb/trunk/lit/lit.cfg Mon Mar 12 13:35:33 2018
@@ -155,8 +155,6 @@ if re.search(r'ARM', llvm_config_output_
 config.available_features.add('arm')
 if re.search(r'Mips', llvm_config_output_list[2]):
 config.available_features.add('mips')
-if re.search(r'PowerPC', llvm_config_output_list[2]):
-config.available_features.add('powerpc')
 if re.search(r'X86', llvm_config_output_list[2]):
 config.available_features.add('x86')
 llvm_config_cmd.wait()

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=327327=327326=327327=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Mar 12 13:35:33 2018
@@ -712,7 +712,6 @@
49F811F31E931B2100F4E163 /* CPlusPlusNameParser.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 49F811EF1E931B1500F4E163 /* 
CPlusPlusNameParser.cpp */; };
4C0083401B9F9BA900D5CF24 /* UtilityFunction.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp 
*/; };
4C05332B1F62121E00DED368 /* SBBreakpointOptionCommon.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 4C0533291F6211FB00DED368 /* 
SBBreakpointOptionCommon.cpp */; };
-   

[Lldb-commits] [PATCH] D44342: Introduce a setting to disable Spotlight while running the test suite

2018-03-12 Thread Vedant Kumar via Phabricator via lldb-commits
vsk accepted this revision.
vsk added a comment.
This revision is now accepted and ready to land.

Thanks @aprantl!


https://reviews.llvm.org/D44342



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


[Lldb-commits] [lldb] r327330 - Introduce a setting to disable Spotlight while running the test suite

2018-03-12 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon Mar 12 13:52:36 2018
New Revision: 327330

URL: http://llvm.org/viewvc/llvm-project?rev=327330=rev
Log:
Introduce a setting to disable Spotlight while running the test suite

This is a more principled approach to disabling Spotlight .dSYM
lookups while running the testsuite, most importantly it also works
for the LIT-based tests, which I overlooked in my initial fix
(renaming the test build dir to lldb-tests.noindex).

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

Added:
lldb/trunk/lit/lit-lldb-init
Modified:
lldb/trunk/include/lldb/Core/ModuleList.h
lldb/trunk/lit/lit.cfg
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
lldb/trunk/source/Core/ModuleList.cpp
lldb/trunk/source/Host/macosx/Symbols.cpp

Modified: lldb/trunk/include/lldb/Core/ModuleList.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ModuleList.h?rev=327330=327329=327330=diff
==
--- lldb/trunk/include/lldb/Core/ModuleList.h (original)
+++ lldb/trunk/include/lldb/Core/ModuleList.h Mon Mar 12 13:52:36 2018
@@ -81,6 +81,7 @@ public:
 
   FileSpec GetClangModulesCachePath() const;
   bool SetClangModulesCachePath(llvm::StringRef path);
+  bool GetEnableExternalLookup() const;
 }; 
 
 //--

Added: lldb/trunk/lit/lit-lldb-init
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit-lldb-init?rev=327330=auto
==
--- lldb/trunk/lit/lit-lldb-init (added)
+++ lldb/trunk/lit/lit-lldb-init Mon Mar 12 13:52:36 2018
@@ -0,0 +1,2 @@
+# LLDB init file for the LIT tests.
+settings set symbols.enable-external-lookup false

Modified: lldb/trunk/lit/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg?rev=327330=327329=327330=diff
==
--- lldb/trunk/lit/lit.cfg (original)
+++ lldb/trunk/lit/lit.cfg Mon Mar 12 13:52:36 2018
@@ -55,7 +55,8 @@ config.environment['PYTHON_EXECUTABLE']
 config.substitutions.append(('%python', config.python_executable))
 
 debugserver = lit.util.which('debugserver', lldb_tools_dir)
-lldb = lit.util.which('lldb', lldb_tools_dir)
+lldb = "%s -S %s/lit-lldb-init" % (lit.util.which('lldb', lldb_tools_dir),
+   config.test_source_root)
 
 if not os.path.exists(config.cc):
 config.cc = lit.util.which(config.cc, config.environment['PATH'])

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=327330=327329=327330=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Mar 12 13:52:36 
2018
@@ -1917,13 +1917,18 @@ class TestBase(Base):
 # decorators.
 Base.setUp(self)
 
-# Set the clang modules cache path.
 if self.child:
+# Set the clang modules cache path.
 assert(self.getDebugInfo() == 'default')
 mod_cache = os.path.join(self.getBuildDir(), "module-cache")
 self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
 % mod_cache)
 
+# Disable Spotlight lookup. The testsuite creates
+# different binaries with the same UUID, because they only
+# differ in the debug info, which is not being hashed.
+self.runCmd('settings set symbols.enable-external-lookup false')
+
 
 if "LLDB_MAX_LAUNCH_COUNT" in os.environ:
 self.maxLaunchCount = int(os.environ["LLDB_MAX_LAUNCH_COUNT"])

Modified: lldb/trunk/source/Core/ModuleList.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ModuleList.cpp?rev=327330=327329=327330=diff
==
--- lldb/trunk/source/Core/ModuleList.cpp (original)
+++ lldb/trunk/source/Core/ModuleList.cpp Mon Mar 12 13:52:36 2018
@@ -67,12 +67,17 @@ using namespace lldb_private;
 namespace {
 
 PropertyDefinition g_properties[] = {
+{"enable-external-lookup", OptionValue::eTypeBoolean, true, true, nullptr,
+ nullptr,
+ "Control the use of external tools or libraries to locate symbol files. "
+ "On macOS, Spotlight is used to locate a matching .dSYM bundle based on "
+ "the UUID of the executable."},
 {"clang-modules-cache-path", OptionValue::eTypeFileSpec, true, 0, nullptr,
  nullptr,
  "The path to the clang modules cache directory (-fmodules-cache-path)."},
 {nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, nullptr, nullptr}};
 
-enum { ePropertyClangModulesCachePath };
+enum { ePropertyEnableExternalLookup, 

[Lldb-commits] [PATCH] D44342: Introduce a setting to disable Spotlight while running the test suite

2018-03-12 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL327330: Introduce a setting to disable Spotlight while 
running the test suite (authored by adrian, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D44342?vs=138086=138093#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D44342

Files:
  lldb/trunk/include/lldb/Core/ModuleList.h
  lldb/trunk/lit/lit-lldb-init
  lldb/trunk/lit/lit.cfg
  lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
  lldb/trunk/source/Core/ModuleList.cpp
  lldb/trunk/source/Host/macosx/Symbols.cpp

Index: lldb/trunk/source/Host/macosx/Symbols.cpp
===
--- lldb/trunk/source/Host/macosx/Symbols.cpp
+++ lldb/trunk/source/Host/macosx/Symbols.cpp
@@ -23,6 +23,7 @@
 #include "Host/macosx/cfcpp/CFCData.h"
 #include "Host/macosx/cfcpp/CFCReleaser.h"
 #include "Host/macosx/cfcpp/CFCString.h"
+#include "lldb/Core/ModuleList.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Symbol/ObjectFile.h"
@@ -54,6 +55,13 @@
 
 int LocateMacOSXFilesUsingDebugSymbols(const ModuleSpec _spec,
ModuleSpec _module_spec) {
+  Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+  if (!ModuleList::GetGlobalModuleListProperties().GetEnableExternalLookup()) {
+if (log)
+  log->Printf("Spotlight lookup for .dSYM bundles is disabled.");
+return 0;
+  }
+  
   return_module_spec = module_spec;
   return_module_spec.GetFileSpec().Clear();
   return_module_spec.GetSymbolFileSpec().Clear();
@@ -79,7 +87,6 @@
   if (module_uuid_ref.get()) {
 CFCReleaser exec_url;
 const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
-Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
 if (exec_fspec) {
   char exec_cf_path[PATH_MAX];
   if (exec_fspec->GetPath(exec_cf_path, sizeof(exec_cf_path)))
Index: lldb/trunk/source/Core/ModuleList.cpp
===
--- lldb/trunk/source/Core/ModuleList.cpp
+++ lldb/trunk/source/Core/ModuleList.cpp
@@ -67,12 +67,17 @@
 namespace {
 
 PropertyDefinition g_properties[] = {
+{"enable-external-lookup", OptionValue::eTypeBoolean, true, true, nullptr,
+ nullptr,
+ "Control the use of external tools or libraries to locate symbol files. "
+ "On macOS, Spotlight is used to locate a matching .dSYM bundle based on "
+ "the UUID of the executable."},
 {"clang-modules-cache-path", OptionValue::eTypeFileSpec, true, 0, nullptr,
  nullptr,
  "The path to the clang modules cache directory (-fmodules-cache-path)."},
 {nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, nullptr, nullptr}};
 
-enum { ePropertyClangModulesCachePath };
+enum { ePropertyEnableExternalLookup, ePropertyClangModulesCachePath };
 
 } // namespace
 
@@ -85,6 +90,12 @@
   SetClangModulesCachePath(path);
 }
 
+bool ModuleListProperties::GetEnableExternalLookup() const {
+  const uint32_t idx = ePropertyEnableExternalLookup;
+  return m_collection_sp->GetPropertyAtIndexAsBoolean(
+  nullptr, idx, g_properties[idx].default_uint_value != 0);
+}
+
 FileSpec ModuleListProperties::GetClangModulesCachePath() const {
   return m_collection_sp
   ->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, false,
Index: lldb/trunk/lit/lit.cfg
===
--- lldb/trunk/lit/lit.cfg
+++ lldb/trunk/lit/lit.cfg
@@ -55,7 +55,8 @@
 config.substitutions.append(('%python', config.python_executable))
 
 debugserver = lit.util.which('debugserver', lldb_tools_dir)
-lldb = lit.util.which('lldb', lldb_tools_dir)
+lldb = "%s -S %s/lit-lldb-init" % (lit.util.which('lldb', lldb_tools_dir),
+   config.test_source_root)
 
 if not os.path.exists(config.cc):
 config.cc = lit.util.which(config.cc, config.environment['PATH'])
Index: lldb/trunk/lit/lit-lldb-init
===
--- lldb/trunk/lit/lit-lldb-init
+++ lldb/trunk/lit/lit-lldb-init
@@ -0,0 +1,2 @@
+# LLDB init file for the LIT tests.
+settings set symbols.enable-external-lookup false
Index: lldb/trunk/include/lldb/Core/ModuleList.h
===
--- lldb/trunk/include/lldb/Core/ModuleList.h
+++ lldb/trunk/include/lldb/Core/ModuleList.h
@@ -81,6 +81,7 @@
 
   FileSpec GetClangModulesCachePath() const;
   bool SetClangModulesCachePath(llvm::StringRef path);
+  bool GetEnableExternalLookup() const;
 }; 
 
 //--
Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ 

[Lldb-commits] [lldb] r327331 - Re-add change for https://reviews.llvm.org/D42582 with added directories.

2018-03-12 Thread Jim Ingham via lldb-commits
Author: jingham
Date: Mon Mar 12 14:17:04 2018
New Revision: 327331

URL: http://llvm.org/viewvc/llvm-project?rev=327331=rev
Log:
Re-add change for https://reviews.llvm.org/D42582 with added directories.

Added:
lldb/trunk/lit/Breakpoint/Inputs/ppc64-localentry.s
lldb/trunk/lit/Breakpoint/ppc64-localentry.test
lldb/trunk/source/Plugins/Architecture/PPC64/
lldb/trunk/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
lldb/trunk/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h
lldb/trunk/source/Plugins/Architecture/PPC64/CMakeLists.txt
Modified:
lldb/trunk/include/lldb/Core/Architecture.h
lldb/trunk/lit/lit.cfg
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
lldb/trunk/source/Plugins/Architecture/CMakeLists.txt
lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
lldb/trunk/tools/lldb-test/SystemInitializerTest.cpp
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/include/lldb/Core/Architecture.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Architecture.h?rev=327331=327330=327331=diff
==
--- lldb/trunk/include/lldb/Core/Architecture.h (original)
+++ lldb/trunk/include/lldb/Core/Architecture.h Mon Mar 12 14:17:04 2018
@@ -33,6 +33,40 @@ public:
   //--
   virtual void OverrideStopInfo(Thread ) = 0;
 
+  //--
+  /// This method is used to get the number of bytes that should be
+  /// skipped, from function start address, to reach the first
+  /// instruction after the prologue. If overrode, it must return
+  /// non-zero only if the current address matches one of the known
+  /// function entry points.
+  ///
+  /// This method is called only if the standard platform-independent
+  /// code fails to get the number of bytes to skip, giving the plugin
+  /// a chance to try to find the missing info.
+  ///
+  /// This is specifically used for PPC64, where functions may have
+  /// more than one entry point, global and local, so both should
+  /// be compared with current address, in order to find out the
+  /// number of bytes that should be skipped, in case we are stopped
+  /// at either function entry point.
+  //--
+  virtual size_t GetBytesToSkip(Symbol , const Address _addr) const {
+return 0;
+  }
+
+  //--
+  /// Adjust function breakpoint address, if needed. In some cases,
+  /// the function start address is not the right place to set the
+  /// breakpoint, specially in functions with multiple entry points.
+  ///
+  /// This is specifically used for PPC64, for functions that have
+  /// both a global and a local entry point. In this case, the
+  /// breakpoint is adjusted to the first function address reached
+  /// by both entry points.
+  //--
+  virtual void AdjustBreakpointAddress(const Symbol ,
+   Address ) const {}
+
 private:
   Architecture(const Architecture &) = delete;
   void operator=(const Architecture &) = delete;

Added: lldb/trunk/lit/Breakpoint/Inputs/ppc64-localentry.s
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Breakpoint/Inputs/ppc64-localentry.s?rev=327331=auto
==
--- lldb/trunk/lit/Breakpoint/Inputs/ppc64-localentry.s (added)
+++ lldb/trunk/lit/Breakpoint/Inputs/ppc64-localentry.s Mon Mar 12 14:17:04 2018
@@ -0,0 +1,55 @@
+   .text
+   .abiversion 2
+
+   .globl  lfunc
+   .p2align4
+   .type   lfunc,@function
+lfunc:  # @lfunc
+.Lfunc_begin0:
+.Lfunc_gep0:
+   addis 2, 12, .TOC.-.Lfunc_gep0@ha
+   addi 2, 2, .TOC.-.Lfunc_gep0@l
+.Lfunc_lep0:
+   .localentry lfunc, .Lfunc_lep0-.Lfunc_gep0
+# BB#0:
+   mr 4, 3
+   addis 3, 2, .LC0@toc@ha
+   ld 3, .LC0@toc@l(3)
+   stw 4, -12(1)
+   lwz 4, 0(3)
+   lwz 5, -12(1)
+   mullw 4, 4, 5
+   extsw 3, 4
+   blr
+   .long   0
+   .quad   0
+.Lfunc_end0:
+   .size   lfunc, .Lfunc_end0-.Lfunc_begin0
+
+   .globl  simple
+   .p2align4
+   .type   simple,@function
+simple: # @simple
+.Lfunc_begin1:
+# %bb.0:# %entry
+   mr 4, 3
+   stw 4, -12(1)
+   lwz 4, -12(1)
+   mulli 4, 4, 10
+   extsw 3, 4
+   blr
+   .long   0
+   .quad   0
+.Lfunc_end1:
+   .size   simple, .Lfunc_end1-.Lfunc_begin1
+
+   .section.toc,"aw",@progbits
+.LC0:
+   .tc g_foo[TC],g_foo
+   .type   

[Lldb-commits] [PATCH] D40466: DWZ 01/11: DWARFUnit split out of DWARFCompileUnit

2018-03-12 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

In https://reviews.llvm.org/D40466#1034875, @davide wrote:

> This is No functional change, right (just code churn)?


Right.


https://reviews.llvm.org/D40466



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