summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Core/Value.cpp15
-rw-r--r--lldb/test/functionalities/target_command/TestTargetCommand.py1
2 files changed, 14 insertions, 2 deletions
diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp
index c2589f33a89..e602514ca38 100644
--- a/lldb/source/Core/Value.cpp
+++ b/lldb/source/Core/Value.cpp
@@ -425,7 +425,20 @@ Value::GetValueAsData (ExecutionContext *exe_ctx,
{
Address so_addr(address, objfile->GetSectionList());
addr_t load_address = so_addr.GetLoadAddress (exe_ctx->GetTargetPtr());
- if (load_address != LLDB_INVALID_ADDRESS)
+ bool process_launched_and_stopped = false;
+ if (exe_ctx->GetProcessPtr())
+ switch (exe_ctx->GetProcessPtr()->GetState())
+ {
+ default:
+ break;
+ case eStateInvalid:
+ case eStateSuspended:
+ case eStateCrashed:
+ case eStateStopped:
+ process_launched_and_stopped = true;
+ }
+ // Don't use the load address if the process has exited.
+ if (load_address != LLDB_INVALID_ADDRESS && process_launched_and_stopped)
{
resolved = true;
address = load_address;
diff --git a/lldb/test/functionalities/target_command/TestTargetCommand.py b/lldb/test/functionalities/target_command/TestTargetCommand.py
index 62f3ade6339..dbeb5080120 100644
--- a/lldb/test/functionalities/target_command/TestTargetCommand.py
+++ b/lldb/test/functionalities/target_command/TestTargetCommand.py
@@ -36,7 +36,6 @@ class targetCommandTestCase(TestBase):
# rdar://problem/9763907
# 'target variable' command fails if the target program has been run
- @unittest2.expectedFailure
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
def test_target_variable_command_with_dsym(self):
"""Test 'target variable' command before and after starting the inferior."""
OpenPOWER on IntegriCloud