[Lldb-commits] [lldb] r236803 - change comment symbol from // to #
Author: chying Date: Thu May 7 20:47:17 2015 New Revision: 236803 URL: http://llvm.org/viewvc/llvm-project?rev=236803&view=rev Log: change comment symbol from // to # Modified: lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py Modified: lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py?rev=236803&r1=236802&r2=236803&view=diff == --- lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py (original) +++ lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py Thu May 7 20:47:17 2015 @@ -159,8 +159,8 @@ class GdbRemoteTestCaseBase(TestBase): err = platform.Run(shell_command) if err.Fail(): raise Exception("remote_platform.RunShellCommand('readlink /proc/%d/exe') failed: %s" % (pid, err)) -// If the binary has been deleted, the link name has " (deleted)" appended. -// Remove if it's there. +# If the binary has been deleted, the link name has " (deleted)" appended. +# Remove if it's there. self.debug_monitor_exe = re.sub(r' \(deleted\)$', '', shell_command.GetOutput().strip()) dname = self.dbg.GetSelectedPlatform().GetWorkingDirectory() else: ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r236802 - Remove tailing " (deleted)" from executable name returned by readlink
Author: chying Date: Thu May 7 20:25:10 2015 New Revision: 236802 URL: http://llvm.org/viewvc/llvm-project?rev=236802&view=rev Log: Remove tailing " (deleted)" from executable name returned by readlink Summary: When calling readlink, " (deleted)" is appended to executable path if it's deleted. Remove if it's there. Reviewers: chaoren, sivachandra, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9583 Modified: lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py Modified: lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py?rev=236802&r1=236801&r2=236802&view=diff == --- lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py (original) +++ lldb/trunk/test/tools/lldb-server/gdbremote_testcase.py Thu May 7 20:25:10 2015 @@ -159,7 +159,9 @@ class GdbRemoteTestCaseBase(TestBase): err = platform.Run(shell_command) if err.Fail(): raise Exception("remote_platform.RunShellCommand('readlink /proc/%d/exe') failed: %s" % (pid, err)) -self.debug_monitor_exe = shell_command.GetOutput().strip() +// If the binary has been deleted, the link name has " (deleted)" appended. +// Remove if it's there. +self.debug_monitor_exe = re.sub(r' \(deleted\)$', '', shell_command.GetOutput().strip()) dname = self.dbg.GetSelectedPlatform().GetWorkingDirectory() else: self.debug_monitor_exe = get_lldb_server_exe() ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r236800 - [TestEvents] Add a 'connected' state to include remote debugging.
Author: sivachandra Date: Thu May 7 19:43:28 2015 New Revision: 236800 URL: http://llvm.org/viewvc/llvm-project?rev=236800&view=rev Log: [TestEvents] Add a 'connected' state to include remote debugging. Test Plan: dotest.py -p TestEvents Reviewers: vharron, chaoren Reviewed By: chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9581 Modified: lldb/trunk/test/python_api/event/TestEvents.py Modified: lldb/trunk/test/python_api/event/TestEvents.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/event/TestEvents.py?rev=236800&r1=236799&r2=236800&view=diff == --- lldb/trunk/test/python_api/event/TestEvents.py (original) +++ lldb/trunk/test/python_api/event/TestEvents.py Thu May 7 19:43:28 2015 @@ -247,11 +247,13 @@ class EventAPITestCase(TestBase): # The finite state machine for our custom listening thread, with an -# initail state of 0, which means a "running" event is expected. -# It changes to 1 after "running" is received. -# It cahnges to 2 after "stopped" is received. -# 2 will be our final state and the test is complete. -self.state = 0 +# initail state of None, which means no event has been received. +# It changes to 'connected' after 'connected' event is received (for remote platforms) +# It changes to 'running' after 'running' event is received (should happen only if the +# currentstate is either 'None' or 'connected') +# It changes to 'stopped' if a 'stopped' event is received (should happen only if the +# current state is 'running'.) +self.state = None # Create MyListeningThread to wait for state changed events. # By design, a "running" event is expected following by a "stopped" event. @@ -272,12 +274,20 @@ class EventAPITestCase(TestBase): match = pattern.search(desc) if not match: break; -if self.context.state == 0 and match.group(1) == 'running': -self.context.state = 1 +if match.group(1) == 'connected': +# When debugging remote targets with lldb-server, we +# first get the 'connected' event. +self.context.assertTrue(self.context.state == None) +self.context.state = 'connected' continue -elif self.context.state == 1 and match.group(1) == 'stopped': +elif match.group(1) == 'running': +self.context.assertTrue(self.context.state == None or self.context.state == 'connected') +self.context.state = 'running' +continue +elif match.group(1) == 'stopped': +self.context.assertTrue(self.context.state == 'running') # Whoopee, both events have been received! -self.context.state = 2 +self.context.state = 'stopped' break else: break @@ -304,7 +314,7 @@ class EventAPITestCase(TestBase): my_thread.join() # The final judgement. :-) -self.assertTrue(self.state == 2, +self.assertTrue(self.state == 'stopped', "Both expected state changed events received") ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Skip sysroot creation by module cache if symbolic links are not allowed for active user.
Hmm, yea that's not a bad idea. Let me look into the privilege thing a little tomorrow. In the meantime, do we properly handle the error case anyway (at least it should print a log and not have unexpected behavior). Creating the symlink could fail on other platforms too, not just windows On Thu, May 7, 2015 at 5:28 PM Oleksiy Vyalov wrote: > In http://reviews.llvm.org/D9587#168485, @zturner wrote: > > > Even with this check, creating the symbolic link might still fail for > other reasons related to the filesystem and not related to security. Would > it be better to just try to create it no matter what and log the error if > it fails? > > > I believe calling EnableCreateSymLinkPrivilege might be beneficial anyway > since as I can tell from running "whoami /priv" that > SE_CREATE_SYMBOLIC_LINK_NAME is disabled by default . I'm somewhat > concerned that we may call FileSystem::Symlink when we 100% confident that > it will fail. As an alternative, we may just call FileSystem::Symlink > anyway but always ignoring its result... > > Please let me know your opinion. > > > http://reviews.llvm.org/D9587 > > EMAIL PREFERENCES > http://reviews.llvm.org/settings/panel/emailpreferences/ > > > ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r236776 - Add logging to ProcessWindows.
Author: zturner Date: Thu May 7 16:39:33 2015 New Revision: 236776 URL: http://llvm.org/viewvc/llvm-project?rev=236776&view=rev Log: Add logging to ProcessWindows. Modified: lldb/trunk/include/lldb/Core/Log.h lldb/trunk/source/Core/Log.cpp lldb/trunk/source/Initialization/SystemInitializerCommon.cpp lldb/trunk/source/Plugins/Process/Windows/DebuggerThread.cpp lldb/trunk/source/Plugins/Process/Windows/ProcessWindows.cpp lldb/trunk/source/Plugins/Process/Windows/ProcessWindowsLog.cpp lldb/trunk/source/Plugins/Process/Windows/ProcessWindowsLog.h lldb/trunk/source/Plugins/Process/Windows/RegisterContextWindows.cpp lldb/trunk/source/Plugins/Process/Windows/x86/RegisterContextWindows_x86.cpp Modified: lldb/trunk/include/lldb/Core/Log.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Log.h?rev=236776&r1=236775&r2=236776&view=diff == --- lldb/trunk/include/lldb/Core/Log.h (original) +++ lldb/trunk/include/lldb/Core/Log.h Thu May 7 16:39:33 2015 @@ -128,6 +128,9 @@ public: Error(const char *fmt, ...) __attribute__((format(printf, 2, 3))); virtual void +VAError(const char *format, va_list args) __attribute__((format(printf, 2, 3))); + +virtual void FatalError(int err, const char *fmt, ...) __attribute__((format(printf, 3, 4))); virtual void Modified: lldb/trunk/source/Core/Log.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Log.cpp?rev=236776&r1=236775&r2=236776&view=diff == --- lldb/trunk/source/Core/Log.cpp (original) +++ lldb/trunk/source/Core/Log.cpp Thu May 7 16:39:33 2015 @@ -208,11 +208,18 @@ Log::LogIf(uint32_t bits, const char *fo void Log::Error(const char *format, ...) { -char *arg_msg = nullptr; va_list args; va_start(args, format); -::vasprintf(&arg_msg, format, args); +VAError(format, args); va_end(args); +} + + +void +Log::VAError(const char *format, va_list args) +{ +char *arg_msg = nullptr; +::vasprintf(&arg_msg, format, args); if (arg_msg == nullptr) return; @@ -221,6 +228,7 @@ Log::Error(const char *format, ...) free(arg_msg); } + //-- // Printing of errors that ARE fatal. Exit with ERR exit code // immediately. Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=236776&r1=236775&r2=236776&view=diff == --- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original) +++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Thu May 7 16:39:33 2015 @@ -171,6 +171,10 @@ SystemInitializerCommon::Terminate() PlatformDarwinKernel::Terminate(); #endif +#if defined(__WIN32__) +ProcessWindowsLog::Terminate(); +#endif + #ifndef LLDB_DISABLE_PYTHON OperatingSystemPython::Terminate(); #endif Modified: lldb/trunk/source/Plugins/Process/Windows/DebuggerThread.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DebuggerThread.cpp?rev=236776&r1=236775&r2=236776&view=diff == --- lldb/trunk/source/Plugins/Process/Windows/DebuggerThread.cpp (original) +++ lldb/trunk/source/Plugins/Process/Windows/DebuggerThread.cpp Thu May 7 16:39:33 2015 @@ -23,6 +23,8 @@ #include "lldb/Host/windows/ProcessLauncherWindows.h" #include "lldb/Target/ProcessLaunchInfo.h" +#include "Plugins/Process/Windows/ProcessWindowsLog.h" + #include "llvm/ADT/STLExtras.h" #include "llvm/Support/raw_ostream.h" @@ -56,10 +58,19 @@ DebuggerThread::~DebuggerThread() Error DebuggerThread::DebugLaunch(const ProcessLaunchInfo &launch_info) { -Error error; +WINLOG_IFALL(WINDOWS_LOG_PROCESS, +"DebuggerThread::DebugLaunch launching '%s'", launch_info.GetExecutableFile().GetPath().c_str()); +Error error; DebugLaunchContext *context = new DebugLaunchContext(this, launch_info); -HostThread slave_thread(ThreadLauncher::LaunchThread("lldb.plugin.process-windows.slave[?]", DebuggerThreadRoutine, context, &error)); +HostThread slave_thread(ThreadLauncher::LaunchThread("lldb.plugin.process-windows.slave[?]", +DebuggerThreadRoutine, context, &error)); + +if (!error.Success()) +{ +WINERR_IFALL(WINDOWS_LOG_PROCESS, +"DebugLaunch couldn't launch debugger thread. %s", error.AsCString()); +} return error; } @@ -80,6 +91,10 @@ DebuggerThread::DebuggerThreadRoutine(co // thread routine has exited. std::shared_ptr this_ref(shared_from_this()); +WINLOG_IFALL(WINDOWS_LOG_PROCESS, +"Debug
[Lldb-commits] [lldb] r236769 - Make it so that changing formats on a synthetic value object causes children to be invalidated and refetched when needed
Author: enrico Date: Thu May 7 15:33:31 2015 New Revision: 236769 URL: http://llvm.org/viewvc/llvm-project?rev=236769&view=rev Log: Make it so that changing formats on a synthetic value object causes children to be invalidated and refetched when needed This is required for supporting vector types formatting Modified: lldb/trunk/include/lldb/Core/ValueObject.h lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py Modified: lldb/trunk/include/lldb/Core/ValueObject.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=236769&r1=236768&r2=236769&view=diff == --- lldb/trunk/include/lldb/Core/ValueObject.h (original) +++ lldb/trunk/include/lldb/Core/ValueObject.h Thu May 7 15:33:31 2015 @@ -1133,6 +1133,7 @@ protected: friend class ClangExpressionVariable; // For SetName friend class Target; // For SetName friend class ValueObjectConstResultImpl; +friend class ValueObjectSynthetic;// For ClearUserVisibleData //-- // Constructors and Destructors Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=236769&r1=236768&r2=236769&view=diff == --- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original) +++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Thu May 7 15:33:31 2015 @@ -144,12 +144,7 @@ public: SetValueFromCString (const char *value_str, Error& error); virtual void -SetFormat (lldb::Format format) -{ -if (m_parent) -m_parent->SetFormat(format); -this->ValueObject::SetFormat(format); -} +SetFormat (lldb::Format format); protected: virtual bool Modified: lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp?rev=236769&r1=236768&r2=236769&view=diff == --- lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp (original) +++ lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp Thu May 7 15:33:31 2015 @@ -304,3 +304,15 @@ ValueObjectSynthetic::SetValueFromCStrin { return m_parent->SetValueFromCString(value_str, error); } + +void +ValueObjectSynthetic::SetFormat (lldb::Format format) +{ +if (m_parent) +{ +m_parent->ClearUserVisibleData(eClearUserVisibleDataItemsAll); +m_parent->SetFormat(format); +} +this->ValueObject::SetFormat(format); +this->ClearUserVisibleData(eClearUserVisibleDataItemsAll); +} Modified: lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py?rev=236769&r1=236768&r2=236769&view=diff == --- lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py (original) +++ lldb/trunk/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py Thu May 7 15:33:31 2015 @@ -71,6 +71,15 @@ class VectorTypesFormattingTestCase(Test self.expect("expr -f int16_t[] -- v", substrs=['[0] = 0', '[1] = 16288', '[2] = 0', '[3] = 16288', '[4] = 0', '[5] = 16416', '[6] = 0', '[7] = 16416']) self.expect("expr -f uint128_t[] -- v", substrs=['[0] = 85236745249553456609335044694184296448']) + +oldValue = v.GetChildAtIndex(0).GetValue() +v.SetFormat(lldb.eFormatHex) +newValue = v.GetChildAtIndex(0).GetValue() +self.assertFalse(oldValue == newValue, "values did not change along with format") + +v.SetFormat(lldb.eFormatVectorOfFloat32) +oldValueAgain = v.GetChildAtIndex(0).GetValue() +self.assertTrue(oldValue == oldValueAgain, "same format but different values") if __name__ == '__main__': import atexit ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Don't call the Process::SyncIOHandler in Target::Launch
>RE: Is change this necessary to ensure correctness, or is it just a matter of saving some lines of code? It was done to ensure correctness because Target::Launch consists of ~4 branches of code where it was needed and it was to difficult to maintain. In addition it is needed only for lldb to ensure that event is handled before printing of (lldb) prompt, but if it doesn't matter when we using a public API (i.e. SBTarget::Launch). And the last benefit is to remove the duplicated code. >RE: It's not clear to me why is this the case, but the test takes ~6 minutes now, where previously it took slightly less than 5. I think it is a matter of TestMiStartupOptoins failure because each test is waiting ~30sec before failing. Thanks, Ilia On May 7, 2015 4:40 PM, "Pavel Labath" wrote: > Is change this necessary to ensure correctness, or is it just a matter of > saving some lines of code? > > I am asking this because, this change has increased the running time of > the test suite (compare > http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/2252 > with > http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/2251), > sending TestConcurrentEvents over the 5m limit on the linux build bot. It's > not clear to me why is this the case, but the test takes ~6 minutes now, > where previously it took slightly less than 5. For now I have increased the > timeout limit to address this, but we will need to do something different > in the future. > > > http://reviews.llvm.org/D9373 > > EMAIL PREFERENCES > http://reviews.llvm.org/settings/panel/emailpreferences/ > > > ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r236762 - Add a missing check for m_real_stop_reason.
Author: jingham Date: Thu May 7 13:51:04 2015 New Revision: 236762 URL: http://llvm.org/viewvc/llvm-project?rev=236762&view=rev Log: Add a missing check for m_real_stop_reason. Modified: lldb/trunk/source/Target/ThreadPlanCallFunction.cpp Modified: lldb/trunk/source/Target/ThreadPlanCallFunction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanCallFunction.cpp?rev=236762&r1=236761&r2=236762&view=diff == --- lldb/trunk/source/Target/ThreadPlanCallFunction.cpp (original) +++ lldb/trunk/source/Target/ThreadPlanCallFunction.cpp Thu May 7 13:51:04 2015 @@ -407,7 +407,7 @@ ThreadPlanCallFunction::DoPlanExplainsSt // signal that is set not to stop. Check that here first. We just say we explain the stop // but aren't done and everything will continue on from there. -if (m_real_stop_info_sp->ShouldStopSynchronous(event_ptr)) +if (m_real_stop_info_sp && m_real_stop_info_sp->ShouldStopSynchronous(event_ptr)) { SetPlanComplete(false); if (m_subplan_sp) ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r236759 - qProcessInfo was not correctly detecting the sysctl value for "hw.cpu64bit_capable".
Author: gclayton Date: Thu May 7 13:42:03 2015 New Revision: 236759 URL: http://llvm.org/viewvc/llvm-project?rev=236759&view=rev Log: qProcessInfo was not correctly detecting the sysctl value for "hw.cpu64bit_capable". It was just detecting the existance of the value. If it gets the value correctly, we need to check that it is non-zero to see if cpu64bit_capable should be true. Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=236759&r1=236758&r2=236759&view=diff == --- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original) +++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Thu May 7 13:42:03 2015 @@ -4387,13 +4387,11 @@ RNBRemote::HandlePacket_qProcessInfo (co rep << "cputype:" << std::hex << cputype << ";"; } -bool host_cpu_is_64bit; +bool host_cpu_is_64bit = false; uint32_t is64bit_capable; size_t is64bit_capable_len = sizeof (is64bit_capable); if (sysctlbyname("hw.cpu64bit_capable", &is64bit_capable, &is64bit_capable_len, NULL, 0) == 0) -host_cpu_is_64bit = true; -else -host_cpu_is_64bit = false; +host_cpu_is_64bit = is64bit_capable != 0; uint32_t cpusubtype; size_t cpusubtype_len = sizeof(cpusubtype); ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r236749 - Extend r236708 to skip tests also failing on FreeBSD
Author: emaste Date: Thu May 7 12:14:56 2015 New Revision: 236749 URL: http://llvm.org/viewvc/llvm-project?rev=236749&view=rev Log: Extend r236708 to skip tests also failing on FreeBSD Modified: lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py Modified: lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py?rev=236749&r1=236748&r2=236749&view=diff == --- lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py (original) +++ lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py Thu May 7 12:14:56 2015 @@ -130,6 +130,7 @@ class MiStartupOptionsTestCase(lldbmi_te @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") +@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots def test_lldbmi_source_option_start_script(self): """Test that 'lldb-mi --interpreter' can execute user's commands after initial commands were executed.""" @@ -170,6 +171,7 @@ class MiStartupOptionsTestCase(lldbmi_te @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") +@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots def test_lldbmi_source_option_start_script_exit(self): """Test that 'lldb-mi --interpreter' can execute a prepared file which passed via --source option.""" @@ -210,6 +212,7 @@ class MiStartupOptionsTestCase(lldbmi_te @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") +@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_source_option_start_script_error(self): """Test that 'lldb-mi --interpreter' stops execution of initial commands in case of error.""" ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] Have lldb_assert accept bool expressions
LGTM - Enrico Sent from my iPhone > On May 7, 2015, at 8:15 AM, Pavel Labath wrote: > > Hi granata.enrico, zturner, > > This changes lldb_assert to accept bool expressions as the parameter, this is > because some > objects (such as std::shared_ptr) are convertible to bool, but are not > convertible to int, which > leads to surprising errors. > > http://reviews.llvm.org/D9565 > > Files: > include/lldb/Utility/LLDBAssert.h > source/Utility/LLDBAssert.cpp > > Index: include/lldb/Utility/LLDBAssert.h > === > --- include/lldb/Utility/LLDBAssert.h > +++ include/lldb/Utility/LLDBAssert.h > @@ -20,7 +20,7 @@ > > namespace lldb_private { > void > -lldb_assert (int expression, > +lldb_assert (bool expression, > const char* expr_text, > const char* func, > const char* file, > Index: source/Utility/LLDBAssert.cpp > === > --- source/Utility/LLDBAssert.cpp > +++ source/Utility/LLDBAssert.cpp > @@ -17,7 +17,7 @@ > using namespace lldb_private; > > void > -lldb_private::lldb_assert (int expression, > +lldb_private::lldb_assert (bool expression, >const char* expr_text, >const char* func, >const char* file, > > EMAIL PREFERENCES > http://reviews.llvm.org/settings/panel/emailpreferences/ > ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r236725 - Increase the timeout limit for TestConcurrentEvents
Author: labath Date: Thu May 7 08:35:21 2015 New Revision: 236725 URL: http://llvm.org/viewvc/llvm-project?rev=236725&view=rev Log: Increase the timeout limit for TestConcurrentEvents After recent changes, TestConcurrentEvents began timing out. This increases the timeout limit to 7m for this test, ensure the Test has enough time to complete. Modified: lldb/trunk/test/dosep.py Modified: lldb/trunk/test/dosep.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dosep.py?rev=236725&r1=236724&r2=236725&view=diff == --- lldb/trunk/test/dosep.py (original) +++ lldb/trunk/test/dosep.py Thu May 7 08:35:21 2015 @@ -48,6 +48,11 @@ def get_timeout_command(): timeout_command = get_timeout_command() +# TestConcurrentEvents is a long test and it times out with default 5m timeout. +# Increase its timeout if it hasn't been already set. +if os.environ.get('LLDB_TEST_TIMEOUT') == None and os.environ.get('LLDB_TESTCONCURRENTEVENTS_TIMEOUT') == None: +os.environ['LLDB_TESTCONCURRENTEVENTS_TIMEOUT'] = "7m" + default_timeout = os.getenv("LLDB_TEST_TIMEOUT") or "5m" # Status codes for running command with timeout. ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r236716 - A small fix in rL236696
Author: mohit.bhakkad Date: Thu May 7 06:43:23 2015 New Revision: 236716 URL: http://llvm.org/viewvc/llvm-project?rev=236716&view=rev Log: A small fix in rL236696 Modified: lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp Modified: lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp?rev=236716&r1=236715&r2=236716&view=diff == --- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp Thu May 7 06:43:23 2015 @@ -48,6 +48,7 @@ using namespace lldb_private; // //-- +#ifdef __mips__ extern "C" { void LLVMInitializeMipsTargetInfo (); void LLVMInitializeMipsTarget (); @@ -55,6 +56,7 @@ extern "C" { void LLVMInitializeMipsTargetMC (); void LLVMInitializeMipsDisassembler (); } +#endif EmulateInstructionMIPS64::EmulateInstructionMIPS64 (const lldb_private::ArchSpec &arch) : EmulateInstruction (arch) @@ -70,6 +72,7 @@ EmulateInstructionMIPS64::EmulateInstruc * to decode the instructions so that the decoding complexity stays with LLVM. * Initialize the MIPS targets and disassemblers. */ +#ifdef __mips__ if (!target) { LLVMInitializeMipsTargetInfo (); @@ -79,6 +82,7 @@ EmulateInstructionMIPS64::EmulateInstruc LLVMInitializeMipsDisassembler (); target = llvm::TargetRegistry::lookupTarget (triple.getTriple(), Error); } +#endif assert (target); ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r236707 - [NativeProcessLinux] Remove logging and error callbacks
Author: labath Date: Thu May 7 03:30:31 2015 New Revision: 236707 URL: http://llvm.org/viewvc/llvm-project?rev=236707&view=rev Log: [NativeProcessLinux] Remove logging and error callbacks Summary: These are remnants of the thread state coordinator, which are now unnecessary. I have basically inlined the callbacks. No functional change. Test Plan: Tests continue to pass. Reviewers: chaoren, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9343 Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.h Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=236707&r1=236706&r2=236707&view=diff == --- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original) +++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Thu May 7 03:30:31 2015 @@ -153,26 +153,6 @@ namespace return signals; } -NativeProcessLinux::LogFunction -GetThreadLoggerFunction () -{ -return [](const char *format, va_list args) -{ -Log *const log = GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD); -if (log) -log->VAPrintf (format, args); -}; -} - -void -CoordinatorErrorHandler (const std::string &error_message) -{ -Log *const log = GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD); -if (log) -log->Printf ("NativeProcessLinux::%s %s", __FUNCTION__, error_message.c_str ()); -assert (false && "NativeProcessLinux error reported"); -} - Error ResolveProcessArchitecture (lldb::pid_t pid, Platform &platform, ArchSpec &arch) { @@ -1673,9 +1653,7 @@ NativeProcessLinux::NativeProcessLinux ( m_supports_mem_region (eLazyBoolCalculate), m_mem_region_cache (), m_mem_region_cache_mutex (), -m_log_function (GetThreadLoggerFunction()), -m_tid_map (), -m_log_event_processing (false) +m_tid_map () { } @@ -2250,7 +2228,7 @@ NativeProcessLinux::MonitorCallback(lldb // This is a group stop reception for this tid. if (log) log->Printf ("NativeThreadLinux::%s received a group stop for pid %" PRIu64 " tid %" PRIu64, __FUNCTION__, GetID (), pid); -NotifyThreadStop (pid); +NotifyThreadStop (pid, false); } else { @@ -2353,7 +2331,7 @@ NativeProcessLinux::WaitForNewThread(::p new_thread_sp = AddThread(tid); std::static_pointer_cast (new_thread_sp)->SetRunning (); Resume (tid, LLDB_INVALID_SIGNAL_NUMBER); -NotifyThreadCreate (tid, false, CoordinatorErrorHandler); +NotifyThreadCreate (tid, false); } void @@ -2470,7 +2448,7 @@ NativeProcessLinux::MonitorSIGTRAP(const // The inferior process or one of its threads is about to exit. // This thread is currently stopped. It's not actually dead yet, just about to be. -NotifyThreadStop (pid); +NotifyThreadStop (pid, false); unsigned long data = 0; if (GetEventMessage(pid, &data).Fail()) @@ -2496,8 +2474,7 @@ NativeProcessLinux::MonitorSIGTRAP(const { std::static_pointer_cast (thread_sp)->SetRunning (); return Resume (tid_to_resume, (supress_signal) ? LLDB_INVALID_SIGNAL_NUMBER : signo); -}, -CoordinatorErrorHandler); +}); break; } @@ -2536,7 +2513,7 @@ NativeProcessLinux::MonitorSIGTRAP(const log->Printf ("NativeProcessLinux::%s() received unknown SIGTRAP system call stop event, pid %" PRIu64 "tid %" PRIu64 ", resuming", __FUNCTION__, GetID (), pid); // This thread is currently stopped. -NotifyThreadStop (pid); +NotifyThreadStop (pid, false); if (thread_sp) std::static_pointer_cast (thread_sp)->SetStoppedBySignal (SIGTRAP); @@ -2547,8 +2524,7 @@ NativeProcessLinux::MonitorSIGTRAP(const { std::static_pointer_cast (thread_sp)->SetRunning (); return Resume (tid_to_resume, LLDB_INVALID_SIGNAL_NUMBER); -}, -CoordinatorErrorHandler); +}); break; default: @@ -2572,7 +2548,7 @@ NativeProcessLinux::MonitorTrace(lldb::p std::static_pointer_cast(thread_sp)->SetStoppedByTrace(); // This thread is currently stopped. -NotifyThreadStop(pid); +NotifyThreadStop(pid, false); // Here we don't have to request the rest of the threads to stop or request a deferred stop. // This would have already happened at the time the Resume() with step operation was signaled. @@ -2592,7 +2568,7 @@ Native
[Lldb-commits] [lldb] r236708 - Skip few MiStartupOptionsTestCase tests to get Linux build green
Author: ki.stfu Date: Thu May 7 03:31:12 2015 New Revision: 236708 URL: http://llvm.org/viewvc/llvm-project?rev=236708&view=rev Log: Skip few MiStartupOptionsTestCase tests to get Linux build green Modified: lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py Modified: lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py?rev=236708&r1=236707&r2=236708&view=diff == --- lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py (original) +++ lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py Thu May 7 03:31:12 2015 @@ -130,6 +130,7 @@ class MiStartupOptionsTestCase(lldbmi_te @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") +@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots def test_lldbmi_source_option_start_script(self): """Test that 'lldb-mi --interpreter' can execute user's commands after initial commands were executed.""" @@ -169,6 +170,7 @@ class MiStartupOptionsTestCase(lldbmi_te @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") +@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots def test_lldbmi_source_option_start_script_exit(self): """Test that 'lldb-mi --interpreter' can execute a prepared file which passed via --source option.""" ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r236705 - Implement -target-attach and -target-detach
Author: ki.stfu Date: Thu May 7 02:38:49 2015 New Revision: 236705 URL: http://llvm.org/viewvc/llvm-project?rev=236705&view=rev Log: Implement -target-attach and -target-detach Summary: This changes add -target-attach and -target-detach. -target-attach allows lldb-mi to attach to an existing process by it's process id, matching gdb mi's syntax of '-target-attach '. Combining this with --waitfor will allow lldb mi to attach to a process by name when the process starts. -target-detach simply detaches from the current process Patch from chu...@microsoft.com Test Plan: I have added three tests, one each for -target-attach , -target-attach -n , and -target-attach -n --waitfor Reviewers: paulmaybee, abidh, ChuckR Subscribers: greggm, lldb-commits Differential Revision: http://reviews.llvm.org/D9484 Added: lldb/trunk/test/tools/lldb-mi/target/ lldb/trunk/test/tools/lldb-mi/target/Makefile lldb/trunk/test/tools/lldb-mi/target/TestMiTarget.py lldb/trunk/test/tools/lldb-mi/target/test_attach.cpp Modified: lldb/trunk/tools/lldb-mi/MICmdCmdTarget.cpp lldb/trunk/tools/lldb-mi/MICmdCmdTarget.h lldb/trunk/tools/lldb-mi/MICmdCommands.cpp lldb/trunk/tools/lldb-mi/MICmnResources.cpp lldb/trunk/tools/lldb-mi/MICmnResources.h lldb/trunk/tools/lldb-mi/MIExtensions.txt Added: lldb/trunk/test/tools/lldb-mi/target/Makefile URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/target/Makefile?rev=236705&view=auto == --- lldb/trunk/test/tools/lldb-mi/target/Makefile (added) +++ lldb/trunk/test/tools/lldb-mi/target/Makefile Thu May 7 02:38:49 2015 @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +CXX_SOURCES := test_attach.cpp + +include $(LEVEL)/Makefile.rules Added: lldb/trunk/test/tools/lldb-mi/target/TestMiTarget.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/target/TestMiTarget.py?rev=236705&view=auto == --- lldb/trunk/test/tools/lldb-mi/target/TestMiTarget.py (added) +++ lldb/trunk/test/tools/lldb-mi/target/TestMiTarget.py Thu May 7 02:38:49 2015 @@ -0,0 +1,125 @@ +""" +Test lldb-mi -target-xxx commands. +""" + +import lldbmi_testcase +from lldbtest import * +import unittest2 + +class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase): + +mydir = TestBase.compute_mydir(__file__) + +@lldbmi_test +@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") +@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races +@skipIfLinux # cannot attach to process on linux +def test_lldbmi_target_attach_wait_for(self): +"""Test that 'lldb-mi --interpreter' works for -target-attach -n --waitfor.""" + +# Build target executable with unique name +exeName = self.testMethodName +d = {'EXE': exeName} +self.buildProgram("test_attach.cpp", exeName) +self.addTearDownCleanup(dictionary=d) + +self.spawnLldbMi(args = None) + +# Load executable +# FIXME: -file-exec-and-sybmols is not required for target attach, but the test will not pass without this +self.runCmd("-file-exec-and-symbols %s" % exeName) +self.expect("\^done") + +# Set up attach +self.runCmd("-target-attach -n %s --waitfor" % exeName) +time.sleep(4) # Give attach time to setup + +# Start target process +self.spawnSubprocess(os.path.join(os.path.dirname(__file__), exeName)); +self.addTearDownHook(self.cleanupSubprocesses) +self.expect("\^done") + +# Set breakpoint on printf +line = line_number('test_attach.cpp', '// BP_i++') +self.runCmd("-break-insert -f test_attach.cpp:%d" % line) +self.expect("\^done,bkpt={number=\"1\"") + +# Continue to breakpoint +self.runCmd("-exec-continue") +self.expect("\*stopped,reason=\"breakpoint-hit\"") + +# Detach +self.runCmd("-target-detach") +self.expect("\^done") + +@lldbmi_test +@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") +@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races +@skipIfLinux # cannot attach to process on linux +def test_lldbmi_target_attach_name(self): +"""Test that 'lldb-mi --interpreter' works for -target-attach -n .""" + +# Build target executable with unique name +exeName = self.testMethodName +d = {'EXE': exeName} +self.buildProgram("test_attach.cpp", exeName) +self.addTearDownCleanup(dictionary=d) + +# Start target process +targetProcess = self.spawnSubprocess(os.path.join(os.path.dirname(__file__), exeName)); +self.addTearDownHook(self.
[Lldb-commits] [lldb] r236704 - Minor changes in the MiStartupOptionsTestCase (MI)
Author: ki.stfu Date: Thu May 7 02:16:06 2015 New Revision: 236704 URL: http://llvm.org/viewvc/llvm-project?rev=236704&view=rev Log: Minor changes in the MiStartupOptionsTestCase (MI) Modified: lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py lldb/trunk/test/tools/lldb-mi/startup_options/main.cpp Modified: lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py?rev=236704&r1=236703&r2=236704&view=diff == --- lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py (original) +++ lldb/trunk/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py Thu May 7 02:16:06 2015 @@ -49,7 +49,7 @@ class MiStartupOptionsTestCase(lldbmi_te # Test that the executable isn't loaded when unknown file was specified self.expect("-file-exec-and-symbols \"%s\"" % path) -self.expect("\^error,msg=\"Command 'file-exec-and-symbols'\. Target binary '%s' is invalid\. error: unable to find executable for '%s'\"" % (path, path)) +self.expect("\^error,msg=\"Command 'file-exec-and-symbols'. Target binary '%s' is invalid. error: unable to find executable for '%s'\"" % (path, path)) # Test that lldb-mi is ready when executable was loaded self.expect(self.child_prompt, exactly = True) @@ -123,7 +123,7 @@ class MiStartupOptionsTestCase(lldbmi_te # Test that the executable isn't loaded when file was specified using unknown path self.expect("-file-exec-and-symbols \"%s\"" % path) -self.expect("\^error,msg=\"Command 'file-exec-and-symbols'\. Target binary '%s' is invalid\. error: unable to find executable for '%s'\"" % (path, path)) +self.expect("\^error,msg=\"Command 'file-exec-and-symbols'. Target binary '%s' is invalid. error: unable to find executable for '%s'\"" % (path, path)) # Test that lldb-mi is ready when executable was loaded self.expect(self.child_prompt, exactly = True) @@ -151,7 +151,7 @@ class MiStartupOptionsTestCase(lldbmi_te self.expect("\^running") # After '-break-insert main.cpp:BP_return' -line = line_number('main.cpp', '// BP_return') +line = line_number('main.cpp', '//BP_return') self.expect("-break-insert main.cpp:%d" % line) self.expect("\^done,bkpt={number=\"2\"") @@ -190,7 +190,7 @@ class MiStartupOptionsTestCase(lldbmi_te self.expect("\^running") # After '-break-insert main.cpp:BP_return' -line = line_number('main.cpp', '// BP_return') +line = line_number('main.cpp', '//BP_return') self.expect("-break-insert main.cpp:%d" % line) self.expect("\^done,bkpt={number=\"2\"") @@ -226,7 +226,7 @@ class MiStartupOptionsTestCase(lldbmi_te # Test that lldb-mi is ready after execution of --source start_script self.expect(self.child_prompt, exactly = True) - + @lldbmi_test @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows") @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races @@ -299,6 +299,6 @@ class MiStartupOptionsTestCase(lldbmi_te # Delete log for f in logFile: os.remove(f) - + if __name__ == '__main__': unittest2.main() Modified: lldb/trunk/test/tools/lldb-mi/startup_options/main.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/startup_options/main.cpp?rev=236704&r1=236703&r2=236704&view=diff == --- lldb/trunk/test/tools/lldb-mi/startup_options/main.cpp (original) +++ lldb/trunk/test/tools/lldb-mi/startup_options/main.cpp Thu May 7 02:16:06 2015 @@ -11,5 +11,5 @@ int main(int argc, char const *argv[]) { int a = 10; -return 0; // BP_return +return 0; //BP_return } ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits