I found a bug, the debugee's start-up arguments does not set/send correctly.
--- plugin.cpp Thu Jan 15 17:14:12 1970
+++ plugin.cpp Thu Jan 15 17:14:12 1970
@@ -570,11 +570,12 @@
return 3;
}
// is gdb accessible, i.e. can we find it?
wxString debugger = GetActiveConfigEx().GetDebuggerExecutable();
- wxString debuggee, working_dir;
+ wxString debuggee, working_dir;
+ wxString args = target->GetExecutionParameters();
if (!GetDebuggee(debuggee, working_dir, target))
{
m_hasStartUpError = true;
return 6;
}
@@ -588,11 +589,11 @@
{
wxSetEnv(CB_LIBRARY_ENVVAR, newLibPath);
DebugLog(CB_LIBRARY_ENVVAR _T("=") + newLibPath);
}
- int res = LaunchDebugger(debugger, debuggee, working_dir, 0, console, start_type);
+ int res = LaunchDebugger(debugger, debuggee, args, working_dir, 0, console, start_type);
if (res != 0)
{
m_hasStartUpError = true;
return res;
}
@@ -604,11 +605,11 @@
if (oldLibPath != newLibPath)
wxSetEnv(CB_LIBRARY_ENVVAR, oldLibPath);
return 0;
}
-int Debugger_GDB_MI::LaunchDebugger(wxString const &debugger, wxString const &debuggee,
+int Debugger_GDB_MI::LaunchDebugger(wxString const &debugger, wxString const &debuggee, wxString const &args,
wxString const &working_dir, int pid, bool console,
StartType start_type)
{
m_current_frame.Reset();
if(debugger.IsEmpty())
@@ -642,11 +643,14 @@
return ret;
m_executor.Stopped(true);
// m_executor.Execute(_T("-enable-timings"));
CommitBreakpoints(true);
- CommitWatches();
+ CommitWatches();
+
+ //Set program arguments -exec-arguments
+ m_actions.Add(new dbg_mi::SimpleAction(wxT("-exec-arguments ") + args));
if(console)
{
wxString console_tty;
m_console_pid = RunNixConsole(console_tty);
@@ -1263,12 +1267,12 @@
long number;
if (!pid.ToLong(&number))
return;
- LaunchDebugger(GetActiveConfigEx().GetDebuggerExecutable(), wxEmptyString, wxEmptyString,
- number, false, StartTypeRun);
+ LaunchDebugger(GetActiveConfigEx().GetDebuggerExecutable(), wxEmptyString, wxEmptyString,
+ wxEmptyString, number, false, StartTypeRun);
m_executor.SetAttachedPID(number);
}
void Debugger_GDB_MI::DetachFromProcess()
{
--- plugin.h Thu Jan 15 17:14:12 1970
+++ plugin.h Thu Jan 15 17:14:12 1970
@@ -159,12 +159,12 @@
void OnTimer(wxTimerEvent& event);
void OnIdle(wxIdleEvent& event);
void OnMenuInfoCommandStream(wxCommandEvent& event);
- int LaunchDebugger(wxString const &debugger, wxString const &debuggee, wxString const &working_dir,
- int pid, bool console, StartType start_type);
+ int LaunchDebugger(wxString const &debugger, wxString const &debuggee, wxString const &args,
+ wxString const &working_dir, int pid, bool console, StartType start_type);
private:
void AddStringCommand(wxString const &command);
void DoSendCommand(const wxString& cmd);
void RunQueue();