Cleaned up the SBWatchpoint public API.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141876 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/lldb/API/SBDefines.h b/include/lldb/API/SBDefines.h
index 5731b91..42642f9 100644
--- a/include/lldb/API/SBDefines.h
+++ b/include/lldb/API/SBDefines.h
@@ -63,7 +63,7 @@
 class SBTypeList;
 class SBValue;
 class SBValueList;
-class SBWatchpointLocation;
+class SBWatchpoint;
 
 }
 
diff --git a/include/lldb/API/SBError.h b/include/lldb/API/SBError.h
index 9715581..3b6b90f 100644
--- a/include/lldb/API/SBError.h
+++ b/include/lldb/API/SBError.h
@@ -81,6 +81,7 @@
     friend class SBThread;
     friend class SBTarget;
     friend class SBValue;
+    friend class SBWatchpoint;
 
     lldb_private::Error *
     get();
diff --git a/include/lldb/API/SBStream.h b/include/lldb/API/SBStream.h
index 33ded97..44e3a81 100644
--- a/include/lldb/API/SBStream.h
+++ b/include/lldb/API/SBStream.h
@@ -77,7 +77,7 @@
     friend class SBTarget;
     friend class SBThread;
     friend class SBValue;
-    friend class SBWatchpointLocation;
+    friend class SBWatchpoint;
 
 #ifndef SWIG
 
diff --git a/include/lldb/API/SBTarget.h b/include/lldb/API/SBTarget.h
index 27f9022..a06d6a5 100644
--- a/include/lldb/API/SBTarget.h
+++ b/include/lldb/API/SBTarget.h
@@ -16,7 +16,7 @@
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBFileSpecList.h"
 #include "lldb/API/SBType.h"
-#include "lldb/API/SBWatchpointLocation.h"
+#include "lldb/API/SBWatchpoint.h"
 
 namespace lldb {
 
@@ -452,28 +452,28 @@
     DeleteAllBreakpoints ();
 
     uint32_t
-    GetNumWatchpointLocations () const;
+    GetNumWatchpoints () const;
 
-    lldb::SBWatchpointLocation
-    GetLastCreatedWatchpointLocation ();
-
-    lldb::SBWatchpointLocation
-    GetWatchpointLocationAtIndex (uint32_t idx) const;
+    lldb::SBWatchpoint
+    GetWatchpointAtIndex (uint32_t idx) const;
 
     bool
-    WatchpointLocationDelete (watch_id_t watch_id);
+    DeleteWatchpoint (lldb::watch_id_t watch_id);
 
-    lldb::SBWatchpointLocation
-    FindWatchpointLocationByID (watch_id_t watch_id);
+    lldb::SBWatchpoint
+    FindWatchpointByID (lldb::watch_id_t watch_id);
+
+    lldb::SBWatchpoint
+    WatchAddress (lldb::addr_t addr, size_t size, bool read, bool write);
 
     bool
-    EnableAllWatchpointLocations ();
+    EnableAllWatchpoints ();
 
     bool
-    DisableAllWatchpointLocations ();
+    DisableAllWatchpoints ();
 
     bool
-    DeleteAllWatchpointLocations ();
+    DeleteAllWatchpoints ();
 
     lldb::SBBroadcaster
     GetBroadcaster () const;
diff --git a/include/lldb/API/SBValue.h b/include/lldb/API/SBValue.h
index 8560738..371dd70 100644
--- a/include/lldb/API/SBValue.h
+++ b/include/lldb/API/SBValue.h
@@ -275,6 +275,58 @@
 
     SBValue (const lldb::ValueObjectSP &value_sp);
 
+    //------------------------------------------------------------------
+    /// Watch this value if it resides in memory.
+    ///
+    /// Sets a watchpoint on the value.
+    ///
+    /// @param[in] resolve_location
+    ///     Resolve the location of this value once and watch its address.
+    ///     This value must currently be set to \b true as watching all
+    ///     locations of a variable or a variable path is not yet supported,
+    ///     though we plan to support it in the future.
+    ///
+    /// @param[in] read
+    ///     Stop when this value is accessed.
+    ///
+    /// @param[in] write
+    ///     Stop when this value is modified
+    ///
+    /// @return
+    ///     An SBWatchpoint object. This object might not be valid upon
+    ///     return due to a value not being contained in memory, too 
+    ///     large, or watchpoint resources are not available or all in
+    ///     use.
+    //------------------------------------------------------------------
+    lldb::SBWatchpoint
+    Watch (bool resolve_location, bool read, bool write);
+
+    //------------------------------------------------------------------
+    /// Watch this value that this value points to in memory
+    ///
+    /// Sets a watchpoint on the value.
+    ///
+    /// @param[in] resolve_location
+    ///     Resolve the location of this value once and watch its address.
+    ///     This value must currently be set to \b true as watching all
+    ///     locations of a variable or a variable path is not yet supported,
+    ///     though we plan to support it in the future.
+    ///
+    /// @param[in] read
+    ///     Stop when this value is accessed.
+    ///
+    /// @param[in] write
+    ///     Stop when this value is modified
+    ///
+    /// @return
+    ///     An SBWatchpoint object. This object might not be valid upon
+    ///     return due to a value not being contained in memory, too 
+    ///     large, or watchpoint resources are not available or all in
+    ///     use.
+    //------------------------------------------------------------------
+    lldb::SBWatchpoint
+    WatchPointee (bool resolve_location, bool read, bool write);
+
 #ifndef SWIG
     // this must be defined in the .h file because synthetic children as implemented in the core
     // currently rely on being able to extract the SharedPointer out of an SBValue. if the implementation
diff --git a/include/lldb/API/SBWatchpoint.h b/include/lldb/API/SBWatchpoint.h
new file mode 100644
index 0000000..16cebb9
--- /dev/null
+++ b/include/lldb/API/SBWatchpoint.h
@@ -0,0 +1,95 @@
+//===-- SBWatchpoint.h ----------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SBWatchpoint_h_
+#define LLDB_SBWatchpoint_h_
+
+#include "lldb/API/SBDefines.h"
+
+namespace lldb {
+
+class SBWatchpoint
+{
+public:
+
+    SBWatchpoint ();
+
+    SBWatchpoint (const lldb::SBWatchpoint &rhs);
+
+    ~SBWatchpoint ();
+
+#ifndef SWIG
+    const lldb::SBWatchpoint &
+    operator = (const lldb::SBWatchpoint &rhs);
+#endif
+
+    lldb::SBError
+    GetError ();
+
+    watch_id_t
+    GetID ();
+
+    bool
+    IsValid() const;
+
+    /// With -1 representing an invalid hardware index.
+    int32_t
+    GetHardwareIndex ();
+
+    lldb::addr_t
+    GetWatchAddress ();
+
+    size_t
+    GetWatchSize();
+
+    void
+    SetEnabled(bool enabled);
+
+    bool
+    IsEnabled ();
+
+    uint32_t
+    GetHitCount ();
+
+    uint32_t
+    GetIgnoreCount ();
+
+    void
+    SetIgnoreCount (uint32_t n);
+
+    bool
+    GetDescription (lldb::SBStream &description, DescriptionLevel level);
+
+#ifndef SWIG
+    SBWatchpoint (const lldb::WatchpointLocationSP &watch_loc_sp);
+#endif
+
+private:
+    friend class SBTarget;
+
+#ifndef SWIG
+
+    lldb_private::WatchpointLocation *
+    operator->();
+
+    lldb_private::WatchpointLocation *
+    get();
+
+    lldb::WatchpointLocationSP &
+    operator *();
+
+#endif
+
+    lldb::WatchpointLocationSP m_opaque_sp;
+
+};
+
+} // namespace lldb
+
+#endif  // LLDB_SBWatchpoint_h_
diff --git a/include/lldb/API/SBWatchpointLocation.h b/include/lldb/API/SBWatchpointLocation.h
deleted file mode 100644
index 632ccd5..0000000
--- a/include/lldb/API/SBWatchpointLocation.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//===-- SBWatchpointLocation.h ----------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_SBWatchpointLocation_h_
-#define LLDB_SBWatchpointLocation_h_
-
-#include "lldb/API/SBDefines.h"
-
-namespace lldb {
-
-class SBWatchpointLocation
-{
-public:
-
-    SBWatchpointLocation ();
-
-    SBWatchpointLocation (const lldb::SBWatchpointLocation &rhs);
-
-    ~SBWatchpointLocation ();
-
-#ifndef SWIG
-    const lldb::SBWatchpointLocation &
-    operator = (const lldb::SBWatchpointLocation &rhs);
-#endif
-
-    watch_id_t
-    GetID () const;
-
-    bool
-    IsValid() const;
-
-    /// With -1 representing an invalid hardware index.
-    int32_t
-    GetHardwareIndex () const;
-
-    lldb::addr_t
-    GetWatchAddress () const;
-
-    size_t
-    GetWatchSize() const;
-
-    void
-    SetEnabled(bool enabled);
-
-    bool
-    IsEnabled ();
-
-    uint32_t
-    GetHitCount () const;
-
-    uint32_t
-    GetIgnoreCount ();
-
-    void
-    SetIgnoreCount (uint32_t n);
-
-    bool
-    GetDescription (lldb::SBStream &description, DescriptionLevel level);
-
-#ifndef SWIG
-    SBWatchpointLocation (const lldb::WatchpointLocationSP &watch_loc_sp);
-#endif
-
-private:
-    friend class SBTarget;
-
-#ifndef SWIG
-
-    lldb_private::WatchpointLocation *
-    operator->() const;
-
-    lldb_private::WatchpointLocation *
-    get() const;
-
-    lldb::WatchpointLocationSP &
-    operator *();
-
-    const lldb::WatchpointLocationSP &
-    operator *() const;
-
-#endif
-
-    lldb::WatchpointLocationSP m_opaque_sp;
-
-};
-
-} // namespace lldb
-
-#endif  // LLDB_SBWatchpointLocation_h_
diff --git a/lldb.xcodeproj/project.pbxproj b/lldb.xcodeproj/project.pbxproj
index 3c646da..50c8fcd 100644
--- a/lldb.xcodeproj/project.pbxproj
+++ b/lldb.xcodeproj/project.pbxproj
@@ -452,8 +452,8 @@
 		B271B11413D6139300C3FEDB /* FormatClasses.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94A9112D13D5DF210046D8A6 /* FormatClasses.cpp */; };
 		B27318421416AC12006039C8 /* WatchpointLocationList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27318411416AC12006039C8 /* WatchpointLocationList.cpp */; };
 		B28058A1139988B0002D96D0 /* InferiorCallPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28058A0139988B0002D96D0 /* InferiorCallPOSIX.cpp */; };
-		B2A58722143119810092BFBA /* SBWatchpointLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A58721143119810092BFBA /* SBWatchpointLocation.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		B2A58724143119D50092BFBA /* SBWatchpointLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A58723143119D50092BFBA /* SBWatchpointLocation.cpp */; };
+		B2A58722143119810092BFBA /* SBWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A58721143119810092BFBA /* SBWatchpoint.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		B2A58724143119D50092BFBA /* SBWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A58723143119D50092BFBA /* SBWatchpoint.cpp */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -1368,9 +1368,9 @@
 		B287E63E12EFAE2C00C9BEFE /* ARMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMDefines.h; path = Utility/ARMDefines.h; sourceTree = "<group>"; };
 		B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectVersion.cpp; path = source/Commands/CommandObjectVersion.cpp; sourceTree = "<group>"; };
 		B296983512C2FB2B002D92C3 /* CommandObjectVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectVersion.h; path = source/Commands/CommandObjectVersion.h; sourceTree = "<group>"; };
-		B2A58721143119810092BFBA /* SBWatchpointLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBWatchpointLocation.h; path = include/lldb/API/SBWatchpointLocation.h; sourceTree = "<group>"; };
-		B2A58723143119D50092BFBA /* SBWatchpointLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBWatchpointLocation.cpp; path = source/API/SBWatchpointLocation.cpp; sourceTree = "<group>"; };
-		B2A5872514313B480092BFBA /* SBWatchpointLocation.i */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; path = SBWatchpointLocation.i; sourceTree = "<group>"; };
+		B2A58721143119810092BFBA /* SBWatchpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBWatchpoint.h; path = include/lldb/API/SBWatchpoint.h; sourceTree = "<group>"; };
+		B2A58723143119D50092BFBA /* SBWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBWatchpoint.cpp; path = source/API/SBWatchpoint.cpp; sourceTree = "<group>"; };
+		B2A5872514313B480092BFBA /* SBWatchpoint.i */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; path = SBWatchpoint.i; sourceTree = "<group>"; };
 		B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstructionUtils.h; path = Utility/InstructionUtils.h; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
@@ -1732,7 +1732,7 @@
 				2611FF11142D83060017FEA3 /* SBType.i */,
 				2611FF12142D83060017FEA3 /* SBValue.i */,
 				2611FF13142D83060017FEA3 /* SBValueList.i */,
-				B2A5872514313B480092BFBA /* SBWatchpointLocation.i */,
+				B2A5872514313B480092BFBA /* SBWatchpoint.i */,
 			);
 			name = interface;
 			path = scripts/Python/interface;
@@ -1842,8 +1842,8 @@
 				9A19A6AD1163BB9800E0D453 /* SBValue.cpp */,
 				9A357582116CFDEE00E8ED2F /* SBValueList.h */,
 				9A35758D116CFE0F00E8ED2F /* SBValueList.cpp */,
-				B2A58723143119D50092BFBA /* SBWatchpointLocation.cpp */,
-				B2A58721143119810092BFBA /* SBWatchpointLocation.h */,
+				B2A58723143119D50092BFBA /* SBWatchpoint.cpp */,
+				B2A58721143119810092BFBA /* SBWatchpoint.h */,
 			);
 			name = API;
 			sourceTree = "<group>";
@@ -2882,7 +2882,7 @@
 				4CF52AF51428291E0051E832 /* SBFileSpecList.h in Headers */,
 				4CAA56131422D96A001FFA01 /* BreakpointResolverFileRegex.h in Headers */,
 				26B8283D142D01E9002DBC64 /* SBSection.h in Headers */,
-				B2A58722143119810092BFBA /* SBWatchpointLocation.h in Headers */,
+				B2A58722143119810092BFBA /* SBWatchpoint.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3171,7 +3171,7 @@
 				4CAA56151422D986001FFA01 /* BreakpointResolverFileRegex.cpp in Sources */,
 				4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */,
 				26B82840142D020F002DBC64 /* SBSection.cpp in Sources */,
-				B2A58724143119D50092BFBA /* SBWatchpointLocation.cpp in Sources */,
+				B2A58724143119D50092BFBA /* SBWatchpoint.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3577,6 +3577,7 @@
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+				DEBUG_INFORMATION_FORMAT = dwarf;
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PREPROCESSOR_DEFINITIONS = (
@@ -3613,6 +3614,7 @@
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					__STDC_CONSTANT_MACROS,
@@ -3646,7 +3648,6 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COPY_PHASE_STRIP = NO;
-				DEBUG_INFORMATION_FORMAT = dwarf;
 				FRAMEWORK_SEARCH_PATHS = /System/Library/PrivateFrameworks;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_OPTIMIZATION_LEVEL = 0;
@@ -3661,7 +3662,6 @@
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				COPY_PHASE_STRIP = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = /System/Library/PrivateFrameworks;
 				INSTALL_PATH = /Developer/usr/bin;
 				ONLY_ACTIVE_ARCH = NO;
@@ -3673,7 +3673,6 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = /System/Library/PrivateFrameworks;
 				INSTALL_PATH = /Developer/usr/bin;
 				ONLY_ACTIVE_ARCH = NO;
@@ -3687,7 +3686,6 @@
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				COPY_PHASE_STRIP = NO;
 				CURRENT_PROJECT_VERSION = 80;
-				DEBUG_INFORMATION_FORMAT = dwarf;
 				DYLIB_COMPATIBILITY_VERSION = 1;
 				DYLIB_CURRENT_VERSION = 80;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
@@ -3739,7 +3737,6 @@
 				COPY_PHASE_STRIP = NO;
 				CURRENT_PROJECT_VERSION = 80;
 				DEAD_CODE_STRIPPING = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DYLIB_COMPATIBILITY_VERSION = 1;
 				DYLIB_CURRENT_VERSION = 80;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
@@ -3826,7 +3823,6 @@
 			buildSettings = {
 				COPY_PHASE_STRIP = NO;
 				CURRENT_PROJECT_VERSION = 80;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DYLIB_CURRENT_VERSION = 80;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -3865,7 +3861,6 @@
 			buildSettings = {
 				COPY_PHASE_STRIP = NO;
 				CURRENT_PROJECT_VERSION = 80;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DYLIB_CURRENT_VERSION = 80;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -3904,6 +3899,7 @@
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					__STDC_CONSTANT_MACROS,
@@ -3938,7 +3934,6 @@
 			buildSettings = {
 				COPY_PHASE_STRIP = YES;
 				CURRENT_PROJECT_VERSION = 80;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -3969,7 +3964,6 @@
 				COPY_PHASE_STRIP = YES;
 				CURRENT_PROJECT_VERSION = 80;
 				DEAD_CODE_STRIPPING = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DYLIB_COMPATIBILITY_VERSION = 1;
 				DYLIB_CURRENT_VERSION = 80;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
@@ -4047,7 +4041,6 @@
 				CODE_SIGN_IDENTITY = lldb_codesign;
 				COPY_PHASE_STRIP = YES;
 				DEAD_CODE_STRIPPING = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4096,7 +4089,6 @@
 			buildSettings = {
 				COPY_PHASE_STRIP = NO;
 				CURRENT_PROJECT_VERSION = 80;
-				DEBUG_INFORMATION_FORMAT = dwarf;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4127,7 +4119,6 @@
 			buildSettings = {
 				COPY_PHASE_STRIP = YES;
 				CURRENT_PROJECT_VERSION = 80;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
diff --git a/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme b/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
index 6e12c06..3870379 100644
--- a/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
+++ b/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
@@ -86,7 +86,7 @@
       launchStyle = "0"
       useCustomWorkingDirectory = "NO"
       customWorkingDirectory = "/Volumes/work/gclayton/Documents/devb/attach"
-      buildConfiguration = "Debug"
+      buildConfiguration = "Release"
       ignoresPersistentStateOnLaunch = "YES"
       debugDocumentVersioning = "YES"
       allowLocationSimulation = "YES">
diff --git a/scripts/Python/build-swig-Python.sh b/scripts/Python/build-swig-Python.sh
index 69da019..d719122 100755
--- a/scripts/Python/build-swig-Python.sh
+++ b/scripts/Python/build-swig-Python.sh
@@ -72,7 +72,7 @@
 " ${SRC_ROOT}/include/lldb/API/SBType.h"\
 " ${SRC_ROOT}/include/lldb/API/SBValue.h"\
 " ${SRC_ROOT}/include/lldb/API/SBValueList.h"\
-" ${SRC_ROOT}/include/lldb/API/SBWatchpointLocation.h"\
+" ${SRC_ROOT}/include/lldb/API/SBWatchpoint.h"\
 
 INTERFACE_FILES="${SRC_ROOT}/scripts/Python/interface/SBAddress.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBBlock.i"\
@@ -108,7 +108,7 @@
 " ${SRC_ROOT}/scripts/Python/interface/SBType.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBValue.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBValueList.i"\
-" ${SRC_ROOT}/scripts/Python/interface/SBWatchpointLocation.i"
+" ${SRC_ROOT}/scripts/Python/interface/SBWatchpoint.i"
 
 if [ $Debug == 1 ]
 then
diff --git a/scripts/Python/interface/SBTarget.i b/scripts/Python/interface/SBTarget.i
index f93128d..9c628a6 100644
--- a/scripts/Python/interface/SBTarget.i
+++ b/scripts/Python/interface/SBTarget.i
@@ -442,28 +442,32 @@
     DeleteAllBreakpoints ();
 
     uint32_t
-    GetNumWatchpointLocations () const;
-
-    lldb::SBWatchpointLocation
-    GetLastCreatedWatchpointLocation ();
-
-    lldb::SBWatchpointLocation
-    GetWatchpointLocationAtIndex (uint32_t idx) const;
-
+    GetNumWatchpoints () const;
+    
+    lldb::SBWatchpoint
+    GetWatchpointAtIndex (uint32_t idx) const;
+    
     bool
-    WatchpointLocationDelete (watch_id_t watch_id);
-
-    lldb::SBWatchpointLocation
-    FindWatchpointLocationByID (watch_id_t watch_id);
-
+    DeleteWatchpoint (lldb::watch_id_t watch_id);
+    
+    lldb::SBWatchpoint
+    FindWatchpointByID (lldb::watch_id_t watch_id);
+    
     bool
-    EnableAllWatchpointLocations ();
-
+    EnableAllWatchpoints ();
+    
     bool
-    DisableAllWatchpointLocations ();
-
+    DisableAllWatchpoints ();
+    
     bool
-    DeleteAllWatchpointLocations ();
+    DeleteAllWatchpoints ();
+
+    lldb::SBWatchpoint
+    WatchAddress (lldb::addr_t addr, 
+                  size_t size, 
+                  bool read, 
+                  bool write);
+             
 
     lldb::SBBroadcaster
     GetBroadcaster () const;
diff --git a/scripts/Python/interface/SBValue.i b/scripts/Python/interface/SBValue.i
index 8792464..439e0ab 100644
--- a/scripts/Python/interface/SBValue.i
+++ b/scripts/Python/interface/SBValue.i
@@ -278,6 +278,12 @@
     lldb::SBFrame
     GetFrame();
     
+    lldb::SBWatchpoint
+    Watch (bool resolve_location, bool read, bool write);
+
+    lldb::SBWatchpoint
+    WatchPointee (bool resolve_location, bool read, bool write);
+
     bool
     GetDescription (lldb::SBStream &description);
 
diff --git a/scripts/Python/interface/SBWatchpointLocation.i b/scripts/Python/interface/SBWatchpoint.i
similarity index 75%
rename from scripts/Python/interface/SBWatchpointLocation.i
rename to scripts/Python/interface/SBWatchpoint.i
index a5e21dd..5ddba45 100644
--- a/scripts/Python/interface/SBWatchpointLocation.i
+++ b/scripts/Python/interface/SBWatchpoint.i
@@ -1,4 +1,4 @@
-//===-- SWIG Interface for SBWatchpointLocation -----------------*- C++ -*-===//
+//===-- SWIG Interface for SBWatchpoint -----------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -18,22 +18,22 @@
 
 See also SBTarget.watchpoint_location_iter() for for example usage of iterating
 through the watchpoint locations of the target."
-) SBWatchpointLocation;
-class SBWatchpointLocation
+) SBWatchpoint;
+class SBWatchpoint
 {
 public:
 
-    SBWatchpointLocation ();
+    SBWatchpoint ();
 
-    SBWatchpointLocation (const lldb::SBWatchpointLocation &rhs);
+    SBWatchpoint (const lldb::SBWatchpoint &rhs);
 
-    ~SBWatchpointLocation ();
+    ~SBWatchpoint ();
 
     watch_id_t
-    GetID () const;
+    GetID ();
 
     bool
-    IsValid() const;
+    IsValid();
 
     %feature("docstring", "
     //------------------------------------------------------------------
@@ -41,13 +41,13 @@
     //------------------------------------------------------------------
     ") GetHardwareIndex;
     int32_t
-    GetHardwareIndex () const;
+    GetHardwareIndex ();
 
     lldb::addr_t
-    GetWatchAddress () const;
+    GetWatchAddress ();
 
     size_t
-    GetWatchSize() const;
+    GetWatchSize();
 
     void
     SetEnabled(bool enabled);
@@ -56,7 +56,7 @@
     IsEnabled ();
 
     uint32_t
-    GetHitCount () const;
+    GetHitCount ();
 
     uint32_t
     GetIgnoreCount ();
diff --git a/scripts/Python/modify-python-lldb.py b/scripts/Python/modify-python-lldb.py
index 645d7de..15f42a4 100644
--- a/scripts/Python/modify-python-lldb.py
+++ b/scripts/Python/modify-python-lldb.py
@@ -236,7 +236,7 @@
 #
 e = { 'SBAddress':            ['GetFileAddress', 'GetModule'],
       'SBBreakpoint':         ['GetID'],
-      'SBWatchpointLocation': ['GetID'],
+      'SBWatchpoint':         ['GetID'],
       'SBFileSpec':           ['GetFilename', 'GetDirectory'],
       'SBModule':             ['GetFileSpec', 'GetUUIDString'],
       'SBType':               ['GetByteSize', 'GetName']
diff --git a/scripts/Python/python-extensions.swig b/scripts/Python/python-extensions.swig
index 5c302ba..52ec68e 100644
--- a/scripts/Python/python-extensions.swig
+++ b/scripts/Python/python-extensions.swig
@@ -160,8 +160,8 @@
                 return PyString_FromString (description.GetData());
         }
 }
-%extend lldb::SBWatchpointLocation {
-        PyObject *lldb::SBWatchpointLocation::__repr__ (){
+%extend lldb::SBWatchpoint {
+        PyObject *lldb::SBWatchpoint::__repr__ (){
                 lldb::SBStream description;
                 $self->GetDescription (description, lldb::eDescriptionLevelVerbose);
                 return PyString_FromString (description.GetData());
diff --git a/scripts/lldb.swig b/scripts/lldb.swig
index 1996aab..a4218cc 100644
--- a/scripts/lldb.swig
+++ b/scripts/lldb.swig
@@ -79,7 +79,7 @@
 #include "lldb/API/SBType.h"
 #include "lldb/API/SBValue.h"
 #include "lldb/API/SBValueList.h"
-#include "lldb/API/SBWatchpointLocation.h"
+#include "lldb/API/SBWatchpoint.h"
 %}
 
 /* Various liblldb typedefs that SWIG needs to know about.  */
@@ -132,7 +132,7 @@
 %include "./Python/interface/SBType.i"
 %include "./Python/interface/SBValue.i"
 %include "./Python/interface/SBValueList.i"
-%include "./Python/interface/SBWatchpointLocation.i"
+%include "./Python/interface/SBWatchpoint.i"
 
 %include "./Python/python-extensions.swig"
 
diff --git a/source/API/SBTarget.cpp b/source/API/SBTarget.cpp
index 64af22a..3cdfe1d 100644
--- a/source/API/SBTarget.cpp
+++ b/source/API/SBTarget.cpp
@@ -883,7 +883,7 @@
 }
 
 uint32_t
-SBTarget::GetNumWatchpointLocations () const
+SBTarget::GetNumWatchpoints () const
 {
     if (m_opaque_sp)
     {
@@ -893,31 +893,10 @@
     return 0;
 }
 
-SBWatchpointLocation
-SBTarget::GetLastCreatedWatchpointLocation ()
+SBWatchpoint
+SBTarget::GetWatchpointAtIndex (uint32_t idx) const
 {
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-
-    SBWatchpointLocation sb_watchpoint_location;
-    if (m_opaque_sp)
-    {
-        Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
-        sb_watchpoint_location = m_opaque_sp->GetLastCreatedWatchpointLocation();
-    }
-
-    if (log)
-    {
-        log->Printf ("SBTarget(%p)::GetLastCreateWatchpointLocation () => SBWatchpointLocation(%p)", 
-                     m_opaque_sp.get(), sb_watchpoint_location.get());
-    }
-
-    return sb_watchpoint_location;
-}
-
-SBWatchpointLocation
-SBTarget::GetWatchpointLocationAtIndex (uint32_t idx) const
-{
-    SBWatchpointLocation sb_watchpoint_location;
+    SBWatchpoint sb_watchpoint_location;
     if (m_opaque_sp)
     {
         // The watchpoint location list is thread safe, no need to lock
@@ -927,7 +906,7 @@
 }
 
 bool
-SBTarget::WatchpointLocationDelete (watch_id_t wp_id)
+SBTarget::DeleteWatchpoint (watch_id_t wp_id)
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
@@ -946,29 +925,51 @@
     return result;
 }
 
-SBWatchpointLocation
-SBTarget::FindWatchpointLocationByID (watch_id_t wp_id)
+SBWatchpoint
+SBTarget::FindWatchpointByID (lldb::watch_id_t wp_id)
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
-    SBWatchpointLocation sb_watchpoint_location;
+    SBWatchpoint sb_watchpoint;
     if (m_opaque_sp && wp_id != LLDB_INVALID_WATCH_ID)
     {
         Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
-        *sb_watchpoint_location = m_opaque_sp->GetWatchpointLocationList().FindByID(wp_id);
+        *sb_watchpoint = m_opaque_sp->GetWatchpointLocationList().FindByID(wp_id);
     }
 
     if (log)
     {
-        log->Printf ("SBTarget(%p)::FindWatchpointLocationByID (bp_id=%d) => SBWatchpointLocation(%p)", 
-                     m_opaque_sp.get(), (uint32_t) wp_id, sb_watchpoint_location.get());
+        log->Printf ("SBTarget(%p)::FindWatchpointLocationByID (bp_id=%d) => SBWatchpoint(%p)", 
+                     m_opaque_sp.get(), (uint32_t) wp_id, sb_watchpoint.get());
     }
 
-    return sb_watchpoint_location;
+    return sb_watchpoint;
+}
+
+lldb::SBWatchpoint
+SBTarget::WatchAddress (lldb::addr_t addr, size_t size, bool read, bool write)
+{
+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    
+    SBWatchpoint sb_watchpoint;
+    if (m_opaque_sp)
+    {
+        Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
+        // TODO: Johnny fill this in
+        //*sb_watchpoint = m_opaque_sp->GetWatchpointLocationList().FindByID(wp_id);
+    }
+    
+    if (log)
+    {
+        log->Printf ("SBTarget(%p)::WatchAddress (addr=0x%llx, 0x%u) => SBWatchpoint(%p)", 
+                     m_opaque_sp.get(), addr, (uint32_t) size, sb_watchpoint.get());
+    }
+    
+    return sb_watchpoint;
 }
 
 bool
-SBTarget::EnableAllWatchpointLocations ()
+SBTarget::EnableAllWatchpoints ()
 {
     if (m_opaque_sp)
     {
@@ -980,7 +981,7 @@
 }
 
 bool
-SBTarget::DisableAllWatchpointLocations ()
+SBTarget::DisableAllWatchpoints ()
 {
     if (m_opaque_sp)
     {
@@ -992,7 +993,7 @@
 }
 
 bool
-SBTarget::DeleteAllWatchpointLocations ()
+SBTarget::DeleteAllWatchpoints ()
 {
     if (m_opaque_sp)
     {
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index 37a5244..8afd564 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -1097,3 +1097,31 @@
     
     return sb_data;
 }
+
+lldb::SBWatchpoint
+SBValue::Watch (bool resolve_location, bool read, bool write)
+{
+    lldb::SBWatchpoint sb_watchpoint;
+    Target* target = m_opaque_sp->GetUpdatePoint().GetTargetSP().get();
+    if (target)
+    {
+        Mutex::Locker api_locker (target->GetAPIMutex());
+        // TODO: Johnny fill this in
+    }
+    return sb_watchpoint;
+}
+
+lldb::SBWatchpoint
+SBValue::WatchPointee (bool resolve_location, bool read, bool write)
+{
+    lldb::SBWatchpoint sb_watchpoint;
+    Target* target = m_opaque_sp->GetUpdatePoint().GetTargetSP().get();
+    if (target)
+    {
+        Mutex::Locker api_locker (target->GetAPIMutex());
+        // TODO: Johnny fill this in
+    }
+    return sb_watchpoint;
+}
+
+
diff --git a/source/API/SBWatchpointLocation.cpp b/source/API/SBWatchpoint.cpp
similarity index 69%
rename from source/API/SBWatchpointLocation.cpp
rename to source/API/SBWatchpoint.cpp
index 33b035f..a921ea1 100644
--- a/source/API/SBWatchpointLocation.cpp
+++ b/source/API/SBWatchpoint.cpp
@@ -1,4 +1,4 @@
-//===-- SBWatchpointLocation.cpp --------------------------------*- C++ -*-===//
+//===-- SBWatchpoint.cpp --------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/API/SBWatchpointLocation.h"
+#include "lldb/API/SBWatchpoint.h"
 #include "lldb/API/SBDefines.h"
 #include "lldb/API/SBAddress.h"
 #include "lldb/API/SBDebugger.h"
@@ -26,12 +26,12 @@
 using namespace lldb_private;
 
 
-SBWatchpointLocation::SBWatchpointLocation () :
+SBWatchpoint::SBWatchpoint () :
     m_opaque_sp ()
 {
 }
 
-SBWatchpointLocation::SBWatchpointLocation (const lldb::WatchpointLocationSP &watch_loc_sp) :
+SBWatchpoint::SBWatchpoint (const lldb::WatchpointLocationSP &watch_loc_sp) :
     m_opaque_sp (watch_loc_sp)
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
@@ -40,18 +40,18 @@
     {
         SBStream sstr;
         GetDescription (sstr, lldb::eDescriptionLevelBrief);
-        log->Printf ("SBWatchpointLocation::SBWatchpointLocation (const lldb::WatchpointLocationsSP &watch_loc_sp"
+        log->Printf ("SBWatchpoint::SBWatchpoint (const lldb::WatchpointLocationsSP &watch_loc_sp"
                      "=%p)  => this.sp = %p (%s)", watch_loc_sp.get(), m_opaque_sp.get(), sstr.GetData());
     }
 }
 
-SBWatchpointLocation::SBWatchpointLocation(const SBWatchpointLocation &rhs) :
+SBWatchpoint::SBWatchpoint(const SBWatchpoint &rhs) :
     m_opaque_sp (rhs.m_opaque_sp)
 {
 }
 
-const SBWatchpointLocation &
-SBWatchpointLocation::operator = (const SBWatchpointLocation &rhs)
+const SBWatchpoint &
+SBWatchpoint::operator = (const SBWatchpoint &rhs)
 {
     if (this != &rhs)
         m_opaque_sp = rhs.m_opaque_sp;
@@ -59,12 +59,12 @@
 }
 
 
-SBWatchpointLocation::~SBWatchpointLocation ()
+SBWatchpoint::~SBWatchpoint ()
 {
 }
 
 watch_id_t
-SBWatchpointLocation::GetID () const
+SBWatchpoint::GetID ()
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
@@ -75,22 +75,41 @@
     if (log)
     {
         if (watch_id == LLDB_INVALID_WATCH_ID)
-            log->Printf ("SBWatchpointLocation(%p)::GetID () => LLDB_INVALID_WATCH_ID", m_opaque_sp.get());
+            log->Printf ("SBWatchpoint(%p)::GetID () => LLDB_INVALID_WATCH_ID", m_opaque_sp.get());
         else
-            log->Printf ("SBWatchpointLocation(%p)::GetID () => %u", m_opaque_sp.get(), watch_id);
+            log->Printf ("SBWatchpoint(%p)::GetID () => %u", m_opaque_sp.get(), watch_id);
     }
 
     return watch_id;
 }
 
 bool
-SBWatchpointLocation::IsValid() const
+SBWatchpoint::IsValid() const
 {
     return m_opaque_sp.get() != NULL;
+#if 0
+    if (m_opaque_sp)
+        return m_opaque_sp->GetError().Success();
+    return false;
+#endif
+}
+
+SBError
+SBWatchpoint::GetError ()
+{
+    SBError sb_error;
+#if 0
+    if (m_opaque_sp)
+    {
+        // TODO: Johnny fill this in
+        sb_error.ref() = m_opaque_sp->GetError();
+    }
+#endif
+    return sb_error;
 }
 
 int32_t
-SBWatchpointLocation::GetHardwareIndex () const
+SBWatchpoint::GetHardwareIndex ()
 {
     int32_t hw_index = -1;
 
@@ -104,7 +123,7 @@
 }
 
 addr_t
-SBWatchpointLocation::GetWatchAddress () const
+SBWatchpoint::GetWatchAddress ()
 {
     addr_t ret_addr = LLDB_INVALID_ADDRESS;
 
@@ -118,7 +137,7 @@
 }
 
 size_t
-SBWatchpointLocation::GetWatchSize () const
+SBWatchpoint::GetWatchSize ()
 {
     size_t watch_size = 0;
 
@@ -132,7 +151,7 @@
 }
 
 void
-SBWatchpointLocation::SetEnabled (bool enabled)
+SBWatchpoint::SetEnabled (bool enabled)
 {
     if (m_opaque_sp)
     {
@@ -142,7 +161,7 @@
 }
 
 bool
-SBWatchpointLocation::IsEnabled ()
+SBWatchpoint::IsEnabled ()
 {
     if (m_opaque_sp)
     {
@@ -154,7 +173,7 @@
 }
 
 uint32_t
-SBWatchpointLocation::GetHitCount () const
+SBWatchpoint::GetHitCount ()
 {
     uint32_t count = 0;
     if (m_opaque_sp)
@@ -165,13 +184,13 @@
 
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBWatchpointLocation(%p)::GetHitCount () => %u", m_opaque_sp.get(), count);
+        log->Printf ("SBWatchpoint(%p)::GetHitCount () => %u", m_opaque_sp.get(), count);
 
     return count;
 }
 
 uint32_t
-SBWatchpointLocation::GetIgnoreCount ()
+SBWatchpoint::GetIgnoreCount ()
 {
     if (m_opaque_sp)
     {
@@ -183,7 +202,7 @@
 }
 
 void
-SBWatchpointLocation::SetIgnoreCount (uint32_t n)
+SBWatchpoint::SetIgnoreCount (uint32_t n)
 {
     if (m_opaque_sp)
     {
@@ -193,7 +212,7 @@
 }
 
 bool
-SBWatchpointLocation::GetDescription (SBStream &description, DescriptionLevel level)
+SBWatchpoint::GetDescription (SBStream &description, DescriptionLevel level)
 {
     if (m_opaque_sp)
     {
@@ -209,26 +228,19 @@
 }
 
 lldb_private::WatchpointLocation *
-SBWatchpointLocation::operator->() const
+SBWatchpoint::operator->()
 {
     return m_opaque_sp.get();
 }
 
 lldb_private::WatchpointLocation *
-SBWatchpointLocation::get() const
+SBWatchpoint::get()
 {
     return m_opaque_sp.get();
 }
 
 lldb::WatchpointLocationSP &
-SBWatchpointLocation::operator *()
+SBWatchpoint::operator *()
 {
     return m_opaque_sp;
 }
-
-const lldb::WatchpointLocationSP &
-SBWatchpointLocation::operator *() const
-{
-    return m_opaque_sp;
-}
-