[nemiver] Don't quote '*' in -data-evaluate-expression argum



commit 25d21e4286b490139028c737b3be540ab5866ec1
Author: Dodji Seketeli <dodji redhat com>
Date:   Tue Mar 10 11:50:10 2009 +0100

    Don't quote '*' in -data-evaluate-expression arguments (Closes: #574212)
    
    	* src/dbgengine/nmv-gdb-engine.cc:
    	  (GDBEngine::print_pointed_variable_value,
               GDBEngine::dereference_variable): Leave the '*' operator
    	   out of the quotes, otherwise, GDB thinks '*' is part of the
    	   name of the variable we are trying to de-reference.
    	* tests/test-deref.cc: Adjust this test case to to make it more
    	  robust. Chain things up properly so that we are sure stepping
    	  really happens after we are done with variable inspecting.
---
 src/dbgengine/nmv-gdb-engine.cc |    4 ++--
 tests/test-deref.cc             |    8 +++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/dbgengine/nmv-gdb-engine.cc b/src/dbgengine/nmv-gdb-engine.cc
index aa56f6e..cce7371 100644
--- a/src/dbgengine/nmv-gdb-engine.cc
+++ b/src/dbgengine/nmv-gdb-engine.cc
@@ -3193,7 +3193,7 @@ GDBEngine::print_pointed_variable_value (const UString &a_var_name,
     }
 
     Command command ("print-pointed-variable-value",
-                     "-data-evaluate-expression '*" + a_var_name + "'",
+                     "-data-evaluate-expression *'" + a_var_name + "'",
                      a_cookie);
     command.tag0 ("print-pointed-variable-value");
     command.tag1 (a_var_name);
@@ -3265,7 +3265,7 @@ GDBEngine::dereference_variable (const VariableSafePtr &a_var,
     a_var->build_qname (var_qname);
     THROW_IF_FAIL (!var_qname.empty ());
     Command command ("dereference-variable",
-                     "-data-evaluate-expression '*" + var_qname + "'",
+                     "-data-evaluate-expression *'" + var_qname + "'",
                      a_cookie);
     command.variable (a_var);
 
diff --git a/tests/test-deref.cc b/tests/test-deref.cc
index 91703d4..1908016 100644
--- a/tests/test-deref.cc
+++ b/tests/test-deref.cc
@@ -18,7 +18,8 @@ static int nb_type_set = 0 ;
 
 void
 on_variable_derefed_signal (const IDebugger::VariableSafePtr &a_var,
-                            const UString &a_cookie)
+                            const UString &a_cookie,
+                            IDebuggerSafePtr a_debugger)
 {
     if (a_cookie.empty ()) {/*keep compiler happy*/}
     BOOST_REQUIRE (a_var) ;
@@ -42,6 +43,7 @@ on_variable_derefed_signal (const IDebugger::VariableSafePtr &a_var,
             (a_var->get_dereferenced ()->members ().size () == 2,
              "got: " << a_var->get_dereferenced ()->members ().size ()) ;
     }
+    a_debugger->step_over () ;
 }
 
 void
@@ -117,7 +119,6 @@ on_stopped_signal (IDebugger::StopReason a_reason,
         a_debugger->print_variable_value ("foo_ptr") ;
         a_debugger->print_variable_value ("bar_ptr") ;
         a_debugger->print_variable_value ("baz_ptr") ;
-        a_debugger->step_over () ;
     } else if (a_frame.function_name () == "main") {
         if (nb_stops < 8) {
             a_debugger->step_over () ;
@@ -153,7 +154,8 @@ test_main (int argc, char **argv)
                                     (&on_variable_type_set_signal, debugger)) ;
 
     debugger->variable_dereferenced_signal ().connect
-                                            (&on_variable_derefed_signal) ;
+                                    (sigc::bind (&on_variable_derefed_signal,
+                                                 debugger)) ;
 
 
     debugger->load_program (".libs/pointerderef", ".") ;



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