[Lldb-commits] [lldb] r164433 - in /lldb/trunk/test: ./ api/check_public_api_headers/ expression_command/call-function/ expression_command/formatters/ expression_command/radar_9531204/ expression_command/radar_9673664/ expression_command/test/ expression_command/two-files/ functionalities/abbreviation/ functionalities/alias/ functionalities/archives/ functionalities/breakpoint/breakpoint_command/ functionalities/breakpoint/breakpoint_conditions/ functionalities/breakpoint/breakpoint_ids/ functionalities/breakpoint/brea...

Jim Ingham jingham at apple.com
Fri Sep 21 17:05:13 PDT 2012


Author: jingham
Date: Fri Sep 21 19:05:11 2012
New Revision: 164433

URL: http://llvm.org/viewvc/llvm-project?rev=164433&view=rev
Log:
Fix all the test case breakages caused by folks writing tests all over the place that depended explicitly 
on the output of "break set".  Please don't do this sort of thing!!!!!

Modified:
    lldb/trunk/test/api/check_public_api_headers/TestPublicAPIHeaders.py
    lldb/trunk/test/expression_command/call-function/TestCallStdStringFunction.py
    lldb/trunk/test/expression_command/call-function/main.cpp
    lldb/trunk/test/expression_command/formatters/TestFormatters.py
    lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py
    lldb/trunk/test/expression_command/radar_9673664/TestExprHelpExamples.py
    lldb/trunk/test/expression_command/test/TestExprs.py
    lldb/trunk/test/expression_command/test/TestExprs2.py
    lldb/trunk/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
    lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py
    lldb/trunk/test/functionalities/abbreviation/TestCommonShortSpellings.py
    lldb/trunk/test/functionalities/alias/TestAliases.py
    lldb/trunk/test/functionalities/archives/TestBSDArchives.py
    lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
    lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
    lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
    lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
    lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
    lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
    lldb/trunk/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/main.m
    lldb/trunk/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp
    lldb/trunk/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
    lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
    lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py
    lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py
    lldb/trunk/test/functionalities/data-formatter/rdar-10887661/TestRdar10887661.py
    lldb/trunk/test/functionalities/data-formatter/rdar-11086338/TestRdar11086338.py
    lldb/trunk/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py
    lldb/trunk/test/functionalities/data-formatter/rdar-11773899/TestFormattersBoolRefPtr.py
    lldb/trunk/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py
    lldb/trunk/test/functionalities/data-formatter/rdar-3534688/TestFormattersOneIsSingular.py
    lldb/trunk/test/functionalities/data-formatter/rdar-9973865/Test-rdar-9973865.py
    lldb/trunk/test/functionalities/data-formatter/rdar-9973992/Test-rdar-9973992.py
    lldb/trunk/test/functionalities/data-formatter/rdar-9974002/Test-rdar-9974002.py
    lldb/trunk/test/functionalities/dead-strip/TestDeadStrip.py
    lldb/trunk/test/functionalities/inferior-changed/TestInferiorChanged.py
    lldb/trunk/test/functionalities/load_unload/TestLoadUnload.py
    lldb/trunk/test/functionalities/memory/read/TestMemoryRead.py
    lldb/trunk/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
    lldb/trunk/test/functionalities/register/TestRegisters.py
    lldb/trunk/test/functionalities/signal/TestSendSignal.py
    lldb/trunk/test/functionalities/stop-hook/TestStopHookCmd.py
    lldb/trunk/test/functionalities/target_command/TestTargetCommand.py
    lldb/trunk/test/functionalities/type_completion/TestTypeCompletion.py
    lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
    lldb/trunk/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
    lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
    lldb/trunk/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
    lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
    lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
    lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
    lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
    lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
    lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
    lldb/trunk/test/lang/c/anonymous/TestAnonymous.py
    lldb/trunk/test/lang/c/array_types/TestArrayTypes.py
    lldb/trunk/test/lang/c/bitfields/TestBitfields.py
    lldb/trunk/test/lang/c/blocks/TestBlocks.py
    lldb/trunk/test/lang/c/enum_types/TestEnumTypes.py
    lldb/trunk/test/lang/c/forward/TestForwardDeclaration.py
    lldb/trunk/test/lang/c/function_types/TestFunctionTypes.py
    lldb/trunk/test/lang/c/global_variables/TestGlobalVariables.py
    lldb/trunk/test/lang/c/set_values/TestSetValues.py
    lldb/trunk/test/lang/c/shared_lib/TestSharedLib.py
    lldb/trunk/test/lang/c/shared_lib/main.c
    lldb/trunk/test/lang/c/stepping/TestThreadStepping.py
    lldb/trunk/test/lang/c/strings/TestCStrings.py
    lldb/trunk/test/lang/c/struct_types/TestStructTypes.py
    lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py
    lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py
    lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py
    lldb/trunk/test/lang/cpp/namespace/TestNamespace.py
    lldb/trunk/test/lang/cpp/rvalue-references/TestRvalueReferences.py
    lldb/trunk/test/lang/cpp/signed_types/TestSignedTypes.py
    lldb/trunk/test/lang/cpp/static_methods/TestCPPStaticMethods.py
    lldb/trunk/test/lang/cpp/stl/TestSTL.py
    lldb/trunk/test/lang/cpp/stl/TestStdCXXDisassembly.py
    lldb/trunk/test/lang/cpp/this/TestCPPThis.py
    lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py
    lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
    lldb/trunk/test/lang/cpp/virtual/TestVirtual.py
    lldb/trunk/test/lang/objc/forward-decl/TestForwardDecl.py
    lldb/trunk/test/lang/objc/foundation/TestConstStrings.py
    lldb/trunk/test/lang/objc/foundation/TestFoundationDisassembly.py
    lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py
    lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py
    lldb/trunk/test/lang/objc/foundation/main.m
    lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py
    lldb/trunk/test/lang/objc/objc++/TestObjCXX.py
    lldb/trunk/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
    lldb/trunk/test/lang/objc/objc-optimized/TestObjcOptimized.py
    lldb/trunk/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py
    lldb/trunk/test/lang/objc/rdar-10967107/TestRdar10967107.py
    lldb/trunk/test/lang/objc/rdar-10967107/main.m
    lldb/trunk/test/lang/objc/rdar-11355592/TestRdar11355592.py
    lldb/trunk/test/lang/objc/rdar-11355592/main.m
    lldb/trunk/test/lang/objc/real-definition/TestRealDefinition.py
    lldb/trunk/test/lang/objc/self/TestObjCSelf.py
    lldb/trunk/test/lldbtest.py
    lldb/trunk/test/lldbutil.py
    lldb/trunk/test/macosx/universal/TestUniversal.py
    lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py
    lldb/trunk/test/python_api/sbdata/TestSBData.py
    lldb/trunk/test/source-manager/TestSourceManager.py
    lldb/trunk/test/types/AbstractBase.py

Modified: lldb/trunk/test/api/check_public_api_headers/TestPublicAPIHeaders.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/api/check_public_api_headers/TestPublicAPIHeaders.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/api/check_public_api_headers/TestPublicAPIHeaders.py (original)
+++ lldb/trunk/test/api/check_public_api_headers/TestPublicAPIHeaders.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import os, re, StringIO
 import unittest2
 from lldbtest import *
+import lldbutil
 
 class SBDirCheckerCase(TestBase):
 
@@ -81,10 +82,7 @@
         self.runCmd(env_cmd)
         self.addTearDownHook(lambda: self.runCmd("settings remove target.env-vars %s" % env_var))
 
-        self.expect('breakpoint set -f %s -l %d' % (self.source, self.line_to_break),
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d" %
-                        (self.source, self.line_to_break))
+        lldbutil.run_break_set_by_file_and_line (self, self.source, self.line_to_break, num_expected_locations = -1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/expression_command/call-function/TestCallStdStringFunction.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/call-function/TestCallStdStringFunction.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/call-function/TestCallStdStringFunction.py (original)
+++ lldb/trunk/test/expression_command/call-function/TestCallStdStringFunction.py Fri Sep 21 19:05:11 2012
@@ -35,10 +35,7 @@
         """Test calling std::String member function."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/expression_command/call-function/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/call-function/main.cpp?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/call-function/main.cpp (original)
+++ lldb/trunk/test/expression_command/call-function/main.cpp Fri Sep 21 19:05:11 2012
@@ -6,10 +6,9 @@
     std::string str = "Hello world";
     std::cout << str << std::endl;
     std::cout << str.c_str() << std::endl;
-    // Please test these expressions while stopped at this line:
 #if 0
     print str
     print str.c_str()
 #endif
-    return 0;
+    return 0; // Please test these expressions while stopped at this line:
 }

Modified: lldb/trunk/test/expression_command/formatters/TestFormatters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/formatters/TestFormatters.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/formatters/TestFormatters.py (original)
+++ lldb/trunk/test/expression_command/formatters/TestFormatters.py Fri Sep 21 19:05:11 2012
@@ -45,10 +45,7 @@
         """Test expr + formatters for good interoperability."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
         self.runCmd("script import formatters")

Modified: lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py (original)
+++ lldb/trunk/test/expression_command/radar_9531204/TestPrintfAfterUp.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class Radar9531204TestCase(TestBase):
 
@@ -18,9 +19,7 @@
 
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -n foo",
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: name = 'foo', locations = 1")
+        lldbutil.run_break_set_by_symbol (self, 'foo', sym_exact=True, num_expected_locations=1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/expression_command/radar_9673664/TestExprHelpExamples.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/radar_9673664/TestExprHelpExamples.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/radar_9673664/TestExprHelpExamples.py (original)
+++ lldb/trunk/test/expression_command/radar_9673664/TestExprHelpExamples.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class Radar9673644TestCase(TestBase):
 
@@ -25,10 +26,7 @@
 
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f %s -l %d" % (self.main_source, self.line),
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                        (self.main_source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, self.main_source, self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

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=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/test/TestExprs.py (original)
+++ lldb/trunk/test/expression_command/test/TestExprs.py Fri Sep 21 19:05:11 2012
@@ -34,10 +34,7 @@
 
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -168,10 +165,7 @@
 
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.line, num_expected_locations=1,loc_exact=False)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/expression_command/test/TestExprs2.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/test/TestExprs2.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/test/TestExprs2.py (original)
+++ lldb/trunk/test/expression_command/test/TestExprs2.py Fri Sep 21 19:05:11 2012
@@ -26,10 +26,7 @@
 
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.line, num_expected_locations=1,loc_exact=False)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py (original)
+++ lldb/trunk/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class ObjCTypeQueryTestCase(TestBase):
 
@@ -36,10 +37,7 @@
         """The expression parser's type search should be wider than the current compilation unit."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.m -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.m', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py (original)
+++ lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class AbbreviationsTestCase(TestBase):
     
@@ -90,11 +91,11 @@
         self.expect("_regexp-b product", matching=False,
                     substrs = [ "breakpoint set --name" ])
 
-        self.expect("br s -n sum",
-                    startstr = "Breakpoint created: 2: name = 'sum', locations = 1")
+        match_object = lldbutil.run_break_set_command (self, "br s -n sum")
+        lldbutil.check_breakpoint_result (self, match_object, symbol_name='sum', symbol_match_exact=False, num_locations=1)
 
-        self.expect("br s -f main.cpp -l 32",
-                    startstr = "Breakpoint created: 3: file ='main.cpp', line = 32, locations = 1")
+        match_object = lldbutil.run_break_set_command (self, "br s -f main.cpp -l 32")
+        lldbutil.check_breakpoint_result (self, match_object, file_name='main.cpp', line_number=32, num_locations=1)
 
         self.runCmd("br co a -s python 1 -o 'print frame'")
         self.expect("br co l 1",

Modified: lldb/trunk/test/functionalities/abbreviation/TestCommonShortSpellings.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/abbreviation/TestCommonShortSpellings.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/abbreviation/TestCommonShortSpellings.py (original)
+++ lldb/trunk/test/functionalities/abbreviation/TestCommonShortSpellings.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class CommonShortSpellingsTestCase(TestBase):
     
@@ -29,8 +30,9 @@
                     patterns = [ "Current executable set to .*a.out.*" ])
 
         # br s -> breakpoint set
-        self.expect("br s -n sum",
-            startstr = "Breakpoint created: 1: name = 'sum', locations = 1")
+        
+        match_object = lldbutil.run_break_set_command (self, "br s -n sum")
+        lldbutil.check_breakpoint_result (self, match_object, symbol_name='sum', symbol_match_exact=False, num_locations=1)
 
         self.runCmd("settings set interpreter.expand-regex-aliases true")
         self.addTearDownHook(

Modified: lldb/trunk/test/functionalities/alias/TestAliases.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/alias/TestAliases.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/alias/TestAliases.py (original)
+++ lldb/trunk/test/functionalities/alias/TestAliases.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class AliasTestCase(TestBase):
 
@@ -80,15 +81,16 @@
         self.runCmd ("alias bpa bp command add")
         self.runCmd ("alias bpi bp list")
 
-        self.expect ("bp set -n foo",
-                     startstr = "Breakpoint created: 1: name = 'foo', locations = 1")
+        break_results = lldbutil.run_break_set_command (self, "bp set -n foo")
+        lldbutil.check_breakpoint_result (self, break_results, num_locations=1, symbol_name='foo', symbol_match_exact=False)
 
-        self.expect ("bp set -n sum",
-                     startstr = "Breakpoint created: 2: name = 'sum', locations = 1")
+        break_results = lldbutil.run_break_set_command (self, "bp set -n sum")
+        lldbutil.check_breakpoint_result (self, break_results, num_locations=1, symbol_name='sum', symbol_match_exact=False)
 
         self.runCmd ("alias bfl bp set -f %1 -l %2")
-        self.expect ("bfl main.cpp 32",
-                     startstr = "Breakpoint created: 3: file ='main.cpp', line = 32, locations = 1")
+
+        break_results = lldbutil.run_break_set_command (self, "bfl main.cpp 32")
+        lldbutil.check_breakpoint_result (self, break_results, num_locations=1, file_name='main.cpp', line_number=32)
 
         self.expect ("bpi",
                      startstr = "Current breakpoints:",

Modified: lldb/trunk/test/functionalities/archives/TestBSDArchives.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/archives/TestBSDArchives.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/archives/TestBSDArchives.py (original)
+++ lldb/trunk/test/functionalities/archives/TestBSDArchives.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class BSDArchivesTestCase(TestBase):
 
@@ -26,9 +27,8 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside a() by file and line first.
-        self.expect("breakpoint set -f a.c -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='a.c', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "a.c", self.line, num_expected_locations=1, loc_exact=True)
+
         self.runCmd("run", RUN_SUCCEEDED)
 
         # The stop reason of the thread should be breakpoint.
@@ -43,9 +43,7 @@
             substrs = ['(int) __a_global = 1'])
 
         # Set breakpoint for b() next.
-        self.expect("breakpoint set -n b", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: name = 'b'",
-            substrs = ['resolved = 1'])
+        lldbutil.run_break_set_by_symbol (self, "b", num_expected_locations=1, sym_exact=True)
 
         # Continue the program, we should break at b(int) next.
         self.runCmd("continue")

Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py (original)
+++ lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class BreakpointCommandTestCase(TestBase):
 
@@ -45,18 +46,21 @@
 
         # Add three breakpoints on the same line.  The first time we don't specify the file,
         # since the default file is the one containing main:
-        self.expect("breakpoint set -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line)
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: file ='main.c', line = %d, locations = 1" %
-                        self.line)
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 3: file ='main.c', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1, loc_exact=True)
+#        self.expect("breakpoint set -l %d" % self.line,
+#                    BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
+#                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
+#        self.expect("breakpoint set -f main.c -l %d" % self.line,
+#                    BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 2: file ='main.c', line = %d, locations = 1" %
+#                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
+#        self.expect("breakpoint set -f main.c -l %d" % self.line,
+#                    BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 3: file ='main.c', line = %d, locations = 1" %
+#                        self.line)
 
         # Now add callbacks for the breakpoints just created.
         self.runCmd("breakpoint command add -s command -o 'frame variable -T -s' 1")
@@ -93,21 +97,17 @@
         # Next lets try some other breakpoint kinds.  First break with a regular expression
         # and then specify only one file.  The first time we should get two locations,
         # the second time only one:
-        self.expect ("break set -r ._MyFunction",
-                     patterns = ["Breakpoint created: [0-9]+: regex = '\._MyFunction', locations = 2"])
-      
-        self.expect ("break set -r ._MyFunction -f a.c",
-                     patterns = ["Breakpoint created: [0-9]+: regex = '\._MyFunction', locations = 1"])
+
+        lldbutil.run_break_set_by_regexp (self, r"._MyFunction", num_expected_locations=2)
+        
+        lldbutil.run_break_set_by_regexp (self, r"._MyFunction", extra_options="-f a.c", num_expected_locations=1)
       
-        self.expect ("break set -r ._MyFunction -f a.c -f b.c",
-                     patterns = ["Breakpoint created: [0-9]+: regex = '\._MyFunction', locations = 2"])
+        lldbutil.run_break_set_by_regexp (self, r"._MyFunction", extra_options="-f a.c -f b.c", num_expected_locations=2)
 
         # Now try a source regex breakpoint:
-        self.expect ("break set -p \"is about to return [12]0\" -f a.c -f b.c",
-                     patterns = ["Breakpoint created: [0-9]+: source regex = \"is about to return \[12\]0\", locations = 2"])
+        lldbutil.run_break_set_by_source_regexp (self, r"is about to return [12]0", extra_options="-f a.c -f b.c", num_expected_locations=2)
       
-        self.expect ("break set -p \"is about to return [12]0\" -f a.c",
-                     patterns = ["Breakpoint created: [0-9]+: source regex = \"is about to return \[12\]0\", locations = 1"])
+        lldbutil.run_break_set_by_source_regexp (self, r"is about to return [12]0", extra_options="-f a.c", num_expected_locations=1)
       
         # Run the program.  Remove 'output.txt' if it exists.
         self.RemoveTempFile("output.txt")
@@ -181,10 +181,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint.
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         # Now add callbacks for the breakpoints just created.
         self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); print >> here, frame; print >> here, bp_loc; here.close()' 1")

Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py (original)
+++ lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class RegexpBreakCommandTestCase(TestBase):
 
@@ -36,12 +37,11 @@
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect("b %d" % self.line,
-                    BREAKPOINT_CREATED,
-            substrs = ["Breakpoint created: 1: file ='main.c', line = %d, locations = 1" % self.line])
-        self.expect("b %s:%d" % (self.source, self.line),
-                    BREAKPOINT_CREATED,
-            substrs = ["Breakpoint created: 2: file ='main.c', line = %d, locations = 1" % self.line])
+        break_results = lldbutil.run_break_set_command (self, "b %d" % self.line)
+        lldbutil.check_breakpoint_result (self, break_results, file_name='main.c', line_number=self.line, num_locations=1)
+
+        break_results = lldbutil.run_break_set_command (self, "b %s:%d" % (self.source, self.line))
+        lldbutil.check_breakpoint_result (self, break_results, file_name='main.c', line_number=self.line, num_locations=1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py (original)
+++ lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py Fri Sep 21 19:05:11 2012
@@ -67,12 +67,10 @@
 
         if inline:
             # Create a breakpoint by function name 'c' and set the condition.
-            self.expect("breakpoint set -n c -c 'val == 3'", BREAKPOINT_CREATED,
-                startstr = "Breakpoint created: 1: name = 'c', locations = 1")
+            lldbutil.run_break_set_by_symbol (self, "c", extra_options="-c 'val == 3'", num_expected_locations=1, sym_exact=True)
         else:
             # Create a breakpoint by function name 'c'.
-            self.expect("breakpoint set -n c", BREAKPOINT_CREATED,
-                startstr = "Breakpoint created: 1: name = 'c', locations = 1")
+            lldbutil.run_break_set_by_symbol (self, "c", num_expected_locations=1, sym_exact=True)
 
             # And set a condition on the breakpoint to stop on when 'val == 3'.
             self.runCmd("breakpoint modify -c 'val == 3' 1")

Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py (original)
+++ lldb/trunk/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class BreakpointIDTestCase(TestBase):
 
@@ -27,15 +28,15 @@
         self.expect("file " + exe,
                     patterns = [ "Current executable set to .*a.out" ])
 
-        self.expect ("breakpoint set -n product",
-                     startstr = "Breakpoint created: 1: name = 'product', locations =")
+        
+        bpno = lldbutil.run_break_set_by_symbol (self, 'product', num_expected_locations=-1, sym_exact=False)
+        self.assertTrue (bpno == 1, "First breakpoint number is 1.")
 
-        self.expect ("breakpoint set -n sum",
-                     startstr = "Breakpoint created: 2: name = 'sum', locations =")
+        bpno = lldbutil.run_break_set_by_symbol (self, 'sum', num_expected_locations=-1, sym_exact=False)
+        self.assertTrue (bpno == 2, "Second breakpoint number is 2.")
 
-        self.expect ("breakpoint set -n junk",
-                     startstr = "Breakpoint created: 3: name = 'junk', locations = 0 (pending)",
-                     substrs = [ "WARNING:  Unable to resolve breakpoint to any actual locations." ] )
+        bpno = lldbutil.run_break_set_by_symbol (self, 'junk', num_expected_locations=0, sym_exact=False)
+        self.assertTrue (bpno == 3, "Third breakpoint number is 3.")
 
         self.expect ("breakpoint disable 1.1 - 2.2 ",
                      COMMAND_FAILED_AS_EXPECTED, error = True,

Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py (original)
+++ lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py Fri Sep 21 19:05:11 2012
@@ -55,10 +55,8 @@
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        # Create a breakpoint by function name 'c'.
-        self.expect("breakpoint set -i 1 -f main.c -l %d" % self.line1, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line1)
+        # Create a breakpoint in main.c at line1.
+        lldbutil.run_break_set_by_file_and_line (self, 'main.c', self.line1, extra_options='-i 1', num_expected_locations=1, loc_exact=True)
 
         # Now run the program.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py (original)
+++ lldb/trunk/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class BreakpointLocationsTestCase(TestBase):
 
@@ -36,10 +37,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # This should create a breakpoint with 3 locations.
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 3" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=3)
 
         # The breakpoint list should show 3 locations.
         self.expect("breakpoint list -f", "Breakpoint locations shown correctly",

Modified: lldb/trunk/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py (original)
+++ lldb/trunk/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class InlinedBreakpointsTestCase(TestBase):
     """Bug fixed: rdar://problem/8464339"""
@@ -38,9 +39,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Set a breakpoint and fail because it is in an inlined source implemenation file
-        self.expect("breakpoint set -f basic_type.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='basic_type.cpp', line = %d, locations = 0 (pending)" % self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "basic_type.cpp", self.line, num_expected_locations=0)
 
         # Now enable breakpoints in implementation files and see the breakpoint set succeed
         self.runCmd('settings set target.inline-breakpoint-strategy always')
@@ -48,10 +47,7 @@
         self.addTearDownHook(
             lambda: self.runCmd("settings set target.inline-breakpoint-strategy headers"))
 
-        self.expect("breakpoint set -f basic_type.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: file ='basic_type.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "basic_type.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class AdvDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class CategoriesDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,11 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+#        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
+#                    BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
+#                        self.line)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class CppDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class DataFormatterDisablingTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Check that we can properly disable all data formatter categories."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class GlobalsDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         # This is the function to remove the custom formats in order to have a
         # clean slate for the next test case.

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class NamedSummariesDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py Fri Sep 21 19:05:11 2012
@@ -8,6 +8,7 @@
 import lldb
 from lldbtest import *
 import datetime
+import lldbutil
 
 class ObjCDataFormatterTestCase(TestBase):
 
@@ -111,10 +112,7 @@
         """Check that Unicode characters come out of CFString summary correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.m -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -145,10 +143,7 @@
         """Test basic ObjC formatting behavior."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.m -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -202,10 +197,7 @@
         """Test formatters for AppKit classes."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.m -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -374,10 +366,7 @@
         """Test common cases of expression parser <--> formatters interaction."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.m -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -420,10 +409,7 @@
         """Test formatters for Core OSX frameworks."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.m -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -477,10 +463,7 @@
         """Test the behavior of formatters when KVO is in use."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.m -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -514,7 +497,8 @@
         # check that NSMutableDictionary's formatter is not confused when dealing with a KVO'd dictionary
         self.expect('frame variable newMutableDictionary', substrs = ['(NSDictionary *) newMutableDictionary = ',' 21 key/value pairs'])
 
-        self.runCmd("breakpoint set -r setAtoms")
+        lldbutil.run_break_set_by_regexp (self, 'setAtoms')
+
         self.runCmd("continue")
         self.expect("frame variable _cmd",substrs = ['setAtoms:'])
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/main.m?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/main.m (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/main.m Fri Sep 21 19:05:11 2012
@@ -653,9 +653,7 @@
 	NSArray *components = @[@"usr", @"blah", @"stuff"];
 	NSString *path = [NSString pathWithComponents: components];
 
-    // Set break point at this line.
-
-    [molecule addObserver:[My_KVO_Observer new] forKeyPath:@"atoms" options:0 context:NULL];
+    [molecule addObserver:[My_KVO_Observer new] forKeyPath:@"atoms" options:0 context:NULL];     // Set break point at this line.
     [newMutableDictionary addObserver:[My_KVO_Observer new] forKeyPath:@"weirdKeyToKVO" options:NSKeyValueObservingOptionNew context:NULL];
 
     [molecule setAtoms:nil];

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class PythonSynthDataFormatterTestCase(TestBase):
 
@@ -50,10 +51,7 @@
         """Test using Python synthetic children provider."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -207,14 +205,9 @@
         """Test that synthetic children persist stoppoints."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line2,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line2)
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line3,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: file ='main.cpp', line = %d, locations = 1" %
-                        self.line3)
+        # The second breakpoint is on a multi-line expression, so the comment can't be on the right line...
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line2, num_expected_locations=1, loc_exact=False)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line3, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-python-synth/main.cpp Fri Sep 21 19:05:11 2012
@@ -62,6 +62,5 @@
 	               256*'X' +
 	               256*256*'T'+
 	               256*256*256*'F';
-    // Set second cast break point at this line.
-    return 0;
-}
\ No newline at end of file
+    return 0;     // Set second cast break point at this line.
+}

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class ScriptDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class SkipSummaryDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,9 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        #import lldbutil
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -134,7 +134,7 @@
         # Bad debugging info on SnowLeopard gcc (Apple Inc. build 5666).
         # Skip the following tests if the condition is met.
         if self.getCompiler().endswith('gcc') and not self.getCompiler().endswith('llvm-gcc'):
-           import re, lldbutil
+           import re
            gcc_version_output = system([lldbutil.which(self.getCompiler()), "-v"])[1]
            #print "my output:", gcc_version_output
            for line in gcc_version_output.split(os.linesep):

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class SmartArrayDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class LibcxxListDataFormatterTestCase(TestBase):
 
@@ -35,14 +36,8 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line2,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: file ='main.cpp', line = %d" %
-                        self.line2)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line2, num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class LibcxxMapDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class LibcxxVectorDataFormatterTestCase(TestBase):
 
@@ -35,14 +36,8 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line2,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: file ='main.cpp', line = %d" %
-                        self.line2)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line2, num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class StdListDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class StdMapDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class StdVectorDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class SynthDataFormatterTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class Radar10449092DataFormatterTestCase(TestBase):
 
@@ -35,10 +36,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-10642615/Test-rdar-10642615.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class Radar10642615DataFormatterTestCase(TestBase):
 
@@ -35,10 +36,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/rdar-10887661/TestRdar10887661.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-10887661/TestRdar10887661.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-10887661/TestRdar10887661.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-10887661/TestRdar10887661.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class Rdar10887661TestCase(TestBase):
 
@@ -38,10 +39,7 @@
         """Check for an issue where capping does not work because the Target pointer appears to be changing behind our backs."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/rdar-11086338/TestRdar11086338.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-11086338/TestRdar11086338.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-11086338/TestRdar11086338.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-11086338/TestRdar11086338.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import lldb
 from lldbtest import *
 import datetime
+import lldbutil
 
 class DataFormatterRdar11086338TestCase(TestBase):
 
@@ -36,10 +37,7 @@
         """Test that NSArray reports its synthetic children properly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.m -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import lldb
 from lldbtest import *
 import datetime
+import lldbutil
 
 class DataFormatterOSTypeTestCase(TestBase):
 
@@ -36,10 +37,7 @@
         """Test the formatters we use for OSType."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.mm -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.mm', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/rdar-11773899/TestFormattersBoolRefPtr.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-11773899/TestFormattersBoolRefPtr.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-11773899/TestFormattersBoolRefPtr.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-11773899/TestFormattersBoolRefPtr.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import lldb
 from lldbtest import *
 import datetime
+import lldbutil
 
 class DataFormatterBoolRefPtr(TestBase):
 
@@ -36,10 +37,7 @@
         """Test the formatters we use for BOOL& and BOOL* in Objective-C."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.mm -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.mm', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-11988289/TestRdar%2011988289.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import lldb
 from lldbtest import *
 import datetime
+import lldbutil
 
 class DataFormatterRdar11988289TestCase(TestBase):
 
@@ -36,10 +37,7 @@
         """Test that NSDictionary reports its synthetic children properly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.m -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/rdar-3534688/TestFormattersOneIsSingular.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-3534688/TestFormattersOneIsSingular.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-3534688/TestFormattersOneIsSingular.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-3534688/TestFormattersOneIsSingular.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import lldb
 from lldbtest import *
 import datetime
+import lldbutil
 
 class DataFormatterOneIsSingularTestCase(TestBase):
 
@@ -36,10 +37,7 @@
         """Test that 1 item is not as reported as 1 items."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.m -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.m', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/rdar-9973865/Test-rdar-9973865.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-9973865/Test-rdar-9973865.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-9973865/Test-rdar-9973865.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-9973865/Test-rdar-9973865.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class Radar9973865DataFormatterTestCase(TestBase):
 
@@ -35,10 +36,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/rdar-9973992/Test-rdar-9973992.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-9973992/Test-rdar-9973992.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-9973992/Test-rdar-9973992.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-9973992/Test-rdar-9973992.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class Radar9973992DataFormatterTestCase(TestBase):
 
@@ -35,10 +36,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/data-formatter/rdar-9974002/Test-rdar-9974002.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-9974002/Test-rdar-9974002.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/rdar-9974002/Test-rdar-9974002.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/rdar-9974002/Test-rdar-9974002.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class Radar9974002DataFormatterTestCase(TestBase):
 
@@ -35,10 +36,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/dead-strip/TestDeadStrip.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/dead-strip/TestDeadStrip.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/dead-strip/TestDeadStrip.py (original)
+++ lldb/trunk/test/functionalities/dead-strip/TestDeadStrip.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class DeadStripTestCase(TestBase):
 
@@ -30,16 +31,13 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break by function name f1 (live code).
-        self.expect("breakpoint set -s a.out -n f1", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: name = 'f1', module = a.out, locations = 1")
+        lldbutil.run_break_set_by_symbol (self, "f1", extra_options="-s a.out", num_expected_locations=1, module_name="a.out")
 
         # Break by function name f2 (dead code).
-        self.expect("breakpoint set -s a.out -n f2", BREAKPOINT_PENDING_CREATED,
-            startstr = "Breakpoint created: 2: name = 'f2', module = a.out, locations = 0 (pending)")
+        lldbutil.run_break_set_by_symbol (self, "f2", extra_options="-s a.out", num_expected_locations=0)
 
         # Break by function name f3 (live code).
-        self.expect("breakpoint set -s a.out -n f3", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 3: name = 'f3', module = a.out, locations = 1")
+        lldbutil.run_break_set_by_symbol (self, "f3", extra_options="-s a.out", num_expected_locations=1, module_name="a.out")
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/inferior-changed/TestInferiorChanged.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/inferior-changed/TestInferiorChanged.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/inferior-changed/TestInferiorChanged.py (original)
+++ lldb/trunk/test/functionalities/inferior-changed/TestInferiorChanged.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class ChangedInferiorTestCase(TestBase):
 
@@ -64,10 +65,7 @@
             self.fail("Inferior changed, but lldb did not perform a reload")
 
         # Break inside the main.
-        self.expect("breakpoint set -f main2.c -l %d" % self.line2,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main2.c', line = %d, locations = 1" %
-                        self.line2)
+        lldbutil.run_break_set_by_file_and_line (self, "main2.c", self.line2, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/load_unload/TestLoadUnload.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/load_unload/TestLoadUnload.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/load_unload/TestLoadUnload.py (original)
+++ lldb/trunk/test/functionalities/load_unload/TestLoadUnload.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class LoadUnloadTestCase(TestBase):
 
@@ -112,10 +113,8 @@
         remove_dyld_path_cmd = "settings remove target.env-vars " + dylibPath
         self.addTearDownHook(lambda: self.runCmd(remove_dyld_path_cmd))
 
-        self.expect("breakpoint set -f d.c -l %d" % self.line_d_function,
-                    BREAKPOINT_CREATED,
-                    startstr = "Breakpoint created: 1: file ='d.c', line = %d" %
-                        self.line_d_function)
+        lldbutil.run_break_set_by_file_and_line (self, "d.c", self.line_d_function, num_expected_locations=1, loc_exact=True)
+
         # For now we don't track DYLD_LIBRARY_PATH, so the old library will be in
         # the modules list.
         self.expect("target modules list",
@@ -143,10 +142,7 @@
         # Break at main.c before the call to dlopen().
         # Use lldb's process load command to load the dylib, instead.
 
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -190,8 +186,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break by function name a_function (not yet loaded).
-        self.expect("breakpoint set -n a_function", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: name = 'a_function', locations = 0 (pending)")
+        lldbutil.run_break_set_by_symbol (self, "a_function", num_expected_locations=0)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -230,9 +225,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break by function name a_function (not yet loaded).
-        self.expect("breakpoint set -f main.c -l %d"%(self.line), BREAKPOINT_CREATED,
-            substrs = ['Breakpoint created:',
-                      "file ='main.c', line = %d, locations = 1"%(self.line)])
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/memory/read/TestMemoryRead.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/memory/read/TestMemoryRead.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/memory/read/TestMemoryRead.py (original)
+++ lldb/trunk/test/functionalities/memory/read/TestMemoryRead.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class MemoryReadTestCase(TestBase):
 
@@ -37,10 +38,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break in main() aftre the variables are assigned values.
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py (original)
+++ lldb/trunk/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class NonOverlappingIndexVariableCase(TestBase):
 
@@ -26,10 +27,7 @@
         exe = os.path.join(os.getcwd(), exe_name)
         self.runCmd("file %s" % exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect('breakpoint set -f %s -l %d' % (self.source, self.line_to_break),
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                        (self.source, self.line_to_break))
+        lldbutil.run_break_set_by_file_and_line (self, self.source, self.line_to_break, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/register/TestRegisters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/TestRegisters.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/register/TestRegisters.py (original)
+++ lldb/trunk/test/functionalities/register/TestRegisters.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class RegisterCommandsTestCase(TestBase):
 
@@ -39,9 +40,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break in main().
-        self.expect("breakpoint set -n main",
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: name = 'main'")
+        lldbutil.run_break_set_by_symbol (self, "main", num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -68,9 +67,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break in main().
-        self.expect("breakpoint set -n main",
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: name = 'main'")
+        lldbutil.run_break_set_by_symbol (self, "main", num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/signal/TestSendSignal.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/signal/TestSendSignal.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/signal/TestSendSignal.py (original)
+++ lldb/trunk/test/functionalities/signal/TestSendSignal.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class SendSignalTestCase(TestBase):
 
@@ -35,10 +36,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the main() function and immediately send a signal to the inferior after resuming.
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
         self.runCmd("thread backtrace")

Modified: lldb/trunk/test/functionalities/stop-hook/TestStopHookCmd.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/stop-hook/TestStopHookCmd.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/stop-hook/TestStopHookCmd.py (original)
+++ lldb/trunk/test/functionalities/stop-hook/TestStopHookCmd.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import StringIO
 import lldb
 from lldbtest import *
+import lldbutil
 
 class StopHookCmdTestCase(TestBase):
 
@@ -43,14 +44,9 @@
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect('breakpoint set -f main.cpp -l %d' % self.begl,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.begl)
-        self.expect('breakpoint set -f main.cpp -l %d' % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.begl, num_expected_locations=1, loc_exact=True)
+
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("target stop-hook add -f main.cpp -l %d -e %d -o 'expr ptr'" % (self.begl, self.endl))
 

Modified: lldb/trunk/test/functionalities/target_command/TestTargetCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/target_command/TestTargetCommand.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/target_command/TestTargetCommand.py (original)
+++ lldb/trunk/test/functionalities/target_command/TestTargetCommand.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import lldb
 import sys
 from lldbtest import *
+import lldbutil
 
 class targetCommandTestCase(TestBase):
 
@@ -84,13 +85,11 @@
         self.runCmd("run", RUN_SUCCEEDED)
 
         self.runCmd("target create " + exe_b, CURRENT_EXECUTABLE_SET)
-        self.runCmd("breakpoint set -f %s -l %d" % ('b.c', self.line_b),
-                    BREAKPOINT_CREATED)
+        lldbutil.run_break_set_by_file_and_line (self, 'b.c', self.line_b, num_expected_locations=1, loc_exact=True)
         self.runCmd("run", RUN_SUCCEEDED)
 
         self.runCmd("target create " + exe_c, CURRENT_EXECUTABLE_SET)
-        self.runCmd("breakpoint set -f %s -l %d" % ('c.c', self.line_c),
-                    BREAKPOINT_CREATED)
+        lldbutil.run_break_set_by_file_and_line (self, 'c.c', self.line_c, num_expected_locations=1, loc_exact=True)
         self.runCmd("run", RUN_SUCCEEDED)
 
         self.runCmd("target list")

Modified: lldb/trunk/test/functionalities/type_completion/TestTypeCompletion.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/type_completion/TestTypeCompletion.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/type_completion/TestTypeCompletion.py (original)
+++ lldb/trunk/test/functionalities/type_completion/TestTypeCompletion.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class TypeCompletionTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         """Check that types only get completed when necessary."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py (original)
+++ lldb/trunk/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class HelloWatchLocationTestCase(TestBase):
 
@@ -46,9 +47,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1, loc_exact=False)
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py (original)
+++ lldb/trunk/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class HelloWatchpointTestCase(TestBase):
 
@@ -44,9 +45,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py (original)
+++ lldb/trunk/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import re
 import lldb
 from lldbtest import *
+import lldbutil
 
 class WatchpointForMultipleThreadsTestCase(TestBase):
 
@@ -60,14 +61,10 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.first_stop, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.first_stop))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.first_stop, num_expected_locations=1)
 
         # Set this breakpoint to allow newly created thread to inherit the global watchpoint state.
-        self.expect("breakpoint set -l %d" % self.thread_function, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.thread_function))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.thread_function, num_expected_locations=1)
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)
@@ -119,14 +116,10 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.first_stop, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.first_stop))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.first_stop, num_expected_locations=1)
 
         # Set this breakpoint to allow newly created thread to inherit the global watchpoint state.
-        self.expect("breakpoint set -l %d" % self.thread_function, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.thread_function))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.thread_function, num_expected_locations=1)
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py (original)
+++ lldb/trunk/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class WatchedVariableHitWhenInScopeTestCase(TestBase):
 
@@ -39,8 +40,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped in main.
-        self.expect("breakpoint set -n main", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: name = 'main'")
+        lldbutil.run_break_set_by_symbol (self, "main", num_expected_locations=-1)
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py (original)
+++ lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class WatchpointCommandsTestCase(TestBase):
 
@@ -106,9 +107,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)
@@ -163,9 +162,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)
@@ -205,9 +202,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)
@@ -251,9 +246,158 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, "main.m")
+#        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
+#                       (self.source, self.line))#
+
+        # Run the program.
+        self.runCmd("run", RUN_SUCCEEDED)
+
+        # We should be stopped again due to the breakpoint.
+        # The stop reason of the thread should be breakpoint.
+        self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+            substrs = ['stopped',
+                       'stop reason = breakpoint'])
+
+        # Now let's set a read_write-type watchpoint for 'global'.
+        # There should be two watchpoint hits (see main.c).
+        self.expect("watchpoint set variable -w read_write global", WATCHPOINT_CREATED,
+            substrs = ['Watchpoint created', 'size = 4', 'type = rw',
+                       '%s:%d' % (self.source, self.decl)])
+
+        # Use the '-v' option to do verbose listing of the watchpoint.
+        # The hit count should be 0 initially.
+        self.expect("watchpoint list -v",
+            substrs = ['Number of supported hardware watchpoints:',
+                       'hit_count = 0'])
+
+        self.runCmd("process continue")
+
+        # We should be stopped again due to the watchpoint (read_write type).
+        # The stop reason of the thread should be watchpoint.
+        self.expect("thread backtrace", STOPPED_DUE_TO_WATCHPOINT,
+            substrs = ['stop reason = watchpoint'])
+
+        self.runCmd("process continue")
+
+        # We should be stopped again due to the watchpoint (read_write type).
+        # The stop reason of the thread should be watchpoint.
+        self.expect("thread backtrace", STOPPED_DUE_TO_WATCHPOINT,
+            substrs = ['stop reason = watchpoint'])
+
+        self.runCmd("process continue")
+
+        # There should be no more watchpoint hit and the process status should
+        # be 'exited'.
+        self.expect("process status",
+            substrs = ['exited'])
+
+        # Use the '-v' option to do verbose listing of the watchpoint.
+        # The hit count should now be 2.
+        self.expect("watchpoint list -v",
+            substrs = ['hit_count = 2'])
+
+    def delete_read_write_watchpoint(self):
+        """Do delete watchpoint immediately and expect not to stop for watchpoint."""
+        exe = os.path.join(os.getcwd(), self.exe_name)
+        self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+        # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
+#        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
+#                       (self.source, self.line))
+
+        # Run the program.
+        self.runCmd("run", RUN_SUCCEEDED)
+
+        # We should be stopped again due to the breakpoint.
+        # The stop reason of the thread should be breakpoint.
+        self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+            substrs = ['stopped',
+                       'stop reason = breakpoint'])
+
+        # Now let's set a read_write-type watchpoint for 'global'.
+        # There should be two watchpoint hits (see main.c).
+        self.expect("watchpoint set variable -w read_write global", WATCHPOINT_CREATED,
+            substrs = ['Watchpoint created', 'size = 4', 'type = rw',
+                       '%s:%d' % (self.source, self.decl)])
+
+        # Delete the watchpoint immediately, but set auto-confirm to true first.
+        self.runCmd("settings set auto-confirm true")
+        self.expect("watchpoint delete",
+            substrs = ['All watchpoints removed.'])
+        # Restore the original setting of auto-confirm.
+        self.runCmd("settings clear auto-confirm")
+
+        # Use the '-v' option to do verbose listing of the watchpoint.
+        self.runCmd("watchpoint list -v")
+
+        self.runCmd("process continue")
+
+        # There should be no more watchpoint hit and the process status should
+        # be 'exited'.
+        self.expect("process status",
+            substrs = ['exited'])
+
+    def ignore_read_write_watchpoint(self):
+        """Test watchpoint ignore count and expect to not to stop at all."""
+        exe = os.path.join(os.getcwd(), self.exe_name)
+        self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+        # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
+#        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
+#                       (self.source, self.line))
+
+        # Run the program.
+        self.runCmd("run", RUN_SUCCEEDED)
+
+        # We should be stopped again due to the breakpoint.
+        # The stop reason of the thread should be breakpoint.
+        self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+            substrs = ['stopped',
+                       'stop reason = breakpoint'])
+
+        # Now let's set a read_write-type watchpoint for 'global'.
+        # There should be two watchpoint hits (see main.c).
+        self.expect("watchpoint set variable -w read_write global", WATCHPOINT_CREATED,
+            substrs = ['Watchpoint created', 'size = 4', 'type = rw',
+                       '%s:%d' % (self.source, self.decl)])
+
+        # Set the ignore count of the watchpoint immediately.
+        self.expect("watchpoint ignore -i 2",
+            substrs = ['All watchpoints ignored.'])
+
+        # Use the '-v' option to do verbose listing of the watchpoint.
+        # Expect to find an ignore_count of 2.
+        self.expect("watchpoint list -v",
+            substrs = ['hit_count = 0', 'ignore_count = 2'])
+
+        self.runCmd("process continue")
+
+        # There should be no more watchpoint hit and the process status should
+        # be 'exited'.
+        self.expect("process status",
+            substrs = ['exited'])
+
+        # Use the '-v' option to do verbose listing of the watchpoint.
+        # Expect to find a hit_count of 2 as well.
+        self.expect("watchpoint list -v",
+            substrs = ['hit_count = 2', 'ignore_count = 2'])
+
+    def read_write_watchpoint_disable_after_first_stop(self):
+        """Do read_write watchpoint but disable it after the first stop."""
+        exe = os.path.join(os.getcwd(), self.exe_name)
+        self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+        # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
+#        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
+#                       (self.source, self.line))#
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)
@@ -307,12 +451,14 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
-        self.expect("breakpoint set -l %d" % self.line2, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line2))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
+#        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
+#                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line2, num_expected_locations=1)
+#        self.expect("breakpoint set -l %d" % self.line2, BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 2: file ='%s', line = %d, locations = 1" %
+#                       (self.source, self.line2))
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py (original)
+++ lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class WatchpointLLDBCommandTestCase(TestBase):
 
@@ -60,9 +61,10 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
+#        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
+#                       (self.source, self.line))
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)
@@ -111,9 +113,10 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
+#        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
+#                       (self.source, self.line))#
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py (original)
+++ lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class WatchpointPythonCommandTestCase(TestBase):
 
@@ -45,9 +46,10 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
+#        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
+#                       (self.source, self.line))#
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py (original)
+++ lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class WatchpointConditionCmdTestCase(TestBase):
 
@@ -45,9 +46,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py (original)
+++ lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class WatchLocationUsingWatchpointSetTestCase(TestBase):
 
@@ -45,9 +46,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py (original)
+++ lldb/trunk/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class WatchpointSetErrorTestCase(TestBase):
 
@@ -34,9 +35,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                       (self.source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=1)
 
         # Run the program.
         self.runCmd("run", RUN_SUCCEEDED)

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=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/anonymous/TestAnonymous.py (original)
+++ lldb/trunk/test/lang/c/anonymous/TestAnonymous.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class AnonymousTestCase(TestBase):
 
@@ -30,8 +31,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
-        self.expect("breakpoint set -f main.c -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created")
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/c/array_types/TestArrayTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/array_types/TestArrayTypes.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/array_types/TestArrayTypes.py (original)
+++ lldb/trunk/test/lang/c/array_types/TestArrayTypes.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class ArrayTypesTestCase(TestBase):
 
@@ -48,10 +49,7 @@
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=False)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/c/bitfields/TestBitfields.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/bitfields/TestBitfields.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/bitfields/TestBitfields.py (original)
+++ lldb/trunk/test/lang/c/bitfields/TestBitfields.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class BitfieldsTestCase(TestBase):
 
@@ -49,10 +50,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the main.
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/c/blocks/TestBlocks.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/blocks/TestBlocks.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/blocks/TestBlocks.py (original)
+++ lldb/trunk/test/lang/c/blocks/TestBlocks.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class AnonymousTestCase(TestBase):
 
@@ -37,8 +38,7 @@
 
         # Break inside the foo function which takes a bar_ptr argument.
 	for line in self.lines:
-            self.expect("breakpoint set -f main.c -l %d" % line, BREAKPOINT_CREATED,
-                startstr = "Breakpoint created")
+            lldbutil.run_break_set_by_file_and_line (self, "main.c", line, num_expected_locations=1, loc_exact=True)
 
     def wait_for_breakpoint(self):
         if self.is_started == False:

Modified: lldb/trunk/test/lang/c/enum_types/TestEnumTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/enum_types/TestEnumTypes.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/enum_types/TestEnumTypes.py (original)
+++ lldb/trunk/test/lang/c/enum_types/TestEnumTypes.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class EnumTypesTestCase(TestBase):
 
@@ -36,10 +37,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the main.
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/c/forward/TestForwardDeclaration.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/forward/TestForwardDeclaration.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/forward/TestForwardDeclaration.py (original)
+++ lldb/trunk/test/lang/c/forward/TestForwardDeclaration.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class ForwardDeclarationTestCase(TestBase):
 
@@ -32,8 +33,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
-        self.expect("breakpoint set -n foo", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: name = 'foo', locations = 1")
+        lldbutil.run_break_set_by_symbol (self, "foo", num_expected_locations=1, sym_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/c/function_types/TestFunctionTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/function_types/TestFunctionTypes.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/function_types/TestFunctionTypes.py (original)
+++ lldb/trunk/test/lang/c/function_types/TestFunctionTypes.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class FunctionTypesTestCase(TestBase):
 
@@ -46,10 +47,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
         
         # Break inside the main.
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-                    startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                    self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
         
         self.runCmd("run", RUN_SUCCEEDED)
         
@@ -72,7 +70,7 @@
             startstr = '(int (*)(const char *)) callback =')
 
         # And that we can break on the callback function.
-        self.runCmd("breakpoint set -n string_not_empty", BREAKPOINT_CREATED)
+        lldbutil.run_break_set_by_symbol (self, "string_not_empty", num_expected_locations=1, sym_exact=True)
         self.runCmd("continue")
 
         # Check that we do indeed stop on the string_not_empty function.

Modified: lldb/trunk/test/lang/c/global_variables/TestGlobalVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/global_variables/TestGlobalVariables.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/global_variables/TestGlobalVariables.py (original)
+++ lldb/trunk/test/lang/c/global_variables/TestGlobalVariables.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class GlobalVariablesTestCase(TestBase):
 
@@ -34,10 +35,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the main.
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/c/set_values/TestSetValues.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/set_values/TestSetValues.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/set_values/TestSetValues.py (original)
+++ lldb/trunk/test/lang/c/set_values/TestSetValues.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class SetValuesTestCase(TestBase):
 
@@ -38,30 +39,15 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Set breakpoints on several places to set program variables.
-        self.expect("breakpoint set -f main.c -l %d" % self.line1,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line1)
-
-        self.expect("breakpoint set -f main.c -l %d" % self.line2,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: file ='main.c', line = %d, locations = 1" %
-                        self.line2)
-
-        self.expect("breakpoint set -f main.c -l %d" % self.line3,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 3: file ='main.c', line = %d, locations = 1" %
-                        self.line3)
-
-        self.expect("breakpoint set -f main.c -l %d" % self.line4,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 4: file ='main.c', line = %d, locations = 1" %
-                        self.line4)
-
-        self.expect("breakpoint set -f main.c -l %d" % self.line5,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 5: file ='main.c', line = %d, locations = 1" %
-                        self.line5)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line1, num_expected_locations=1, loc_exact=True)
+
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line2, num_expected_locations=1, loc_exact=True)
+
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line3, num_expected_locations=1, loc_exact=True)
+
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line4, num_expected_locations=1, loc_exact=True)
+
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line5, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/c/shared_lib/TestSharedLib.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/shared_lib/TestSharedLib.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/shared_lib/TestSharedLib.py (original)
+++ lldb/trunk/test/lang/c/shared_lib/TestSharedLib.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class SharedLibTestCase(TestBase):
 
@@ -44,8 +45,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
-        self.expect("breakpoint set -f main.c -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created")
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/c/shared_lib/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/shared_lib/main.c?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/shared_lib/main.c (original)
+++ lldb/trunk/test/lang/c/shared_lib/main.c Fri Sep 21 19:05:11 2012
@@ -6,8 +6,8 @@
 {
   struct foo *my_foo_ptr;
   my_foo_ptr = GetMeAFoo();
-  // Set breakpoint 0 here.
-  printf ("My sub foo has: %d.\n", GetMeASubFoo(my_foo_ptr)->sub_1);
+  
+  printf ("My sub foo has: %d.\n", GetMeASubFoo(my_foo_ptr)->sub_1); // Set breakpoint 0 here.
 
   return 0;
 }

Modified: lldb/trunk/test/lang/c/stepping/TestThreadStepping.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/stepping/TestThreadStepping.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/stepping/TestThreadStepping.py (original)
+++ lldb/trunk/test/lang/c/stepping/TestThreadStepping.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb, lldbutil
 from lldbtest import *
+import lldbutil
 
 class ThreadSteppingTestCase(TestBase):
 
@@ -40,9 +41,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Create a breakpoint inside function 'c'.
-        self.expect("breakpoint set -f main.c -l %d" % self.line1, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line1)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line1, num_expected_locations=1, loc_exact=True)
 
         # Now run the program.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/lang/c/strings/TestCStrings.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/strings/TestCStrings.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/strings/TestCStrings.py (original)
+++ lldb/trunk/test/lang/c/strings/TestCStrings.py Fri Sep 21 19:05:11 2012
@@ -1,8 +1,9 @@
 """
 Tests that C strings work as expected in expressions
 """
-
+import lldb
 from lldbtest import *
+import lldbutil
 
 class CStringsTestCase(TestBase):
     
@@ -25,9 +26,7 @@
         TestBase.setUp(self)
     
     def set_breakpoint(self, line):
-        self.expect("breakpoint set -f main.c -l %d" % line,
-                    BREAKPOINT_CREATED,
-                    startstr = "Breakpoint created")
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", line, num_expected_locations=1, loc_exact=True)
     
     def static_method_commands(self):
         """Tests that C strings work as expected in expressions"""

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=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/struct_types/TestStructTypes.py (original)
+++ lldb/trunk/test/lang/c/struct_types/TestStructTypes.py Fri Sep 21 19:05:11 2012
@@ -8,6 +8,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class StructTypesTestCase(TestBase):
 
@@ -40,10 +41,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break on the struct declration statement in main.c.
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=False)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py (original)
+++ lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class StaticVariableTestCase(TestBase):
 
@@ -53,10 +54,7 @@
         """Test that that file and class static variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py (original)
+++ lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py Fri Sep 21 19:05:11 2012
@@ -5,6 +5,7 @@
 import lldb
 import lldbutil
 from lldbtest import *
+import lldbutil
 
 class ClassTypesTestCase(TestBase):
 
@@ -70,10 +71,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break on the ctor function of class C.
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -169,8 +167,7 @@
         #    startstr = "Breakpoint created: 1: name = 'C'")
 
         # Make the test case more robust by using line number to break, instead.
-        self.expect("breakpoint set -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created")
+        lldbutil.run_break_set_by_file_and_line (self, None, self.line, num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py (original)
+++ lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class IterateFrameAndDisassembleTestCase(TestBase):
 
@@ -51,10 +52,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break on the ctor function of class C.
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/namespace/TestNamespace.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/namespace/TestNamespace.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/namespace/TestNamespace.py (original)
+++ lldb/trunk/test/lang/cpp/namespace/TestNamespace.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class NamespaceTestCase(TestBase):
 
@@ -42,10 +43,7 @@
         """Test that anonymous and named namespace variables display correctly."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line_break,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line_break)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line_break, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/rvalue-references/TestRvalueReferences.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/rvalue-references/TestRvalueReferences.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/rvalue-references/TestRvalueReferences.py (original)
+++ lldb/trunk/test/lang/cpp/rvalue-references/TestRvalueReferences.py Fri Sep 21 19:05:11 2012
@@ -2,7 +2,9 @@
 Tests that rvalue references are supported in C++
 """
 
+import lldb
 from lldbtest import *
+import lldbutil
 
 class CPPThisTestCase(TestBase):
     
@@ -29,10 +31,8 @@
         TestBase.setUp(self)
     
     def set_breakpoint(self, line):
-        self.expect("breakpoint set -f main.cpp -l %d" % line,
-                    BREAKPOINT_CREATED,
-                    startstr = "Breakpoint created")
-    
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", line, num_expected_locations=1, loc_exact=True)
+
     def static_method_commands(self):
         """Test that rvalues are supported in the C++ expression parser"""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)

Modified: lldb/trunk/test/lang/cpp/signed_types/TestSignedTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/signed_types/TestSignedTypes.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/signed_types/TestSignedTypes.py (original)
+++ lldb/trunk/test/lang/cpp/signed_types/TestSignedTypes.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class UnsignedTypesTestCase(TestBase):
 
@@ -37,10 +38,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break on line 22 in main() aftre the variables are assigned values.
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/static_methods/TestCPPStaticMethods.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/static_methods/TestCPPStaticMethods.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/static_methods/TestCPPStaticMethods.py (original)
+++ lldb/trunk/test/lang/cpp/static_methods/TestCPPStaticMethods.py Fri Sep 21 19:05:11 2012
@@ -2,7 +2,9 @@
 Tests expressions that distinguish between static and non-static methods.
 """
 
+import lldb
 from lldbtest import *
+import lldbutil
 
 class CPPStaticMethodsTestCase(TestBase):
     
@@ -29,9 +31,7 @@
         """Test that static methods are properly distinguished from regular methods"""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-                    startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" % self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("process launch", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/stl/TestSTL.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/stl/TestSTL.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/stl/TestSTL.py (original)
+++ lldb/trunk/test/lang/cpp/stl/TestSTL.py Fri Sep 21 19:05:11 2012
@@ -63,10 +63,7 @@
         # rdar://problem/8543077
         # test/stl: clang built binaries results in the breakpoint locations = 3,
         # is this a problem with clang generated debug info?
-        self.expect("breakpoint set -f %s -l %d" % (self.source, self.line),
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/stl/TestStdCXXDisassembly.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/stl/TestStdCXXDisassembly.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/stl/TestStdCXXDisassembly.py (original)
+++ lldb/trunk/test/lang/cpp/stl/TestStdCXXDisassembly.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class StdCXXDisassembleTestCase(TestBase):
 
@@ -31,10 +32,7 @@
         # is this a problem with clang generated debug info?
         #
         # Break on line 13 of main.cpp.
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/this/TestCPPThis.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/this/TestCPPThis.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/this/TestCPPThis.py (original)
+++ lldb/trunk/test/lang/cpp/this/TestCPPThis.py Fri Sep 21 19:05:11 2012
@@ -1,8 +1,9 @@
 """
 Tests that C++ member and static variables are available where they should be.
 """
-
+import lldb
 from lldbtest import *
+import lldbutil
 
 class CPPThisTestCase(TestBase):
     
@@ -29,10 +30,8 @@
         TestBase.setUp(self)
     
     def set_breakpoint(self, line):
-        self.expect("breakpoint set -f main.cpp -l %d" % line,
-                    BREAKPOINT_CREATED,
-                    startstr = "Breakpoint created")
-    
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", line, num_expected_locations=1, loc_exact=False)
+
     def static_method_commands(self):
         """Test that the appropriate member variables are available when stopped in C++ static, inline, and const methods"""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)

Modified: lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py (original)
+++ lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py Fri Sep 21 19:05:11 2012
@@ -36,10 +36,7 @@
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py (original)
+++ lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class UnsignedTypesTestCase(TestBase):
 
@@ -37,10 +38,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break on line 19 in main() aftre the variables are assigned values.
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/virtual/TestVirtual.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/virtual/TestVirtual.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/virtual/TestVirtual.py (original)
+++ lldb/trunk/test/lang/cpp/virtual/TestVirtual.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import re
 import lldb
 from lldbtest import *
+import lldbutil
 
 def Msg(expr, val):
     return "'expression %s' matches the output (from compiled code): %s" % (expr, val)
@@ -62,7 +63,7 @@
         # Bring the program to the point where we can issue a series of
         # 'expression' command to compare against the golden output.
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-        self.runCmd("breakpoint set -f main.cpp -l %d" % self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
         self.runCmd("run", RUN_SUCCEEDED)
 
         # Now iterate through the golden list, comparing against the output from

Modified: lldb/trunk/test/lang/objc/forward-decl/TestForwardDecl.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/forward-decl/TestForwardDecl.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/forward-decl/TestForwardDecl.py (original)
+++ lldb/trunk/test/lang/objc/forward-decl/TestForwardDecl.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class ForwardDeclTestCase(TestBase):
 
@@ -32,8 +33,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
-        self.expect("breakpoint set -f main.m -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created")
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/objc/foundation/TestConstStrings.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestConstStrings.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/foundation/TestConstStrings.py (original)
+++ lldb/trunk/test/lang/objc/foundation/TestConstStrings.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
 class ConstStringTestCase(TestBase):
@@ -40,10 +41,7 @@
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f %s -l %d" % (self.main_source, self.line),
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                        (self.main_source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, self.main_source, self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("process status", STOPPED_DUE_TO_BREAKPOINT,

Modified: lldb/trunk/test/lang/objc/foundation/TestFoundationDisassembly.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestFoundationDisassembly.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/foundation/TestFoundationDisassembly.py (original)
+++ lldb/trunk/test/lang/objc/foundation/TestFoundationDisassembly.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
 class FoundationDisassembleTestCase(TestBase):
@@ -72,20 +73,27 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Stop at +[NSString stringWithFormat:].
-        self.expect("_regexp-break +[NSString stringWithFormat:]", BREAKPOINT_CREATED,
-            substrs = ["Breakpoint created: 1: name = '+[NSString stringWithFormat:]', locations = 1"])
+        symbol_name = "+[NSString stringWithFormat:]"
+        break_results = lldbutil.run_break_set_command (self, "_regexp-break %s"%(symbol_name))
+        lldbutil.check_breakpoint_result (self, break_results, symbol_name=symbol_name, num_locations=1)
+#        self.expect("_regexp-break +[NSString stringWithFormat:]", BREAKPOINT_CREATED,
+#            substrs = ["Breakpoint created: 1: name = '+[NSString stringWithFormat:]', locations = 1"])
 
         # Stop at -[MyString initWithNSString:].
-        self.expect("breakpoint set -n '-[MyString initWithNSString:]'", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: name = '-[MyString initWithNSString:]', locations = 1")
+        lldbutil.run_break_set_by_symbol (self, '-[MyString initWithNSString:]', num_expected_locations=1, sym_exact=True)
+#        self.expect("breakpoint set -n '-[MyString initWithNSString:]'", BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 2: name = '-[MyString initWithNSString:]', locations = 1")
 
         # Stop at the "description" selector.
-        self.expect("breakpoint set -S description", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 3: name = 'description', locations = 1")
+        lldbutil.run_break_set_by_selector (self, 'description', num_expected_locations=1)
+#        self.expect("breakpoint set -S description", BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 3: name = 'description', locations = 1")
 
         # Stop at -[NSAutoreleasePool release].
-        self.expect("_regexp-break -[NSAutoreleasePool release]", BREAKPOINT_CREATED,
-            substrs = ["Breakpoint created: 4: name = '-[NSAutoreleasePool release]', locations = 1"])
+        break_results = lldbutil.run_break_set_command (self, "_regexp-break -[NSAutoreleasePool release]")
+        lldbutil.check_breakpoint_result (self, break_results, symbol_name='-[NSAutoreleasePool release]', num_locations=1)
+#        self.expect("_regexp-break -[NSAutoreleasePool release]", BREAKPOINT_CREATED,
+#            substrs = ["Breakpoint created: 4: name = '-[NSAutoreleasePool release]', locations = 1"])
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py (original)
+++ lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py Fri Sep 21 19:05:11 2012
@@ -7,6 +7,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
 class FoundationTestCase(TestBase):
@@ -61,20 +62,26 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Stop at +[NSString stringWithFormat:].
-        self.expect("_regexp-break +[NSString stringWithFormat:]", BREAKPOINT_CREATED,
-            substrs = ["Breakpoint created: 1: name = '+[NSString stringWithFormat:]', locations = 1"])
+        break_results = lldbutil.run_break_set_command(self, "_regexp-break +[NSString stringWithFormat:]")
+        lldbutil.check_breakpoint_result (self, break_results, symbol_name='+[NSString stringWithFormat:]', num_locations=1)
+#        self.expect("_regexp-break +[NSString stringWithFormat:]", BREAKPOINT_CREATED,
+#            substrs = ["Breakpoint created: 1: name = '+[NSString stringWithFormat:]', locations = 1"])
 
         # Stop at -[MyString initWithNSString:].
-        self.expect("breakpoint set -n '-[MyString initWithNSString:]'", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: name = '-[MyString initWithNSString:]', locations = 1")
+        lldbutil.run_break_set_by_symbol (self, '-[MyString initWithNSString:]', num_expected_locations=1, sym_exact=True)
+#        self.expect("breakpoint set -n '-[MyString initWithNSString:]'", BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 2: name = '-[MyString initWithNSString:]', locations = 1")
 
         # Stop at the "description" selector.
-        self.expect("breakpoint set -S description", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 3: name = 'description', locations = 1")
+        lldbutil.run_break_set_by_selector (self, 'description', num_expected_locations=1)
+#        self.expect("breakpoint set -S description", BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 3: name = 'description', locations = 1")
 
         # Stop at -[NSAutoreleasePool release].
-        self.expect("_regexp-break -[NSAutoreleasePool release]", BREAKPOINT_CREATED,
-            substrs = ["Breakpoint created: 4: name = '-[NSAutoreleasePool release]', locations = 1"])
+        break_results = lldbutil.run_break_set_command(self, "_regexp-break -[NSAutoreleasePool release]")
+        lldbutil.check_breakpoint_result (self, break_results, symbol_name='-[NSAutoreleasePool release]', num_locations=1)
+#        self.expect("_regexp-break -[NSAutoreleasePool release]", BREAKPOINT_CREATED,
+#            substrs = ["Breakpoint created: 4: name = '-[NSAutoreleasePool release]', locations = 1"])
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -125,8 +132,9 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Stop at -[MyString description].
-        self.expect("breakpoint set -n '-[MyString description]", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: name = '-[MyString description]', locations = 1")
+        lldbutil.run_break_set_by_symbol (self, '-[MyString description]', num_expected_locations=1, sym_exact=True)
+#        self.expect("breakpoint set -n '-[MyString description]", BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 1: name = '-[MyString description]', locations = 1")
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -195,10 +203,11 @@
         #
 
         self.runCmd("breakpoint delete 1")
-        self.expect("breakpoint set -f main.m -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 2: file ='main.m', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+#        self.expect("breakpoint set -f main.m -l %d" % self.line,
+#                    BREAKPOINT_CREATED,
+#            startstr = "Breakpoint created: 2: file ='main.m', line = %d, locations = 1" %
+#                        self.line)
         self.runCmd("process continue")
 
         # rdar://problem/8542091

Modified: lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py (original)
+++ lldb/trunk/test/lang/objc/foundation/TestObjCMethods2.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
 class FoundationTestCase2(TestBase):
@@ -91,10 +92,10 @@
         TestBase.setUp(self)
         # Find the line numbers to break at.
         self.lines = []
-        self.lines.append(line_number('main.m', '// Expressions to test here for selector:'))
-        self.lines.append(line_number('main.m', '// Expressions to test here for NSArray:'))
-        self.lines.append(line_number('main.m', '// Expressions to test here for NSString:'))
-        self.lines.append(line_number('main.m', "// Set a breakpoint on '-[MyString description]' and test expressions:"))
+        self.lines.append(line_number('main.m', '// Break here for selector: tests'))
+        self.lines.append(line_number('main.m', '// Break here for NSArray tests'))
+        self.lines.append(line_number('main.m', '// Break here for NSString tests'))
+        self.lines.append(line_number('main.m', '// Break here for description test'))
         self.lines.append(line_number('main.m', '// Set break point at this line'))
     
     def more_expr_objc(self):
@@ -104,9 +105,10 @@
 
         # Create a bunch of breakpoints.
         for line in self.lines:
-            self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
-                substrs = ["Breakpoint created:",
-                           "file ='main.m', line = %d, locations = 1" % line])
+            lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
+#            self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
+#                substrs = ["Breakpoint created:",
+#                           "file ='main.m', line = %d, locations = 1" % line])
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -143,9 +145,10 @@
 
         # Break inside Test_NSArray:
         line = self.lines[1]
-        self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
-            substrs = ["Breakpoint created:",
-                       "file ='main.m', line = %d, locations = 1" % line])
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
+#        self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
+#            substrs = ["Breakpoint created:",
+#                       "file ='main.m', line = %d, locations = 1" % line])#
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -172,9 +175,10 @@
 
         # Break inside Test_NSString:
         line = self.lines[2]
-        self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
-            substrs = ["Breakpoint created:",
-                       "file ='main.m', line = %d, locations = 1" % line])
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
+#        self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
+#            substrs = ["Breakpoint created:",
+#                       "file ='main.m', line = %d, locations = 1" % line])#
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -201,10 +205,11 @@
         
         line = self.lines[4]
 
-        self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
-                    substrs = ["Breakpoint created:",
-                               "file ='main.m', line = %d, locations = 1" % line])
-        
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
+#        self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
+#                    substrs = ["Breakpoint created:",
+#                               "file ='main.m', line = %d, locations = 1" % line])
+#        
         self.runCmd("run", RUN_SUCCEEDED)
         
         self.expect("expression *my",
@@ -218,9 +223,10 @@
         
         line = self.lines[4]
 
-        self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
-                    substrs = ["Breakpoint created:",
-                               "file ='main.m', line = %d, locations = 1" % line])
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
+#        self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
+#                    substrs = ["Breakpoint created:",
+#                               "file ='main.m', line = %d, locations = 1" % line])#
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -235,9 +241,10 @@
         
         line = self.lines[4]
 
-        self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
-                    substrs = ["Breakpoint created:",
-                               "file ='main.m', line = %d, locations = 1" % line])
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
+#        self.expect("breakpoint set -f main.m -l %d" % line, BREAKPOINT_CREATED,
+#                    substrs = ["Breakpoint created:",
+#                               "file ='main.m', line = %d, locations = 1" % line])#
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/objc/foundation/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/main.m?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/foundation/main.m (original)
+++ lldb/trunk/test/lang/objc/foundation/main.m Fri Sep 21 19:05:11 2012
@@ -40,7 +40,7 @@
 {
     // Set a breakpoint on '-[MyString description]' and test expressions:
     // expression (char *)sel_getName(_cmd)
-    if (self.descriptionPauses)
+  if (self.descriptionPauses)  // Break here for description test
     {
         printf ("\nAbout to sleep.\n");
         usleep(100000);
@@ -60,7 +60,7 @@
     //      The expression above should return "sel" as it should be just
     //      a uniqued C string pointer. We were seeing the result pointer being
     //      truncated with recent LLDBs.
-    return 0;
+    return 0; // Break here for selector: tests
 }
 
 int
@@ -82,7 +82,7 @@
     // expression str.description
     // expression str = @"new"
     // expression str = [NSString stringWithFormat: @"%cew", 'N']
-    return 0;
+    return 0; // Break here for NSString tests
 }
 
 NSString *my_global_str = NULL;
@@ -112,7 +112,7 @@
     // expression array2.count
     id obj;
     // After each object at index call, use expression and validate object
-    obj = [array1 objectAtIndex: 0];
+    obj = [array1 objectAtIndex: 0]; // Break here for NSArray tests
     obj = [array1 objectAtIndex: 1];
     obj = [array1 objectAtIndex: 2];
 

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=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py (original)
+++ lldb/trunk/test/lang/objc/hidden-ivars/TestHiddenIvars.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class HiddenIvarsTestCase(TestBase):
 
@@ -52,8 +53,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
-        self.expect("breakpoint set -f main.m -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created")
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/objc/objc++/TestObjCXX.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc%2B%2B/TestObjCXX.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/objc++/TestObjCXX.py (original)
+++ lldb/trunk/test/lang/objc/objc++/TestObjCXX.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class ObjCXXTestCase(TestBase):
 
@@ -32,8 +33,7 @@
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -p 'breakpoint 1'", BREAKPOINT_CREATED,
-            startstr = "Breakpoint created")
+        lldbutil.run_break_set_by_source_regexp (self, 'breakpoint 1', num_expected_locations=1) 
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py (original)
+++ lldb/trunk/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 import platform
+import lldbutil
 
 from distutils.version import StrictVersion
 
@@ -44,8 +45,7 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
-        self.expect("breakpoint set -f main.m -l %d" % self.line, BREAKPOINT_CREATED,
-            startstr = "Breakpoint created")
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/objc/objc-optimized/TestObjcOptimized.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-optimized/TestObjcOptimized.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/objc-optimized/TestObjcOptimized.py (original)
+++ lldb/trunk/test/lang/objc/objc-optimized/TestObjcOptimized.py Fri Sep 21 19:05:11 2012
@@ -11,6 +11,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 # rdar://problem/9087739
 # test failure: objc_optimized does not work for "-C clang -A i386"
@@ -39,9 +40,7 @@
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -n '%s'" % self.method_spec,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: name = '%s', locations = 1" % self.method_spec)
+        lldbutil.run_break_set_by_symbol (self, self.method_spec, num_expected_locations=1, sym_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT,

Modified: lldb/trunk/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py (original)
+++ lldb/trunk/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
 class MethodReturningBOOLTestCase(TestBase):
@@ -42,10 +43,7 @@
         exe = os.path.join(os.getcwd(), exe_name)
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f %s -l %d" % (self.main_source, self.line),
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                        (self.main_source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("process status", STOPPED_DUE_TO_BREAKPOINT,

Modified: lldb/trunk/test/lang/objc/rdar-10967107/TestRdar10967107.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/rdar-10967107/TestRdar10967107.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/rdar-10967107/TestRdar10967107.py (original)
+++ lldb/trunk/test/lang/objc/rdar-10967107/TestRdar10967107.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
 class Rdar10967107TestCase(TestBase):
@@ -42,10 +43,7 @@
         exe = os.path.join(os.getcwd(), exe_name)
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f %s -l %d" % (self.main_source, self.line),
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                        (self.main_source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, self.main_source, self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
         # check that each type is correctly bound to its list of children

Modified: lldb/trunk/test/lang/objc/rdar-10967107/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/rdar-10967107/main.m?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/rdar-10967107/main.m (original)
+++ lldb/trunk/test/lang/objc/rdar-10967107/main.m Fri Sep 21 19:05:11 2012
@@ -7,7 +7,7 @@
 	NSDate *date1 = [NSDate date];
 	CFGregorianDate cf_greg_date = CFAbsoluteTimeGetGregorianDate(CFDateGetAbsoluteTime((CFDateRef)date1), NULL);
 	CFRange cf_range = {4,4};
-// Set breakpoint here.
-    [pool release];
+
+    [pool release]; // Set breakpoint here.
     return 0;
 }

Modified: lldb/trunk/test/lang/objc/rdar-11355592/TestRdar11355592.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/rdar-11355592/TestRdar11355592.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/rdar-11355592/TestRdar11355592.py (original)
+++ lldb/trunk/test/lang/objc/rdar-11355592/TestRdar11355592.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
 class Rdar10967107TestCase(TestBase):
@@ -42,10 +43,7 @@
         exe = os.path.join(os.getcwd(), exe_name)
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f %s -l %d" % (self.main_source, self.line),
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='%s', line = %d, locations = 1" %
-                        (self.main_source, self.line))
+        lldbutil.run_break_set_by_file_and_line (self, self.main_source, self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
         # check that we correctly see the const char*, even with dynamic types on

Modified: lldb/trunk/test/lang/objc/rdar-11355592/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/rdar-11355592/main.m?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/rdar-11355592/main.m (original)
+++ lldb/trunk/test/lang/objc/rdar-11355592/main.m Fri Sep 21 19:05:11 2012
@@ -29,8 +29,8 @@
 
     FoolMeOnce *my_foolie = [[FoolMeOnce alloc] initWithFirst: 20 andSecond: 55];
     const char *my_string = (char *) my_foolie;
-// Set breakpoint here.
-    my_string = "Now this is a REAL string...";
+
+    my_string = "Now this is a REAL string..."; // Set breakpoint here.
 
     [pool release];
     return 0;

Modified: lldb/trunk/test/lang/objc/real-definition/TestRealDefinition.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/real-definition/TestRealDefinition.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/real-definition/TestRealDefinition.py (original)
+++ lldb/trunk/test/lang/objc/real-definition/TestRealDefinition.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class TestRealDefinition(TestBase):
 
@@ -54,13 +55,15 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break inside the foo function which takes a bar_ptr argument.
-        self.expect("breakpoint set -f main.m -l %d" % line_number('main.m', '// Set breakpoint in main'), BREAKPOINT_CREATED, startstr = "Breakpoint created")
+        line = line_number('main.m', '// Set breakpoint in main')
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
 
     def stop_at_interface(self):
         """Test that we can find the implementation for an objective C type when we stop in the interface"""
         self.common_setup()
 
-        self.expect("breakpoint set -f Foo.m -l %d" % line_number('Foo.m', '// Set breakpoint where Bar is an interface'), BREAKPOINT_CREATED, startstr = "Breakpoint created")
+        line = line_number('Foo.m', '// Set breakpoint where Bar is an interface')
+        lldbutil.run_break_set_by_file_and_line (self, 'Foo.m', line, num_expected_locations=1, loc_exact=True);
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -87,7 +90,8 @@
         """Test that we can find the implementation for an objective C type when we stop in the implementation"""
         self.common_setup()
 
-        self.expect("breakpoint set -f Bar.m -l %d" % line_number('Bar.m', '// Set breakpoint where Bar is an implementation'), BREAKPOINT_CREATED, startstr = "Breakpoint created")
+        line = line_number('Bar.m', '// Set breakpoint where Bar is an implementation')
+        lldbutil.run_break_set_by_file_and_line (self, 'Bar.m', line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/objc/self/TestObjCSelf.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/self/TestObjCSelf.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/self/TestObjCSelf.py (original)
+++ lldb/trunk/test/lang/objc/self/TestObjCSelf.py Fri Sep 21 19:05:11 2012
@@ -1,8 +1,9 @@
 """
 Tests that ObjC member variables are available where they should be.
 """
-
+import lldb
 from lldbtest import *
+import lldbutil
 
 class ObjCSelfTestCase(TestBase):
     
@@ -25,9 +26,7 @@
         TestBase.setUp(self)
     
     def set_breakpoint(self, line):
-        self.expect("breakpoint set -f main.m -l %d" % line,
-                    BREAKPOINT_CREATED,
-                    startstr = "Breakpoint created")
+        lldbutil.run_break_set_by_file_and_line (self, "main.m", line, num_expected_locations=1, loc_exact=True)
     
     def self_commands(self):
         """Test that the appropriate member variables are available when stopped in Objective-C class and instance methods"""

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Fri Sep 21 19:05:11 2012
@@ -1101,6 +1101,49 @@
             self.assertTrue(self.res.Succeeded(),
                             msg if msg else CMD_MSG(cmd))
 
+    def match (self, str, patterns, msg=None, trace=False, error=False, matching=True, exe=True):
+        """run command in str, and match the result against regexp in patterns returning the match object for the first matching pattern
+
+        Otherwise, all the arguments have the same meanings as for the expect function"""
+
+        trace = (True if traceAlways else trace)
+
+        if exe:
+            # First run the command.  If we are expecting error, set check=False.
+            # Pass the assert message along since it provides more semantic info.
+            self.runCmd(str, msg=msg, trace = (True if trace else False), check = not error)
+
+            # Then compare the output against expected strings.
+            output = self.res.GetError() if error else self.res.GetOutput()
+
+            # If error is True, the API client expects the command to fail!
+            if error:
+                self.assertFalse(self.res.Succeeded(),
+                                 "Command '" + str + "' is expected to fail!")
+        else:
+            # No execution required, just compare str against the golden input.
+            output = str
+            with recording(self, trace) as sbuf:
+                print >> sbuf, "looking at:", output
+
+        # The heading says either "Expecting" or "Not expecting".
+        heading = "Expecting" if matching else "Not expecting"
+
+        for pattern in patterns:
+            # Match Objects always have a boolean value of True.
+            match_object = re.search(pattern, output)
+            matched = bool(match_object)
+            with recording(self, trace) as sbuf:
+                print >> sbuf, "%s pattern: %s" % (heading, pattern)
+                print >> sbuf, "Matched" if matched else "Not matched"
+            if matched:
+                break
+
+        self.assertTrue(matched if matching else not matched,
+                        msg if msg else EXP_MSG(str, exe))
+
+        return match_object        
+
     def expect(self, str, msg=None, patterns=None, startstr=None, endstr=None, substrs=None, trace=False, error=False, matching=True, exe=True):
         """
         Similar to runCmd; with additional expect style output matching ability.

Modified: lldb/trunk/test/lldbutil.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbutil.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/lldbutil.py (original)
+++ lldb/trunk/test/lldbutil.py Fri Sep 21 19:05:11 2012
@@ -258,6 +258,193 @@
 
 
 # ==================================================
+# Utility functions for setting breakpoints
+# ==================================================
+
+def run_break_set_by_file_and_line (test, file_name, line_number, extra_options = None, num_expected_locations = 1, loc_exact=False, module_name=None):
+    """Set a breakpoint by file and line, returning the breakpoint number. 
+
+    If extra_options is not None, then we append it to the breakpoint set command.
+
+    If num_expected_locations is -1 we check that we got AT LEAST one location, otherwise we check that num_expected_locations equals the number of locations.
+
+    If loc_exact is true, we check that there is one location, and that location must be at the input file and line number."""
+
+    if file_name == None:
+        command = 'breakpoint set -l %d'%(line_number)
+    else:
+        command = 'breakpoint set -f "%s" -l %d'%(file_name, line_number)
+
+    if extra_options:
+        command += " " + extra_options
+
+    break_results = run_break_set_command (test, command)
+
+    if num_expected_locations == 1 and loc_exact:
+        check_breakpoint_result (test, break_results, num_locations=num_expected_locations, file_name = file_name, line_number = line_number, module_name=module_name)
+    else:
+        check_breakpoint_result (test, break_results, num_locations = num_expected_locations)
+
+    return get_bpno_from_match (break_results)
+
+def run_break_set_by_symbol (test, symbol, extra_options = None, num_expected_locations = -1, sym_exact = False, module_name=None):
+    """Set a breakpoint by symbol name.  Common options are the same as run_break_set_by_file_and_line.
+
+    If sym_exact is true, then the output symbol must match the input exactly, otherwise we do a substring match."""
+    command = 'breakpoint set -n "%s"'%(symbol)
+    if extra_options:
+        command += " " + extra_options
+
+    break_results = run_break_set_command (test, command)
+
+    if num_expected_locations == 1 and sym_exact:
+        check_breakpoint_result (test, break_results, num_locations = num_expected_locations, symbol_name = symbol, module_name=module_name)
+    else:
+        check_breakpoint_result (test, break_results, num_locations = num_expected_locations)
+
+    return get_bpno_from_match (break_results)
+
+def run_break_set_by_selector (test, selector, extra_options = None, num_expected_locations = -1, module_name=None):
+    """Set a breakpoint by selector.  Common options are the same as run_break_set_by_file_and_line."""
+
+    command = 'breakpoint set -S "%s"'%(selector)
+    if extra_options:
+        command += " " + extra_options
+
+    break_results = run_break_set_command (test, command)
+
+    if num_expected_locations == 1:
+        check_breakpoint_result (test, break_results, num_locations = num_expected_locations, symbol_name = selector, symbol_match_exact=False, module_name=module_name)
+    else:
+        check_breakpoint_result (test, break_results, num_locations = num_expected_locations)
+
+    return get_bpno_from_match (break_results)
+
+def run_break_set_by_regexp (test, regexp, extra_options=None, num_expected_locations=-1):
+    """Set a breakpoint by regular expression match on symbol name.  Common options are the same as run_break_set_by_file_and_line."""
+
+    command = 'breakpoint set -r "%s"'%(regexp)
+    if extra_options:
+        command += " " + extra_options
+    
+    break_results = run_break_set_command (test, command)
+    
+    check_breakpoint_result (test, break_results, num_locations=num_expected_locations)
+
+    return get_bpno_from_match (break_results)
+
+def run_break_set_by_source_regexp (test, regexp, extra_options=None, num_expected_locations=-1):
+    """Set a breakpoint by source regular expression.  Common options are the same as run_break_set_by_file_and_line."""
+    command = 'breakpoint set -p "%s"'%(regexp)
+    if extra_options:
+        command += " " + extra_options
+    
+    break_results = run_break_set_command (test, command)
+    
+    check_breakpoint_result (test, break_results, num_locations=num_expected_locations)
+
+    return get_bpno_from_match (break_results)
+
+def run_break_set_command (test, command):
+    """Run the command passed in - it must be some break set variant - and analyze the result.  
+    Returns a dictionary of information gleaned from the command-line results.
+    Will assert if the breakpoint setting fails altogether.
+
+    Dictionary will contain:
+        bpno          - breakpoint of the newly created breakpoint, -1 on error.
+        num_locations - number of locations set for the breakpoint.
+
+    If there is only one location, the dictionary MAY contain:
+        file          - source file name
+        line_no       - source line number
+        symbol        - symbol name
+        inline_symbol - inlined symbol name
+        offset        - offset from the original symbol
+        module        - module
+        address       - address at which the breakpoint was set."""
+
+    patterns = [r"^Breakpoint (?P<bpno>[0-9]+): (?P<num_locations>[0-9]+) locations\.$",
+                r"^Breakpoint (?P<bpno>[0-9]+): (?P<num_locations>no) locations \(pending\)\.",
+                r"^Breakpoint (?P<bpno>[0-9]+): where = (?P<module>.*)`(?P<symbol>[+\-]{0,1}[^+]+)( \+ (?P<offset>[0-9]+)){0,1}( \[inlined\] (?P<inline_symbol>.*)){0,1} at (?P<file>[^:]+):(?P<line_no>[0-9]+), address = (?P<address>0x[0-9a-fA-F]+)$",
+                r"^Breakpoint (?P<bpno>[0-9]+): where = (?P<module>.*)`(?P<symbol>.*)( \+ (?P<offset>[0-9]+)){0,1}, address = (?P<address>0x[0-9a-fA-F]+)$"]
+    match_object = test.match (command, patterns)
+    break_results = match_object.groupdict()
+    print "Break results: ", break_results
+
+    # We always insert the breakpoint number, setting it to -1 if we couldn't find it
+    # Also, make sure it gets stored as an integer.
+    if not 'bpno' in break_results:
+        break_results['bpno'] = -1
+    else:
+        break_results['bpno'] = int(break_results['bpno'])
+        
+    # We always insert the number of locations
+    # If ONE location is set for the breakpoint, then the output doesn't mention locations, but it has to be 1...
+    # We also make sure it is an integer.
+
+    if not 'num_locations' in break_results:
+        num_locations = 1
+    else:
+        num_locations = break_results['num_locations']
+        if num_locations == 'no':
+            num_locations = 0
+        else:
+            num_locations = int(break_results['num_locations'])
+
+    break_results['num_locations'] = num_locations
+    
+    if 'line_no' in break_results:
+        break_results['line_no'] = int(break_results['line_no'])
+
+    return break_results
+
+def get_bpno_from_match (break_results):
+    return int (break_results['bpno'])
+
+def check_breakpoint_result (test, break_results, file_name=None, line_number=-1, symbol_name=None, symbol_match_exact=True, module_name=None, offset=-1, num_locations=-1):
+
+    out_num_locations = break_results['num_locations']
+
+    print "Num locations: ", num_locations, " and out num locations: ", out_num_locations
+    if num_locations == -1:
+        test.assertTrue (out_num_locations > 0, "Expecting one or more locations, got none.")
+    else:
+        test.assertTrue (num_locations == out_num_locations, "Expecting %d locations, got %d."%(num_locations, out_num_locations))
+
+    if file_name:
+        out_file_name = ""
+        if 'file' in break_results:
+            out_file_name = break_results['file']
+        test.assertTrue (file_name == out_file_name, "Breakpoint file name '%s' doesn't match resultant name '%s'."%(file_name, out_file_name))
+
+    if line_number != -1:
+        out_file_line = -1
+        if 'line_no' in break_results:
+            out_line_number = break_results['line_no']
+
+        test.assertTrue (line_number == out_line_number, "Breakpoint line number %s doesn't match resultant line %s."%(line_number, out_line_number))
+
+    if symbol_name:
+        out_symbol_name = ""
+        # Look first for the inlined symbol name, otherwise use the symbol name:
+        if 'inline_symbol' in break_results and break_results['inline_symbol']:
+            out_symbol_name = break_results['inline_symbol']
+        elif 'symbol' in break_results:
+            out_symbol_name = break_results['symbol']
+
+        if symbol_match_exact:
+            test.assertTrue(symbol_name == out_symbol_name, "Symbol name '%s' doesn't match resultant symbol '%s'."%(symbol_name, out_symbol_name))
+        else:
+            test.assertTrue(out_symbol_name.find(symbol_name) != -1, "Symbol name '%s' isn't in resultant symbol '%s'."%(symbol_name, out_symbol_name))
+
+    if module_name:
+        out_nodule_name = None
+        if 'module' in break_results:
+            out_module_name = break_results['module']
+        
+        test.assertTrue (module_name.find(out_module_name) != -1, "Symbol module name '%s' isn't in expected module name '%s'."%(out_module_name, module_name))
+
+# ==================================================
 # Utility functions related to Threads and Processes
 # ==================================================
 

Modified: lldb/trunk/test/macosx/universal/TestUniversal.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/macosx/universal/TestUniversal.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/macosx/universal/TestUniversal.py (original)
+++ lldb/trunk/test/macosx/universal/TestUniversal.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class UniversalTestCase(TestBase):
 
@@ -53,10 +54,7 @@
             substrs = ["testit' (x86_64)."])
 
         # Break inside the main.
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         # We should be able to launch the x86_64 executable.
         self.runCmd("run", RUN_SUCCEEDED)
@@ -81,10 +79,7 @@
             substrs = ["testit' (i386)."])
 
         # Break inside the main.
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         # We should be able to launch the i386 executable as well.
         self.runCmd("run", RUN_SUCCEEDED)

Modified: lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py (original)
+++ lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py Fri Sep 21 19:05:11 2012
@@ -4,6 +4,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class SBFormattersAPITestCase(TestBase):
 
@@ -42,10 +43,7 @@
         """Test Python APIs for working with formatters"""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -304,10 +302,7 @@
         """Test that one can have the public API return non-synthetic SBValues if desired"""
         self.runCmd("file no_synth", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/python_api/sbdata/TestSBData.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/sbdata/TestSBData.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/python_api/sbdata/TestSBData.py (original)
+++ lldb/trunk/test/python_api/sbdata/TestSBData.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import pexpect
 from lldbtest import *
 from math import fabs
+import lldbutil
 
 class SBDataAPICase(TestBase):
 
@@ -36,10 +37,7 @@
         """Test the SBData APIs."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
         
-        self.expect("breakpoint set -f main.cpp -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-                    startstr = "Breakpoint created: 1: file ='main.cpp', line = %d, locations = 1" %
-                    self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
         
         self.runCmd("run", RUN_SUCCEEDED)
         

Modified: lldb/trunk/test/source-manager/TestSourceManager.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/source-manager/TestSourceManager.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/source-manager/TestSourceManager.py (original)
+++ lldb/trunk/test/source-manager/TestSourceManager.py Fri Sep 21 19:05:11 2012
@@ -12,6 +12,7 @@
 import unittest2
 import lldb
 from lldbtest import *
+import lldbutil
 
 class SourceManagerTestCase(TestBase):
 
@@ -112,10 +113,7 @@
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d, locations = 1" %
-                        self.line)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/types/AbstractBase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=164433&r1=164432&r2=164433&view=diff
==============================================================================
--- lldb/trunk/test/types/AbstractBase.py (original)
+++ lldb/trunk/test/types/AbstractBase.py Fri Sep 21 19:05:11 2012
@@ -6,6 +6,7 @@
 import re
 import lldb
 from lldbtest import *
+import lldbutil
 
 def Msg(var, val, using_frame_variable):
     return "'%s %s' matches the output (from compiled code): %s" % (
@@ -120,10 +121,7 @@
             break_line = line_number ("basic_type.cpp", "// Break here to test block captured variables.")
         else:
             break_line = line_number ("basic_type.cpp", "// Here is the line we will break on to check variables.")
-        self.expect("breakpoint set -f basic_type.cpp -l %d" % break_line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='basic_type.cpp', line = %d, locations = 1" %
-                        break_line)
+        lldbutil.run_break_set_by_file_and_line (self, "basic_type.cpp", break_line, num_expected_locations=1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("process status", STOPPED_DUE_TO_BREAKPOINT,
@@ -204,10 +202,8 @@
             break_line = line_number ("basic_type.cpp", "// Break here to test block captured variables.")
         else:
             break_line = line_number ("basic_type.cpp", "// Here is the line we will break on to check variables.")
-        self.expect("breakpoint set -f basic_type.cpp -l %d" % break_line,
-                    BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='basic_type.cpp', line = %d, locations = 1" %
-                        break_line)
+        lldbutil.run_break_set_by_file_and_line (self, "basic_type.cpp", break_line, num_expected_locations=1, loc_exact=True)
+
         self.runCmd("run", RUN_SUCCEEDED)
         self.expect("process status", STOPPED_DUE_TO_BREAKPOINT,
             substrs = [" at basic_type.cpp:%d" % break_line,





More information about the lldb-commits mailing list