[Lldb-commits] [lldb] r219905 - Remove dead store.

2014-10-16 Thread Jason Molenda
Author: jmolenda
Date: Thu Oct 16 02:47:37 2014
New Revision: 219905

URL: http://llvm.org/viewvc/llvm-project?rev=219905view=rev
Log:
Remove dead store.
clang static analyzer fixit.

Modified:
lldb/trunk/source/Symbol/LineTable.cpp

Modified: lldb/trunk/source/Symbol/LineTable.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/LineTable.cpp?rev=219905r1=219904r2=219905view=diff
==
--- lldb/trunk/source/Symbol/LineTable.cpp (original)
+++ lldb/trunk/source/Symbol/LineTable.cpp Thu Oct 16 02:47:37 2014
@@ -562,7 +562,6 @@ LineTable::LinkLineTable (const FileRang
 // Append the sequence since we just terminated the previous one
 line_table_ap-InsertSequence (sequence);
 sequence.Clear();
-prev_entry_was_linked = false;
 }
 
 // Now link the current entry


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219907 - Remove dead store.

2014-10-16 Thread Jason Molenda
Author: jmolenda
Date: Thu Oct 16 02:49:27 2014
New Revision: 219907

URL: http://llvm.org/viewvc/llvm-project?rev=219907view=rev
Log:
Remove dead store.
clang static analyzer fixit.

Modified:
lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Target/Process.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=219907r1=219906r2=219907view=diff
==
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Thu Oct 16 02:49:27 2014
@@ -2535,10 +2535,10 @@ Process::WriteMemory (addr_t addr, const
 });
 
 if (bytes_written  size)
-bytes_written += WriteMemoryPrivate (addr + bytes_written,
- ubuf + bytes_written,
- size - bytes_written,
- error);
+WriteMemoryPrivate (addr + bytes_written,
+ubuf + bytes_written,
+size - bytes_written,
+error);
 }
 }
 else


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219911 - Remove unreachable code.

2014-10-16 Thread Jason Molenda
Author: jmolenda
Date: Thu Oct 16 03:05:22 2014
New Revision: 219911

URL: http://llvm.org/viewvc/llvm-project?rev=219911view=rev
Log:
Remove unreachable code.

Modified:
lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp

Modified: lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp?rev=219911r1=219910r2=219911view=diff
==
--- lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp (original)
+++ lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp Thu Oct 16 
03:05:22 2014
@@ -1211,10 +1211,6 @@ lldb_private::formatters::NSStringSummar
 explicit_length++; // account for the fact that there is no NULL 
and we need to have one added
 return 
ReadAsciiBufferAndDumpToStream(location,process_sp,stream,explicit_length);
 }
-
-stream.Printf(class name = %s,class_name);
-return true;
-
 }
 
 bool


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219915 - Remove unreachable code.

2014-10-16 Thread Jason Molenda
Author: jmolenda
Date: Thu Oct 16 03:08:13 2014
New Revision: 219915

URL: http://llvm.org/viewvc/llvm-project?rev=219915view=rev
Log:
Remove unreachable code.

Modified:
lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp

Modified: lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp?rev=219915r1=219914r2=219915view=diff
==
--- lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp Thu Oct 16 
03:08:13 2014
@@ -173,9 +173,6 @@ OptionValuePathMappings::SetValueFromCSt
 break;
 }
 return error;
-
-m_value_was_set = true;
-return Error();
 }
 
 lldb::OptionValueSP


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219920 - Most of this function checks to see if m_process is non-null before

2014-10-16 Thread Jason Molenda
Author: jmolenda
Date: Thu Oct 16 03:43:27 2014
New Revision: 219920

URL: http://llvm.org/viewvc/llvm-project?rev=219920view=rev
Log:
Most of this function checks to see if m_process is non-null before
dereferencing it, except for this one section of code.  Add a null
check around it.
clang static analyzer fix.

Modified:

lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp?rev=219920r1=219919r2=219920view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
Thu Oct 16 03:43:27 2014
@@ -257,13 +257,15 @@ DynamicLoaderPOSIXDYLD::ProbeEntry()
 if (log)
 log-Printf (DynamicLoaderPOSIXDYLD::%s pid % PRIu64  
GetEntryPoint() returned address 0x% PRIx64 , setting entry breakpoint, 
__FUNCTION__, m_process ? m_process-GetID () : LLDB_INVALID_PROCESS_ID, entry);
 
+if (m_process)
+{
+Breakpoint *const entry_break = 
m_process-GetTarget().CreateBreakpoint(entry, true, false).get();
+entry_break-SetCallback(EntryBreakpointHit, this, true);
+entry_break-SetBreakpointKind(shared-library-event);
 
-Breakpoint *const entry_break = 
m_process-GetTarget().CreateBreakpoint(entry, true, false).get();
-entry_break-SetCallback(EntryBreakpointHit, this, true);
-entry_break-SetBreakpointKind(shared-library-event);
-
-// Shoudn't hit this more than once.
-entry_break-SetOneShot (true);
+// Shoudn't hit this more than once.
+entry_break-SetOneShot (true);
+}
 }
 
 // The runtime linker has run and initialized the rendezvous structure once the


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] Compiler args patch resubmission

2014-10-16 Thread Alex Pepper
I am looking into it.  Thanks.

- Alex


On Oct 16, 2014, at 8:09 AM, Ed Maste ema...@freebsd.org wrote:

 On FreeBSD this change introduced 29 test failures. It seems like they are 
 all segfaults.
 
 My test build was w/o debug info - I'll have to rebuild and grab a backtrace.
 
 ```
 Failing Tests (29)
 FAIL: LLDB (suite) :: TestHelloWorld.py (FreeBSD feynman 10.0-STABLE FreeBSD 
 10.0-STABLE #1 r268946+94ba9c8(stable-10): Mon Jul 21 14:06:09 EDT 2014 
 emaste@feynman:/tank/emaste/obj/tank/emaste/src/git-stable-10/sys/GENERIC 
 amd64 amd64)
 FAIL: LLDB (suite) :: TestMultithreaded.py (FreeBSD feynman 10.0-STABLE 
 FreeBSD 10.0-STABLE #1 r268946+94ba9c8(stable-10): Mon Jul 21 14:06:09 EDT 
 2014 
 emaste@feynman:/tank/emaste/obj/tank/emaste/src/git-stable-10/sys/GENERIC 
 amd64 amd64)
 FAIL: LLDB (suite) :: TestConditionalBreak.py (FreeBSD feynman 10.0-STABLE 
 FreeBSD 10.0-STABLE #1 r268946+94ba9c8(stable-10): Mon Jul 21 14:06:09 EDT 
 2014 
 emaste@feynman:/tank/emaste/obj/tank/emaste/src/git-stable-10/sys/GENERIC 
 amd64 amd64)
 FAIL: LLDB (suite) :: TestBreakpointCommand.py (FreeBSD feynman 10.0-STABLE 
 FreeBSD 10.0-STABLE #1 r268946+94ba9c8(stable-10): Mon Jul 21 14:06:09 EDT 
 2014 
 emaste@feynman:/tank/emaste/obj/tank/emaste/src/git-stable-10/sys/GENERIC 
 amd64 amd64)
 ...
 ninja: build stopped: subcommand failed.  
   
 ```
 
 http://reviews.llvm.org/D5806
 
 


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219936 - Fix MemoryHistory plugin to check whether the plugin

2014-10-16 Thread Jason Molenda
Author: jmolenda
Date: Thu Oct 16 11:59:23 2014
New Revision: 219936

URL: http://llvm.org/viewvc/llvm-project?rev=219936view=rev
Log:
Fix MemoryHistory plugin to check whether the plugin
was able to create itself before returning the shared
pointer to it.
clang warning.

Modified:
lldb/trunk/source/Target/MemoryHistory.cpp

