[nemiver] Don't clobber cmdline arguments (Close: #591327)



commit a23dbb179adc4055f340a29c5ae27e155aaa513f
Author: Dodji Seketeli <dodji redhat com>
Date:   Wed Aug 12 09:29:19 2009 +0200

    Don't clobber cmdline arguments (Close: #591327)
    
    	* src/dbgengine/nmv-i-debugger.h:
    	(IDebugger::load_program): Inferior arguments are now passed
    	as a vector of strings.
    	* src/dbgengine/nmv-gdb-engine.h:
    	(GDBEngine::load_program): Adjust.
    	src/dbgengine/nmv-gdb-engine.cc:
    	(GDBEngine::load_program): Adjust.
    	(quote_args): Quote all args starting from index 0.
    	(GDBEngine::Priv::launch_gdb): Swap the order of the
    	two last parameters.
    	(GDBEngine::Priv::launch_gdb_and_set_args): The prog path
    	and the args are now passed in two distinct variables.
    	Args are still in vector of strings.
    	(GDBEngine::step_out): Really pass the command to GDB.
    	* src/persp/dbgperspective/nmv-dbg-perspective.cc:
    	(DBGPerspective::execute_program): Prog path and args are now
    	distinct. Args are passed as a vector of strings.
    	(DBGPerspective::record_and_save_session): Command line arguments
    	are now separated by a special separator at serialization time.
    	(DBGPerspective::execute_session): Consider the new special command
    	line arguments separator when de-serializing the command line
    	arguments.
    	(DBGPerspective::execute_program,
    	 DBGPerspective::connect_to_remote_target): Adjust
    	* src/main.cc (process_gui_command_line,
    	process_gui_command_line): Adjust.
    	* tests/test-breakpoint.cc (test_main): Likewise.
    	* tests/test-deref.cc (test_main): Likewise.
    	* tests/test-local-vars-list.cc (test_main): Likewise.
    	* tests/test-types.cc (test_main): Likewise.
    	* tests/test-var-list.cc (test_main): Likewise.
    	* tests/test-var-path-expr.cc (test_main): Likewise.
    	* tests/test-var-walker.cc (test_main): Likewise.
    	* tests/test-varobj-walker.cc (test_main): Likewise.
    	* tests/test-vars.cc (test_main): Likewise.
    	* tests/test-watchpoint.cc (test_main): Likewise.

 src/dbgengine/nmv-gdb-engine.cc                 |   48 ++++++++------
 src/dbgengine/nmv-gdb-engine.h                  |    7 ++-
 src/dbgengine/nmv-i-debugger.h                  |    6 +-
 src/main.cc                                     |   14 ++--
 src/persp/dbgperspective/nmv-dbg-perspective.cc |   80 ++++++++++++-----------
 src/persp/dbgperspective/nmv-dbg-perspective.h  |   14 ++--
 tests/test-breakpoint.cc                        |    4 +-
 tests/test-deref.cc                             |    3 +-
 tests/test-local-vars-list.cc                   |    3 +-
 tests/test-types.cc                             |    3 +-
 tests/test-var-list.cc                          |    3 +-
 tests/test-var-path-expr.cc                     |    4 +-
 tests/test-var-walker.cc                        |    3 +-
 tests/test-varobj-walker.cc                     |    3 +-
 tests/test-vars.cc                              |    3 +-
 tests/test-watchpoint.cc                        |    4 +-
 16 files changed, 109 insertions(+), 93 deletions(-)
---
diff --git a/src/dbgengine/nmv-gdb-engine.cc b/src/dbgengine/nmv-gdb-engine.cc
index fa8d1d4..59862fa 100644
--- a/src/dbgengine/nmv-gdb-engine.cc
+++ b/src/dbgengine/nmv-gdb-engine.cc
@@ -61,7 +61,7 @@ quote_args (const vector<UString> &a_prog_args)
 {
     UString args;
     if (!a_prog_args.empty ()) {
-        for (vector<UString>::size_type i=1;
+        for (vector<UString>::size_type i = 0;
              i < a_prog_args.size ();
              ++i) {
             if (!a_prog_args[i].empty ())
@@ -599,8 +599,8 @@ public:
 
     bool launch_gdb (const UString &working_dir,
                      const vector<UString> &a_source_search_dirs,
-                     const vector<UString> &a_gdb_options,
-                     const UString a_prog="")
+                     const UString &a_prog,
+                     const vector<UString> &a_gdb_options)
     {
         if (is_gdb_running ()) {
             kill_gdb ();
@@ -618,7 +618,8 @@ public:
                 }
             }
         }
-        // if the executable program to be debugged is a libtool wrapper script,
+        // if the executable program to be debugged is a
+        // libtool wrapper script,
         // run the debugging session under libtool
         if (is_libtool_executable_wrapper (prog_path)) {
             argv.push_back ("libtool");
@@ -645,18 +646,21 @@ public:
     }
 
     bool launch_gdb_and_set_args (const UString &working_dir,
-                                  const vector<UString> &a_source_search_dirs,
+                                  const vector<UString> &a_src_search_dirs,
+                                  const UString &a_prog,
                                   const vector<UString> &a_prog_args,
                                   const vector<UString> a_gdb_options)
     {
         LOG_FUNCTION_SCOPE_NORMAL_DD;
         bool result (false);
-        result = launch_gdb (working_dir, a_source_search_dirs,
-                             a_gdb_options, a_prog_args[0]);
+        result = launch_gdb (working_dir, a_src_search_dirs,
+                             a_prog, a_gdb_options);
+
         LOG_DD ("workingdir:" << working_dir
-                << "\nsearchpath:" << UString::join (a_source_search_dirs)
-                << "\nprogargs:" << UString::join (a_prog_args)
-                << "\ngdboptions:" << UString::join (a_gdb_options));
+                << "\nsearchpath: " << UString::join (a_src_search_dirs)
+                << "\nprog: " << a_prog
+                << "\nprogargs: " << UString::join (a_prog_args, " ")
+                << "\ngdboptions: " << UString::join (a_gdb_options));
 
         if (!result) {return false;}
         UString args = quote_args (a_prog_args);
@@ -2466,35 +2470,34 @@ GDBEngine::~GDBEngine ()
 }
 
 void
-GDBEngine::load_program (const UString &a_prog_with_args,
+GDBEngine::load_program (const UString &a_prog,
+                         const vector<UString> &a_args,
                          const UString &a_working_dir)
 {
     LOG_FUNCTION_SCOPE_NORMAL_DD;
 
-
-    vector<UString> args = a_prog_with_args.split (" ");
     vector<UString> search_paths;
     UString tty_path;
-
-    load_program (args, a_working_dir, search_paths, tty_path);
+    load_program (a_prog, a_args, a_working_dir, search_paths, tty_path);
 }
 
 void
-GDBEngine::load_program (const vector<UString> &a_argv,
+GDBEngine::load_program (const UString &a_prog,
+                         const vector<UString> &a_argv,
                          const UString &working_dir,
                          const vector<UString> &a_source_search_dirs,
                          const UString &a_tty_path)
 {
     LOG_FUNCTION_SCOPE_NORMAL_DD;
 
-    THROW_IF_FAIL (!a_argv.empty ());
+    THROW_IF_FAIL (!a_prog.empty ());
     vector<UString> argv (a_argv);
 
     if (!m_priv->is_gdb_running ()) {
         vector<UString> gdb_opts;
         THROW_IF_FAIL (m_priv->launch_gdb_and_set_args
                                     (working_dir, a_source_search_dirs, 
-                                     argv, gdb_opts));
+                                     a_prog, a_argv, gdb_opts));
 
         Command command;
 
@@ -2516,7 +2519,7 @@ GDBEngine::load_program (const vector<UString> &a_argv,
         }
     } else {
         Command command ("load-program",
-                         UString ("-file-exec-and-symbols ") + argv[0]);
+                         UString ("-file-exec-and-symbols ") + a_prog);
         queue_command (command);
 
         UString args = quote_args (argv);
@@ -2553,7 +2556,10 @@ GDBEngine::attach_to_target (unsigned int a_pid,
 
     if (!m_priv->is_gdb_running ()) {
         vector<UString> gdb_opts;
-        THROW_IF_FAIL (m_priv->launch_gdb ("", source_search_dirs, gdb_opts));
+        THROW_IF_FAIL (m_priv->launch_gdb ("" /* no cwd */,
+                                           source_search_dirs,
+                                           "" /* no inferior*/,
+                                           gdb_opts));
 
         Command command;
         command.value ("set breakpoint pending auto");
@@ -3405,7 +3411,7 @@ GDBEngine::step_out (const UString &a_cookie)
     Command command ("step-out",
                      "-exec-finish",
                      a_cookie);
-    queue_command (Command ());
+    queue_command (command);
 }
 
 void
diff --git a/src/dbgengine/nmv-gdb-engine.h b/src/dbgengine/nmv-gdb-engine.h
index 7bd46af..7543306 100644
--- a/src/dbgengine/nmv-gdb-engine.h
+++ b/src/dbgengine/nmv-gdb-engine.h
@@ -238,10 +238,13 @@ public:
     void set_debugger_parameter (const UString &a_name,
                                  const UString &a_value) ;
     void set_solib_prefix_path (const UString &a_name) ;
-    void load_program (const UString &a_prog_with_args,
+
+    void load_program (const UString &a_prog,
+                       const vector<UString> &a_args,
                        const UString &a_working_dir) ;
 
-    void load_program (const vector<UString> &a_argv,
+    void load_program (const UString &a_prog,
+                       const vector<UString> &a_argv,
                        const UString &working_dir,
                        const vector<UString> &a_source_search_dirs,
                        const UString &a_tty_path) ;
diff --git a/src/dbgengine/nmv-i-debugger.h b/src/dbgengine/nmv-i-debugger.h
index d0bafa0..73155e3 100644
--- a/src/dbgengine/nmv-i-debugger.h
+++ b/src/dbgengine/nmv-i-debugger.h
@@ -964,11 +964,13 @@ public:
 
     virtual void set_solib_prefix_path (const UString &a_name) = 0;
 
-    virtual void load_program (const UString &a_prog_with_args,
+    virtual void load_program (const UString &a_prog,
+                               const vector<UString> &a_args,
                                const UString &a_working_dir) = 0;
 
     virtual void load_program
-                (const vector<UString> &a_argv,
+                (const UString &a_prog,
+                 const vector<UString> &a_argv,
                  const UString &working_dir,
                  const vector<UString> &a_source_search_dirs,
                  const UString &a_tty_path="") = 0;
diff --git a/src/main.cc b/src/main.cc
index 6242f93..1a15f36 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -406,17 +406,15 @@ process_gui_command_line (int& a_argc, char** a_argv, int &a_return)
             a_return = 0;
             return false;
         }
-        UString prog_args;
-        for (int i=1; i < a_argc;++i) {
-            prog_args +=  Glib::locale_to_utf8 (a_argv[i]) + " ";
+        vector<UString> prog_args;
+        UString prog_path = a_argv[1];
+        for (int i=2; i < a_argc; ++i) {
+            prog_args.push_back (Glib::locale_to_utf8 (a_argv[i]));
         }
         IDBGPerspective *debug_persp =
             dynamic_cast<IDBGPerspective*> (s_workbench->get_perspective
                                                 (DBGPERSPECTIVE_PLUGIN_NAME));
         if (debug_persp) {
-            LOG_D ("going to debug program: '"
-                   << prog_args << "'\n",
-                   NMV_DEFAULT_DOMAIN);
             map<UString, UString> env;
             if (gv_env_vars) {
                 vector<UString> env_vars =
@@ -436,7 +434,9 @@ process_gui_command_line (int& a_argc, char** a_argv, int &a_return)
                     env[name] = value;
                 }
             }
-            debug_persp->execute_program (prog_args, env);
+            debug_persp->execute_program (prog_path,
+                                          prog_args,
+                                          env);
         } else {
             cerr << "Could not find the debugger perspective plugin\n";
             a_return = -1;
diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index fb42d34..0dd827b 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -170,7 +170,7 @@ const Gtk::StockID STOCK_STEP_INTO (STEP_INTO);
 const Gtk::StockID STOCK_STEP_OVER (STEP_OVER);
 const Gtk::StockID STOCK_STEP_OUT (STEP_OUT);
 
-const char* SUPPORTED_ENCODINGS[] =
+const char *SUPPORTED_ENCODINGS[] =
 {
     "UTF-8",
     "ISO-8859",
@@ -178,7 +178,9 @@ const char* SUPPORTED_ENCODINGS[] =
     "ISO-8859-15",
 };
 
-const char* I_DEBUGGER_COOKIE_EXECUTE_PROGRAM = "i-debugger-execute-program";
+const char *I_DEBUGGER_COOKIE_EXECUTE_PROGRAM = "i-debugger-execute-program";
+
+const char *PROG_ARG_SEPARATOR = "#DUMMY-SEP007#";
 
 #define SIZE_OF_SUPPORTED_ENCODINGS \
 sizeof (SUPPORTED_ENCODINGS)/sizeof (SUPPORTED_ENCODINGS[0])
@@ -509,13 +511,14 @@ public:
 
     void execute_last_program_in_memory ();
 
-    void execute_program (const UString &a_prog_and_args,
+    void execute_program (const UString &a_prog,
+                          const vector<UString> &a_args,
                           const map<UString, UString> &a_env,
-                          const UString &a_cwd=".",
-                          bool a_close_opened_files=false);
+                          const UString &a_cwd,
+                          bool a_close_opened_files);
 
     void execute_program (const UString &a_prog,
-                          const UString &a_args,
+                          const vector<UString> &a_args,
                           const map<UString, UString> &a_env,
                           const UString &a_cwd,
                           const vector<IDebugger::BreakPoint> &a_breaks,
@@ -758,7 +761,7 @@ struct DBGPerspective::Priv {
     // engine died or not.
     bool debugger_engine_alive;
     UString prog_path;
-    UString prog_args;
+    vector<UString> prog_args;
     UString prog_cwd;
     map<UString, UString> env_variables;
     list<UString> search_paths;
@@ -4571,10 +4574,12 @@ DBGPerspective::record_and_save_session (ISessMgr::Session &a_session)
     UString today;
     dateutils::get_current_datetime (today);
     session_name += "-" + today;
+    UString prog_args = UString::join (m_priv->prog_args,
+                                       PROG_ARG_SEPARATOR);
     a_session.properties ().clear ();
     a_session.properties ()[SESSION_NAME] = session_name;
     a_session.properties ()[PROGRAM_NAME] = m_priv->prog_path;
-    a_session.properties ()[PROGRAM_ARGS] = m_priv->prog_args;
+    a_session.properties ()[PROGRAM_ARGS] = prog_args;
     a_session.properties ()[PROGRAM_CWD] = m_priv->prog_cwd;
     GTimeVal timeval;
     g_get_current_time (&timeval);
@@ -5224,8 +5229,11 @@ DBGPerspective::execute_session (ISessMgr::Session &a_session)
         open_file(*path_iter);
     }
 
+    vector<UString> args =
+        a_session.properties ()[PROGRAM_ARGS].split (PROG_ARG_SEPARATOR);
+
     execute_program (a_session.properties ()[PROGRAM_NAME],
-                     a_session.properties ()[PROGRAM_ARGS],
+                     args,
                      a_session.env_variables (),
                      a_session.properties ()[PROGRAM_CWD],
                      breakpoints);
@@ -5241,7 +5249,8 @@ DBGPerspective::execute_program ()
     if (debugger ()->get_target_path () != "") {
         dialog.program_name (debugger ()->get_target_path ());
     }
-    dialog.arguments (m_priv->prog_args);
+    dialog.arguments (UString::join (m_priv->prog_args,
+                                     " "));
     if (m_priv->prog_cwd == "") {
         m_priv->prog_cwd = Glib::filename_to_utf8 (Glib::get_current_dir ());
     }
@@ -5253,10 +5262,11 @@ DBGPerspective::execute_program ()
         return;
     }
 
-    UString prog, args, cwd;
+    vector<UString> args;
+    UString prog, cwd;
     prog = dialog.program_name ();
     THROW_IF_FAIL (prog != "");
-    args = dialog.arguments ();
+    args = dialog.arguments ().split (" ");
     cwd = dialog.working_directory ();
     THROW_IF_FAIL (cwd != "");
     map<UString, UString> env = dialog.environment_variables();
@@ -5292,27 +5302,16 @@ DBGPerspective::execute_last_program_in_memory ()
 }
 
 void
-DBGPerspective::execute_program (const UString &a_prog_and_args,
+DBGPerspective::execute_program (const UString &a_prog,
+                                 const vector<UString> &a_args,
                                  const map<UString, UString> &a_env,
                                  const UString &a_cwd,
                                  bool a_close_opened_files)
 {
-    UString cwd;
-    if (a_cwd == "." || a_cwd == "") {
-        cwd = Glib::filename_to_utf8 (Glib::get_current_dir ());
-    } else {
-        cwd = a_cwd;
-    }
-    vector<UString> argv = a_prog_and_args.split (" ");
-    vector<UString>::const_iterator iter = argv.begin ();
-    vector<UString>::const_iterator end_iter = argv.end ();
-    ++iter;
-    UString prog_name=argv[0], args = UString::join (iter, end_iter);
-    vector<IDebugger::BreakPoint> breaks;
-
-    execute_program (prog_name, args, a_env, cwd,
-                     breaks, true, a_close_opened_files);
-    m_priv->reused_session = false;
+    vector<IDebugger::BreakPoint> bps;
+    execute_program (a_prog, a_args, a_env,
+                     a_cwd, bps, true,
+                     a_close_opened_files);
 }
 
 /// Loads and executes a program (called an inferior) under the debugger.
@@ -5335,7 +5334,7 @@ DBGPerspective::execute_program (const UString &a_prog_and_args,
 void
 DBGPerspective::execute_program
                         (const UString &a_prog,
-                         const UString &a_args,
+                         const vector<UString> &a_args,
                          const map<UString, UString> &a_env,
                          const UString &a_cwd,
                          const vector<IDebugger::BreakPoint> &a_breaks,
@@ -5388,8 +5387,6 @@ DBGPerspective::execute_program
         close_opened_files ();
     }
 
-    vector<UString> args = a_args.split (" ");
-    args.insert (args.begin (), prog);
     vector<UString> source_search_dirs = a_cwd.split (" ");
 
     // Detect if we are debugging a new program or not.
@@ -5409,8 +5406,9 @@ DBGPerspective::execute_program
              bp_it != m_priv->breakpoints.end ();
              ++bp_it) {
             if (m_priv->debugger_engine_alive)
-                dbg_engine->delete_breakpoint (bp_it->first,
-                                               I_DEBUGGER_COOKIE_EXECUTE_PROGRAM);
+                dbg_engine->delete_breakpoint
+                                (bp_it->first,
+                                 I_DEBUGGER_COOKIE_EXECUTE_PROGRAM);
         }
     }
 
@@ -5422,7 +5420,7 @@ DBGPerspective::execute_program
     clear_status_notebook ();
 
     // now really load the inferior program (i.e: the one to be debugged)
-    dbg_engine->load_program (args, a_cwd, source_search_dirs,
+    dbg_engine->load_program (prog, a_args, a_cwd, source_search_dirs,
                               get_terminal ().slave_pts_name ());
 
     m_priv->debugger_engine_alive = true;
@@ -5444,8 +5442,13 @@ DBGPerspective::execute_program
                 // We need to pass along some additional information
                 // in the 'cookie' to determine which breakpoint
                 // needs to be disabling after it is set.
-                UString cookie = it->enabled() ? "" : "initially-disabled#" +
-                    it->file_full_name () + "#" + UString::from_int(it->line ());
+                UString cookie =
+                    it->enabled()
+                    ? ""
+                    : "initially-disabled#"
+                       + it->file_full_name ()
+                       + "#"
+                       + UString::from_int(it->line ());
                 dbg_engine->set_breakpoint (it->file_full_name (),
                                             it->line (),
                                             it->condition (),
@@ -5526,7 +5529,8 @@ DBGPerspective::connect_to_remote_target ()
 
     UString path = dialog.get_executable_path ();
     LOG_DD ("executable path: '" <<  path << "'");
-    debugger ()->load_program (path , ".");
+    vector<UString> args;
+    debugger ()->load_program (path , args, ".");
     path = dialog.get_solib_prefix_path ();
     LOG_DD ("solib prefix path: '" <<  path << "'");
     debugger ()->set_solib_prefix_path (path);
diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.h b/src/persp/dbgperspective/nmv-dbg-perspective.h
index 2771345..8ed822f 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.h
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.h
@@ -79,16 +79,18 @@ public:
 
     virtual void execute_program () = 0;
 
-    virtual void execute_program (const UString &a_prog_and_args,
-                                  const map<UString, UString> &a_env,
-                                  const UString &a_cwd = ".",
-                                  bool a_close_opened_files = false) = 0;
+    virtual void execute_program (const UString &a_prog,
+                          const vector<UString> &a_args,
+                          const map<UString, UString> &a_env,
+                          const UString &a_cwd = ".",
+                          bool a_close_opened_files = false) = 0;
 
     virtual void execute_program (const UString &a_prog,
-                                  const UString &a_args,
+                                  const vector<UString> &a_args,
                                   const map<UString, UString> &a_env,
                                   const UString &a_cwd,
-                                  const vector<IDebugger::BreakPoint> &a_breaks,
+                                  const vector<IDebugger::BreakPoint>
+                                                                  &a_breaks,
                                   bool a_check_is_new_program = true,
                                   bool a_close_opened_files = false) = 0;
 
diff --git a/tests/test-breakpoint.cc b/tests/test-breakpoint.cc
index 777e290..0f8bd5b 100644
--- a/tests/test-breakpoint.cc
+++ b/tests/test-breakpoint.cc
@@ -238,10 +238,8 @@ test_main (int argc, char *argv[])
     //*****************************
 
     std::vector<UString> args, source_search_dir ;
-    args.push_back ("fooprog") ;
     source_search_dir.push_back (".") ;
-
-    debugger->load_program (args, "", source_search_dir);
+    debugger->load_program ("fooprog", args, ".", source_search_dir);
     debugger->set_breakpoint ("main") ;
     debugger->set_breakpoint ("func1") ;
     debugger->set_breakpoint ("func2") ;
diff --git a/tests/test-deref.cc b/tests/test-deref.cc
index fecfc7b..5901867 100644
--- a/tests/test-deref.cc
+++ b/tests/test-deref.cc
@@ -154,7 +154,8 @@ test_main (int argc, char **argv)
                                                  debugger)) ;
 
 
-    debugger->load_program (".libs/pointerderef", ".") ;
+    vector<UString> args;
+    debugger->load_program (".libs/pointerderef", args, ".") ;
     debugger->set_breakpoint ("main") ;
     debugger->run () ;
 
diff --git a/tests/test-local-vars-list.cc b/tests/test-local-vars-list.cc
index 6b23f4e..bdc4c16 100644
--- a/tests/test-local-vars-list.cc
+++ b/tests/test-local-vars-list.cc
@@ -159,7 +159,8 @@ test_main (int argc, char **argv)
     //load .libs/pointerderef program, list its local variables
     //add them to the list, step a bit, update the varlist state at
     //each step, check the state has been updated.
-    debugger->load_program (".libs/pointerderef", ".") ;
+    vector<UString> args;
+    debugger->load_program (".libs/pointerderef", args, ".") ;
     debugger->set_breakpoint ("main") ;
     debugger->run () ;
 
diff --git a/tests/test-types.cc b/tests/test-types.cc
index 94bc91a..275197b 100644
--- a/tests/test-types.cc
+++ b/tests/test-types.cc
@@ -97,10 +97,9 @@ test_main (int, char **)
     debugger->variable_value_signal ().connect (&on_variable_value_signal);
 
     std::vector<UString> args, source_search_dir ;
-    args.push_back ("fooprog") ;
     source_search_dir.push_back (".") ;
 
-    debugger->load_program (args, "", source_search_dir);
+    debugger->load_program ("fooprog", args, ".", source_search_dir);
     debugger->set_breakpoint ("func1") ;
     debugger->run () ;
     loop->run () ;
diff --git a/tests/test-var-list.cc b/tests/test-var-list.cc
index 3d0d00c..e5f1f71 100644
--- a/tests/test-var-list.cc
+++ b/tests/test-var-list.cc
@@ -243,7 +243,8 @@ test_main (int argc, char **argv)
     //</connect to IDebugger events>
     //******************************
 
-    debugger->load_program ("fooprog", ".") ;
+    vector<UString> args;
+    debugger->load_program ("fooprog", args, ".") ;
     debugger->set_breakpoint ("main") ;
     debugger->set_breakpoint ("func1") ;
     debugger->set_breakpoint ("func2") ;
diff --git a/tests/test-var-path-expr.cc b/tests/test-var-path-expr.cc
index c531f26..8dfb344 100644
--- a/tests/test-var-path-expr.cc
+++ b/tests/test-var-path-expr.cc
@@ -139,10 +139,8 @@ test_main (int argc, char *argv[])
                                                      debugger));
 
     std::vector<UString> args, source_search_dir ;
-    args.push_back ("fooprog") ;
     source_search_dir.push_back (".") ;
-
-    debugger->load_program (args, "", source_search_dir);
+    debugger->load_program ("fooprog", args, ".", source_search_dir);
     debugger->set_breakpoint ("main") ;
     debugger->run () ;
     loop->run () ;
diff --git a/tests/test-var-walker.cc b/tests/test-var-walker.cc
index e619a8a..57be4c4 100644
--- a/tests/test-var-walker.cc
+++ b/tests/test-var-walker.cc
@@ -211,7 +211,8 @@ test_main (int argc, char **argv)
     //</connect to IDebugger events>
     //******************************
 
-    debugger->load_program ("fooprog", ".") ;
+    vector<UString> args;
+    debugger->load_program ("fooprog", args, ".") ;
     debugger->set_breakpoint ("main") ;
     debugger->set_breakpoint ("func1") ;
     debugger->set_breakpoint ("func2") ;
diff --git a/tests/test-varobj-walker.cc b/tests/test-varobj-walker.cc
index 8050415..b07460d 100644
--- a/tests/test-varobj-walker.cc
+++ b/tests/test-varobj-walker.cc
@@ -170,7 +170,8 @@ test_main (int, char **)
     //</connect to IDebugger events>
     //******************************
 
-    debugger->load_program ("fooprog", ".");
+    vector<UString> args;
+    debugger->load_program ("fooprog", args, ".");
     debugger->set_breakpoint ("main");
 
     debugger->run ();
diff --git a/tests/test-vars.cc b/tests/test-vars.cc
index 098e1d2..618f410 100644
--- a/tests/test-vars.cc
+++ b/tests/test-vars.cc
@@ -273,7 +273,8 @@ test_main (int argc __attribute__((unused)),
     //*******************************
     //</connect to IDebugger events>
     //******************************
-    debugger->load_program ("fooprog", ".");
+    vector<UString> args;
+    debugger->load_program ("fooprog", args, ".");
     debugger->set_breakpoint ("main");
     debugger->set_breakpoint ("func4");
     // Set a breakpoint right after the person variable members get
diff --git a/tests/test-watchpoint.cc b/tests/test-watchpoint.cc
index ab9faf5..407b0cf 100644
--- a/tests/test-watchpoint.cc
+++ b/tests/test-watchpoint.cc
@@ -101,10 +101,8 @@ test_main (int, char **)
                             (sigc::bind (&on_stopped_signal, debugger));
 
     std::vector<UString> args, source_search_dir;
-    args.push_back ("fooprog") ;
     source_search_dir.push_back (".");
-
-    debugger->load_program (args, "", source_search_dir);
+    debugger->load_program ("fooprog", args, ".", source_search_dir);
     debugger->set_breakpoint ("main");
     debugger->set_breakpoint ("func1");
     debugger->run ();



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