[Lldb-commits] [lldb] r149629 - in /lldb/trunk: source/Core/Value.cpp test/functionalities/target_command/TestTargetCommand.py

Johnny Chen johnny.chen at apple.com
Thu Feb 2 11:55:18 PST 2012


Author: johnny
Date: Thu Feb  2 13:55:18 2012
New Revision: 149629

URL: http://llvm.org/viewvc/llvm-project?rev=149629&view=rev
Log:
For processes which are not in one of the "launched and stopped" state, 'target variable' command
should use Target::ReadMemory() call to read from the file section offset address.
Also remove the @expectedFailure decorator..

'target variable' command fails if the target program has been run
rdar://problem/9763907

Modified:
    lldb/trunk/source/Core/Value.cpp
    lldb/trunk/test/functionalities/target_command/TestTargetCommand.py

Modified: lldb/trunk/source/Core/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=149629&r1=149628&r2=149629&view=diff
==============================================================================
--- lldb/trunk/source/Core/Value.cpp (original)
+++ lldb/trunk/source/Core/Value.cpp Thu Feb  2 13:55:18 2012
@@ -425,7 +425,20 @@
                     {
                         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;

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=149629&r1=149628&r2=149629&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/target_command/TestTargetCommand.py (original)
+++ lldb/trunk/test/functionalities/target_command/TestTargetCommand.py Thu Feb  2 13:55:18 2012
@@ -36,7 +36,6 @@
 
     # 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."""





More information about the lldb-commits mailing list