Re: [Lldb-commits] [PATCH] D24890: implement timeout sample support for Linux
tfiala added inline comments. Comment at: packages/Python/lldbsuite/pre_kill_hook/linux.py:68 @@ +67,3 @@ +else: +raise Exception("failed to call 'perf record .., error: ") + Haha woops - that should be: ``` raise Exception("failed to call 'perf record ..., error code: {}".format(returncode)) ``` I'll fix that in the final. https://reviews.llvm.org/D24890 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D24890: implement timeout sample support for Linux
tfiala created this revision. tfiala added reviewers: labath, tberghammer. tfiala added a subscriber: lldb-commits. This is the Linux counterpart to the recently-added macOS-side support for sampling a test process that times out, prior to killing it. This implementation is based on the Linux perf tools. Each distribution will have a different way to install it. The hook is skipped if Linux perf is not available. On Ubuntu 16.04, the requisite support can be retrieved with: ``` sudo apt-get install perf-tools-unstable ``` Like the macOS side, the content out the time spent at each call point per backtrace is specified in a file in the session directory of the format: {TestName.py}-{pid}.sample https://reviews.llvm.org/D24890 Files: packages/Python/lldbsuite/pre_kill_hook/linux.py packages/Python/lldbsuite/pre_kill_hook/tests/test_darwin.py packages/Python/lldbsuite/pre_kill_hook/tests/test_linux.py Index: packages/Python/lldbsuite/pre_kill_hook/tests/test_linux.py === --- /dev/null +++ packages/Python/lldbsuite/pre_kill_hook/tests/test_linux.py @@ -0,0 +1,133 @@ +"""Test the pre-kill hook on Linux.""" +from __future__ import print_function + +# system imports +from multiprocessing import Process, Queue +import platform +import re +import subprocess +from unittest import main, TestCase + +# third party +from six import StringIO + + +def do_child_thread(): +import os +x = 0 +while True: +x = x + 42 * os.getpid() +return x + + +def do_child_process(child_work_queue, parent_work_queue, verbose): +import os + +pid = os.getpid() +if verbose: +print("child: pid {} started, sending to parent".format(pid)) +parent_work_queue.put(pid) + +# Spin up a daemon thread to do some "work", which will show +# up in a sample of this process. +import threading +worker = threading.Thread(target=do_child_thread) +worker.daemon = True +worker.start() + +if verbose: +print("child: waiting for shut-down request from parent") +child_work_queue.get() +if verbose: +print("child: received shut-down request. Child exiting.") + + +class LinuxPreKillTestCase(TestCase): + +def __init__(self, methodName): +super(LinuxPreKillTestCase, self).__init__(methodName) +self.process = None +self.child_work_queue = None +self.verbose = False +# self.verbose = True + +def tearDown(self): +if self.verbose: +print("parent: sending shut-down request to child") +if self.process: +self.child_work_queue.put("hello, child") +self.process.join() +if self.verbose: +print("parent: child is fully shut down") + +def test_sample(self): +# Ensure we're Darwin. +if platform.system() != 'Linux': +self.skipTest("requires a Linux-based OS") + +# Ensure we have the 'perf' tool. If not, skip the test. +try: +perf_version = subprocess.check_output(["perf", "version"]) +if perf_version is None or not ( +perf_version.startswith("perf version")): +raise Exception("The perf executable doesn't appear" +" to be the Linux perf tools perf") +except Exception: +self.skipTest("requires the Linux perf tools 'perf' command") + +# Start the child process. +self.child_work_queue = Queue() +parent_work_queue = Queue() +self.process = Process(target=do_child_process, + args=(self.child_work_queue, parent_work_queue, + self.verbose)) +if self.verbose: +print("parent: starting child") +self.process.start() + +# Wait for the child to report its pid. Then we know we're running. +if self.verbose: +print("parent: waiting for child to start") +child_pid = parent_work_queue.get() + +# Sample the child process. +from linux import do_pre_kill +context_dict = { +"archs": [platform.machine()], +"platform_name": None, +"platform_url": None, +"platform_working_dir": None +} + +if self.verbose: +print("parent: running pre-kill action on child") +output_io = StringIO() +do_pre_kill(child_pid, context_dict, output_io) +output = output_io.getvalue() + +if self.verbose: +print("parent: do_pre_kill() wrote the following output:", output) +self.assertIsNotNone(output) + +# We should have a samples count entry. +# Samples: +self.assertTrue("Samples:" in output, "should have found a 'Samples:' " +"field in the sampled process output") + +# We should see an event count entry +
Re: [Lldb-commits] [PATCH] D24846: [CMake] Generate LLDB_REVISION at build time
This revision was automatically updated to reflect the committed changes. Closed by commit rL282314: [CMake] Generate LLDB_REVISION at build time (authored by cbieneman). Changed prior to commit: https://reviews.llvm.org/D24846?vs=72215=72381#toc Repository: rL LLVM https://reviews.llvm.org/D24846 Files: lldb/trunk/source/CMakeLists.txt lldb/trunk/source/lldb.cpp Index: lldb/trunk/source/lldb.cpp === --- lldb/trunk/source/lldb.cpp +++ lldb/trunk/source/lldb.cpp @@ -18,6 +18,10 @@ #include "clang/Basic/Version.h" +#ifdef HAVE_SVN_VERSION_INC +# include "SVNVersion.inc" +#endif + static const char *GetLLDBRevision() { #ifdef LLDB_REVISION return LLDB_REVISION; Index: lldb/trunk/source/CMakeLists.txt === --- lldb/trunk/source/CMakeLists.txt +++ lldb/trunk/source/CMakeLists.txt @@ -40,6 +40,41 @@ DEPENDS ${LLDB_VERS_GENERATED_FILE}) endif() +foreach(file +"${LLDB_SOURCE_DIR}/.git/logs/HEAD" # Git +"${LLDB_SOURCE_DIR}/.svn/wc.db" # SVN 1.7 +"${LLDB_SOURCE_DIR}/.svn/entries" # SVN 1.6 +) + if(EXISTS "${file}") +set(lldb_vc "${file}") +break() + endif() +endforeach() + +if(DEFINED lldb_vc) + set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc") + set(get_svn_script "${LLVM_MAIN_SRC_DIR}/cmake/modules/GetSVN.cmake") + + # Create custom target to generate the VC revision include. + add_custom_command(OUTPUT "${version_inc}" +DEPENDS "${lldb_vc}" "${get_svn_script}" +COMMAND +${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${LLDB_SOURCE_DIR}" + "-DFIRST_NAME=LLDB" + "-DHEADER_FILE=${version_inc}" + -P "${get_svn_script}") + + # Mark the generated header as being generated. + set_source_files_properties("${version_inc}" +PROPERTIES GENERATED TRUE + HEADER_FILE_ONLY TRUE) + + # Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC. + set_source_files_properties(lldb.cpp +PROPERTIES COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC") + list(APPEND lldbBase_SOURCES ${version_inc}) +endif() + add_lldb_library(lldbBase ${lldbBase_SOURCES} ) @@ -64,29 +99,3 @@ # Build API last. Since liblldb needs to link against every other target, it needs # those targets to have already been created. add_subdirectory(API) - -# Determine LLDB revision and repository. GetSourceVersion and GetRepositoryPath are shell-scripts, and as -# such will not work on Windows. -if ( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" ) - execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetSourceVersion ${LLDB_SOURCE_DIR} - OUTPUT_VARIABLE LLDB_REVISION) - if ( LLDB_REVISION ) -string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REVISION ${LLDB_REVISION}) - endif() - - execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath ${LLDB_SOURCE_DIR} - OUTPUT_VARIABLE LLDB_REPOSITORY) - if ( LLDB_REPOSITORY ) -# Replace newline characters with spaces -string(REGEX REPLACE "(\r?\n)+" " " LLDB_REPOSITORY ${LLDB_REPOSITORY}) - -# Remove trailing spaces -string(REGEX REPLACE "(\ )+$" "" LLDB_REPOSITORY ${LLDB_REPOSITORY}) - endif() - - set_property( -SOURCE lldb.cpp -PROPERTY COMPILE_DEFINITIONS "LLDB_REVISION=\"${LLDB_REVISION}\"" "LLDB_REPOSITORY=\"${LLDB_REPOSITORY}\"") -endif () -# FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only -#revision parsing solution in tools/clang/lib/Basic/CMakelists.txt. Index: lldb/trunk/source/lldb.cpp === --- lldb/trunk/source/lldb.cpp +++ lldb/trunk/source/lldb.cpp @@ -18,6 +18,10 @@ #include "clang/Basic/Version.h" +#ifdef HAVE_SVN_VERSION_INC +# include "SVNVersion.inc" +#endif + static const char *GetLLDBRevision() { #ifdef LLDB_REVISION return LLDB_REVISION; Index: lldb/trunk/source/CMakeLists.txt === --- lldb/trunk/source/CMakeLists.txt +++ lldb/trunk/source/CMakeLists.txt @@ -40,6 +40,41 @@ DEPENDS ${LLDB_VERS_GENERATED_FILE}) endif() +foreach(file +"${LLDB_SOURCE_DIR}/.git/logs/HEAD" # Git +"${LLDB_SOURCE_DIR}/.svn/wc.db" # SVN 1.7 +"${LLDB_SOURCE_DIR}/.svn/entries" # SVN 1.6 +) + if(EXISTS "${file}") +set(lldb_vc "${file}") +break() + endif() +endforeach() + +if(DEFINED lldb_vc) + set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc") + set(get_svn_script "${LLVM_MAIN_SRC_DIR}/cmake/modules/GetSVN.cmake") + + # Create custom target to generate the VC revision include. + add_custom_command(OUTPUT "${version_inc}" +DEPENDS "${lldb_vc}" "${get_svn_script}" +COMMAND +${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${LLDB_SOURCE_DIR}" + "-DFIRST_NAME=LLDB" +
[Lldb-commits] [lldb] r282314 - [CMake] Generate LLDB_REVISION at build time
Author: cbieneman Date: Fri Sep 23 18:33:52 2016 New Revision: 282314 URL: http://llvm.org/viewvc/llvm-project?rev=282314=rev Log: [CMake] Generate LLDB_REVISION at build time Summary: This alters the generation of LLDB_REVISION to be heavily based on how clang generates its version header. There are two benefits of this aproach. (1) The LLDB_REVISION is generated at build time, so it will be updated after an SCM pull/update even if CMake doesn't re-run (2) This works on Windows As noted this code is a simplified implementation of the code from clang. Reviewers: tfiala, zturner Subscribers: beanz, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D24846 Modified: lldb/trunk/source/CMakeLists.txt lldb/trunk/source/lldb.cpp Modified: lldb/trunk/source/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=282314=282313=282314=diff == --- lldb/trunk/source/CMakeLists.txt (original) +++ lldb/trunk/source/CMakeLists.txt Fri Sep 23 18:33:52 2016 @@ -40,6 +40,41 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin") DEPENDS ${LLDB_VERS_GENERATED_FILE}) endif() +foreach(file +"${LLDB_SOURCE_DIR}/.git/logs/HEAD" # Git +"${LLDB_SOURCE_DIR}/.svn/wc.db" # SVN 1.7 +"${LLDB_SOURCE_DIR}/.svn/entries" # SVN 1.6 +) + if(EXISTS "${file}") +set(lldb_vc "${file}") +break() + endif() +endforeach() + +if(DEFINED lldb_vc) + set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/SVNVersion.inc") + set(get_svn_script "${LLVM_MAIN_SRC_DIR}/cmake/modules/GetSVN.cmake") + + # Create custom target to generate the VC revision include. + add_custom_command(OUTPUT "${version_inc}" +DEPENDS "${lldb_vc}" "${get_svn_script}" +COMMAND +${CMAKE_COMMAND} "-DFIRST_SOURCE_DIR=${LLDB_SOURCE_DIR}" + "-DFIRST_NAME=LLDB" + "-DHEADER_FILE=${version_inc}" + -P "${get_svn_script}") + + # Mark the generated header as being generated. + set_source_files_properties("${version_inc}" +PROPERTIES GENERATED TRUE + HEADER_FILE_ONLY TRUE) + + # Tell Version.cpp that it needs to build with -DHAVE_SVN_VERSION_INC. + set_source_files_properties(lldb.cpp +PROPERTIES COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC") + list(APPEND lldbBase_SOURCES ${version_inc}) +endif() + add_lldb_library(lldbBase ${lldbBase_SOURCES} ) @@ -64,29 +99,3 @@ add_subdirectory(Utility) # Build API last. Since liblldb needs to link against every other target, it needs # those targets to have already been created. add_subdirectory(API) - -# Determine LLDB revision and repository. GetSourceVersion and GetRepositoryPath are shell-scripts, and as -# such will not work on Windows. -if ( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" ) - execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetSourceVersion ${LLDB_SOURCE_DIR} - OUTPUT_VARIABLE LLDB_REVISION) - if ( LLDB_REVISION ) -string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REVISION ${LLDB_REVISION}) - endif() - - execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath ${LLDB_SOURCE_DIR} - OUTPUT_VARIABLE LLDB_REPOSITORY) - if ( LLDB_REPOSITORY ) -# Replace newline characters with spaces -string(REGEX REPLACE "(\r?\n)+" " " LLDB_REPOSITORY ${LLDB_REPOSITORY}) - -# Remove trailing spaces -string(REGEX REPLACE "(\ )+$" "" LLDB_REPOSITORY ${LLDB_REPOSITORY}) - endif() - - set_property( -SOURCE lldb.cpp -PROPERTY COMPILE_DEFINITIONS "LLDB_REVISION=\"${LLDB_REVISION}\"" "LLDB_REPOSITORY=\"${LLDB_REPOSITORY}\"") -endif () -# FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only -#revision parsing solution in tools/clang/lib/Basic/CMakelists.txt. Modified: lldb/trunk/source/lldb.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/lldb.cpp?rev=282314=282313=282314=diff == --- lldb/trunk/source/lldb.cpp (original) +++ lldb/trunk/source/lldb.cpp Fri Sep 23 18:33:52 2016 @@ -18,6 +18,10 @@ extern "C" const unsigned char liblldb_c #include "clang/Basic/Version.h" +#ifdef HAVE_SVN_VERSION_INC +# include "SVNVersion.inc" +#endif + static const char *GetLLDBRevision() { #ifdef LLDB_REVISION return LLDB_REVISION; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24846: [CMake] Generate LLDB_REVISION at build time
zturner accepted this revision. zturner added a comment. lgtm, everything works. https://reviews.llvm.org/D24846 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24863: Keep dependencies separated between static and dynamic libraries. Fix for bug #28127.
beanz requested changes to this revision. beanz added a comment. This revision now requires changes to proceed. Making static archives only have dependencies on other static archives has serious implications and fundamentally breaks `LLVM_LINK_LLVM_DYLIB`. For example: libClangDriver.a depends on libLLVMDriver.a. In the current build with the `LLVM_LINK_LLVM_DYLIB` libClangDriver.a depends on libLLVM, which means clang depends on libLLVM. If you make static archives only depend on static archives now libClangDriver.a depends on libLLVMDriver.a, which means clang would link libLLVMDriver.a in addition to getting libLLVM. Standard unix linker semantics will result in code from libLLVMDriver being linked into libClang, which is explicitly what `LLVM_LINK_LLVM_DYLIB` is intended to prevent. Repository: rL LLVM https://reviews.llvm.org/D24863 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r282309 - Fix build on Ubuntu.
Not done building yet, I also had to fetch a new llvm, but at least those were needed. Jim > On Sep 23, 2016, at 3:47 PM, Zachary Turnerwrote: > > Ahh nvm, I see you beat me to it. Thanks > > On Fri, Sep 23, 2016 at 3:47 PM Zachary Turner wrote: > Thanks I'll take a look. I only saw the other because I got a buildbot break > notification. I'll go checkout Host.mm > > On Fri, Sep 23, 2016 at 3:44 PM Jim Ingham wrote: > I think you missed some changes in Host.mm on OS X as well. > > Jim > > > On Sep 23, 2016, at 3:27 PM, Zachary Turner via lldb-commits > > wrote: > > > > Author: zturner > > Date: Fri Sep 23 17:27:03 2016 > > New Revision: 282309 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=282309=rev > > Log: > > Fix build on Ubuntu. > > > > This was in some code that was #ifdef'd out on Windows, so I > > didn't see it. > > > > Modified: > >lldb/trunk/source/Host/common/Host.cpp > > > > Modified: lldb/trunk/source/Host/common/Host.cpp > > URL: > > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=282309=282308=282309=diff > > == > > --- lldb/trunk/source/Host/common/Host.cpp (original) > > +++ lldb/trunk/source/Host/common/Host.cpp Fri Sep 23 17:27:03 2016 > > @@ -942,15 +942,15 @@ bool Host::AddPosixSpawnFileAction(void > > if (oflag & O_CREAT) > > mode = 0640; > > > > - error.SetError( > > - ::posix_spawn_file_actions_addopen(file_actions, info->GetFD(), > > - info->GetPath(), oflag, mode), > > - eErrorTypePOSIX); > > + error.SetError(::posix_spawn_file_actions_addopen( > > + file_actions, info->GetFD(), > > + info->GetPath().str().c_str(), oflag, mode), > > + eErrorTypePOSIX); > > if (error.Fail() || log) > > error.PutToLog(log, "posix_spawn_file_actions_addopen (action=%p, " > > "fd=%i, path='%s', oflag=%i, mode=%i)", > >static_cast(file_actions), info->GetFD(), > > - info->GetPath(), oflag, mode); > > + info->GetPath().str().c_str(), oflag, mode); > > } > > break; > > } > > > > > > ___ > > 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] r282309 - Fix build on Ubuntu.
Ahh nvm, I see you beat me to it. Thanks On Fri, Sep 23, 2016 at 3:47 PM Zachary Turnerwrote: > Thanks I'll take a look. I only saw the other because I got a buildbot > break notification. I'll go checkout Host.mm > > On Fri, Sep 23, 2016 at 3:44 PM Jim Ingham wrote: > > I think you missed some changes in Host.mm on OS X as well. > > Jim > > > On Sep 23, 2016, at 3:27 PM, Zachary Turner via lldb-commits < > lldb-commits@lists.llvm.org> wrote: > > > > Author: zturner > > Date: Fri Sep 23 17:27:03 2016 > > New Revision: 282309 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=282309=rev > > Log: > > Fix build on Ubuntu. > > > > This was in some code that was #ifdef'd out on Windows, so I > > didn't see it. > > > > Modified: > >lldb/trunk/source/Host/common/Host.cpp > > > > Modified: lldb/trunk/source/Host/common/Host.cpp > > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=282309=282308=282309=diff > > > == > > --- lldb/trunk/source/Host/common/Host.cpp (original) > > +++ lldb/trunk/source/Host/common/Host.cpp Fri Sep 23 17:27:03 2016 > > @@ -942,15 +942,15 @@ bool Host::AddPosixSpawnFileAction(void > > if (oflag & O_CREAT) > > mode = 0640; > > > > - error.SetError( > > - ::posix_spawn_file_actions_addopen(file_actions, > info->GetFD(), > > - info->GetPath(), oflag, > mode), > > - eErrorTypePOSIX); > > + error.SetError(::posix_spawn_file_actions_addopen( > > + file_actions, info->GetFD(), > > + info->GetPath().str().c_str(), oflag, mode), > > + eErrorTypePOSIX); > > if (error.Fail() || log) > > error.PutToLog(log, "posix_spawn_file_actions_addopen > (action=%p, " > > "fd=%i, path='%s', oflag=%i, mode=%i)", > >static_cast(file_actions), info->GetFD(), > > - info->GetPath(), oflag, mode); > > + info->GetPath().str().c_str(), oflag, mode); > > } > > break; > > } > > > > > > ___ > > 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] r282309 - Fix build on Ubuntu.
Thanks I'll take a look. I only saw the other because I got a buildbot break notification. I'll go checkout Host.mm On Fri, Sep 23, 2016 at 3:44 PM Jim Inghamwrote: > I think you missed some changes in Host.mm on OS X as well. > > Jim > > > On Sep 23, 2016, at 3:27 PM, Zachary Turner via lldb-commits < > lldb-commits@lists.llvm.org> wrote: > > > > Author: zturner > > Date: Fri Sep 23 17:27:03 2016 > > New Revision: 282309 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=282309=rev > > Log: > > Fix build on Ubuntu. > > > > This was in some code that was #ifdef'd out on Windows, so I > > didn't see it. > > > > Modified: > >lldb/trunk/source/Host/common/Host.cpp > > > > Modified: lldb/trunk/source/Host/common/Host.cpp > > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=282309=282308=282309=diff > > > == > > --- lldb/trunk/source/Host/common/Host.cpp (original) > > +++ lldb/trunk/source/Host/common/Host.cpp Fri Sep 23 17:27:03 2016 > > @@ -942,15 +942,15 @@ bool Host::AddPosixSpawnFileAction(void > > if (oflag & O_CREAT) > > mode = 0640; > > > > - error.SetError( > > - ::posix_spawn_file_actions_addopen(file_actions, > info->GetFD(), > > - info->GetPath(), oflag, > mode), > > - eErrorTypePOSIX); > > + error.SetError(::posix_spawn_file_actions_addopen( > > + file_actions, info->GetFD(), > > + info->GetPath().str().c_str(), oflag, mode), > > + eErrorTypePOSIX); > > if (error.Fail() || log) > > error.PutToLog(log, "posix_spawn_file_actions_addopen > (action=%p, " > > "fd=%i, path='%s', oflag=%i, mode=%i)", > >static_cast(file_actions), info->GetFD(), > > - info->GetPath(), oflag, mode); > > + info->GetPath().str().c_str(), oflag, mode); > > } > > break; > > } > > > > > > ___ > > lldb-commits mailing list > > lldb-commits@lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r282311 - Mutatis mutandis for char * -> StringRef.
Author: jingham Date: Fri Sep 23 17:36:00 2016 New Revision: 282311 URL: http://llvm.org/viewvc/llvm-project?rev=282311=rev Log: Mutatis mutandis for char * -> StringRef. Modified: lldb/trunk/source/Host/macosx/Host.mm Modified: lldb/trunk/source/Host/macosx/Host.mm URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=282311=282310=282311=diff == --- lldb/trunk/source/Host/macosx/Host.mm (original) +++ lldb/trunk/source/Host/macosx/Host.mm Fri Sep 23 17:36:00 2016 @@ -1156,19 +1156,19 @@ static Error LaunchProcessXPC(const char xpc_dictionary_set_int64(message, LauncherXPCServicePosixspawnFlagsKey, Host::GetPosixspawnFlags(launch_info)); const FileAction *file_action = launch_info.GetFileActionForFD(STDIN_FILENO); - if (file_action && file_action->GetPath()) { + if (file_action && !file_action->GetPath().empty()) { xpc_dictionary_set_string(message, LauncherXPCServiceStdInPathKeyKey, - file_action->GetPath()); + file_action->GetPath().str().c_str()); } file_action = launch_info.GetFileActionForFD(STDOUT_FILENO); - if (file_action && file_action->GetPath()) { + if (file_action && !file_action->GetPath().empty()) { xpc_dictionary_set_string(message, LauncherXPCServiceStdOutPathKeyKey, - file_action->GetPath()); + file_action->GetPath().str().c_str()); } file_action = launch_info.GetFileActionForFD(STDERR_FILENO); - if (file_action && file_action->GetPath()) { + if (file_action && !file_action->GetPath().empty()) { xpc_dictionary_set_string(message, LauncherXPCServiceStdErrPathKeyKey, - file_action->GetPath()); + file_action->GetPath().str().c_str()); } xpc_object_t reply = ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r282309 - Fix build on Ubuntu.
I think you missed some changes in Host.mm on OS X as well. Jim > On Sep 23, 2016, at 3:27 PM, Zachary Turner via lldb-commits >wrote: > > Author: zturner > Date: Fri Sep 23 17:27:03 2016 > New Revision: 282309 > > URL: http://llvm.org/viewvc/llvm-project?rev=282309=rev > Log: > Fix build on Ubuntu. > > This was in some code that was #ifdef'd out on Windows, so I > didn't see it. > > Modified: >lldb/trunk/source/Host/common/Host.cpp > > Modified: lldb/trunk/source/Host/common/Host.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=282309=282308=282309=diff > == > --- lldb/trunk/source/Host/common/Host.cpp (original) > +++ lldb/trunk/source/Host/common/Host.cpp Fri Sep 23 17:27:03 2016 > @@ -942,15 +942,15 @@ bool Host::AddPosixSpawnFileAction(void > if (oflag & O_CREAT) > mode = 0640; > > - error.SetError( > - ::posix_spawn_file_actions_addopen(file_actions, info->GetFD(), > - info->GetPath(), oflag, mode), > - eErrorTypePOSIX); > + error.SetError(::posix_spawn_file_actions_addopen( > + file_actions, info->GetFD(), > + info->GetPath().str().c_str(), oflag, mode), > + eErrorTypePOSIX); > if (error.Fail() || log) > error.PutToLog(log, "posix_spawn_file_actions_addopen (action=%p, " > "fd=%i, path='%s', oflag=%i, mode=%i)", >static_cast(file_actions), info->GetFD(), > - info->GetPath(), oflag, mode); > + info->GetPath().str().c_str(), oflag, mode); > } > break; > } > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r282310 - Add an accessor to get the value of RC_PLATFORM_NAME at build time
Author: enrico Date: Fri Sep 23 17:30:08 2016 New Revision: 282310 URL: http://llvm.org/viewvc/llvm-project?rev=282310=rev Log: Add an accessor to get the value of RC_PLATFORM_NAME at build time Modified: lldb/trunk/scripts/Xcode/lldbbuild.py Modified: lldb/trunk/scripts/Xcode/lldbbuild.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Xcode/lldbbuild.py?rev=282310=282309=282310=diff == --- lldb/trunk/scripts/Xcode/lldbbuild.py (original) +++ lldb/trunk/scripts/Xcode/lldbbuild.py Fri Sep 23 17:30:08 2016 @@ -42,6 +42,9 @@ def is_host_build(): def rc_release_target(): return os.environ.get('RC_RELEASE', '') +def rc_platform_name(): + return os.environ.get('RC_PLATFORM_NAME', 'macOS') + def architecture(): if is_host_build(): return 'macosx' platform_name = os.environ.get('RC_PLATFORM_NAME') ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r282309 - Fix build on Ubuntu.
Author: zturner Date: Fri Sep 23 17:27:03 2016 New Revision: 282309 URL: http://llvm.org/viewvc/llvm-project?rev=282309=rev Log: Fix build on Ubuntu. This was in some code that was #ifdef'd out on Windows, so I didn't see it. Modified: lldb/trunk/source/Host/common/Host.cpp Modified: lldb/trunk/source/Host/common/Host.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=282309=282308=282309=diff == --- lldb/trunk/source/Host/common/Host.cpp (original) +++ lldb/trunk/source/Host/common/Host.cpp Fri Sep 23 17:27:03 2016 @@ -942,15 +942,15 @@ bool Host::AddPosixSpawnFileAction(void if (oflag & O_CREAT) mode = 0640; - error.SetError( - ::posix_spawn_file_actions_addopen(file_actions, info->GetFD(), - info->GetPath(), oflag, mode), - eErrorTypePOSIX); + error.SetError(::posix_spawn_file_actions_addopen( + file_actions, info->GetFD(), + info->GetPath().str().c_str(), oflag, mode), + eErrorTypePOSIX); if (error.Fail() || log) error.PutToLog(log, "posix_spawn_file_actions_addopen (action=%p, " "fd=%i, path='%s', oflag=%i, mode=%i)", static_cast(file_actions), info->GetFD(), - info->GetPath(), oflag, mode); + info->GetPath().str().c_str(), oflag, mode); } break; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r282306 - Change FileAction::GetPath() to return a StringRef.
Author: zturner Date: Fri Sep 23 17:11:51 2016 New Revision: 282306 URL: http://llvm.org/viewvc/llvm-project?rev=282306=rev Log: Change FileAction::GetPath() to return a StringRef. Modified: lldb/trunk/include/lldb/Target/FileAction.h lldb/trunk/include/lldb/Target/Target.h lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp lldb/trunk/source/Target/FileAction.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Target/FileAction.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/FileAction.h?rev=282306=282305=282306=diff == --- lldb/trunk/include/lldb/Target/FileAction.h (original) +++ lldb/trunk/include/lldb/Target/FileAction.h Fri Sep 23 17:11:51 2016 @@ -40,7 +40,7 @@ public: int GetActionArgument() const { return m_arg; } - const char *GetPath() const; + llvm::StringRef GetPath() const; const FileSpec () const; Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=282306=282305=282306=diff == --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Fri Sep 23 17:11:51 2016 @@ -137,16 +137,16 @@ public: uint32_t GetMaximumMemReadSize() const; FileSpec GetStandardInputPath() const; - - void SetStandardInputPath(const char *path); - - FileSpec GetStandardOutputPath() const; - - void SetStandardOutputPath(const char *path); - FileSpec GetStandardErrorPath() const; + FileSpec GetStandardOutputPath() const; - void SetStandardErrorPath(const char *path); + void SetStandardInputPath(llvm::StringRef path); + void SetStandardOutputPath(llvm::StringRef path); + void SetStandardErrorPath(llvm::StringRef path); + + void SetStandardInputPath(const char *path) = delete; + void SetStandardOutputPath(const char *path) = delete; + void SetStandardErrorPath(const char *path) = delete; bool GetBreakpointsConsultPlatformAvoidList(); Modified: lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp?rev=282306=282305=282306=diff == --- lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp (original) +++ lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp Fri Sep 23 17:11:51 2016 @@ -124,7 +124,7 @@ ProcessLauncherWindows::GetStdioHandle(c secattr.nLength = sizeof(SECURITY_ATTRIBUTES); secattr.bInheritHandle = TRUE; - const char *path = action->GetPath(); + llvm::StringRef path = action->GetPath(); DWORD access = 0; DWORD share = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; DWORD create = 0; Modified: lldb/trunk/source/Target/FileAction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/FileAction.cpp?rev=282306=282305=282306=diff == --- lldb/trunk/source/Target/FileAction.cpp (original) +++ lldb/trunk/source/Target/FileAction.cpp Fri Sep 23 17:11:51 2016 @@ -29,7 +29,7 @@ void FileAction::Clear() { m_file_spec.Clear(); } -const char *FileAction::GetPath() const { return m_file_spec.GetCString(); } +llvm::StringRef FileAction::GetPath() const { return m_file_spec.GetCString(); } const FileSpec ::GetFileSpec() const { return m_file_spec; } Modified: lldb/trunk/source/Target/Target.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=282306=282305=282306=diff == --- lldb/trunk/source/Target/Target.cpp (original) +++ lldb/trunk/source/Target/Target.cpp Fri Sep 23 17:11:51 2016 @@ -3817,10 +3817,9 @@ FileSpec TargetProperties::GetStandardIn return m_collection_sp->GetPropertyAtIndexAsFileSpec(nullptr, idx); } -void TargetProperties::SetStandardInputPath(const char *p) { +void TargetProperties::SetStandardInputPath(llvm::StringRef path) { const uint32_t idx = ePropertyInputPath; - m_collection_sp->SetPropertyAtIndexAsString( - nullptr, idx, llvm::StringRef::withNullAsEmpty(p)); + m_collection_sp->SetPropertyAtIndexAsString(nullptr, idx, path); } FileSpec TargetProperties::GetStandardOutputPath() const { @@ -3828,10 +3827,9 @@ FileSpec TargetProperties::GetStandardOu return m_collection_sp->GetPropertyAtIndexAsFileSpec(nullptr, idx); } -void TargetProperties::SetStandardOutputPath(const char *p) { +void TargetProperties::SetStandardOutputPath(llvm::StringRef path) { const uint32_t idx = ePropertyOutputPath; - m_collection_sp->SetPropertyAtIndexAsString( - nullptr, idx, llvm::StringRef::withNullAsEmpty(p)); + m_collection_sp->SetPropertyAtIndexAsString(nullptr, idx, path);
[Lldb-commits] [lldb] r282298 - Allow for tests to be disabled at runtime
Author: fjricci Date: Fri Sep 23 16:32:47 2016 New Revision: 282298 URL: http://llvm.org/viewvc/llvm-project?rev=282298=rev Log: Allow for tests to be disabled at runtime Summary: The current implementation of the test suite allows the user to run a certain subset of tests using '-p', but does not allow the inverse, where a user wants to run all but some number of known failing tests. Implement this functionality. Reviewers: labath, zturner, tfiala Subscribers: jingham, sas, lldb-commits Differential Revision: https://reviews.llvm.org/D24629 Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py lldb/trunk/packages/Python/lldbsuite/test/dotest.py lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py lldb/trunk/packages/Python/lldbsuite/test/test_result.py Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=282298=282297=282298=diff == --- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Fri Sep 23 16:32:47 2016 @@ -101,6 +101,12 @@ parsable = False # our test cases. regexp = None +# Sets of tests which are excluded at runtime +skip_files = None +skip_methods = None +xfail_files = None +xfail_methods = None + # By default, recorded session info for errored/failed test are dumped into its # own file under a session directory named after the timestamp of the test suite # run. Use '-s session-dir-name' to specify a specific dir name. Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=282298=282297=282298=diff == --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Fri Sep 23 16:32:47 2016 @@ -26,6 +26,7 @@ import atexit import os import errno import platform +import re import signal import socket import subprocess @@ -202,6 +203,48 @@ o GDB_REMOTE_LOG: if defined, specifies sys.exit(0) +def parseExclusion(exclusion_file): +"""Parse an exclusion file, of the following format, where + 'skip files', 'skip methods', 'xfail files', and 'xfail methods' + are the possible list heading values: + + skip files + + + + xfail methods + +""" +excl_type = None +case_type = None + +with open(exclusion_file) as f: +for line in f: +if not excl_type: +[excl_type, case_type] = line.split() +continue + +line = line.strip() +if not line: +excl_type = None +elif excl_type == 'skip' and case_type == 'files': +if not configuration.skip_files: +configuration.skip_files = [] +configuration.skip_files.append(line) +elif excl_type == 'skip' and case_type == 'methods': +if not configuration.skip_methods: +configuration.skip_methods = [] +configuration.skip_methods.append(line) +elif excl_type == 'xfail' and case_type == 'files': +if not configuration.xfail_files: +configuration.xfail_files = [] +configuration.xfail_files.append(line) +elif excl_type == 'xfail' and case_type == 'methods': +if not configuration.xfail_methods: +configuration.xfail_methods = [] +configuration.xfail_methods.append(line) + + def parseOptionsAndInitTestdirs(): """Initialize the list of directories containing our unittest scripts. @@ -331,6 +374,9 @@ def parseOptionsAndInitTestdirs(): if args.executable: lldbtest_config.lldbExec = os.path.realpath(args.executable) +if args.excluded: +parseExclusion(args.excluded) + if args.p: if args.p.startswith('-'): usage(parser) @@ -749,11 +795,15 @@ def setupSysPath(): def visit_file(dir, name): # Try to match the regexp pattern, if specified. if configuration.regexp: -import re if not re.search(configuration.regexp, name): # We didn't match the regex, we're done. return +if configuration.skip_files: +for file_regexp in configuration.skip_files: +if re.search(file_regexp, name): +return + # We found a match for our test. Add it to the suite. # Update the sys.path first. Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py URL:
Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime
This revision was automatically updated to reflect the committed changes. Closed by commit rL282298: Allow for tests to be disabled at runtime (authored by fjricci). Changed prior to commit: https://reviews.llvm.org/D24629?vs=71651=72360#toc Repository: rL LLVM https://reviews.llvm.org/D24629 Files: lldb/trunk/packages/Python/lldbsuite/test/configuration.py lldb/trunk/packages/Python/lldbsuite/test/dotest.py lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py lldb/trunk/packages/Python/lldbsuite/test/test_result.py Index: lldb/trunk/packages/Python/lldbsuite/test/configuration.py === --- lldb/trunk/packages/Python/lldbsuite/test/configuration.py +++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py @@ -101,6 +101,12 @@ # our test cases. regexp = None +# Sets of tests which are excluded at runtime +skip_files = None +skip_methods = None +xfail_files = None +xfail_methods = None + # By default, recorded session info for errored/failed test are dumped into its # own file under a session directory named after the timestamp of the test suite # run. Use '-s session-dir-name' to specify a specific dir name. Index: lldb/trunk/packages/Python/lldbsuite/test/dotest.py === --- lldb/trunk/packages/Python/lldbsuite/test/dotest.py +++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py @@ -26,6 +26,7 @@ import os import errno import platform +import re import signal import socket import subprocess @@ -202,6 +203,48 @@ sys.exit(0) +def parseExclusion(exclusion_file): +"""Parse an exclusion file, of the following format, where + 'skip files', 'skip methods', 'xfail files', and 'xfail methods' + are the possible list heading values: + + skip files + + + + xfail methods + +""" +excl_type = None +case_type = None + +with open(exclusion_file) as f: +for line in f: +if not excl_type: +[excl_type, case_type] = line.split() +continue + +line = line.strip() +if not line: +excl_type = None +elif excl_type == 'skip' and case_type == 'files': +if not configuration.skip_files: +configuration.skip_files = [] +configuration.skip_files.append(line) +elif excl_type == 'skip' and case_type == 'methods': +if not configuration.skip_methods: +configuration.skip_methods = [] +configuration.skip_methods.append(line) +elif excl_type == 'xfail' and case_type == 'files': +if not configuration.xfail_files: +configuration.xfail_files = [] +configuration.xfail_files.append(line) +elif excl_type == 'xfail' and case_type == 'methods': +if not configuration.xfail_methods: +configuration.xfail_methods = [] +configuration.xfail_methods.append(line) + + def parseOptionsAndInitTestdirs(): """Initialize the list of directories containing our unittest scripts. @@ -331,6 +374,9 @@ if args.executable: lldbtest_config.lldbExec = os.path.realpath(args.executable) +if args.excluded: +parseExclusion(args.excluded) + if args.p: if args.p.startswith('-'): usage(parser) @@ -749,11 +795,15 @@ def visit_file(dir, name): # Try to match the regexp pattern, if specified. if configuration.regexp: -import re if not re.search(configuration.regexp, name): # We didn't match the regex, we're done. return +if configuration.skip_files: +for file_regexp in configuration.skip_files: +if re.search(file_regexp, name): +return + # We found a match for our test. Add it to the suite. # Update the sys.path first. Index: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py === --- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py +++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py @@ -96,6 +96,9 @@ '-p', metavar='pattern', help='Specify a regexp filename pattern for inclusion in the test suite') +group.add_argument('--excluded', metavar='exclusion-file', help=textwrap.dedent( +'''Specify a file for tests to exclude. File should contain lists of regular expressions for test files or methods, +with each list under a matching header (xfail files, xfail methods, skip files, skip methods)''')) group.add_argument( '-G', '--category', Index: lldb/trunk/packages/Python/lldbsuite/test/test_result.py ===
Re: [Lldb-commits] [PATCH] D20835: Mark the current column when displaying the context of the current breakpoint on the terminal.
tfiala closed this revision. tfiala added a comment. Thanks, Jim! https://reviews.llvm.org/D20835 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r282297 - Install only the manpage and only in the proper location
Author: enrico Date: Fri Sep 23 16:24:08 2016 New Revision: 282297 URL: http://llvm.org/viewvc/llvm-project?rev=282297=rev Log: Install only the manpage and only in the proper location Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=282297=282296=282297=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Sep 23 16:24:08 2016 @@ -57,7 +57,6 @@ 23059A0719532B96007B8189 /* LinuxSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23059A0519532B96007B8189 /* LinuxSignals.cpp */; }; 23059A101958B319007B8189 /* SBUnixSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23059A0F1958B319007B8189 /* SBUnixSignals.cpp */; }; 23059A121958B3B2007B8189 /* SBUnixSignals.h in Headers */ = {isa = PBXBuildFile; fileRef = 23059A111958B37B007B8189 /* SBUnixSignals.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 230EC4591D63C3A7008DF59F /* CMakeLists.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 230EC4571D63C3A7008DF59F /* CMakeLists.txt */; }; 230EC45B1D63C3BA008DF59F /* ThreadPlanCallOnFunctionExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 230EC4581D63C3A7008DF59F /* ThreadPlanCallOnFunctionExit.cpp */; }; 232CB615191E00CD00EF39FC /* NativeBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB60B191E00CC00EF39FC /* NativeBreakpoint.cpp */; }; 232CB617191E00CD00EF39FC /* NativeBreakpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB60D191E00CC00EF39FC /* NativeBreakpointList.cpp */; }; @@ -68,8 +67,6 @@ 233B007F1960CB280090E598 /* ProcessLaunchInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B007E1960CB280090E598 /* ProcessLaunchInfo.cpp */; }; 236124A41986B4E2004EFC37 /* IOObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 236124A21986B4E2004EFC37 /* IOObject.cpp */; }; 236124A51986B4E2004EFC37 /* Socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 236124A31986B4E2004EFC37 /* Socket.cpp */; }; - 2374D7461D4BAA1D005C9575 /* CMakeLists.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2374D7431D4BAA1D005C9575 /* CMakeLists.txt */; }; - 2374D7521D4BB299005C9575 /* GDBRemoteClientBase.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2374D74F1D4BB299005C9575 /* GDBRemoteClientBase.h */; }; 2374D7531D4BB2FF005C9575 /* GDBRemoteClientBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2374D74E1D4BB299005C9575 /* GDBRemoteClientBase.cpp */; }; 2377C2F819E613C100737875 /* PipePosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2377C2F719E613C100737875 /* PipePosix.cpp */; }; 238F2B9E1D2C82D0001FF92A /* StructuredDataPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 238F2B9D1D2C82D0001FF92A /* StructuredDataPlugin.cpp */; }; @@ -78,10 +75,6 @@ 238F2BA81D2C85FA001FF92A /* StructuredDataDarwinLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 238F2BA61D2C85FA001FF92A /* StructuredDataDarwinLog.cpp */; }; 238F2BA91D2C85FA001FF92A /* StructuredDataDarwinLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 238F2BA71D2C85FA001FF92A /* StructuredDataDarwinLog.h */; }; 239481861C59EBDD00DF7168 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 239481851C59EBDD00DF7168 /* libncurses.dylib */; }; - 23CB14F21D66CC9000EDDDE1 /* CMakeLists.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 23CB14F11D66CC9000EDDDE1 /* CMakeLists.txt */; }; - 23CB14F41D66CC9B00EDDDE1 /* CMakeLists.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 23CB14F31D66CC9B00EDDDE1 /* CMakeLists.txt */; }; - 23CB14F71D66CCD600EDDDE1 /* CMakeLists.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 23CB14F61D66CCD600EDDDE1 /* CMakeLists.txt */; }; - 23CB14FB1D66CCF100EDDDE1 /* CMakeLists.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 23CB14F91D66CCF100EDDDE1 /* CMakeLists.txt */; }; 23CB15331D66DA9300EDDDE1 /* GoParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEC6FF9F1BE970A2007882C1 /* GoParserTest.cpp */; }; 23CB15341D66DA9300EDDDE1 /* CPlusPlusLanguageTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB14FA1D66CCF100EDDDE1 /* CPlusPlusLanguageTest.cpp */; }; 23CB15351D66DA9300EDDDE1 /* UriParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F9461BDD346100BA9A93 /* UriParserTest.cpp */; }; @@ -109,18 +102,11 @@ 23CB154C1D66DA9300EDDDE1 /* libz.dylib in Frameworks */ = {isa =
[Lldb-commits] [lldb] r282277 - Change Module::RemapPath to use StringRef.
Author: zturner Date: Fri Sep 23 13:42:38 2016 New Revision: 282277 URL: http://llvm.org/viewvc/llvm-project?rev=282277=rev Log: Change Module::RemapPath to use StringRef. Modified: lldb/trunk/include/lldb/Core/Module.h lldb/trunk/include/lldb/Target/PathMappingList.h lldb/trunk/source/Core/Module.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Target/PathMappingList.cpp Modified: lldb/trunk/include/lldb/Core/Module.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Module.h?rev=282277=282276=282277=diff == --- lldb/trunk/include/lldb/Core/Module.h (original) +++ lldb/trunk/include/lldb/Core/Module.h Fri Sep 23 13:42:38 2016 @@ -27,7 +27,9 @@ #include "lldb/Symbol/TypeSystem.h" #include "lldb/Target/PathMappingList.h" #include "lldb/lldb-forward.h" + #include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/StringRef.h" namespace lldb_private { @@ -953,7 +955,8 @@ public: /// /b true if \a path was successfully located and \a new_path /// is filled in with a new source path, \b false otherwise. //-- - bool RemapSourceFile(const char *path, std::string _path) const; + bool RemapSourceFile(llvm::StringRef path, std::string _path) const; + bool RemapSourceFile(const char *, std::string &) const = delete; //-- /// @class LookupInfo Module.h "lldb/Core/Module.h" Modified: lldb/trunk/include/lldb/Target/PathMappingList.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/PathMappingList.h?rev=282277=282276=282277=diff == --- lldb/trunk/include/lldb/Target/PathMappingList.h (original) +++ lldb/trunk/include/lldb/Target/PathMappingList.h Fri Sep 23 13:42:38 2016 @@ -87,7 +87,8 @@ public: /// /b true if \a path was successfully located and \a new_path /// is filled in with a new source path, \b false otherwise. //-- - bool RemapPath(const char *path, std::string _path) const; + bool RemapPath(llvm::StringRef path, std::string _path) const; + bool RemapPath(const char *, std::string &) const = delete; bool ReverseRemapPath(const ConstString , ConstString _path) const; Modified: lldb/trunk/source/Core/Module.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=282277=282276=282277=diff == --- lldb/trunk/source/Core/Module.cpp (original) +++ lldb/trunk/source/Core/Module.cpp Fri Sep 23 13:42:38 2016 @@ -1635,7 +1635,8 @@ bool Module::FindSourceFile(const FileSp return m_source_mappings.FindFile(orig_spec, new_spec); } -bool Module::RemapSourceFile(const char *path, std::string _path) const { +bool Module::RemapSourceFile(llvm::StringRef path, + std::string _path) const { std::lock_guard guard(m_mutex); return m_source_mappings.RemapPath(path, new_path); } Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp?rev=282277=282276=282277=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp Fri Sep 23 13:42:38 2016 @@ -462,7 +462,7 @@ bool DWARFDebugLine::ParseSupportFiles( for (uint32_t file_idx = 1; prologue.GetFile(file_idx, cu_comp_dir, file_spec); ++file_idx) { -if (module_sp->RemapSourceFile(file_spec.GetCString(), remapped_file)) +if (module_sp->RemapSourceFile(file_spec.GetPath(), remapped_file)) file_spec.SetFile(remapped_file, false); support_files.Append(file_spec); } Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=282277=282276=282277=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Sep 23 13:42:38 2016 @@ -746,7 +746,7 @@ lldb::CompUnitSP SymbolFileDWARF::ParseC } std::string remapped_file; - if (module_sp->RemapSourceFile(cu_file_spec.GetCString(), + if (module_sp->RemapSourceFile(cu_file_spec.GetPath(), remapped_file))
Re: [Lldb-commits] [lldb] r282196 - [CMake] Fixing a small hack in add_lldb_library
BTW, a TON of unnecessary stuff currently depends on the clang tablegen targets, due to the way the libraries are not well layered. So you can be trying to build CommandObjectMemory.cpp, and all of a sudden it has to build the clang tablegen targets. Very frustrating for incremental development. I expect it's a rather large undertaking, but just an FYI. On Thu, Sep 22, 2016 at 2:25 PM Chris Bienemanwrote: > Also of note. This implementation is “standalone” safe. If LLDB is being > built without clang (against a pre-installed clang) CLANG_TABLEGEN_TARGETS > will not be set, so no dependency will be setup. > > That same concern came up in a similar patch I submitted to Swift. > > -Chris > > On Sep 22, 2016, at 2:23 PM, Zachary Turner wrote: > > Ok, cool! > > On Thu, Sep 22, 2016 at 2:23 PM Chris Bieneman wrote: > > Calls to add_dependencies don’t setup linkage, they just setup build > order, so changing this has no impact on what is linked or how. > > -Chris > > On Sep 22, 2016, at 2:21 PM, Zachary Turner wrote: > > At the end of the day though, lldb DOES need to link against libclang. Is > it still doing this? > > > On Thu, Sep 22, 2016 at 2:17 PM Chris Bieneman via lldb-commits < > lldb-commits@lists.llvm.org> wrote: > > Author: cbieneman > Date: Thu Sep 22 16:08:27 2016 > New Revision: 282196 > > URL: http://llvm.org/viewvc/llvm-project?rev=282196=rev > Log: > [CMake] Fixing a small hack in add_lldb_library > > This code was adding an explicit dependency on libclang because lldb needs > clang headers, changing this to instead depend on the clang tablegen > targets means we don't have to depend on building the clang bits in > libclang that lldb doesn't need. > > Note this is still a bit of a hack because we're adding the dependency to > all lldb libraries, instead of just the ones that need it. > > Modified: > lldb/trunk/cmake/modules/AddLLDB.cmake > > Modified: lldb/trunk/cmake/modules/AddLLDB.cmake > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=282196=282195=282196=diff > > == > --- lldb/trunk/cmake/modules/AddLLDB.cmake (original) > +++ lldb/trunk/cmake/modules/AddLLDB.cmake Thu Sep 22 16:08:27 2016 > @@ -91,7 +91,10 @@ macro(add_lldb_library name) ># Hack: only some LLDB libraries depend on the clang autogenerated > headers, ># but it is simple enough to make all of LLDB depend on some of those ># headers without negatively impacting much of anything. > - add_dependencies(${name} libclang) > + get_property(CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY > CLANG_TABLEGEN_TARGETS) > + if(CLANG_TABLEGEN_TARGETS) > +add_dependencies(${name} ${CLANG_TABLEGEN_TARGETS}) > + endif() > >set_target_properties(${name} PROPERTIES FOLDER "lldb libraries") > endmacro(add_lldb_library) > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits > > > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r282271 - Try again to match the logic of the code before re-writing.
Author: zturner Date: Fri Sep 23 13:13:18 2016 New Revision: 282271 URL: http://llvm.org/viewvc/llvm-project?rev=282271=rev Log: Try again to match the logic of the code before re-writing. Modified: lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp Modified: lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp?rev=282271=282270=282271=diff == --- lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp (original) +++ lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp Fri Sep 23 13:13:18 2016 @@ -138,7 +138,7 @@ Error OptionGroupValueObjectDisplay::Set if (option_arg.empty()) no_summary_depth = 1; else if (option_arg.getAsInteger(0, no_summary_depth)) { - no_summary_depth = 1; + no_summary_depth = 0; error.SetErrorStringWithFormat("invalid pointer depth '%s'", option_arg.str().c_str()); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r282270 - Try to fix failing TestDataFormatterSkipSummary test case.
Author: zturner Date: Fri Sep 23 13:11:03 2016 New Revision: 282270 URL: http://llvm.org/viewvc/llvm-project?rev=282270=rev Log: Try to fix failing TestDataFormatterSkipSummary test case. Modified: lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp Modified: lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp?rev=282270=282269=282270=diff == --- lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp (original) +++ lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp Fri Sep 23 13:11:03 2016 @@ -135,7 +135,9 @@ Error OptionGroupValueObjectDisplay::Set break; case 'Y': -if (option_arg.getAsInteger(0, no_summary_depth)) { +if (option_arg.empty()) + no_summary_depth = 1; +else if (option_arg.getAsInteger(0, no_summary_depth)) { no_summary_depth = 1; error.SetErrorStringWithFormat("invalid pointer depth '%s'", option_arg.str().c_str()); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r282269 - Update the prompt related functions to use StringRefs.
Author: zturner Date: Fri Sep 23 13:06:53 2016 New Revision: 282269 URL: http://llvm.org/viewvc/llvm-project?rev=282269=rev Log: Update the prompt related functions to use StringRefs. Modified: lldb/trunk/include/lldb/Core/Debugger.h lldb/trunk/include/lldb/Core/Event.h lldb/trunk/include/lldb/Core/IOHandler.h lldb/trunk/include/lldb/Core/Log.h lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h lldb/trunk/include/lldb/Interpreter/OptionValue.h lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h lldb/trunk/include/lldb/Utility/AnsiTerminal.h lldb/trunk/source/API/SBDebugger.cpp lldb/trunk/source/Commands/CommandObjectCommands.cpp lldb/trunk/source/Commands/CommandObjectExpression.cpp lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Core/Event.cpp lldb/trunk/source/Core/IOHandler.cpp lldb/trunk/source/Expression/REPL.cpp lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/source/Interpreter/OptionValue.cpp lldb/trunk/source/Interpreter/OptionValueProperties.cpp lldb/trunk/source/Target/Target.cpp Modified: lldb/trunk/include/lldb/Core/Debugger.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=282269=282268=282269=diff == --- lldb/trunk/include/lldb/Core/Debugger.h (original) +++ lldb/trunk/include/lldb/Core/Debugger.h Fri Sep 23 13:06:53 2016 @@ -226,9 +226,10 @@ public: bool SetTerminalWidth(uint32_t term_width); - const char *GetPrompt() const; + llvm::StringRef GetPrompt() const; - void SetPrompt(const char *p); + void SetPrompt(llvm::StringRef p); + void SetPrompt(const char *) = delete; bool GetUseExternalEditor() const; Modified: lldb/trunk/include/lldb/Core/Event.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Event.h?rev=282269=282268=282269=diff == --- lldb/trunk/include/lldb/Core/Event.h (original) +++ lldb/trunk/include/lldb/Core/Event.h Fri Sep 23 13:06:53 2016 @@ -59,6 +59,8 @@ public: EventDataBytes(const char *cstr); + EventDataBytes(llvm::StringRef str); + EventDataBytes(const void *src, size_t src_len); ~EventDataBytes() override; Modified: lldb/trunk/include/lldb/Core/IOHandler.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/IOHandler.h?rev=282269=282268=282269=diff == --- lldb/trunk/include/lldb/Core/IOHandler.h (original) +++ lldb/trunk/include/lldb/Core/IOHandler.h Fri Sep 23 13:06:53 2016 @@ -97,10 +97,11 @@ public: return nullptr; } - virtual bool SetPrompt(const char *prompt) { + virtual bool SetPrompt(llvm::StringRef prompt) { // Prompt support isn't mandatory return false; } + bool SetPrompt(const char *) = delete; virtual ConstString GetControlSequence(char ch) { return ConstString(); } @@ -341,7 +342,7 @@ class IOHandlerEditline : public IOHandl public: IOHandlerEditline(Debugger , IOHandler::Type type, const char *editline_name, // Used for saving history files -const char *prompt, const char *continuation_prompt, +llvm::StringRef prompt, llvm::StringRef continuation_prompt, bool multi_line, bool color_prompts, uint32_t line_number_start, // If non-zero show line numbers // starting at @@ -353,13 +354,22 @@ public: const lldb::StreamFileSP _sp, const lldb::StreamFileSP _sp, uint32_t flags, const char *editline_name, // Used for saving history files -const char *prompt, const char *continuation_prompt, +llvm::StringRef prompt, llvm::StringRef continuation_prompt, bool multi_line, bool color_prompts, uint32_t line_number_start, // If non-zero show line numbers // starting at // 'line_number_start' IOHandlerDelegate ); + IOHandlerEditline(Debugger &, IOHandler::Type, const char *, const char *, +const char *, bool, bool, uint32_t, +IOHandlerDelegate &) = delete; + + IOHandlerEditline(Debugger &, IOHandler::Type, const lldb::StreamFileSP &, +const lldb::StreamFileSP &, const lldb::StreamFileSP &, +uint32_t, const char *, const char *, const char *, bool, +bool, uint32_t, IOHandlerDelegate &) = delete; + ~IOHandlerEditline() override; void Run() override; @@ -388,11 +398,13 @@ public: const char *GetPrompt() override; - bool SetPrompt(const char *prompt)
Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef
This revision was automatically updated to reflect the committed changes. Closed by commit rL282265: Update OptionGroup::SetValue to take StringRef. (authored by zturner). Changed prior to commit: https://reviews.llvm.org/D24847?vs=72234=72310#toc Repository: rL LLVM https://reviews.llvm.org/D24847 Files: lldb/trunk/include/lldb/Interpreter/Args.h lldb/trunk/include/lldb/Interpreter/OptionGroupArchitecture.h lldb/trunk/include/lldb/Interpreter/OptionGroupBoolean.h lldb/trunk/include/lldb/Interpreter/OptionGroupFile.h lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h lldb/trunk/include/lldb/Interpreter/OptionGroupOutputFile.h lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h lldb/trunk/include/lldb/Interpreter/OptionGroupString.h lldb/trunk/include/lldb/Interpreter/OptionGroupUInt64.h lldb/trunk/include/lldb/Interpreter/OptionGroupUUID.h lldb/trunk/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h lldb/trunk/include/lldb/Interpreter/OptionGroupVariable.h lldb/trunk/include/lldb/Interpreter/OptionGroupWatchpoint.h lldb/trunk/include/lldb/Interpreter/OptionValue.h lldb/trunk/include/lldb/Interpreter/OptionValueArch.h lldb/trunk/include/lldb/Interpreter/OptionValueArray.h lldb/trunk/include/lldb/Interpreter/OptionValueBoolean.h lldb/trunk/include/lldb/Interpreter/OptionValueChar.h lldb/trunk/include/lldb/Interpreter/OptionValueDictionary.h lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h lldb/trunk/include/lldb/Interpreter/OptionValueFileSpecList.h lldb/trunk/include/lldb/Interpreter/OptionValueFormat.h lldb/trunk/include/lldb/Interpreter/OptionValueFormatEntity.h lldb/trunk/include/lldb/Interpreter/OptionValueLanguage.h lldb/trunk/include/lldb/Interpreter/OptionValuePathMappings.h lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h lldb/trunk/include/lldb/Interpreter/OptionValueSInt64.h lldb/trunk/include/lldb/Interpreter/OptionValueString.h lldb/trunk/include/lldb/Interpreter/OptionValueUInt64.h lldb/trunk/include/lldb/Interpreter/OptionValueUUID.h lldb/trunk/include/lldb/Interpreter/Options.h lldb/trunk/include/lldb/Target/Language.h lldb/trunk/include/lldb/Target/Platform.h lldb/trunk/source/API/SBLanguageRuntime.cpp lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp lldb/trunk/source/Commands/CommandObjectCommands.cpp lldb/trunk/source/Commands/CommandObjectExpression.cpp lldb/trunk/source/Commands/CommandObjectExpression.h lldb/trunk/source/Commands/CommandObjectMemory.cpp lldb/trunk/source/Commands/CommandObjectPlatform.cpp lldb/trunk/source/Commands/CommandObjectRegister.cpp lldb/trunk/source/Commands/CommandObjectTarget.cpp lldb/trunk/source/Commands/CommandObjectThread.cpp lldb/trunk/source/Commands/CommandObjectType.cpp lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp lldb/trunk/source/Interpreter/Args.cpp lldb/trunk/source/Interpreter/OptionGroupArchitecture.cpp lldb/trunk/source/Interpreter/OptionGroupBoolean.cpp lldb/trunk/source/Interpreter/OptionGroupFile.cpp lldb/trunk/source/Interpreter/OptionGroupFormat.cpp lldb/trunk/source/Interpreter/OptionGroupOutputFile.cpp lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp lldb/trunk/source/Interpreter/OptionGroupString.cpp lldb/trunk/source/Interpreter/OptionGroupUInt64.cpp lldb/trunk/source/Interpreter/OptionGroupUUID.cpp lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp lldb/trunk/source/Interpreter/OptionGroupVariable.cpp lldb/trunk/source/Interpreter/OptionGroupWatchpoint.cpp lldb/trunk/source/Interpreter/OptionValue.cpp lldb/trunk/source/Interpreter/OptionValueChar.cpp lldb/trunk/source/Interpreter/OptionValueDictionary.cpp lldb/trunk/source/Interpreter/OptionValueString.cpp lldb/trunk/source/Interpreter/OptionValueUInt64.cpp lldb/trunk/source/Interpreter/Options.cpp lldb/trunk/source/Interpreter/Property.cpp lldb/trunk/source/Target/Language.cpp lldb/trunk/source/Target/Platform.cpp Index: lldb/trunk/source/Target/Platform.cpp === --- lldb/trunk/source/Target/Platform.cpp +++ lldb/trunk/source/Target/Platform.cpp @@ -1401,7 +1401,7 @@ lldb_private::Error OptionGroupPlatformRSync::SetOptionValue(uint32_t option_idx, - const char *option_arg, + llvm::StringRef option_arg, ExecutionContext *execution_context) { Error error; char short_option = (char)GetDefinitions()[option_idx].short_option; @@ -1447,7 +1447,7 @@ lldb_private::Error OptionGroupPlatformSSH::SetOptionValue(uint32_t option_idx, - const char *option_arg, +
[Lldb-commits] [lldb] r282265 - Update OptionGroup::SetValue to take StringRef.
Author: zturner Date: Fri Sep 23 12:48:13 2016 New Revision: 282265 URL: http://llvm.org/viewvc/llvm-project?rev=282265=rev Log: Update OptionGroup::SetValue to take StringRef. Then deal with all the fallout. Differential Revision: https://reviews.llvm.org/D24847 Modified: lldb/trunk/include/lldb/Interpreter/Args.h lldb/trunk/include/lldb/Interpreter/OptionGroupArchitecture.h lldb/trunk/include/lldb/Interpreter/OptionGroupBoolean.h lldb/trunk/include/lldb/Interpreter/OptionGroupFile.h lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h lldb/trunk/include/lldb/Interpreter/OptionGroupOutputFile.h lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h lldb/trunk/include/lldb/Interpreter/OptionGroupString.h lldb/trunk/include/lldb/Interpreter/OptionGroupUInt64.h lldb/trunk/include/lldb/Interpreter/OptionGroupUUID.h lldb/trunk/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h lldb/trunk/include/lldb/Interpreter/OptionGroupVariable.h lldb/trunk/include/lldb/Interpreter/OptionGroupWatchpoint.h lldb/trunk/include/lldb/Interpreter/OptionValue.h lldb/trunk/include/lldb/Interpreter/OptionValueArch.h lldb/trunk/include/lldb/Interpreter/OptionValueArray.h lldb/trunk/include/lldb/Interpreter/OptionValueBoolean.h lldb/trunk/include/lldb/Interpreter/OptionValueChar.h lldb/trunk/include/lldb/Interpreter/OptionValueDictionary.h lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h lldb/trunk/include/lldb/Interpreter/OptionValueFileSpecList.h lldb/trunk/include/lldb/Interpreter/OptionValueFormat.h lldb/trunk/include/lldb/Interpreter/OptionValueFormatEntity.h lldb/trunk/include/lldb/Interpreter/OptionValueLanguage.h lldb/trunk/include/lldb/Interpreter/OptionValuePathMappings.h lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h lldb/trunk/include/lldb/Interpreter/OptionValueSInt64.h lldb/trunk/include/lldb/Interpreter/OptionValueString.h lldb/trunk/include/lldb/Interpreter/OptionValueUInt64.h lldb/trunk/include/lldb/Interpreter/OptionValueUUID.h lldb/trunk/include/lldb/Interpreter/Options.h lldb/trunk/include/lldb/Target/Language.h lldb/trunk/include/lldb/Target/Platform.h lldb/trunk/source/API/SBLanguageRuntime.cpp lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp lldb/trunk/source/Commands/CommandObjectCommands.cpp lldb/trunk/source/Commands/CommandObjectExpression.cpp lldb/trunk/source/Commands/CommandObjectExpression.h lldb/trunk/source/Commands/CommandObjectMemory.cpp lldb/trunk/source/Commands/CommandObjectPlatform.cpp lldb/trunk/source/Commands/CommandObjectRegister.cpp lldb/trunk/source/Commands/CommandObjectTarget.cpp lldb/trunk/source/Commands/CommandObjectThread.cpp lldb/trunk/source/Commands/CommandObjectType.cpp lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp lldb/trunk/source/Interpreter/Args.cpp lldb/trunk/source/Interpreter/OptionGroupArchitecture.cpp lldb/trunk/source/Interpreter/OptionGroupBoolean.cpp lldb/trunk/source/Interpreter/OptionGroupFile.cpp lldb/trunk/source/Interpreter/OptionGroupFormat.cpp lldb/trunk/source/Interpreter/OptionGroupOutputFile.cpp lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp lldb/trunk/source/Interpreter/OptionGroupString.cpp lldb/trunk/source/Interpreter/OptionGroupUInt64.cpp lldb/trunk/source/Interpreter/OptionGroupUUID.cpp lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp lldb/trunk/source/Interpreter/OptionGroupVariable.cpp lldb/trunk/source/Interpreter/OptionGroupWatchpoint.cpp lldb/trunk/source/Interpreter/OptionValue.cpp lldb/trunk/source/Interpreter/OptionValueChar.cpp lldb/trunk/source/Interpreter/OptionValueDictionary.cpp lldb/trunk/source/Interpreter/OptionValueString.cpp lldb/trunk/source/Interpreter/OptionValueUInt64.cpp lldb/trunk/source/Interpreter/Options.cpp lldb/trunk/source/Interpreter/Property.cpp lldb/trunk/source/Target/Language.cpp lldb/trunk/source/Target/Platform.cpp Modified: lldb/trunk/include/lldb/Interpreter/Args.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/Args.h?rev=282265=282264=282265=diff == --- lldb/trunk/include/lldb/Interpreter/Args.h (original) +++ lldb/trunk/include/lldb/Interpreter/Args.h Fri Sep 23 12:48:13 2016 @@ -227,6 +227,8 @@ public: void AddOrReplaceEnvironmentVariable(const char *, const char *) = delete; bool ContainsEnvironmentVariable(const char *, size_t * = nullptr) const = delete; + static int64_t StringToOptionEnum(const char *, OptionEnumValueElement *,
Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime
jingham added a subscriber: jingham. jingham added a comment. As long as the only way you can specify the black-list is explicitly on the command line, I think this is fine. There should never be implicit searches for a backlist file. You must have to supply it each time you run the testsuite. That way somebody would have to willfully decide not to run the full testsuite on their patch, and that's a human not a tech problem, since they could just as well check it in with failures they are ignoring, and not need this fancy mechanism... https://reviews.llvm.org/D24629 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24847: Make OptionGroup::SetValue take a StringRef
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Looks good. https://reviews.llvm.org/D24847 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime
fjricci added a comment. Ok. Barring objections from anyone else, I'll merge this later on today then, with the understanding that if it causes issues like the ones you describe, it should be reverted. https://reviews.llvm.org/D24629 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D21032: Eliminate differences in lldbinline-generated Makefiles and ensure they're regenerated every time
tfiala closed this revision. tfiala added a comment. Closing this out as it appears to be resolved one way or another. Repository: rL LLVM https://reviews.llvm.org/D21032 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D21152: Hunt for unused memory properly when dealing with processes that can tell us about memory mappings
tfiala closed this revision. tfiala added a comment. Closing per comments on this already being checked in. Repository: rL LLVM https://reviews.llvm.org/D21152 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime
fjricci added a comment. In https://reviews.llvm.org/D24629#550823, @tfiala wrote: > > > There is no reasonable thing we can base the expectation as the exact > > > same device with a different cpu revision could support watchpoints just > > > fine, so we could just define the list of these tests externally (in this > > > case, I would probably annotate them with the watchpoint category and > > > then do the skips based on categories instead). > > > > > > Tangential: most chips I've worked on that had hardware watchpoint support > had an instruction that could be called to find out if such a feature exists. > I think ARM does this. I would think we could expose an API that says > whether watchpoints are supported or not, and use that info in LLDB and the > test suite to enable or disable them. I believe that PTRACE_GETHBPREGS with a value of 0 returns that hardware stoppoint info on arm, and the byte representing the number of available hardware watchpoints will be 0 if they aren't supported. Not sure if there's a simpler way. https://reviews.llvm.org/D24629 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime
tfiala accepted this revision. tfiala added a comment. This revision is now accepted and ready to land. I am accepting this with one strong reservation which I will explicitly call out here: - If somebody checks in changes that are broken, and claims they missed it because they have an xfail exclusion file and didn't catch it, I will rip this out. If the xfails are hard to setup, it is likely that this is a code smell for needing better decorators to more precisely home in on the cases that are failing. Often times version checks are helpful. I do get the utility this would afford for bring-up of different scenarios, though. Hence I see that being useful enough to have it as an escape hatch. Comment at: packages/Python/lldbsuite/test/configuration.py:107-108 @@ +106,4 @@ +skip_methods = None +xfail_files = None +xfail_methods = None + The skip seems okay. The xfail seems *very* dangerous. Nobody else is going to get these xfails. We're setting ourselves up for having people check in tests that are broken. It allows for a workflow where the user "thinks they're done", when they're not. https://reviews.llvm.org/D24629 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24629: Allow for tests to be disabled at runtime
tfiala added a comment. > > There is no reasonable thing we can base the expectation as the exact same > > device with a different cpu revision could support watchpoints just fine, > > so we could just define the list of these tests externally (in this case, I > > would probably annotate them with the watchpoint category and then do the > > skips based on categories instead). > Tangential: most chips I've worked on that had hardware watchpoint support had an instruction that could be called to find out if such a feature exists. I think ARM does this. I would think we could expose an API that says whether watchpoints are supported or not, and use that info in LLDB and the test suite to enable or disable them. I'll look at the rest of the change here. I'm not opposed to the general idea, although if it encourages people to skip running tests, then check in code that breaks those tests, "unbeknownst to them" (* only because they were intentionally not running them), then I'd say that's bad news. https://reviews.llvm.org/D24629 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D20835: Mark the current column when displaying the context of the current breakpoint on the terminal.
tfiala added a comment. (I'll close this out as soon as Jim accepts). https://reviews.llvm.org/D20835 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24850: add hook for calling platform-dependent pre-kill action on a timed out test
tfiala closed this revision. tfiala added a comment. Closed by r282258 https://reviews.llvm.org/D24850 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r282258 - add hook for calling platform-dependent pre-kill action on a timed out test
Author: tfiala Date: Fri Sep 23 11:10:01 2016 New Revision: 282258 URL: http://llvm.org/viewvc/llvm-project?rev=282258=rev Log: add hook for calling platform-dependent pre-kill action on a timed out test differential review: https://reviews.llvm.org/D24850 reviewers: clayborg, labath Added: lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/ lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/README.md lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/__init__.py lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/darwin.py lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/tests/ lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/tests/__init__.py lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/tests/test_darwin.py Modified: lldb/trunk/packages/Python/lldbsuite/test/dosep.py lldb/trunk/packages/Python/lldbsuite/test/test_runner/process_control.py Added: lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/README.md URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/README.md?rev=282258=auto == --- lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/README.md (added) +++ lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/README.md Fri Sep 23 11:10:01 2016 @@ -0,0 +1,55 @@ +# pre\_kill\_hook package + +## Overview + +The pre\_kill\_hook package provides a per-platform method for running code +after a test process times out but before the concurrent test runner kills the +timed-out process. + +## Detailed Description of Usage + +If a platform defines the hook, then the hook gets called right after a timeout +is detected in a test run, but before the process is killed. + +The pre-kill-hook mechanism works as follows: + +* When a timeout is detected in the process_control.ProcessDriver class that + runs the per-test lldb process, a new overridable on\_timeout\_pre\_kill() method + is called on the ProcessDriver instance. + +* The concurrent test driver's derived ProcessDriver overrides this method. It + looks to see if a module called + "lldbsuite.pre\_kill\_hook.{platform-system-name}" module exists, where + platform-system-name is replaced with platform.system().lower(). (e.g. + "Darwin" becomes the darwin.py module). + + * If that module doesn't exist, the rest of the new behavior is skipped. + + * If that module does exist, it is loaded, and the method +"do\_pre\_kill(process\_id, context\_dict, output\_stream)" is called. If +that method throws an exception, we log it and we ignore further processing +of the pre-killed process. + + * The process\_id argument of the do\_pre\_kill function is the process id as +returned by the ProcessDriver.pid property. + + * The output\_stream argument of the do\_pre\_kill function takes a file-like +object. Output to be collected from doing any processing on the +process-to-be-killed should be written into the file-like object. The +current impl uses a six.StringIO and then writes this output to +{TestFilename}-{pid}.sample in the session directory. + +* Platforms where platform.system() is "Darwin" will get a pre-kill action that + runs the 'sample' program on the lldb that has timed out. That data will be + collected on CI and analyzed to determine what is happening during timeouts. + (This has an advantage over a core in that it is much smaller and that it + clearly demonstrates any liveness of the process, if there is any). + +## Running the tests + +To run the tests in the pre\_kill\_hook package, open a console, change into +this directory and run the following: + +``` +python -m unittest discover +``` Added: lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/__init__.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/__init__.py?rev=282258=auto == --- lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/__init__.py (added) +++ lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/__init__.py Fri Sep 23 11:10:01 2016 @@ -0,0 +1 @@ +"""Initialize the package.""" Added: lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/darwin.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/darwin.py?rev=282258=auto == --- lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/darwin.py (added) +++ lldb/trunk/packages/Python/lldbsuite/pre_kill_hook/darwin.py Fri Sep 23 11:10:01 2016 @@ -0,0 +1,46 @@ +"""Provides a pre-kill method to run on macOS.""" +from __future__ import print_function + +# system imports +import subprocess +import sys + +# third-party module imports +import six + + +def do_pre_kill(process_id, runner_context, output_stream, sample_time=3): +"""Samples the given process id, and puts the output to output_stream. +
Re: [Lldb-commits] [PATCH] D24850: add hook for calling platform-dependent pre-kill action on a timed out test
tfiala updated this revision to Diff 72294. tfiala added a comment. I'm about to check this in. I just wanted to put up my final change, which includes the following: - README.md - documents the new pre_kill_hook package in lldbsuite. - added a runner_context/context_dict argument to the pre-kill-hook logic. This dictionary will contain: - entry 'args': array containing configuration.args - entry 'platform_name': contains configuration.lldb_platform_name - entry 'platform_url': contains configuration.lldb_platform_url - entry 'platform_working_dir': contains configuration.lldb_platform_working_dir I pass the dictionary in to decouple the pre_kill_hook package from the test runner configuration module. (Also, the configuration module logic is not guaranteed to be run on any of those test queue workers, which may be in separate processes when using the multiprocessing* test runner strategies). https://reviews.llvm.org/D24850 Files: packages/Python/lldbsuite/pre_kill_hook/README.md packages/Python/lldbsuite/pre_kill_hook/__init__.py packages/Python/lldbsuite/pre_kill_hook/darwin.py packages/Python/lldbsuite/pre_kill_hook/tests/__init__.py packages/Python/lldbsuite/pre_kill_hook/tests/test_darwin.py packages/Python/lldbsuite/test/dosep.py packages/Python/lldbsuite/test/test_runner/process_control.py Index: packages/Python/lldbsuite/test/test_runner/process_control.py === --- packages/Python/lldbsuite/test/test_runner/process_control.py +++ packages/Python/lldbsuite/test/test_runner/process_control.py @@ -483,6 +483,19 @@ def on_process_exited(self, command, output, was_timeout, exit_status): pass +def on_timeout_pre_kill(self): +"""Called after the timeout interval elapses but before killing it. + +This method is added to enable derived classes the ability to do +something to the process prior to it being killed. For example, +this would be a good spot to run a program that samples the process +to see what it was doing (or not doing). + +Do not attempt to reap the process (i.e. use wait()) in this method. +That will interfere with the kill mechanism and return code processing. +""" +pass + def write(self, content): # pylint: disable=no-self-use # Intended - we want derived classes to be able to override @@ -640,6 +653,11 @@ # Reap the child process here. self.returncode = self.process.wait() else: + +# Allow derived classes to do some work after we detected +# a timeout but before we touch the timed-out process. +self.on_timeout_pre_kill() + # Prepare to stop the process process_terminated = completed_normally terminate_attempt_count = 0 Index: packages/Python/lldbsuite/test/dosep.py === --- packages/Python/lldbsuite/test/dosep.py +++ packages/Python/lldbsuite/test/dosep.py @@ -46,6 +46,7 @@ import sys import threading +from six import StringIO from six.moves import queue # Our packages and modules @@ -64,6 +65,8 @@ # Status codes for running command with timeout. eTimedOut, ePassed, eFailed = 124, 0, 1 +g_session_dir = None +g_runner_context = None output_lock = None test_counter = None total_tests = None @@ -227,6 +230,39 @@ failures, unexpected_successes) +def on_timeout_pre_kill(self): +# We're just about to have a timeout take effect. Here's our chance +# to do a pre-kill action. + +# For now, we look to see if the lldbsuite.pre_kill module has a +# runner for our platform. +module_name = "lldbsuite.pre_kill_hook." + platform.system().lower() +import importlib +try: +module = importlib.import_module(module_name) +except ImportError: +# We don't have one for this platform. Skip. +sys.stderr.write("\nwarning: no timeout handler module: " + + module_name) +return + +# Try to run the pre-kill-hook method. +try: +# Run the pre-kill command. +output_io = StringIO() +module.do_pre_kill(self.pid, g_runner_context, output_io) + +# Write the output to a filename associated with the test file and +# pid. +basename = "{}-{}.sample".format(self.file_name, self.pid) +sample_path = os.path.join(g_session_dir, basename) +with open(sample_path, "w") as output_file: +output_file.write(output_io.getvalue()) +except Exception as e: +sys.stderr.write("caught exception while running " + "pre-kill action: {}".format(e)) +return + def is_exceptional_exit(self):
Re: [Lldb-commits] [PATCH] D24850: add hook for calling platform-dependent pre-kill action on a timed out test
tfiala added inline comments. Comment at: packages/Python/lldbsuite/test/test_runner/process_control.py:514 @@ +513,3 @@ +# to it later. +self.command = command + labath wrote: > Is this actually used anywhere? No - I originally was parsing some options out of it in the handler, but I no longer am doing that. I will take this out of the final. It's easy enough to add in later if we ever need it. https://reviews.llvm.org/D24850 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24863: Keep dependencies separated between static and dynamic libraries. Fix for bug #28127.
brad.king added a comment. > ensuring that when static .a libraries are build they only introduce cmake > transitive dependencies to other .a components. This sounds good from a design level. As for the implementation, I'm not particularly familiar with `llvm_add_library` and all its options and use cases so I'll have to defer to other reviewers for that. Repository: rL LLVM https://reviews.llvm.org/D24863 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D24863: Keep dependencies separated between static and dynamic libraries. Fix for bug #28127.
labath resigned from this revision. labath edited reviewers, added: beanz; removed: labath. labath added a comment. @beanz, could you look at the llvm side of this? Repository: rL LLVM https://reviews.llvm.org/D24863 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r282236 - [gdb-remote] Remove the const char * version of SendPacketAndWaitForResponse
Author: labath Date: Fri Sep 23 04:11:49 2016 New Revision: 282236 URL: http://llvm.org/viewvc/llvm-project?rev=282236=rev Log: [gdb-remote] Remove the const char * version of SendPacketAndWaitForResponse Switch all callers to use the StringRef version. Modified: lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Modified: lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp?rev=282236=282235=282236=diff == --- lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp (original) +++ lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp Fri Sep 23 04:11:49 2016 @@ -751,10 +751,9 @@ const UnixSignalsSP // we'll guess the signal set based on the remote architecture. m_remote_signals_sp = UnixSignals::Create(GetRemoteSystemArchitecture()); - const char packet[] = "jSignalsInfo"; StringExtractorGDBRemote response; - auto result = m_gdb_client.SendPacketAndWaitForResponse( - packet, strlen(packet), response, false); + auto result = m_gdb_client.SendPacketAndWaitForResponse("jSignalsInfo", + response, false); if (result != decltype(result)::Success || response.GetResponseType() != response.eResponse) Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h?rev=282236=282235=282236=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h Fri Sep 23 04:11:49 2016 @@ -44,13 +44,6 @@ public: ContinueDelegate , const UnixSignals , llvm::StringRef payload, StringExtractorGDBRemote ); - PacketResult SendPacketAndWaitForResponse(const char *payload, size_t len, -StringExtractorGDBRemote , -bool send_async) { -return SendPacketAndWaitForResponse(llvm::StringRef(payload, len), response, -send_async); - } - PacketResult SendPacketAndWaitForResponse(llvm::StringRef payload, StringExtractorGDBRemote , bool send_async); Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=282236=282235=282236=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Fri Sep 23 04:11:49 2016 @@ -700,7 +700,7 @@ lldb::pid_t GDBRemoteCommunicationClient // newer // debugserver and lldb-gdbserver stubs return correctly. StringExtractorGDBRemote response; -if (SendPacketAndWaitForResponse("qC", strlen("qC"), response, false) == +if (SendPacketAndWaitForResponse("qC", response, false) == PacketResult::Success) { if (response.GetChar() == 'Q') { if (response.GetChar() == 'C') { @@ -734,8 +734,8 @@ lldb::pid_t GDBRemoteCommunicationClient bool GDBRemoteCommunicationClient::GetLaunchSuccess(std::string _str) { error_str.clear(); StringExtractorGDBRemote response; - if (SendPacketAndWaitForResponse("qLaunchSuccess", strlen("qLaunchSuccess"), - response, false) == PacketResult::Success) { + if (SendPacketAndWaitForResponse("qLaunchSuccess", response, false) == + PacketResult::Success) { if (response.IsOKResponse()) return true; if (response.GetChar() == 'E') { @@ -788,9 +788,8 @@ int GDBRemoteCommunicationClient::SendAr } StringExtractorGDBRemote response; -if (SendPacketAndWaitForResponse(packet.GetData(), packet.GetSize(), - response, - false) == PacketResult::Success) { +if (SendPacketAndWaitForResponse(packet.GetString(), response, false) == +PacketResult::Success) { if (response.IsOKResponse()) return 0; uint8_t error = response.GetError(); @@ -830,9 +829,8 @@ int GDBRemoteCommunicationClient::SendEn if
Re: [Lldb-commits] [PATCH] D24850: add hook for calling platform-dependent pre-kill action on a timed out test
labath accepted this revision. labath added a comment. Sounds like a useful thing to have. I've found turning on logging very helpful when looking for these issues, as it can tell you what was happening in the past, in addition to the current state (also it allows you to compare the logs from a successful and unsuccessful run). Comment at: packages/Python/lldbsuite/test/test_runner/process_control.py:514 @@ +513,3 @@ +# to it later. +self.command = command + Is this actually used anywhere? https://reviews.llvm.org/D24850 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits