[nemiver] Set IDebugger state before firing IDebugger::command_done_signal



commit 82c5cf63e7b640efb7301eabbae94fdc554465aa
Author: Dodji Seketeli <dodji redhat com>
Date:   Fri May 1 13:31:15 2009 +0200

    Set IDebugger state before firing IDebugger::command_done_signal
    
    	* src/dbgengine/nmv-gdb-engine.cc:
    	(OnCommandDoneHandler::do_handle): Set internal state about current
    	frame level and "being attached to target" before firing out the
    	IDebugger::command_done_signal(). This ensures that IDebugger
    	is in a consistent state when client code is notified.
---
 src/dbgengine/nmv-gdb-engine.cc |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/dbgengine/nmv-gdb-engine.cc b/src/dbgengine/nmv-gdb-engine.cc
index f0e42e5..03e08c8 100644
--- a/src/dbgengine/nmv-gdb-engine.cc
+++ b/src/dbgengine/nmv-gdb-engine.cc
@@ -1253,14 +1253,15 @@ struct OnCommandDoneHandler : OutputHandler {
     {
         LOG_FUNCTION_SCOPE_NORMAL_DD;
 
-        m_engine->command_done_signal ().emit (a_in.command ().name (),
-                                               a_in.command ().cookie ());
         if (a_in.command ().name () == "attach-to-program") {
             m_engine->set_attached_to_target (true);
         }
         if (a_in.command ().name () == "select-frame") {
             m_engine->set_current_frame_level (a_in.command ().tag2 ());
         }
+
+        m_engine->command_done_signal ().emit (a_in.command ().name (),
+                                               a_in.command ().cookie ());
         //TODO: this is not necessarily true. Before setting the state
         //to ready here, one must now which command exactly was fired so
         //that gdb returned the "DONE" status for it.
@@ -2265,6 +2266,7 @@ GDBEngine::set_current_frame_level (int a_level)
     LOG_FUNCTION_SCOPE_NORMAL_DD;
     THROW_IF_FAIL (m_priv);
 
+    LOG_DD ("cur frame level: " << (int) a_level);
     m_priv->cur_frame_level = a_level;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]