[Lldb-commits] [lldb] r149637 - /lldb/trunk/source/Core/Value.cpp

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


Author: johnny
Date: Thu Feb  2 16:11:13 2012
New Revision: 149637

URL: http://llvm.org/viewvc/llvm-project?rev=149637&view=rev
Log:
Should have used the convenience function:

bool
lldb_private::StateIsStoppedState (StateType state, bool must_exist)

instead.

Modified:
    lldb/trunk/source/Core/Value.cpp

Modified: lldb/trunk/source/Core/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=149637&r1=149636&r2=149637&view=diff
==============================================================================
--- lldb/trunk/source/Core/Value.cpp (original)
+++ lldb/trunk/source/Core/Value.cpp Thu Feb  2 16:11:13 2012
@@ -16,6 +16,7 @@
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Module.h"
+#include "lldb/Core/State.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Symbol/ClangASTType.h"
 #include "lldb/Symbol/ClangASTContext.h"
@@ -425,18 +426,9 @@
                     {
                         Address so_addr(address, objfile->GetSectionList());
                         addr_t load_address = so_addr.GetLoadAddress (exe_ctx->GetTargetPtr());
-                        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;
-                            }
+                        bool process_launched_and_stopped = exe_ctx->GetProcessPtr()
+                            ? StateIsStoppedState(exe_ctx->GetProcessPtr()->GetState(), true /* must_exist */)
+                            : false;
                         // Don't use the load address if the process has exited.
                         if (load_address != LLDB_INVALID_ADDRESS && process_launched_and_stopped)
                         {





More information about the lldb-commits mailing list