[Lldb-commits] [PATCH] D74903: [lldb][testsuite] Create a SBDebugger instance for each test

2020-03-04 Thread Tatyana Krasnukha via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa31130f6fcf2: [lldb][testsuite] Create a SBDebugger instance 
for each test (authored by tatyana-krasnukha).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74903/new/

https://reviews.llvm.org/D74903

Files:
  lldb/bindings/interface/SBPlatform.i
  lldb/include/lldb/API/SBPlatform.h
  lldb/packages/Python/lldbsuite/test/decorators.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/source/API/SBPlatform.cpp
  
lldb/test/API/commands/target/auto-install-main-executable/TestAutoInstallMainExecutable.py
  
lldb/test/API/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
  
lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
  lldb/test/API/functionalities/gdb_remote_client/TestWasm.py
  lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py
  lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py
  lldb/test/API/functionalities/plugins/command_plugin/TestPluginCommands.py
  lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
  lldb/test/API/functionalities/postmortem/elf-core/gcore/TestGCore.py
  
lldb/test/API/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py
  lldb/test/API/functionalities/postmortem/mach-core/TestMachCore.py
  lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
  lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py
  lldb/test/API/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
  lldb/test/API/functionalities/thread/backtrace_all/TestBacktraceAll.py
  
lldb/test/API/functionalities/unwind/noreturn/module-end/TestNoReturnModuleEnd.py
  lldb/test/API/macosx/load-kext/TestLoadKext.py
  lldb/test/API/python_api/file_handle/TestFileHandle.py
  
lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py

Index: lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
===
--- lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
+++ lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
@@ -10,14 +10,6 @@
 class TestPlatformProcessConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
 mydir = TestBase.compute_mydir(__file__)
 
-def setUp(self):
-super(TestPlatformProcessConnect, self).setUp()
-self._initial_platform = lldb.DBG.GetSelectedPlatform()
-
-def tearDown(self):
-lldb.DBG.SetSelectedPlatform(self._initial_platform)
-super(TestPlatformProcessConnect, self).tearDown()
-
 @llgs_test
 @no_debug_info_test
 @skipIf(remote=False)
@@ -66,16 +58,10 @@
 
 socket_id = lldbutil.wait_for_file_on_target(self, port_file)
 
-new_debugger = lldb.SBDebugger.Create()
-new_debugger.SetAsync(False)
-
-def del_debugger(new_debugger=new_debugger):
-del new_debugger
-self.addTearDownHook(del_debugger)
+self.dbg.SetAsync(False)
 
 new_platform = lldb.SBPlatform(lldb.remote_platform.GetName())
-new_debugger.SetSelectedPlatform(new_platform)
-new_interpreter = new_debugger.GetCommandInterpreter()
+self.dbg.SetSelectedPlatform(new_platform)
 
 if unix_protocol:
 connect_url = "%s://%s%s" % (protocol, hostname, socket_id)
@@ -84,13 +70,13 @@
 
 command = "platform connect %s" % (connect_url)
 result = lldb.SBCommandReturnObject()
-new_interpreter.HandleCommand(command, result)
+self.dbg.GetCommandInterpreter().HandleCommand(command, result)
 self.assertTrue(
 result.Succeeded(),
 "platform process connect failed: %s" %
 result.GetOutput())
 
-target = new_debugger.GetSelectedTarget()
+target = self.dbg.GetSelectedTarget()
 process = target.GetProcess()
 thread = process.GetThreadAtIndex(0)
 
Index: lldb/test/API/python_api/file_handle/TestFileHandle.py
===
--- lldb/test/API/python_api/file_handle/TestFileHandle.py
+++ lldb/test/API/python_api/file_handle/TestFileHandle.py
@@ -82,12 +82,7 @@
 NO_DEBUG_INFO_TESTCASE = True
 mydir = lldbtest.Base.compute_mydir(__file__)
 
-# The way this class interacts with the debugger is different
-# than normal.   Most of these test cases will mess with the
-# debugger I/O streams, so we want a fresh debugger for each
-# test so those mutations don't interfere with each other.

[Lldb-commits] [PATCH] D74903: [lldb][testsuite] Create a SBDebugger instance for each test

2020-03-04 Thread Jim Ingham via Phabricator via lldb-commits
jingham accepted this revision.
jingham added a comment.

Seems great to me.  Getting the host platform is a generally useful thing to be 
able to do, and I can't think of anything you would want to add to this, so 
that is fine to.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74903/new/

https://reviews.llvm.org/D74903



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D74903: [lldb][testsuite] Create a SBDebugger instance for each test

2020-03-04 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a reviewer: jingham.
labath added a comment.
This revision is now accepted and ready to land.

This is a great cleanup.

I don't believe the addition of the new SBPlatform interface is an issue, but 
I've added @jingham just in case he has any thoughts on that. Please give him a 
chance to comment on this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74903/new/

https://reviews.llvm.org/D74903



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D74903: [lldb][testsuite] Create a SBDebugger instance for each test

2020-03-03 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha updated this revision to Diff 247928.
tatyana-krasnukha added a comment.

Moved settings clearing to the separate patch D75537 



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74903/new/

https://reviews.llvm.org/D74903

Files:
  lldb/bindings/interface/SBPlatform.i
  lldb/include/lldb/API/SBPlatform.h
  lldb/packages/Python/lldbsuite/test/decorators.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/source/API/SBPlatform.cpp
  
lldb/test/API/commands/target/auto-install-main-executable/TestAutoInstallMainExecutable.py
  
lldb/test/API/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
  
lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
  lldb/test/API/functionalities/gdb_remote_client/TestWasm.py
  lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py
  lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py
  lldb/test/API/functionalities/plugins/command_plugin/TestPluginCommands.py
  lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
  lldb/test/API/functionalities/postmortem/elf-core/gcore/TestGCore.py
  
lldb/test/API/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py
  lldb/test/API/functionalities/postmortem/mach-core/TestMachCore.py
  lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
  lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py
  lldb/test/API/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
  lldb/test/API/functionalities/thread/backtrace_all/TestBacktraceAll.py
  
lldb/test/API/functionalities/unwind/noreturn/module-end/TestNoReturnModuleEnd.py
  lldb/test/API/macosx/load-kext/TestLoadKext.py
  lldb/test/API/python_api/file_handle/TestFileHandle.py
  
lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py

Index: lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
===
--- lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
+++ lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
@@ -10,14 +10,6 @@
 class TestPlatformProcessConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
 mydir = TestBase.compute_mydir(__file__)
 
-def setUp(self):
-super(TestPlatformProcessConnect, self).setUp()
-self._initial_platform = lldb.DBG.GetSelectedPlatform()
-
-def tearDown(self):
-lldb.DBG.SetSelectedPlatform(self._initial_platform)
-super(TestPlatformProcessConnect, self).tearDown()
-
 @llgs_test
 @no_debug_info_test
 @skipIf(remote=False)
@@ -66,16 +58,10 @@
 
 socket_id = lldbutil.wait_for_file_on_target(self, port_file)
 
-new_debugger = lldb.SBDebugger.Create()
-new_debugger.SetAsync(False)
-
-def del_debugger(new_debugger=new_debugger):
-del new_debugger
-self.addTearDownHook(del_debugger)
+self.dbg.SetAsync(False)
 
 new_platform = lldb.SBPlatform(lldb.remote_platform.GetName())
-new_debugger.SetSelectedPlatform(new_platform)
-new_interpreter = new_debugger.GetCommandInterpreter()
+self.dbg.SetSelectedPlatform(new_platform)
 
 if unix_protocol:
 connect_url = "%s://%s%s" % (protocol, hostname, socket_id)
@@ -84,13 +70,13 @@
 
 command = "platform connect %s" % (connect_url)
 result = lldb.SBCommandReturnObject()
-new_interpreter.HandleCommand(command, result)
+self.dbg.GetCommandInterpreter().HandleCommand(command, result)
 self.assertTrue(
 result.Succeeded(),
 "platform process connect failed: %s" %
 result.GetOutput())
 
-target = new_debugger.GetSelectedTarget()
+target = self.dbg.GetSelectedTarget()
 process = target.GetProcess()
 thread = process.GetThreadAtIndex(0)
 
Index: lldb/test/API/python_api/file_handle/TestFileHandle.py
===
--- lldb/test/API/python_api/file_handle/TestFileHandle.py
+++ lldb/test/API/python_api/file_handle/TestFileHandle.py
@@ -82,12 +82,7 @@
 NO_DEBUG_INFO_TESTCASE = True
 mydir = lldbtest.Base.compute_mydir(__file__)
 
-# The way this class interacts with the debugger is different
-# than normal.   Most of these test cases will mess with the
-# debugger I/O streams, so we want a fresh debugger for each
-# test so those mutations don't interfere with each other.
-#
-# Also, the way normal tests evaluate debugger c

[Lldb-commits] [PATCH] D74903: [lldb][testsuite] Create a SBDebugger instance for each test

2020-03-03 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Overall, I don't have any big issues with this patch, but overall I see at 
least two distinct issues being handled here: a) changing how the platform 
selection works; and b) auto-clearing of settings. Please split those up into 
separate patches.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74903/new/

https://reviews.llvm.org/D74903



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D74903: [lldb][testsuite] Create a SBDebugger instance for each test

2020-03-03 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha updated this revision to Diff 247908.
tatyana-krasnukha added a comment.

Clear all settings during a test's setUp


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74903/new/

https://reviews.llvm.org/D74903

Files:
  lldb/bindings/interface/SBPlatform.i
  lldb/include/lldb/API/SBPlatform.h
  lldb/packages/Python/lldbsuite/test/decorators.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/source/API/SBPlatform.cpp
  lldb/source/Commands/CommandObjectSettings.cpp
  
lldb/test/API/commands/target/auto-install-main-executable/TestAutoInstallMainExecutable.py
  
lldb/test/API/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
  
lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
  lldb/test/API/functionalities/gdb_remote_client/TestWasm.py
  lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py
  lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py
  lldb/test/API/functionalities/plugins/command_plugin/TestPluginCommands.py
  lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
  lldb/test/API/functionalities/postmortem/elf-core/gcore/TestGCore.py
  
lldb/test/API/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py
  lldb/test/API/functionalities/postmortem/mach-core/TestMachCore.py
  lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
  lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py
  lldb/test/API/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
  lldb/test/API/functionalities/thread/backtrace_all/TestBacktraceAll.py
  
lldb/test/API/functionalities/unwind/noreturn/module-end/TestNoReturnModuleEnd.py
  lldb/test/API/macosx/load-kext/TestLoadKext.py
  lldb/test/API/python_api/file_handle/TestFileHandle.py
  
lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py

Index: lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
===
--- lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
+++ lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
@@ -10,14 +10,6 @@
 class TestPlatformProcessConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
 mydir = TestBase.compute_mydir(__file__)
 
-def setUp(self):
-super(TestPlatformProcessConnect, self).setUp()
-self._initial_platform = lldb.DBG.GetSelectedPlatform()
-
-def tearDown(self):
-lldb.DBG.SetSelectedPlatform(self._initial_platform)
-super(TestPlatformProcessConnect, self).tearDown()
-
 @llgs_test
 @no_debug_info_test
 @skipIf(remote=False)
@@ -66,16 +58,10 @@
 
 socket_id = lldbutil.wait_for_file_on_target(self, port_file)
 
-new_debugger = lldb.SBDebugger.Create()
-new_debugger.SetAsync(False)
-
-def del_debugger(new_debugger=new_debugger):
-del new_debugger
-self.addTearDownHook(del_debugger)
+self.dbg.SetAsync(False)
 
 new_platform = lldb.SBPlatform(lldb.remote_platform.GetName())
-new_debugger.SetSelectedPlatform(new_platform)
-new_interpreter = new_debugger.GetCommandInterpreter()
+self.dbg.SetSelectedPlatform(new_platform)
 
 if unix_protocol:
 connect_url = "%s://%s%s" % (protocol, hostname, socket_id)
@@ -84,13 +70,13 @@
 
 command = "platform connect %s" % (connect_url)
 result = lldb.SBCommandReturnObject()
-new_interpreter.HandleCommand(command, result)
+self.dbg.GetCommandInterpreter().HandleCommand(command, result)
 self.assertTrue(
 result.Succeeded(),
 "platform process connect failed: %s" %
 result.GetOutput())
 
-target = new_debugger.GetSelectedTarget()
+target = self.dbg.GetSelectedTarget()
 process = target.GetProcess()
 thread = process.GetThreadAtIndex(0)
 
Index: lldb/test/API/python_api/file_handle/TestFileHandle.py
===
--- lldb/test/API/python_api/file_handle/TestFileHandle.py
+++ lldb/test/API/python_api/file_handle/TestFileHandle.py
@@ -82,12 +82,7 @@
 NO_DEBUG_INFO_TESTCASE = True
 mydir = lldbtest.Base.compute_mydir(__file__)
 
-# The way this class interacts with the debugger is different
-# than normal.   Most of these test cases will mess with the
-# debugger I/O streams, so we want a fresh debugger for each
-# test so those mutations don't interfere with each other.
-#
-# Also, the way norm

[Lldb-commits] [PATCH] D74903: [lldb][testsuite] Create a SBDebugger instance for each test

2020-03-03 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha planned changes to this revision.
tatyana-krasnukha added a comment.

As Pavel wrote, there are global properties that all debuggers share. That's 
why this approach doesn't work for me.
I'm going to add `settings clear` mode without arguments that will revert all 
the settings to their default values.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74903/new/

https://reviews.llvm.org/D74903



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D74903: [lldb][testsuite] Create a SBDebugger instance for each test

2020-03-03 Thread Tatyana Krasnukha via Phabricator via lldb-commits
tatyana-krasnukha updated this revision to Diff 247842.
tatyana-krasnukha retitled this revision from "[lldb][test] Add two wrapper 
functions to manage settings in test-suite" to "[lldb][testsuite] Create a 
SBDebugger instance for each test".
tatyana-krasnukha edited the summary of this revision.
Herald added subscribers: abidh, aheejin, sbc100.

Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74903/new/

https://reviews.llvm.org/D74903

Files:
  lldb/bindings/interface/SBPlatform.i
  lldb/include/lldb/API/SBPlatform.h
  lldb/packages/Python/lldbsuite/test/decorators.py
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/source/API/SBPlatform.cpp
  
lldb/test/API/commands/target/auto-install-main-executable/TestAutoInstallMainExecutable.py
  
lldb/test/API/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
  
lldb/test/API/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
  lldb/test/API/functionalities/gdb_remote_client/TestWasm.py
  lldb/test/API/functionalities/gdb_remote_client/TestWriteMemory.py
  lldb/test/API/functionalities/gdb_remote_client/TestqOffsets.py
  lldb/test/API/functionalities/plugins/command_plugin/TestPluginCommands.py
  lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
  lldb/test/API/functionalities/postmortem/elf-core/gcore/TestGCore.py
  
lldb/test/API/functionalities/postmortem/elf-core/thread_crash/TestLinuxCoreThreads.py
  lldb/test/API/functionalities/postmortem/mach-core/TestMachCore.py
  lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
  lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py
  lldb/test/API/functionalities/postmortem/netbsd-core/TestNetBSDCore.py
  lldb/test/API/functionalities/thread/backtrace_all/TestBacktraceAll.py
  
lldb/test/API/functionalities/unwind/noreturn/module-end/TestNoReturnModuleEnd.py
  lldb/test/API/macosx/load-kext/TestLoadKext.py
  lldb/test/API/python_api/file_handle/TestFileHandle.py
  
lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py

Index: lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
===
--- lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
+++ lldb/test/API/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
@@ -10,14 +10,6 @@
 class TestPlatformProcessConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
 mydir = TestBase.compute_mydir(__file__)
 
-def setUp(self):
-super(TestPlatformProcessConnect, self).setUp()
-self._initial_platform = lldb.DBG.GetSelectedPlatform()
-
-def tearDown(self):
-lldb.DBG.SetSelectedPlatform(self._initial_platform)
-super(TestPlatformProcessConnect, self).tearDown()
-
 @llgs_test
 @no_debug_info_test
 @skipIf(remote=False)
@@ -66,16 +58,10 @@
 
 socket_id = lldbutil.wait_for_file_on_target(self, port_file)
 
-new_debugger = lldb.SBDebugger.Create()
-new_debugger.SetAsync(False)
-
-def del_debugger(new_debugger=new_debugger):
-del new_debugger
-self.addTearDownHook(del_debugger)
+self.dbg.SetAsync(False)
 
 new_platform = lldb.SBPlatform(lldb.remote_platform.GetName())
-new_debugger.SetSelectedPlatform(new_platform)
-new_interpreter = new_debugger.GetCommandInterpreter()
+self.dbg.SetSelectedPlatform(new_platform)
 
 if unix_protocol:
 connect_url = "%s://%s%s" % (protocol, hostname, socket_id)
@@ -84,13 +70,13 @@
 
 command = "platform connect %s" % (connect_url)
 result = lldb.SBCommandReturnObject()
-new_interpreter.HandleCommand(command, result)
+self.dbg.GetCommandInterpreter().HandleCommand(command, result)
 self.assertTrue(
 result.Succeeded(),
 "platform process connect failed: %s" %
 result.GetOutput())
 
-target = new_debugger.GetSelectedTarget()
+target = self.dbg.GetSelectedTarget()
 process = target.GetProcess()
 thread = process.GetThreadAtIndex(0)
 
Index: lldb/test/API/python_api/file_handle/TestFileHandle.py
===
--- lldb/test/API/python_api/file_handle/TestFileHandle.py
+++ lldb/test/API/python_api/file_handle/TestFileHandle.py
@@ -82,12 +82,7 @@
 NO_DEBUG_INFO_TESTCASE = True
 mydir = lldbtest.Base.compute_mydir(__file__)
 
-# The way this class interacts with the debugger is different
-# than normal.   Most of these test cases will mess with