[Lldb-commits] [lldb] r285332 - Add support for "type lookup" to find C and C++ types

2016-10-27 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Thu Oct 27 13:44:45 2016
New Revision: 285332

URL: http://llvm.org/viewvc/llvm-project?rev=285332&view=rev
Log:
Add support for "type lookup" to find C and C++ types

This is an important first step in closing the functionality gap between "type 
lookup" and "images lookup -t"

rdar://28971388


Added:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.mm
  - copied, changed from r285331, 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m
Removed:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m
Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile

lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile?rev=285332&r1=285331&r2=285332&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile 
Thu Oct 27 13:44:45 2016
@@ -1,6 +1,6 @@
 LEVEL = ../../make
 
-OBJC_SOURCES := main.m
+OBJCXX_SOURCES := main.mm
 
 CFLAGS_EXTRAS += -w
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py?rev=285332&r1=285331&r2=285332&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
 Thu Oct 27 13:44:45 2016
@@ -22,7 +22,7 @@ class TypeLookupTestCase(TestBase):
 # Call super's setUp().
 TestBase.setUp(self)
 # Find the line number to break at.
-self.line = line_number('main.m', '// break here')
+self.line = line_number('main.mm', '// break here')
 
 @skipUnlessDarwin
 @skipIf(archs=['i386'])
@@ -32,7 +32,7 @@ class TypeLookupTestCase(TestBase):
 self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
 lldbutil.run_break_set_by_file_and_line(
-self, "main.m", self.line, num_expected_locations=1, 
loc_exact=True)
+self, "main.mm", self.line, num_expected_locations=1, 
loc_exact=True)
 
 self.runCmd("run", RUN_SUCCEEDED)
 