Modified: lldb/trunk/source/Target/MemoryHistory.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/MemoryHistory.cpp?rev=219936r1=219935r2=219936view=diff
==
--- lldb/trunk/source/Target/MemoryHistory.cpp (original)
+++ lldb/trunk/source/Target/MemoryHistory.cpp Thu Oct 16 11:59:23 2014
@@ -21,7 +21,9 @@ MemoryHistory::FindPlugin (const Process
 
 for (uint32_t idx = 0; (create_callback = 
PluginManager::GetMemoryHistoryCreateCallbackAtIndex(idx)) != NULL; ++idx)
 {
-return create_callback(process);
+MemoryHistorySP memory_history_sp (create_callback (process));
+if (memory_history_sp.get())
+return memory_history_sp;
 }
 
 return MemoryHistorySP();


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219970 - I see this test case crash - skip for now

2014-10-16 Thread Enrico Granata
Author: enrico
Date: Thu Oct 16 16:42:34 2014
New Revision: 219970

URL: http://llvm.org/viewvc/llvm-project?rev=219970view=rev
Log:
I see this test case crash - skip for now

Modified:
lldb/trunk/test/lang/objc/blocks/TestObjCIvarsInBlocks.py

Modified: lldb/trunk/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/blocks/TestObjCIvarsInBlocks.py?rev=219970r1=219969r2=219970view=diff
==
--- lldb/trunk/test/lang/objc/blocks/TestObjCIvarsInBlocks.py (original)
+++ lldb/trunk/test/lang/objc/blocks/TestObjCIvarsInBlocks.py Thu Oct 16 
16:42:34 2014
@@ -15,6 +15,7 @@ class TestObjCIvarsInBlocks(TestBase):
 @expectedFailurei386
 @python_api_test
 @dsym_test
+@unittest2.skip(rdar://18682916)
 def test_with_dsym_and_python_api(self):
 Test printing the ivars of the self when captured in blocks
 self.buildDsym()
@@ -25,6 +26,7 @@ class TestObjCIvarsInBlocks(TestBase):
 # This test requires the 2.0 runtime, so it will fail on i386.
 @expectedFailurei386
 @dwarf_test
+@unittest2.skip(rdar://18682916)
 def test_with_dwarf_and_python_api(self):
 Test printing the ivars of the self when captured in blocks
 self.buildDwarf()


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219971 - This test actually works alright - we were just checking for the wrong string

2014-10-16 Thread Enrico Granata
Author: enrico
Date: Thu Oct 16 17:04:05 2014
New Revision: 219971

URL: http://llvm.org/viewvc/llvm-project?rev=219971view=rev
Log:
This test actually works alright - we were just checking for the wrong string

Modified:
lldb/trunk/test/lang/c/anonymous/TestAnonymous.py

Modified: lldb/trunk/test/lang/c/anonymous/TestAnonymous.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/anonymous/TestAnonymous.py?rev=219971r1=219970r2=219971view=diff
==
--- lldb/trunk/test/lang/c/anonymous/TestAnonymous.py (original)
+++ lldb/trunk/test/lang/c/anonymous/TestAnonymous.py Thu Oct 16 17:04:05 2014
@@ -30,7 +30,6 @@ class AnonymousTestCase(TestBase):
 self.buildDsym()
 self.expr_parent()
 
-@unittest2.expectedFailure # llvm.org/pr15591 
 @dsym_test
 def test_expr_null(self):
 self.buildDsym()
@@ -66,7 +65,6 @@ class AnonymousTestCase(TestBase):
 self.buildDwarf()
 self.expr_parent()
 
-@unittest2.expectedFailure # llvm.org/pr15591 
 @dwarf_test
 def test_expr_null(self):
 self.buildDwarf()
@@ -151,8 +149,7 @@ class AnonymousTestCase(TestBase):
 # This should fail because pz is 0, but it succeeds on OS/X.
 # This fails on Linux with an upstream error Couldn't dematerialize 
struct, as does p *n with int *n = 0.
 # Note that this can also trigger llvm.org/pr15036 when run 
interactively at the lldb command prompt.
-self.expect(expression *(type_z *)pz,
-substrs = [Cannot access memory at address 0x0], error = True)
+self.expect(expression *(type_z *)pz, error = True)
 
 def child_by_name(self):
 exe = os.path.join (os.getcwd(), a.out)


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219973 - Some more failure to bug tracking

2014-10-16 Thread Enrico Granata
Author: enrico
Date: Thu Oct 16 17:27:17 2014
New Revision: 219973

URL: http://llvm.org/viewvc/llvm-project?rev=219973view=rev
Log:
Some more failure to bug tracking

Modified:
lldb/trunk/test/expression_command/test/TestExprs.py
lldb/trunk/test/lang/cpp/dynamic-value/TestCppValueCast.py
lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py

Modified: lldb/trunk/test/expression_command/test/TestExprs.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/test/TestExprs.py?rev=219973r1=219972r2=219973view=diff
==
--- lldb/trunk/test/expression_command/test/TestExprs.py (original)
+++ lldb/trunk/test/expression_command/test/TestExprs.py Thu Oct 16 17:27:17 
2014
@@ -43,7 +43,7 @@ class BasicExprCommandsTestCase(TestBase
 
 self.runCmd(run, RUN_SUCCEEDED)
 
-@unittest2.expectedFailure # llvm.org/pr17135: APFloat::toString does not 
identify the correct (i.e. least) precision.
+@unittest2.expectedFailure(llvm.org/pr17135 rdar://problem/14874559 
APFloat::toString does not identify the correct (i.e. least) precision.)
 def test_floating_point_expr_commands(self):
 self.build_and_run()
 

Modified: lldb/trunk/test/lang/cpp/dynamic-value/TestCppValueCast.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/dynamic-value/TestCppValueCast.py?rev=219973r1=219972r2=219973view=diff
==
--- lldb/trunk/test/lang/cpp/dynamic-value/TestCppValueCast.py (original)
+++ lldb/trunk/test/lang/cpp/dynamic-value/TestCppValueCast.py Thu Oct 16 
17:27:17 2014
@@ -12,8 +12,7 @@ class CppValueCastTestCase(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-# rdar://problem/10808472 SBValue::Cast test case is failing (virtual 
inheritance)
-@unittest2.expectedFailure
+@unittest2.expectedFailure(rdar://problem/10808472 SBValue::Cast test 
case is failing (virtual inheritance))
 @unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
 @python_api_test
 @dsym_test
@@ -23,8 +22,7 @@ class CppValueCastTestCase(TestBase):
 self.setTearDownCleanup(dictionary=self.d_virtual)
 self.do_sbvalue_cast(self.exe_name)
 
-# rdar://problem/10808472 SBValue::Cast test case is failing (virtual 
inheritance)
-@unittest2.expectedFailure
+@unittest2.expectedFailure(rdar://problem/10808472 SBValue::Cast test 
case is failing (virtual inheritance))
 @python_api_test
 @dwarf_test
 def test_value_cast_with_dwarf_and_virtual_inheritance(self):

Modified: lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py?rev=219973r1=219972r2=219973view=diff
==
--- lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py (original)
+++ lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py Thu Oct 16 
17:27:17 2014
@@ -26,7 +26,7 @@ class HiddenIvarsTestCase(TestBase):
 self.buildDwarf()
 self.expr()
 
-@unittest2.expectedFailure
+@unittest2.expectedFailure(rdar://18683637)
 @unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
 @dsym_test
 def test_frame_variable_with_dsym(self):
@@ -35,7 +35,7 @@ class HiddenIvarsTestCase(TestBase):
 self.buildDsym()
 self.frame_var()
 
-@unittest2.expectedFailure
+@unittest2.expectedFailure(rdar://18683637)
 @unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
 @dwarf_test
 def test_frame_variable_with_dwarf(self):


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219979 - Add a test for the -b (batch mode) option to the lldb driver.

2014-10-16 Thread Jim Ingham
Author: jingham
Date: Thu Oct 16 18:02:14 2014
New Revision: 219979

URL: http://llvm.org/viewvc/llvm-project?rev=219979view=rev
Log:
Add a test for the -b (batch mode) option to the lldb driver.

Added:
lldb/trunk/test/driver/
lldb/trunk/test/driver/batch_mode/
lldb/trunk/test/driver/batch_mode/Makefile
lldb/trunk/test/driver/batch_mode/TestBatchMode.py
lldb/trunk/test/driver/batch_mode/main.c
Modified:
lldb/trunk/test/lldbtest.py

Added: lldb/trunk/test/driver/batch_mode/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/driver/batch_mode/Makefile?rev=219979view=auto
==
--- lldb/trunk/test/driver/batch_mode/Makefile (added)
+++ lldb/trunk/test/driver/batch_mode/Makefile Thu Oct 16 18:02:14 2014
@@ -0,0 +1,28 @@
+CC ?= clang
+ifeq $(ARCH) 
+   ARCH = x86_64
+endif
+
+ifeq $(OS) 
+   OS = $(shell uname -s)
+endif
+
+CFLAGS ?= -g -O0
+CWD := $(shell pwd)
+
+LIB_PREFIX := lib
+
+ifeq $(OS) Darwin
+   CFLAGS += -arch $(ARCH)
+endif
+
+all: a.out
+
+a.out: main.o
+   $(CC) $(CFLAGS) -o a.out main.o
+
+main.o: main.c
+   $(CC) $(CFLAGS) -c main.c
+
+clean:
+   rm -rf $(wildcard *.o *~ *.dylib *.so a.out *.dSYM)

Added: lldb/trunk/test/driver/batch_mode/TestBatchMode.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/driver/batch_mode/TestBatchMode.py?rev=219979view=auto
==
--- lldb/trunk/test/driver/batch_mode/TestBatchMode.py (added)
+++ lldb/trunk/test/driver/batch_mode/TestBatchMode.py Thu Oct 16 18:02:14 2014
@@ -0,0 +1,99 @@
+
+Test that the lldb driver's batch mode works correctly.
+
+
+import os, time
+import unittest2
+import lldb
+import pexpect
+from lldbtest import *
+
+class DriverBatchModeTest (TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
+@unittest2.expectedFailure(rdar://problem/18684124, lldb doesn't 
reliably print the prompt when run under pexpect)
+@dsym_test
+def test_driver_batch_mode_with_dsym(self):
+Test that the lldb driver's batch mode works correctly.
+self.buildDsym()
+self.setTearDownCleanup()
+self.batch_mode ()
+
+@unittest2.expectedFailure(rdar://problem/18684124, lldb doesn't 
reliably print the prompt when run under pexpect)
+@dwarf_test
+def test_driver_batch_mode_with_dwarf(self):
+Test that the lldb driver's batch mode works correctly.
+self.buildDwarf()
+self.setTearDownCleanup()
+self.batch_mode()
+
+def setUp(self):
+# Call super's setUp().
+TestBase.setUp(self)
+# Our simple source filename.
+self.source = 'main.c'
+
+def expect_string (self, string):
+This expects for string, with timeout  EOF being test fails.
+try:
+self.child.expect_exact(string)
+except pexpect.EOF:
+self.fail (Got EOF waiting for '%s'%(string))
+except pexpect.TIMEOUT:
+self.fail (Timed out waiting for '%s'%(string))
+
+
+def batch_mode (self):
+exe = os.path.join(os.getcwd(), a.out)
+prompt = (lldb) 
+
+# First time through, pass CRASH so the process will crash and stop in 
batch mode.
+run_commands = ' -b -o break set -n main -o run -o continue '
+self.child = pexpect.spawn('%s %s %s %s -- CRASH' % (self.lldbHere, 
self.lldbOption, run_commands, exe))
+child = self.child
+# Turn on logging for what the child sends back.
+if self.TraceOn():
+child.logfile_read = sys.stdout
+
+# We should see the run:
+self.expect_string (run)
+# We should have hit the breakpoint  continued:
+self.expect_string (continue)
+# The App should have crashed:
+self.expect_string(About to crash)
+# Then we should have a live prompt:
+self.expect_string (prompt)
+self.child.sendline(frame variable touch_me_not)
+self.expect_string ('(char *) touch_me_not')
+
+self.deletePexpectChild()
+
+# Now do it again, and see make sure if we don't crash, we quit:
+run_commands = ' -b -o break set -n main -o run -o continue '
+self.child = pexpect.spawn('%s %s %s %s -- NOCRASH' % (self.lldbHere, 
self.lldbOption, run_commands, exe))
+child = self.child
+# Turn on logging for what the child sends back.
+if self.TraceOn():
+child.logfile_read = sys.stdout
+
+# We should see the run:
+self.expect_string (run)
+# We should have hit the breakpoint  continued:
+self.expect_string (continue)
+# The App should have not have crashed:
+self.expect_string(Got there on time and it did not crash.)
+# Then we should have a live prompt:
+

[Lldb-commits] [lldb] r219980 - This test needs the SB headers to make sense

2014-10-16 Thread Enrico Granata
Author: enrico
Date: Thu Oct 16 18:02:45 2014
New Revision: 219980

URL: http://llvm.org/viewvc/llvm-project?rev=219980view=rev
Log:
This test needs the SB headers to make sense

Modified:
lldb/trunk/test/api/multiple-debuggers/TestMultipleDebuggers.py

Modified: lldb/trunk/test/api/multiple-debuggers/TestMultipleDebuggers.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/api/multiple-debuggers/TestMultipleDebuggers.py?rev=219980r1=219979r2=219980view=diff
==
--- lldb/trunk/test/api/multiple-debuggers/TestMultipleDebuggers.py (original)
+++ lldb/trunk/test/api/multiple-debuggers/TestMultipleDebuggers.py Thu Oct 16 
18:02:45 2014
@@ -16,10 +16,12 @@ class TestMultipleSimultaneousDebuggers(
 self.lib_dir = os.environ[LLDB_LIB_DIR]
 
 @skipIfi386
+@skipIfNoSBHeaders
 @expectedFailureDarwin(llvm.org/pr20282) # intermittent
 @expectedFailureFreeBSD(llvm.org/pr20282)
 @expectedFailureLinux(llvm.org/pr20282)
 def test_multiple_debuggers(self):
+env = {self.dylibPath : self.getLLDBLibraryEnvVal()}
 
 self.driver_exe = os.path.join(os.getcwd(), multi-process-driver)
 self.buildDriver('multi-process-driver.cpp', self.driver_exe)
@@ -29,8 +31,6 @@ class TestMultipleSimultaneousDebuggers(
 self.buildDriver('testprog.cpp', self.inferior_exe)
 self.addTearDownHook(lambda: os.remove(self.inferior_exe))
 
-env = {self.dylibPath : self.getLLDBLibraryEnvVal()}
-
 # check_call will raise a CalledProcessError if multi-process-driver doesn't 
return
 # exit code 0 to indicate success.  We can let this exception go - the test 
harness
 # will recognize it as a test failure.


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219982 - The number '5' triggers a bug unrelated to LLDB, and is not instrumental to this test in any way. Use another, randomly chosen, number to make the test pass again and p

2014-10-16 Thread Enrico Granata
Author: enrico
Date: Thu Oct 16 18:06:40 2014
New Revision: 219982

URL: http://llvm.org/viewvc/llvm-project?rev=219982view=rev
Log:
The number '5' triggers a bug unrelated to LLDB, and is not instrumental to 
this test in any way. Use another, randomly chosen, number to make the test 
pass again and provide useful actionable feedback about things that truly matter

Modified:
lldb/trunk/test/expression_command/po_verbosity/TestPoVerbosity.py
lldb/trunk/test/expression_command/po_verbosity/main.m

Modified: lldb/trunk/test/expression_command/po_verbosity/TestPoVerbosity.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/po_verbosity/TestPoVerbosity.py?rev=219982r1=219981r2=219982view=diff
==
--- lldb/trunk/test/expression_command/po_verbosity/TestPoVerbosity.py 
(original)
+++ lldb/trunk/test/expression_command/po_verbosity/TestPoVerbosity.py Thu Oct 
16 18:06:40 2014
@@ -20,7 +20,6 @@ class PoVerbosityTestCase(TestBase):
 
 @unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
 @dsym_test
-@expectedFailureDarwin(16374063)
 def test_with_dsym(self):
 Test that the po command acts correctly.
 self.buildDsym()
@@ -28,7 +27,6 @@ class PoVerbosityTestCase(TestBase):
 
 @unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin 
due to ObjC test case)
 @dwarf_test
-@expectedFailureDarwin(16374063)
 def test_with_dwarf(self):
 Test that the po command acts correctly.
 self.buildDwarf()
@@ -59,16 +57,16 @@ class PoVerbosityTestCase(TestBase):
 self.expect(expr -O -- foo,matching=False,
 substrs = ['(id) $'])
 
-self.expect(expr -O -- 5,matching=False,
+self.expect(expr -O -- 22,matching=False,
 substrs = ['(int) $'])
-self.expect(expr -O -- 5,
-substrs = ['5'])
+self.expect(expr -O -- 22,
+substrs = ['22'])
 
-self.expect(expr -O -vfull -- 5,
-substrs = ['(int) $', ' = 5'])
+self.expect(expr -O -vfull -- 22,
+substrs = ['(int) $', ' = 22'])
 
-self.expect(expr -O -v -- 5,
-substrs = ['(int) $', ' = 5'])
+self.expect(expr -O -v -- 22,
+substrs = ['(int) $', ' = 22'])
 
 
 if __name__ == '__main__':

Modified: lldb/trunk/test/expression_command/po_verbosity/main.m
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/po_verbosity/main.m?rev=219982r1=219981r2=219982view=diff
==
--- lldb/trunk/test/expression_command/po_verbosity/main.m (original)
+++ lldb/trunk/test/expression_command/po_verbosity/main.m Thu Oct 16 18:06:40 
2014
@@ -2,6 +2,7 @@
 
 int main()
 {
+[NSString initialize];
id foo = @{@1 : @2, @2 : @3};
int x = 34;
return 0; // Stop here


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219983 - Change a use of mktemp() to mkstemp() for better security.

2014-10-16 Thread Jason Molenda
Author: jmolenda
Date: Thu Oct 16 18:10:03 2014
New Revision: 219983

URL: http://llvm.org/viewvc/llvm-project?rev=219983view=rev
Log:
Change a use of mktemp() to mkstemp() for better security.
We have two more uses of mktemp still in the source base
but they'll take a little more consideration.
clang static analyzer fixit.

Modified:
lldb/trunk/source/Expression/ClangExpressionParser.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=219983r1=219982r2=219983view=diff
==
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Thu Oct 16 18:10:03 
2014
@@ -312,11 +312,11 @@ ClangExpressionParser::Parse (Stream st
 temp_source_path = /tmp/expr.XX;
 }
 
-if (mktemp(temp_source_path[0]))
+int temp_fd = ::mkstemp(temp_source_path[0]);
+
+if (temp_fd != -1)
 {
-lldb_private::File file (temp_source_path.c_str(),
- File::eOpenOptionWrite | 
File::eOpenOptionCanCreateNewOnly,
- lldb::eFilePermissionsFileDefault);
+lldb_private::File file (temp_fd, true);
 const size_t expr_text_len = strlen(expr_text);
 size_t bytes_written = expr_text_len;
 if (file.Write(expr_text, bytes_written).Success())


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r219984 - Added a new kind of test case: the inline test

2014-10-16 Thread Sean Callanan
Author: spyffe
Date: Thu Oct 16 18:15:22 2014
New Revision: 219984

URL: http://llvm.org/viewvc/llvm-project?rev=219984view=rev
Log:
Added a new kind of test case: the inline test
case.  This test case style attempts to shed all
of the boilerplate that is required for test
cases, and let 80% of test cases use a much terser
syntax.

Inline testcases have much simplified python files
(the corresponding .py file should contain two
lines of code) and require no Makefile, because the
Makefile is generated automatically.  Breakpoints
are set automatically and the indicated breakpoint
actions (specified after a magic //% comment) are
executed when the breakpoint is hit.

All other testcases are unaffected.

One thing I'm not really happy with yet is the way
multiple actions for the same line are specified.
I'm going to use lang/c/struct_types as a guinea
pig to develop this further.

Added:
lldb/trunk/test/lldbinline.py
Removed:
lldb/trunk/test/lang/c/struct_types/Makefile
lldb/trunk/test/lang/c/struct_types/cmds.txt
Modified:
lldb/trunk/test/lang/c/struct_types/TestStructTypes.py
lldb/trunk/test/lang/c/struct_types/main.c

Removed: lldb/trunk/test/lang/c/struct_types/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/struct_types/Makefile?rev=219983view=auto
==
--- lldb/trunk/test/lang/c/struct_types/Makefile (original)
+++ lldb/trunk/test/lang/c/struct_types/Makefile (removed)
@@ -1,5 +0,0 @@
-LEVEL = ../../../make
-
-C_SOURCES := main.c
-
-include $(LEVEL)/Makefile.rules

Modified: lldb/trunk/test/lang/c/struct_types/TestStructTypes.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/struct_types/TestStructTypes.py?rev=219984r1=219983r2=219984view=diff
==
--- lldb/trunk/test/lang/c/struct_types/TestStructTypes.py (original)
+++ lldb/trunk/test/lang/c/struct_types/TestStructTypes.py Thu Oct 16 18:15:22 
2014
@@ -1,102 +1,3 @@
-
-Test that break on a struct declaration has no effect.
+import lldbinline
 
-Instead, the first executable statement is set as the breakpoint.
-
-
-import os, time
-import unittest2
-import lldb
-from lldbtest import *
-import lldbutil
-
-class StructTypesTestCase(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-# rdar://problem/12566646
-@unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
-@dsym_test
-def test_with_dsym(self):
-Test that break on a struct declaration has no effect.
-self.buildDsym()
-self.struct_types()
-
-# rdar://problem/12566646
-@expectedFailureIcc # llvm.org/pr16793
-# ICC generates DW_AT_byte_size zero with a 
zero-length 
-# array and LLDB doesn't process it correctly.
-@dwarf_test
-def test_with_dwarf(self):
-Test that break on a struct declaration has no effect.
-self.buildDwarf()
-self.struct_types()
-
-def setUp(self):
-# Call super's setUp().
-TestBase.setUp(self)
-# Find the line number to break for main.c.
-self.source = 'main.c'
-self.line = line_number(self.source, '// Set break point at this 
line.')
-self.first_executable_line = line_number(self.source,
- '// This is the first 
executable statement.')
-self.return_line = line_number(self.source, '// This is the return 
statement.')
-
-def struct_types(self):
-Test that break on a struct declaration has no effect and test 
structure access for zero sized arrays.
-exe = os.path.join(os.getcwd(), a.out)
-
-# Create a target by the debugger.
-target = self.dbg.CreateTarget(exe)
-self.assertTrue(target, VALID_TARGET)
-
-# Break on the struct declration statement in main.c.
-lldbutil.run_break_set_by_file_and_line (self, main.c, self.line, 
num_expected_locations=1, loc_exact=False)
-lldbutil.run_break_set_by_file_and_line (self, main.c, 
self.return_line, num_expected_locations=1, loc_exact=True)
-
-# Now launch the process, and do not stop at entry point.
-process = target.LaunchSimple (None, None, 
self.get_process_working_directory())
-
-if not process:
-self.fail(SBTarget.Launch() failed)
-
-thread = lldbutil.get_stopped_thread(process, 
lldb.eStopReasonBreakpoint)
-
-# We should be stopped on the first executable statement within the
-# function where the original breakpoint was attempted.
-self.expect(thread backtrace, STOPPED_DUE_TO_BREAKPOINT,
-substrs = ['main.c:%d' % self.first_executable_line,
-   'stop reason = breakpoint'])
-
-# The breakpoint should have a hit count of 1.
-self.expect(breakpoint list -f, BREAKPOINT_HIT_ONCE,
-

[Lldb-commits] [lldb] r219985 - Split this test case to handle each literal kind uniquely

2014-10-16 Thread Enrico Granata
Author: enrico
Date: Thu Oct 16 18:16:13 2014
New Revision: 219985

URL: http://llvm.org/viewvc/llvm-project?rev=219985view=rev
Log:
Split this test case to handle each literal kind uniquely

Modified:
lldb/trunk/test/lang/cpp/rdar12991846/TestRdar12991846.py

Modified: lldb/trunk/test/lang/cpp/rdar12991846/TestRdar12991846.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/rdar12991846/TestRdar12991846.py?rev=219985r1=219984r2=219985view=diff
==
--- lldb/trunk/test/lang/cpp/rdar12991846/TestRdar12991846.py (original)
+++ lldb/trunk/test/lang/cpp/rdar12991846/TestRdar12991846.py Thu Oct 16 
18:16:13 2014
@@ -29,17 +29,47 @@ class Rdar12991846TestCase(TestBase):
 @unittest2.expectedFailure
 @unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
 @dsym_test
-def test_with_dsym(self):
+def test_expr1_with_dsym(self):
 Test that the expression parser returns proper Unicode strings.
 self.buildDsym()
-self.rdar12991846()
+self.rdar12991846(expr=1)
 
 @unittest2.expectedFailure
 @dwarf_test
-def test_with_dwarf(self):
+def test_expr1_with_dwarf(self):
 Test that the expression parser returns proper Unicode strings.
 self.buildDwarf()
-self.rdar12991846()
+self.rdar12991846(expr=1)
+
+@unittest2.expectedFailure
+@unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
+@dsym_test
+def test_expr2_with_dsym(self):
+Test that the expression parser returns proper Unicode strings.
+self.buildDsym()
+self.rdar12991846(expr=2)
+
+@unittest2.expectedFailure
+@dwarf_test
+def test_expr2_with_dwarf(self):
+Test that the expression parser returns proper Unicode strings.
+self.buildDwarf()
+self.rdar12991846(expr=2)
+
+@unittest2.expectedFailure
+@unittest2.skipUnless(sys.platform.startswith(darwin), requires Darwin)
+@dsym_test
+def test_expr3_with_dsym(self):
+Test that the expression parser returns proper Unicode strings.
+self.buildDsym()
+self.rdar12991846(expr=3)
+
+@unittest2.expectedFailure
+@dwarf_test
+def test_expr3_with_dwarf(self):
+Test that the expression parser returns proper Unicode strings.
+self.buildDwarf()
+self.rdar12991846(expr=3)
 
 def setUp(self):
 # Call super's setUp().
@@ -48,7 +78,7 @@ class Rdar12991846TestCase(TestBase):
 self.source = 'main.cpp'
 self.line = line_number(self.source, '// Set break point at this 
line.')
 
-def rdar12991846(self):
+def rdar12991846(self, expr=None):
 Test that the expression parser returns proper Unicode strings.
 if self.getArchitecture() in ['i386']:
 self.skipTest(Skipping because this test is known to crash on 
i386)
@@ -68,14 +98,11 @@ class Rdar12991846TestCase(TestBase):
 if not process:
 self.fail(SBTarget.Launch() failed)
 
-self.expect('expression Lhello',
-substrs = ['hello'])
+if expr == 1: self.expect('expression Lhello', substrs = ['hello'])
 
-self.expect('expression uhello',
-   substrs = ['hello'])
+if expr == 2: self.expect('expression uhello', substrs = ['hello'])
 
-self.expect('expression Uhello',
-substrs = ['hello'])
+if expr == 3: self.expect('expression Uhello', substrs = ['hello'])
 
 if __name__ == '__main__':
 import atexit


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r220001 - Made multi-line test case actions possible in

2014-10-16 Thread Sean Callanan
Author: spyffe
Date: Thu Oct 16 19:39:37 2014
New Revision: 220001

URL: http://llvm.org/viewvc/llvm-project?rev=220001view=rev
Log:
Made multi-line test case actions possible in
the inline test cases.  This makes them much
more readable.

Modified:
lldb/trunk/test/lang/c/struct_types/main.c
lldb/trunk/test/lldbinline.py

Modified: lldb/trunk/test/lang/c/struct_types/main.c
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/struct_types/main.c?rev=220001r1=22r2=220001view=diff
==
--- lldb/trunk/test/lang/c/struct_types/main.c (original)
+++ lldb/trunk/test/lang/c/struct_types/main.c Thu Oct 16 19:39:37 2014
@@ -12,13 +12,16 @@ int main (int argc, char const *argv[])
 int x;
 int y;
 char padding[0];
-}; //% self.expect(frame variable pt.padding[0], 
DATA_TYPES_DISPLAYED_CORRECTLY, substrs = [pt.padding[0] = ]); 
self.expect(frame variable pt.padding[1], DATA_TYPES_DISPLAYED_CORRECTLY, 
substrs = [pt.padding[1] = ]); self.expect(expression -- (pt.padding[0]), 
DATA_TYPES_DISPLAYED_CORRECTLY, substrs = [(char),  = ]); 
self.expect(image lookup -t point_tag, DATA_TYPES_DISPLAYED_CORRECTLY, 
substrs = ['padding[]']) # Once rdar://problem/12566646 is fixed, this should 
display correctly
+}; //% self.expect(frame variable pt.padding[0], 
DATA_TYPES_DISPLAYED_CORRECTLY, substrs = [pt.padding[0] = ])
+   //% self.expect(frame variable pt.padding[1], 
DATA_TYPES_DISPLAYED_CORRECTLY, substrs = [pt.padding[1] = ])
+   //% self.expect(expression -- (pt.padding[0]), 
DATA_TYPES_DISPLAYED_CORRECTLY, substrs = [(char),  = ])
+   //% self.expect(image lookup -t point_tag, 
DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ['padding[]']) # Once 
rdar://problem/12566646 is fixed, this should display correctly
 
 struct rect_tag {
 struct point_tag bottom_left;
 struct point_tag top_right;
 };
-struct point_tag pt = { 2, 3, {} }; //% self.
+struct point_tag pt = { 2, 3, {} };
 struct rect_tag rect = {{1, 2, {}}, {3, 4, {}}};
 return 0; //% self.expect(expression -- pt == (struct point_tag*)0, 
substrs = ['false'])
 }

Modified: lldb/trunk/test/lldbinline.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbinline.py?rev=220001r1=22r2=220001view=diff
==
--- lldb/trunk/test/lldbinline.py (original)
+++ lldb/trunk/test/lldbinline.py Thu Oct 16 19:39:37 2014
@@ -21,25 +21,39 @@ class CommandParser:
 
 def parse_one_command(self, line):
 parts = line.split('//%')
-if len(parts) != 2:
-return None
-else:
-return parts[1].strip() # take off trailing whitespace
+
+command = None
+new_breakpoint = True
+
+if len(parts) == 2:
+command = parts[1].strip() # take off whitespace
+new_breakpoint = parts[0].strip() != 
+
+return (command, new_breakpoint)
 
 def parse_source_files(self, source_files):
 for source_file in source_files:
 file_handle = open(source_file)
 lines = file_handle.readlines()
 line_number = 0
+current_breakpoint = None # non-NULL means we're looking through 
whitespace to find additional commands
 for line in lines:
 line_number = line_number + 1 # 1-based, so we do this first
-command = self.parse_one_command(line)
+(command, new_breakpoint) = self.parse_one_command(line)
+
+if new_breakpoint:
+current_breakpoint = None
+
 if command != None:
-breakpoint = {}
-breakpoint['file_name'] = source_file
-breakpoint['line_number'] = line_number
-breakpoint['command'] = command
-self.breakpoints.append(breakpoint)
+if current_breakpoint == None:
+current_breakpoint = {}
+current_breakpoint['file_name'] = source_file
+current_breakpoint['line_number'] = line_number
+current_breakpoint['command'] = command
+self.breakpoints.append(current_breakpoint)
+else:
+current_breakpoint['command'] = 
current_breakpoint['command'] + \n + command
+print self.breakpoints
 
 def set_breakpoints(self, target):
 for breakpoint in self.breakpoints:


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] fix Bug21211 : reworked test/api/multithreaded/test_listener_event_description.cpp to work properly on Linux/FreeBSD

2014-10-16 Thread Shawn Best
Hi emaste,

Issue D5632 fixed an issue where linux would dump spurious output to tty on 
startup (due to a broadcast stop event).  After the checkin, it was noticed on 
FreeBSD a unit test was now failing.  On closer investigation I found the test 
was using the C++ API to launch an inferior while using an SBListener to 
monitor the public state changes. It was expecting to see:

eStateRunning
eStateStopped

On Linux/FreeBSD, there is an extra state change

eStateLaunching
eStateRunning
eStateStopped

I reworked the test to work for both cases.

http://reviews.llvm.org/D5837

Files:
  test/api/multithreaded/TestMultithreaded.py
  test/api/multithreaded/test_listener_event_description.cpp
Index: test/api/multithreaded/TestMultithreaded.py
===
--- test/api/multithreaded/TestMultithreaded.py
+++ test/api/multithreaded/TestMultithreaded.py
@@ -28,7 +28,6 @@
 self.build_and_test('driver.cpp test_breakpoint_callback.cpp',
 'test_breakpoint_callback')
 
-@expectedFailureFreeBSD(llvm.org/21211)
 @skipIfi386
 @skipIfRemote
 @skipIfLinuxClang # buildbot clang version unable to use libstdc++ with c++11
Index: test/api/multithreaded/test_listener_event_description.cpp
===
--- test/api/multithreaded/test_listener_event_description.cpp
+++ test/api/multithreaded/test_listener_event_description.cpp
@@ -16,16 +16,17 @@
 using namespace std;
 
 // listener thread control
-extern atomicbool g_done; 
+extern atomicbool g_done;
+extern SBListener g_listener;
 
 multithreaded_queuestring g_event_descriptions;
-
-extern SBListener g_listener;
+string g_error_desc;
 
 void listener_func() {
   while (!g_done) {
 SBEvent event;
 bool got_event = g_listener.WaitForEvent(1, event);
+
 if (got_event) {
   if (!event.IsValid())
 throw Exception(event is not valid in listener thread);
@@ -38,27 +39,59 @@
   }
 }
 
-void check_listener(SBDebugger dbg) {
-  arraystring, 2 expected_states = {running, stopped};
-  for(string  state : expected_states) {
-bool got_description = false;
-string desc = g_event_descriptions.pop(5, got_description);
-
-if (!got_description)
-  throw Exception(Did not get expected event description);
+bool check_state(string state, string desc, bool got_description)
+{
+g_error_desc.clear();
 
+if(!got_description)
+{
+g_error_desc.append(Did not get expected event description);
+return false;
+}
 
 if (desc.find(state-changed) == desc.npos)
-  throw Exception(Event description incorrect: missing 'state-changed');
+g_error_desc.append(Event description incorrect: missing 'state-changed' );
+
+if (desc.find(pid = ) == desc.npos)
+g_error_desc.append(Event description incorrect: missing process pid );
 
 string state_search_str = state =  + state;
 if (desc.find(state_search_str) == desc.npos)
-  throw Exception(Event description incorrect: expected state 
+{
+string errString = (Event description incorrect: expected state 
   + state
   +  but desc was 
   + desc);
+g_error_desc.append(errString);
+}
 
-if (desc.find(pid = ) == desc.npos)
-  throw Exception(Event description incorrect: missing process pid);
-  }
+if (g_error_desc.length()  0)
+return false;
+
+cout  check_state:   stateOK\n;
+return true;
+}
+
+void check_listener(SBDebugger dbg)
+{
+bool got_description;
+string state;
+
+// check for launching state, this may or may not be present
+string desc = g_event_descriptions.pop(5, got_description);
+state = launching;
+if (check_state(state, desc, got_description))
+{
+// found a 'launching' state, pop next one from queue
+desc = g_event_descriptions.pop(5, got_description);
+}
+
+state = running;
+if( !check_state(state, desc, got_description) )
+throw Exception(g_error_desc);
+
+desc = g_event_descriptions.pop(5, got_description);
+state = stopped;
+if( !check_state(state, desc, got_description) )
+throw Exception(g_error_desc);
 }
___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] remove CREATE_THREADS:=yes from api/multithreaded Makefile

2014-10-16 Thread Shawn Best
This flag triggers a '-lpthead' during the linking stage.  Technically this is 
not needed since the multithreading is handled by std library, triggered by 
'-std=c++11' in build command line.

The **real** reason I want to remove the '-lpthread' is it was causing a 
(linux/gcc built) test program to hang in a destructor for the 
std::condition_variable

http://reviews.llvm.org/D5838

Files:
  test/api/multithreaded/Makefile
Index: test/api/multithreaded/Makefile
===
--- test/api/multithreaded/Makefile
+++ test/api/multithreaded/Makefile
@@ -1,6 +1,5 @@
 LEVEL = ../../make
 
-ENABLE_THREADS := YES
 CXX_SOURCES := main.cpp
 
 include $(LEVEL)/Makefile.rules
___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits