protected string GetApplication(out string cwd, out string[] cmdline_args)
{
IntPtr data = IntPtr.Zero;
IntPtr p_exe = IntPtr.Zero;
IntPtr p_cwd = IntPtr.Zero;
try {
int count;
string exe_file;
check_error (mono_debugger_server_get_application (
server_handle, out p_exe, out p_cwd,
out count, out data));
cmdline_args = new string [count];
exe_file = Marshal.PtrToStringAnsi (p_exe);
cwd = Marshal.PtrToStringAnsi (p_cwd);
for (int i = 0; i < count; i++) {
IntPtr ptr = Marshal.ReadIntPtr (data, i * IntPtr.Size);
cmdline_args [i] = Marshal.PtrToStringAnsi (ptr);
}
return exe_file;
} finally {
g_free (data);
g_free (p_exe);
g_free (p_cwd);
}
}