forked from Imagelibrary/binutils-gdb
2002-04-08 Pierre Muller <muller@ics.u-strasbg.fr>
from 2002-03-22 Christopher Faylor <cgf@redhat.com> patch in main branch. * win32-nat.c (child_create_inferior): Check for proper shell to use here, in case the user changes it on the fly. (_initialize_inftarg): Remove shell path considerations.
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
2002-04-08 Pierre Muller <muller@ics.u-strasbg.fr>
|
||||||
|
|
||||||
|
from 2002-03-22 Christopher Faylor <cgf@redhat.com> patch
|
||||||
|
in main branch.
|
||||||
|
* win32-nat.c (child_create_inferior): Check for proper shell to use
|
||||||
|
here, in case the user changes it on the fly.
|
||||||
|
(_initialize_inftarg): Remove shell path considerations.
|
||||||
|
|
||||||
|
|
||||||
2002-04-07 Andrew Cagney <ac131313@redhat.com>
|
2002-04-07 Andrew Cagney <ac131313@redhat.com>
|
||||||
|
|
||||||
I believe Jeff Law denies responsability for this one:
|
I believe Jeff Law denies responsability for this one:
|
||||||
|
|||||||
@@ -123,7 +123,8 @@ static DEBUG_EVENT current_event; /* The current debug event from
|
|||||||
WaitForDebugEvent */
|
WaitForDebugEvent */
|
||||||
static HANDLE current_process_handle; /* Currently executing process */
|
static HANDLE current_process_handle; /* Currently executing process */
|
||||||
static thread_info *current_thread; /* Info on currently selected thread */
|
static thread_info *current_thread; /* Info on currently selected thread */
|
||||||
static DWORD main_thread_id; /* Thread ID of the main thread */
|
static DWORD main_thread_id; /* Thread ID of the main thread */
|
||||||
|
static pid_t cygwin_pid; /* pid of cygwin process */
|
||||||
|
|
||||||
/* Counts of things. */
|
/* Counts of things. */
|
||||||
static int exception_count = 0;
|
static int exception_count = 0;
|
||||||
@@ -139,9 +140,6 @@ static int debug_memory = 0; /* show target memory accesses */
|
|||||||
static int debug_exceptions = 0; /* show target exceptions */
|
static int debug_exceptions = 0; /* show target exceptions */
|
||||||
static int useshell = 0; /* use shell for subprocesses */
|
static int useshell = 0; /* use shell for subprocesses */
|
||||||
|
|
||||||
/* Path to shell */
|
|
||||||
static char shell[MAX_PATH + 1];
|
|
||||||
|
|
||||||
/* This vector maps GDB's idea of a register's number into an address
|
/* This vector maps GDB's idea of a register's number into an address
|
||||||
in the win32 exception context vector.
|
in the win32 exception context vector.
|
||||||
|
|
||||||
@@ -1461,6 +1459,8 @@ child_create_inferior (char *exec_file, char *allargs, char **env)
|
|||||||
char *args;
|
char *args;
|
||||||
char real_path[MAXPATHLEN];
|
char real_path[MAXPATHLEN];
|
||||||
char *toexec;
|
char *toexec;
|
||||||
|
char shell[MAX_PATH + 1]; /* Path to shell */
|
||||||
|
const char *sh;
|
||||||
|
|
||||||
if (!exec_file)
|
if (!exec_file)
|
||||||
error ("No executable specified, use `target exec'.\n");
|
error ("No executable specified, use `target exec'.\n");
|
||||||
@@ -1468,7 +1468,7 @@ child_create_inferior (char *exec_file, char *allargs, char **env)
|
|||||||
memset (&si, 0, sizeof (si));
|
memset (&si, 0, sizeof (si));
|
||||||
si.cb = sizeof (si);
|
si.cb = sizeof (si);
|
||||||
|
|
||||||
if (!useshell || !shell[0])
|
if (!useshell)
|
||||||
{
|
{
|
||||||
flags = DEBUG_ONLY_THIS_PROCESS;
|
flags = DEBUG_ONLY_THIS_PROCESS;
|
||||||
cygwin_conv_to_win32_path (exec_file, real_path);
|
cygwin_conv_to_win32_path (exec_file, real_path);
|
||||||
@@ -1476,8 +1476,13 @@ child_create_inferior (char *exec_file, char *allargs, char **env)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file)
|
char *newallargs;
|
||||||
+ strlen (allargs) + 2);
|
sh = getenv ("SHELL");
|
||||||
|
if (!sh)
|
||||||
|
sh = "/bin/sh";
|
||||||
|
cygwin_conv_to_win32_path (sh, shell);
|
||||||
|
newallargs = alloca (sizeof (" -c 'exec '") + strlen (exec_file)
|
||||||
|
+ strlen (allargs) + 2);
|
||||||
sprintf (newallargs, " -c 'exec %s %s'", exec_file, allargs);
|
sprintf (newallargs, " -c 'exec %s %s'", exec_file, allargs);
|
||||||
allargs = newallargs;
|
allargs = newallargs;
|
||||||
toexec = shell;
|
toexec = shell;
|
||||||
@@ -1497,7 +1502,7 @@ child_create_inferior (char *exec_file, char *allargs, char **env)
|
|||||||
|
|
||||||
/* Prepare the environment vars for CreateProcess. */
|
/* Prepare the environment vars for CreateProcess. */
|
||||||
{
|
{
|
||||||
/* This code use to assume all env vars were file names and would
|
/* This code used to assume all env vars were file names and would
|
||||||
translate them all to win32 style. That obviously doesn't work in the
|
translate them all to win32 style. That obviously doesn't work in the
|
||||||
general case. The current rule is that we only translate PATH.
|
general case. The current rule is that we only translate PATH.
|
||||||
We need to handle PATH because we're about to call CreateProcess and
|
We need to handle PATH because we're about to call CreateProcess and
|
||||||
@@ -1813,7 +1818,6 @@ void
|
|||||||
_initialize_inftarg (void)
|
_initialize_inftarg (void)
|
||||||
{
|
{
|
||||||
struct cmd_list_element *c;
|
struct cmd_list_element *c;
|
||||||
const char *sh;
|
|
||||||
|
|
||||||
init_child_ops ();
|
init_child_ops ();
|
||||||
|
|
||||||
@@ -1821,20 +1825,6 @@ _initialize_inftarg (void)
|
|||||||
"Load dll library symbols from FILE.");
|
"Load dll library symbols from FILE.");
|
||||||
c->completer = filename_completer;
|
c->completer = filename_completer;
|
||||||
|
|
||||||
sh = getenv ("SHELL");
|
|
||||||
if (!sh)
|
|
||||||
sh = "/bin/sh";
|
|
||||||
if (access (sh, X_OK) != 0)
|
|
||||||
{
|
|
||||||
shell[0] = '\0';
|
|
||||||
useshell = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cygwin_conv_to_win32_path (sh, shell);
|
|
||||||
useshell = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
add_com_alias ("sharedlibrary", "dll-symbols", class_alias, 1);
|
add_com_alias ("sharedlibrary", "dll-symbols", class_alias, 1);
|
||||||
|
|
||||||
add_show_from_set (add_set_cmd ("shell", class_support, var_boolean,
|
add_show_from_set (add_set_cmd ("shell", class_support, var_boolean,
|
||||||
|
|||||||
Reference in New Issue
Block a user