@@ -50,3 +50,5 @@ class TypeLookupTestCase(TestBase):
 self.expect('type lookup NSObject', substrs=['NSObject', 'isa'])
 self.expect('type lookup PleaseDontBeARealTypeThatExists', substrs=[
 "no type was found matching 
'PleaseDontBeARealTypeThatExists'"])
+self.expect('type lookup MyCPPClass', substrs=['setF', 'float getF'])
+self.expect('type lookup MyClass', substrs=['setF', 'float getF'])

Removed: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m?rev=285331&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m 
(removed)
@@ -1,16 +0,0 @@
-//===-- main.m *- ObjC -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#import 
-
-int main (int argc, const char * argv[])
-{
-  return 0; // break here
-}
-

Copied: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.mm 
(from r285331, 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m)
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.mm?p2=lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.mm&p1=lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m&r1=285331&r2=285332&rev=285332&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m 
(original)
+++ 
lldb/trunk/packages/Python/lldbsui

[Lldb-commits] LLVM buildmaster will be updated and restarted at 3 PM Pacific time today

2016-10-27 Thread Galina Kistanova via lldb-commits
Hello everyone,

LLVM buildmaster will be updated and restarted at 3 PM Pacific time today.
Thank you for understanding.

Thanks

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


[Lldb-commits] [PATCH] D25830: Search for llvm-config in LLDB_PATH_TO_LLVM_BUILD first

2016-10-27 Thread Vivian Kong via lldb-commits
vivkong created this revision.
vivkong added reviewers: labath, beanz, tfiala.
vivkong added subscribers: lldb-commits, tfiala.
vivkong set the repository for this revision to rL LLVM.
Herald added a subscriber: mgorny.

If LLDB_PATH_TO_LLVM_BUILD is present, search for llvm-config there first 
before looking in CMake or system paths.

(The patch is a modified fix from @tfiala)


Repository:
  rL LLVM

https://reviews.llvm.org/D25830

Files:
  cmake/modules/LLDBStandalone.cmake


Index: cmake/modules/LLDBStandalone.cmake
===
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -12,7 +12,12 @@
 
   # Rely on llvm-config.
   set(CONFIG_OUTPUT)
-  find_program(LLVM_CONFIG "llvm-config")
+  set(FIND_PATHS "")
+  if (LLDB_PATH_TO_LLVM_BUILD)
+set(FIND_PATHS "${LLDB_PATH_TO_LLVM_BUILD}/bin")
+  endif()
+  find_program(LLVM_CONFIG "llvm-config"
+HINTS ${FIND_PATHS})
   if(LLVM_CONFIG)
 message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
 set(CONFIG_COMMAND ${LLVM_CONFIG}


Index: cmake/modules/LLDBStandalone.cmake
===
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -12,7 +12,12 @@
 
   # Rely on llvm-config.
   set(CONFIG_OUTPUT)
-  find_program(LLVM_CONFIG "llvm-config")
+  set(FIND_PATHS "")
+  if (LLDB_PATH_TO_LLVM_BUILD)
+set(FIND_PATHS "${LLDB_PATH_TO_LLVM_BUILD}/bin")
+  endif()
+  find_program(LLVM_CONFIG "llvm-config"
+HINTS ${FIND_PATHS})
   if(LLVM_CONFIG)
 message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
 set(CONFIG_COMMAND ${LLVM_CONFIG}
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25830: Search for llvm-config in LLDB_PATH_TO_LLVM_BUILD first

2016-10-27 Thread Vivian Kong via lldb-commits
vivkong requested changes to this revision.
vivkong added a comment.

This is not required anymore and it can be closed.  Thanks.


Repository:
  rL LLVM

https://reviews.llvm.org/D25830



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


[Lldb-commits] [lldb] r285356 - [CMake] Rename lldb-launcher to darwin-debug

2016-10-27 Thread Chris Bieneman via lldb-commits
Author: cbieneman
Date: Thu Oct 27 17:51:41 2016
New Revision: 285356

URL: http://llvm.org/viewvc/llvm-project?rev=285356&view=rev
Log:
[CMake] Rename lldb-launcher to darwin-debug

Summary: This tool is only built on Darwin, and the name darwin-debug matches 
the Xcode project. We should have this in sync unless there is a good reason 
not to.

Reviewers: zturner, tfiala, labath

Subscribers: labath, mgorny, lldb-commits

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

Modified:
lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh
lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
lldb/trunk/tools/darwin-debug/CMakeLists.txt

Modified: lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh?rev=285356&r1=285355&r2=285356&view=diff
==
--- lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh (original)
+++ lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh Thu Oct 27 17:51:41 
2016
@@ -179,7 +179,6 @@ then
 echo "Creating symlink for darwin-debug"
 fi
 cd "${framework_python_dir}"
-ln -s "../../../../bin/lldb-launcher" darwin-debug
 else
 if [ $Debug -eq 1 ]
 then

Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=285356&r1=285355&r2=285356&view=diff
==
--- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original)
+++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Thu Oct 27 17:51:41 2016
@@ -452,39 +452,6 @@ def make_symlink_liblldb(
 return (bOk, strErrMsg)
 
 #++---
-# Details:  Make the symbolic link to the darwin-debug.
-# Args: vDictArgs   - (R) Program input parameters.
-#   vstrFrameworkPythonDir  - (R) Python framework directory.
-#   vstrDarwinDebugFileName - (R) File name for darwin-debug.
-# Returns:  Bool - True = function success, False = failure.
-#   Str - Error description on task failure.
-# Throws:   None.
-#--
-
-
-def make_symlink_darwin_debug(
-vDictArgs,
-vstrFrameworkPythonDir,
-vstrDarwinDebugFileName):
-dbg = utilsDebug.CDebugFnVerbose(
-"Python script make_symlink_darwin_debug()")
-bOk = True
-strErrMsg = ""
-strTarget = vstrDarwinDebugFileName
-strSrc = ""
-
-bMakeFileCalled = "-m" in vDictArgs
-if not bMakeFileCalled:
-return (bOk, strErrMsg)
-else:
-strSrc = os.path.join("bin", "lldb-launcher")
-
-bOk, strErrMsg = make_symlink(
-vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget)
-
-return (bOk, strErrMsg)
-
-#++---
 # Details:  Make the symbolic link to the lldb-argdumper.
 # Args: vDictArgs   - (R) Program input parameters.
 #   vstrFrameworkPythonDir  - (R) Python framework directory.
@@ -550,13 +517,6 @@ def create_symlinks(vDictArgs, vstrFrame
   strLibLldbFileName,
   vstrLldbLibDir)
 
-# Make symlink for darwin-debug on Darwin
-strDarwinDebugFileName = "darwin-debug"
-if bOk and eOSType == utilsOsType.EnumOsType.Darwin:
-bOk, strErrMsg = make_symlink_darwin_debug(vDictArgs,
-   vstrFrameworkPythonDir,
-   strDarwinDebugFileName)
-
 # Make symlink for lldb-argdumper
 strArgdumperFileName = "lldb-argdumper"
 if bOk:

Modified: lldb/trunk/tools/darwin-debug/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/darwin-debug/CMakeLists.txt?rev=285356&r1=285355&r2=285356&view=diff
==
--- lldb/trunk/tools/darwin-debug/CMakeLists.txt (original)
+++ lldb/trunk/tools/darwin-debug/CMakeLists.txt Thu Oct 27 17:51:41 2016
@@ -1,6 +1,6 @@
-add_lldb_executable(lldb-launcher INCLUDE_IN_FRAMEWORK
+add_lldb_executable(darwin-debug INCLUDE_IN_FRAMEWORK
   darwin-debug.cpp
   )
 
-install(TARGETS lldb-launcher
+install(TARGETS darwin-debug
   RUNTIME DESTINATION bin)


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


[Lldb-commits] [PATCH] D25745: [CMake] Rename lldb-launcher to darwin-debug

2016-10-27 Thread Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL285356: [CMake] Rename lldb-launcher to darwin-debug 
(authored by cbieneman).

Changed prior to commit:
  https://reviews.llvm.org/D25745?vs=75507&id=76121#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25745

Files:
  lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh
  lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
  lldb/trunk/tools/darwin-debug/CMakeLists.txt


Index: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
===
--- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
+++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
@@ -452,39 +452,6 @@
 return (bOk, strErrMsg)
 
 #++---
-# Details:  Make the symbolic link to the darwin-debug.
-# Args: vDictArgs   - (R) Program input parameters.
-#   vstrFrameworkPythonDir  - (R) Python framework directory.
-#   vstrDarwinDebugFileName - (R) File name for darwin-debug.
-# Returns:  Bool - True = function success, False = failure.
-#   Str - Error description on task failure.
-# Throws:   None.
-#--
-
-
-def make_symlink_darwin_debug(
-vDictArgs,
-vstrFrameworkPythonDir,
-vstrDarwinDebugFileName):
-dbg = utilsDebug.CDebugFnVerbose(
-"Python script make_symlink_darwin_debug()")
-bOk = True
-strErrMsg = ""
-strTarget = vstrDarwinDebugFileName
-strSrc = ""
-
-bMakeFileCalled = "-m" in vDictArgs
-if not bMakeFileCalled:
-return (bOk, strErrMsg)
-else:
-strSrc = os.path.join("bin", "lldb-launcher")
-
-bOk, strErrMsg = make_symlink(
-vDictArgs, vstrFrameworkPythonDir, strSrc, strTarget)
-
-return (bOk, strErrMsg)
-
-#++---
 # Details:  Make the symbolic link to the lldb-argdumper.
 # Args: vDictArgs   - (R) Program input parameters.
 #   vstrFrameworkPythonDir  - (R) Python framework directory.
@@ -550,13 +517,6 @@
   strLibLldbFileName,
   vstrLldbLibDir)
 
-# Make symlink for darwin-debug on Darwin
-strDarwinDebugFileName = "darwin-debug"
-if bOk and eOSType == utilsOsType.EnumOsType.Darwin:
-bOk, strErrMsg = make_symlink_darwin_debug(vDictArgs,
-   vstrFrameworkPythonDir,
-   strDarwinDebugFileName)
-
 # Make symlink for lldb-argdumper
 strArgdumperFileName = "lldb-argdumper"
 if bOk:
Index: lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh
===
--- lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh
+++ lldb/trunk/scripts/Python/finish-swig-Python-LLDB.sh
@@ -179,7 +179,6 @@
 echo "Creating symlink for darwin-debug"
 fi
 cd "${framework_python_dir}"
-ln -s "../../../../bin/lldb-launcher" darwin-debug
 else
 if [ $Debug -eq 1 ]
 then
Index: lldb/trunk/tools/darwin-debug/CMakeLists.txt
===
--- lldb/trunk/tools/darwin-debug/CMakeLists.txt
+++ lldb/trunk/tools/darwin-debug/CMakeLists.txt
@@ -1,6 +1,6 @@
-add_lldb_executable(lldb-launcher INCLUDE_IN_FRAMEWORK
+add_lldb_executable(darwin-debug INCLUDE_IN_FRAMEWORK
   darwin-debug.cpp
   )
 
-install(TARGETS lldb-launcher
+install(TARGETS darwin-debug
   RUNTIME DESTINATION bin)


Index: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
===
--- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
+++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
@@ -452,39 +452,6 @@
 return (bOk, strErrMsg)
 
 #++---
-# Details:  Make the symbolic link to the darwin-debug.
-# Args: vDictArgs   - (R) Program input parameters.
-#   vstrFrameworkPythonDir  - (R) Python framework directory.
-#   vstrDarwinDebugFileName - (R) File name for darwin-debug.
-# Returns:  Bool - True = function success, False = failure.
-#   Str - Error description on task failure.
-# Throws:   None.
-#--
-
-
-def make_symlink_darwin_debug(
-vDictArgs,
-vstrFrameworkPythonDir,
-vstrDarwinDebugFileName):
-dbg = utilsDebug.CDebugFnVerbose(
-"Python script make_symlink_darwin_debug()")
-bOk = True
-strErrMsg = ""
-strTarget = vstrDarwinDebugFileName
-strSrc = ""
-
-bMakeFileCalled = "-m" in vDictArgs
-if not bMakeFileCalled:
-return (bOk, strErrMsg)
-else:
-strSrc = os.path.join("bin", "lldb-launcher")
-
-bOk, strErrMsg = make_symlink(
-

[Lldb-commits] [lldb] r285357 - [Test Suite] Pull generateSource into lldbtest

2016-10-27 Thread Chris Bieneman via lldb-commits
Author: cbieneman
Date: Thu Oct 27 17:52:32 2016
New Revision: 285357

URL: http://llvm.org/viewvc/llvm-project?rev=285357&view=rev
Log:
[Test Suite] Pull generateSource into lldbtest

Summary:
Convert tests using LLDB headers to use generateSource to put the right include 
paths in place regardless of whether or not you're building a framework.

This also abstracted generateSource out of TestPublicAPIHeaders.py into 
lldbtest.py.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
  - copied, changed from r285356, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp.template
  - copied, changed from r285356, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp.template
  - copied, changed from r285356, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp.template
  - copied, changed from r285356, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp.template
  - copied, changed from r285356, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp.template
  - copied, changed from r285356, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template
  - copied, changed from r285356, 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp
Removed:
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/lldb-headers.h

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp

lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp
Modified:

lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py?rev=285357&r1=285356&r2=285357&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
 Thu Oct 27 17:52:32 2016
@@ -19,9 +19,9 @@ class SBDirCheckerCase(TestBase):
 
 def setUp(self):
 TestBase.setUp(self)
-self.template = 'main.cpp.template'
 self.source = 'main.cpp'
 self.exe_name = 'a.out'
+self.generateSource(self.source)
 
 @skipIfNoSBHeaders
 def test_sb_api_directory(self):
@@ -34,40 +34,9 @@ class SBDirCheckerCase(TestBase):
 self.skipTest(
 "LLDB is 64-bit and cannot be linked to 32-bit test program.")
 
-# Generate main.cpp, build it, and execute.
-self.generate_main_cpp()
 self.buildDriver(self.source, self.exe_name)
 self.sanity_check_executable(self.exe_name)
 
-def generate_main_cpp(self):
-"""Generate main.cpp from main.cpp.template."""
-temp = os.path.join(os.getcwd(), self.template)
-with open(temp, 'r') as f:
-content = f.read()
-
-public_api_dir = os.path.join(
-os.environ["LLDB_SRC"], "include", "lldb", "API")
-
-# Look under the include/lldb/API directory and add #include statements
-# for all the SB API headers.
-public_headers = os.listdir(public_api_dir)
- 

[Lldb-commits] [PATCH] D25887: [Test Suite] Pull generateSource into lldbtest

2016-10-27 Thread Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL285357: [Test Suite] Pull generateSource into lldbtest 
(authored by cbieneman).

Changed prior to commit:
  https://reviews.llvm.org/D25887?vs=75506&id=76122#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D25887

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
  lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template
  lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp.template
  lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/lldb-headers.h
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp.template
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp.template
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp.template
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp.template
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template
  lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Index: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
@@ -1824,6 +1824,33 @@
 folder = os.path.dirname(folder)
 continue
 
+def generateSource(self, source):
+template = source + '.template'
+temp = os.path.join(os.getcwd(), template)
+with open(temp, 'r') as f:
+content = f.read()
+
+public_api_dir = os.path.join(
+os.environ["LLDB_SRC"], "include", "lldb", "API")
+
+# Look under the include/lldb/API directory and add #include statements
+# for all the SB API headers.
+public_headers = os.listdir(public_api_dir)
+# For different platforms, the include statement can vary.
+if self.hasDarwinFramework():
+include_stmt = "'#include <%s>' % os.path.join('LLDB', header)"
+else:
+include_stmt = "'#include <%s>' % os.path.join(public_api_dir, header)"
+list = [eval(include_stmt) for header in public_headers if (
+header.startswith("SB") and header.endswith(".h"))]
+includes = '\n'.join(list)
+new_content = content.replace('%include_SB_APIs%', includes)
+src = os.path.join(os.getcwd(), source)
+with open(src, 'w') as f:
+f.write(new_content)
+
+self.addTearDownHook(lambda: os.remove(src))
+
 def setUp(self):
 #import traceback
 # traceback.print_stack()
Index: lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template
===
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template
@@ -0,0 +1,54 @@
+//===-- plugin.cpp ---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+/*
+An example plugin for LLDB that provides a new foo command with a child subcommand
+Compile this into a dylib foo.dylib and load by placing in appropriate locations on disk or
+by typing plugin load foo.dylib at the LLDB command line
+*/
+
+%include_SB_APIs%
+
+namespace lldb {
+bool
+PluginInitialize (lldb::SBDebugger debugger);
+}
+
+class ChildCommand : public lldb::SBCommandPluginInterface
+{
+public:
+virtual bool
+DoExecute (lldb::SBDebugger debugger,
+   char** command,
+   lldb::SBCommandReturnObject &result)
+{
+if (command)
+

[Lldb-commits] [lldb] r285361 - Revert "[Test Suite] Pull generateSource into lldbtest"

2016-10-27 Thread Chris Bieneman via lldb-commits
Author: cbieneman
Date: Thu Oct 27 18:18:52 2016
New Revision: 285361

URL: http://llvm.org/viewvc/llvm-project?rev=285361&view=rev
Log:
Revert "[Test Suite] Pull generateSource into lldbtest"

This reverts commit r285357.

I committed this patch accidentally out of order. Will recommit when the change 
this depends on is landed.

Added:
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp
  - copied, changed from r285357, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp
  - copied, changed from r285357, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp.template
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/lldb-headers.h

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp
  - copied, changed from r285357, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp
  - copied, changed from r285357, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
  - copied, changed from r285357, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp
  - copied, changed from r285357, 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp
  - copied, changed from r285357, 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template
Removed:

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/driver.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/listener_test.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_breakpoint_callback.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_description.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_resume.cpp.template

lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/plugin.cpp.template
Modified:

lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py

lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py?rev=285361&r1=285360&r2=285361&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
 Thu Oct 27 18:18:52 2016
@@ -19,9 +19,9 @@ class SBDirCheckerCase(TestBase):
 
 def setUp(self):
 TestBase.setUp(self)
+self.template = 'main.cpp.template'
 self.source = 'main.cpp'
 self.exe_name = 'a.out'
-self.generateSource(self.source)
 
 @skipIfNoSBHeaders
 def test_sb_api_directory(self):
@@ -34,9 +34,40 @@ class SBDirCheckerCase(TestBase):
 self.skipTest(
 "LLDB is 64-bit and cannot be linked to 32-bit test program.")
 
+# Generate main.cpp, build it, and execute.
+self.generate_main_cpp()
 self.buildDriver(self.source, self.exe_name)
 self.sanity_check_executable(self.exe_name)
 
+def generate_main_cpp(self):
+"""Generate main.cpp from main.cpp.template."""
+temp = os.path.join(os.getcwd(), self.template)
+with open(temp, 'r') as f:
+content = f.read()
+
+public_api_dir = os.path.join(
+os.environ["LLDB_SRC"], "include", "lldb", "API")
+
+# Look under the include/lldb/API directory and add #include statements
+# for all the SB API headers.
+public_headers = os.listdir(public_api_dir)
+# For different platforms, the include statement can vary.
+if self.platformIsDarwin():
+include_stmt = "'#include <%s>' % os.pa

[Lldb-commits] [lldb] r285369 - Check that we got back an object from MakeFunctionCaller

2016-10-27 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Thu Oct 27 18:52:46 2016
New Revision: 285369

URL: http://llvm.org/viewvc/llvm-project?rev=285369&view=rev
Log:
Check that we got back an object from MakeFunctionCaller
before we call through it.  

 

Modified:
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp

lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp

lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp

Modified: 
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp?rev=285369&r1=285368&r2=285369&view=diff
==
--- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp 
(original)
+++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp 
Thu Oct 27 18:52:46 2016
@@ -188,7 +188,7 @@ lldb::addr_t AppleGetItemInfoHandler::Se
   get_item_info_caller = m_get_item_info_impl_code->MakeFunctionCaller(
   get_item_info_return_type, get_item_info_arglist,
   thread.shared_from_this(), error);
-  if (error.Fail()) {
+  if (error.Fail() || get_item_info_caller == nullptr) {
 if (log)
   log->Printf("Error Inserting get-item-info function: \"%s\".",
   error.AsCString());

Modified: 
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp?rev=285369&r1=285368&r2=285369&view=diff
==
--- 
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp 
Thu Oct 27 18:52:46 2016
@@ -192,7 +192,7 @@ lldb::addr_t AppleGetPendingItemsHandler
   m_get_pending_items_impl_code->MakeFunctionCaller(
   get_pending_items_return_type, get_pending_items_arglist,
   thread_sp, error);
-  if (error.Fail()) {
+  if (error.Fail() || get_pending_items_caller == nullptr) {
 if (log)
   log->Printf("Failed to install pending-items introspection function "
   "caller: %s.",

Modified: 
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp?rev=285369&r1=285368&r2=285369&view=diff
==
--- lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp 
(original)
+++ lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp 
Thu Oct 27 18:52:46 2016
@@ -205,7 +205,7 @@ AppleGetQueuesHandler::SetupGetQueuesFun
 Error error;
 get_queues_caller = m_get_queues_impl_code_up->MakeFunctionCaller(
 get_queues_return_type, get_queues_arglist, thread_sp, error);
-if (error.Fail()) {
+if (error.Fail() || get_queues_caller == nullptr) {
   if (log)
 log->Printf(
 "Could not get function caller for get-queues function: %s.",

Modified: 
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp?rev=285369&r1=285368&r2=285369&view=diff
==
--- 
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
 Thu Oct 27 18:52:46 2016
@@ -203,7 +203,7 @@ lldb::addr_t AppleGetThreadItemInfoHandl
   m_get_thread_item_info_impl_code->MakeFunctionCaller(
   get_thread_item_info_return_type, get_thread_item_info_arglist,
   thread_sp, error);
-  if (error.Fail()) {
+  if (error.Fail() || get_thread_item_info_caller == nullptr) {
 if (log)
   log->Printf("Failed to install get-thread-item-info introspection "
   "caller: %s.",


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


Re: [Lldb-commits] [PATCH] debugserver: Disable four-char-constants and format-pedantic warnings

2016-10-27 Thread Justin Bogner via lldb-commits
Pavel Labath  writes:
> On 19 October 2016 at 00:20, Justin Bogner  wrote:
>> Pavel Labath  writes:
>>> Thanks for the patch. Could you submit the patch through phabricator
>>>  and add Greg Clayton as a reviewer.
>>
>> Maybe later. I don't have time to fight with phabricator today.
>>
>>> That said, my preference would be to actually fix those warnings
>>> instead of silencing them.
>>
>> If you think that's best, but do note that neither of these warnings is
>> flagging much of a problem:
>>
>> - The four-character-literal warning is flagging implementation defined
>>   behaviour four spelling a 32 bit hex constant in ascii instead of
>>   something like 0x46445343. This is a portability vs readability thing,
>>   and pretty minor.
>
> Agreed, but it also is pretty easily workaroundable without hurting
> readability by defining a symbolic constant.

Sure, I'd be fine with that too.

>> - The format-pedantic is warning about passing typed pointers to a %p
>>   format specifier. The "fix" is to cast these arguments to `void *`,
>>   which IMO hurts readability for no gain. I'm pretty sure this warning
>>   only exists to preserve portability to some hypothetical ABI whose
>>   calling convention depends on the type of the pointer.
>
> This one actually annoys me as well, but if we do that, I think it
> should be done at the project level. BTW, does the flag disable
> anything else apart from the void *-cast issue. I'd hate to lose other
> checks, as it's extremely easy to write non-portable format strings.

The format-pedantic warning is specifically for %p with any pointer type
other than `void *`. It also looks like clang applies this for some sort
of freebsd kernel extension %D arg, but that doesn't seem relevant.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits