summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2012-05-17 15:48:02 +0000
committerFilipe Cabecinhas <me@filcab.net>2012-05-17 15:48:02 +0000
commitb018345ddcdc74779d0d9efb7b59d5762422f87d (patch)
tree253fa0c1c0e4f8ef2a0a734067f30cca71387e48
parent26ad6a4f600b4644088d79e8dab1d0d88eca10e8 (diff)
downloadbcm5719-llvm-b018345ddcdc74779d0d9efb7b59d5762422f87d.tar.gz
bcm5719-llvm-b018345ddcdc74779d0d9efb7b59d5762422f87d.zip
We shouldn't save g_dummy_target_sp. Other code will simply call Destroy() on it.
TestBackticksWithoutATarget.BackticksWithNoTargetTestCase was calling GetDummyTarget() when executing for x86_64. When performing session tearDown, it would get destroyed (and everything would be invalid (arch, etc). Then the test would run for i386. The dummy target wasn't being reinitialized and was invalid. lldb complained that 'current process state is unsuitable for expression parsing'. llvm-svn: 156994
-rw-r--r--lldb/source/Host/common/Host.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index 62a0b9e99ad..1e3cb0a14da 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -1227,22 +1227,19 @@ Host::GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &process_info)
lldb::TargetSP
Host::GetDummyTarget (lldb_private::Debugger &debugger)
{
- static TargetSP g_dummy_target_sp;
-
- if (!g_dummy_target_sp)
- {
- ArchSpec arch(Target::GetDefaultArchitecture());
- if (!arch.IsValid())
- arch = Host::GetArchitecture ();
- Error err = debugger.GetTargetList().CreateTarget(debugger,
- FileSpec(),
- arch.GetTriple().getTriple().c_str(),
- false,
- NULL,
- g_dummy_target_sp);
- }
-
- return g_dummy_target_sp;
+ lldb::TargetSP dummy_target_sp;
+
+ ArchSpec arch(Target::GetDefaultArchitecture());
+ if (!arch.IsValid())
+ arch = Host::GetArchitecture ();
+ Error err = debugger.GetTargetList().CreateTarget(debugger,
+ FileSpec(),
+ arch.GetTriple().getTriple().c_str(),
+ false,
+ NULL,
+ dummy_target_sp);
+
+ return dummy_target_sp;
}
struct ShellInfo
OpenPOWER on IntegriCloud