* Re: [RFA] Remove OS-specific defines (was: _WIN32?) [not found] ` <1010507173855.ZM18890@ocotillo.lan> @ 2001-05-07 11:24 ` Eli Zaretskii 2001-06-10 6:28 ` Eli Zaretskii 1 sibling, 0 replies; 20+ messages in thread From: Eli Zaretskii @ 2001-05-07 11:24 UTC (permalink / raw) To: gdb-patches I see that I sent the original RFA to a wrong address. Sorry, I will resend. Here's my reply to Kevin's approval: > Date: Mon, 7 May 2001 10:38:55 -0700 > From: Kevin Buettner <kevinb@cygnus.com> > > On May 7, 7:10pm, Eli Zaretskii wrote: > > > * solib.c (solib_open): Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH > > instead of SLASH_CHAR, ROOTED_P and SLASH_P. > > (top-level): #include "filenames.h". > > Your changes to solib.c are approved. (FWIW, I glanced over your > changes to the other files and they look good too.) Thanks for reviewing them so soon. > Don't forget to also remove the definitions of SLASH_P, SLASH_CHAR, and > ROOTED_P in config/i386/xm-cygwin.h and config/i386/xm-go32.h. Yes, it's in the pipeline ;-) I just wanted to hear from Chris, at the very least, before futzing with his files. Btw, is it perhaps a good idea to add to gdbint.texinfo some guidelines about writing portable code which handles file names, including the list of these macros? Andrew? ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Remove OS-specific defines (was: _WIN32?) [not found] ` <1010507173855.ZM18890@ocotillo.lan> 2001-05-07 11:24 ` [RFA] Remove OS-specific defines (was: _WIN32?) Eli Zaretskii @ 2001-06-10 6:28 ` Eli Zaretskii 2001-06-12 17:14 ` Christopher Faylor 1 sibling, 1 reply; 20+ messages in thread From: Eli Zaretskii @ 2001-06-10 6:28 UTC (permalink / raw) To: kevinb; +Cc: gdb-patches, Christopher Faylor > Date: Mon, 7 May 2001 10:38:55 -0700 > From: Kevin Buettner <kevinb@cygnus.com> > > On May 7, 7:10pm, Eli Zaretskii wrote: > > > * solib.c (solib_open): Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH > > instead of SLASH_CHAR, ROOTED_P and SLASH_P. > > (top-level): #include "filenames.h". > > Your changes to solib.c are approved. (FWIW, I glanced over your > changes to the other files and they look good too.) > > > * defs.h (SLASH_P, SLASH_CHAR, ROOTED_P): Remove definitions. > > (SLASH_STRING): Define only for _WIN32. > > Once your changes to the other .c files are approved, I think this > one can be regarded as an obvious change. > > Don't forget to also remove the definitions of SLASH_P, SLASH_CHAR, and > ROOTED_P in config/i386/xm-cygwin.h and config/i386/xm-go32.h. This time is now. Chris, is the patch below okay with you? 2001-06-10 Eli Zaretskii <eliz@is.elta.co.il> * config/i386/xm-go32.h (SLASH_P, ROOTED_P, SLASH_CHAR) (SLASH_STRING): Remove unised definitions * config/i386/xm-go32.h: Likewise. --- gdb/config/i386/xm-go32.h~0 Mon Apr 3 17:44:56 2000 +++ gdb/config/i386/xm-go32.h Sun Jun 10 15:50:42 2001 @@ -24,13 +24,6 @@ #define GDBINIT_FILENAME "gdb.ini" -#define SLASH_P(X) ((X)=='\\' || (X) == '/') - -#define ROOTED_P(X) ((SLASH_P((X)[0])) || ((X)[0] && (X)[1] ==':')) - -#define SLASH_CHAR '/' -#define SLASH_STRING "/" - #define CRLF_SOURCE_FILES #define DIRNAME_SEPARATOR ';' --- gdb/config/i386/xm-cygwin.h~0 Fri Mar 2 05:14:48 2001 +++ gdb/config/i386/xm-cygwin.h Sun Jun 10 16:00:46 2001 @@ -24,11 +24,6 @@ #define GDBINIT_FILENAME "gdb.ini" -#define SLASH_P(X) ((X)=='\\' || (X) == '/') -#define ROOTED_P(X) ((SLASH_P((X)[0]))|| ((X)[1] ==':')) -#define SLASH_CHAR '/' -#define SLASH_STRING "/" - /* Define this if source files use \r\n rather than just \n. */ #define CRLF_SOURCE_FILES ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Remove OS-specific defines (was: _WIN32?) 2001-06-10 6:28 ` Eli Zaretskii @ 2001-06-12 17:14 ` Christopher Faylor 2001-06-13 2:08 ` Eli Zaretskii 0 siblings, 1 reply; 20+ messages in thread From: Christopher Faylor @ 2001-06-12 17:14 UTC (permalink / raw) To: Eli Zaretskii; +Cc: kevinb, gdb-patches On Sun, Jun 10, 2001 at 04:29:46PM +0300, Eli Zaretskii wrote: >This time is now. Chris, is the patch below okay with you? Looks ok to me. cgf ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Remove OS-specific defines (was: _WIN32?) 2001-06-12 17:14 ` Christopher Faylor @ 2001-06-13 2:08 ` Eli Zaretskii 0 siblings, 0 replies; 20+ messages in thread From: Eli Zaretskii @ 2001-06-13 2:08 UTC (permalink / raw) To: Christopher Faylor; +Cc: kevinb, gdb-patches On Tue, 12 Jun 2001, Christopher Faylor wrote: > On Sun, Jun 10, 2001 at 04:29:46PM +0300, Eli Zaretskii wrote: > >This time is now. Chris, is the patch below okay with you? > > Looks ok to me. Committed. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Remove OS-specific defines (was: _WIN32?) [not found] ` <200105071610.TAA24144@is.elta.co.il> [not found] ` <1010507173855.ZM18890@ocotillo.lan> @ 2001-05-13 1:29 ` Eli Zaretskii 2001-05-13 7:09 ` Fernando Nasser 1 sibling, 1 reply; 20+ messages in thread From: Eli Zaretskii @ 2001-05-13 1:29 UTC (permalink / raw) To: gdb-patches > Date: Mon, 7 May 2001 19:10:59 +0300 (IDT) > From: Eli Zaretskii <eliz@is.elta.co.il> > > I'm seeking approval for the following patches. They remove all the > DOS- and Windows-specific #ifdef's like "#ifdef _WIN32" and use the > portable macros from filenames.h instead. In addition, they convert > code which used macros private to GDB, such as SLASH_P and ROOTED_P, > to use the macros from filenames.h instead. Ping! I think I still need an approval for patches to source.c, completer.c and cli-cmds.c (see below). Did I missed some messages? > 2001-05-07 Eli Zaretskii <eliz@is.elta.co.il> > > * source.c (mod_path, openp): Use HAVE_DOS_BASED_FILE_SYSTEM > instead of system-specific define's like _WIN32 and __MSDOS__. > Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH instead of SLASH_P and > ROOTED_P. > (top-level): #include "filenames.h". > > * solib.c (solib_open): Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH > instead of SLASH_CHAR, ROOTED_P and SLASH_P. > (top-level): #include "filenames.h". > > * defs.h (SLASH_P, SLASH_CHAR, ROOTED_P): Remove definitions. > (SLASH_STRING): Define only for _WIN32. > > * completer.c: Use HAVE_DOS_BASED_FILE_SYSTEM instead of > __MSDOS_. > > * cli/cli-cmds.c (cd_command): Use IS_DIR_SEPARATOR and > IS_ABSOLUTE_PATH instead of SLASH_P and ROOTED_P. Replace > system-specific ifdefs with HAVE_DOS_BASED_FILE_SYSTEM. > (top-level): #include "filenames.h". > > > --- gdb/cli/cli-cmds.c~0 Thu Mar 29 01:42:22 2001 > +++ gdb/cli/cli-cmds.c Mon May 7 18:08:40 2001 > @@ -23,6 +23,7 @@ > #include "target.h" /* For baud_rate, remote_debug and remote_timeout */ > #include "gdb_wait.h" /* For shell escape implementation */ > #include "gnu-regex.h" /* Used by apropos_command */ > +#include "filenames.h" /* for DOSish file names */ > > #ifdef UI_OUT > #include "ui-out.h" > @@ -292,7 +293,7 @@ cd_command (char *dir, int from_tty) > if (chdir (dir) < 0) > perror_with_name (dir); > > -#if defined(_WIN32) || defined(__MSDOS__) > +#if HAVE_DOS_BASED_FILE_SYSTEM > /* There's too much mess with DOSish names like "d:", "d:.", > "d:./foo" etc. Instead of having lots of special #ifdef'ed code, > simply get the canonicalized name of the current directory. */ > @@ -300,24 +301,24 @@ cd_command (char *dir, int from_tty) > #endif > > len = strlen (dir); > - if (SLASH_P (dir[len - 1])) > + if (IS_DIR_SEPARATOR (dir[len - 1])) > { > /* Remove the trailing slash unless this is a root directory > (including a drive letter on non-Unix systems). */ > if (!(len == 1) /* "/" */ > -#if defined(_WIN32) || defined(__MSDOS__) > - && !(!SLASH_P (*dir) && ROOTED_P (dir) && len <= 3) /* "d:/" */ > +#if HAVE_DOS_BASED_FILE_SYSTEM > + && !(len == 3 && dir[1] == ':') /* "d:/" */ > #endif > ) > len--; > } > > dir = savestring (dir, len); > - if (ROOTED_P (dir)) > + if (IS_ABSOLUTE_PATH (dir)) > current_directory = dir; > else > { > - if (SLASH_P (current_directory[strlen (current_directory) - 1])) > + if (IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])) > current_directory = concat (current_directory, dir, NULL); > else > current_directory = concat (current_directory, SLASH_STRING, dir, NULL); > @@ -329,17 +330,18 @@ cd_command (char *dir, int from_tty) > found_real_path = 0; > for (p = current_directory; *p;) > { > - if (SLASH_P (p[0]) && p[1] == '.' && (p[2] == 0 || SLASH_P (p[2]))) > + if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.' > + && (p[2] == 0 || IS_DIR_SEPARATOR (p[2]))) > strcpy (p, p + 2); > - else if (SLASH_P (p[0]) && p[1] == '.' && p[2] == '.' > - && (p[3] == 0 || SLASH_P (p[3]))) > + else if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.' && p[2] == '.' > + && (p[3] == 0 || IS_DIR_SEPARATOR (p[3]))) > { > if (found_real_path) > { > /* Search backwards for the directory just before the "/.." > and obliterate it and the "/..". */ > char *q = p; > - while (q != current_directory && !SLASH_P (q[-1])) > + while (q != current_directory && !IS_DIR_SEPARATOR (q[-1])) > --q; > > if (q == current_directory) > > --- gdb/completer.c~5 Sun May 6 13:10:30 2001 > +++ gdb/completer.c Mon May 7 17:21:02 2001 > @@ -66,7 +66,7 @@ static char *gdb_completer_command_word_ > break characters any characters that are commonly used in file > names, such as '-', '+', '~', etc. Otherwise, readline displays > incorrect completion candidates. */ > -#ifdef __MSDOS__ > +#if HAVE_DOS_BASED_FILE_SYSTEM > /* MS-DOS and MS-Windows use colon as part of the drive spec, and most > programs support @foo style response files. */ > static char *gdb_completer_file_name_break_characters = " \t\n*|\"';?><@"; > > --- gdb/defs.h~0 Sat Mar 24 02:00:36 2001 > +++ gdb/defs.h Mon May 7 18:08:48 2001 > @@ -1330,34 +1330,14 @@ extern int use_windows; > #define DIRNAME_SEPARATOR ':' > #endif > > -#ifndef SLASH_P > -#if defined(__GO32__)||defined(_WIN32) > -#define SLASH_P(X) ((X)=='\\') > -#else > -#define SLASH_P(X) ((X)=='/') > -#endif > -#endif > - > -#ifndef SLASH_CHAR > -#if defined(__GO32__)||defined(_WIN32) > -#define SLASH_CHAR '\\' > -#else > -#define SLASH_CHAR '/' > -#endif > -#endif > - > #ifndef SLASH_STRING > -#if defined(__GO32__)||defined(_WIN32) > +#ifdef _WIN32 > #define SLASH_STRING "\\" > #else > #define SLASH_STRING "/" > #endif > #endif > > -#ifndef ROOTED_P > -#define ROOTED_P(X) (SLASH_P((X)[0])) > -#endif > - > /* On some systems, PIDGET is defined to extract the inferior pid from > an internal pid that has the thread id and pid in seperate bit > fields. If not defined, then just use the entire internal pid as > > --- gdb/solib.c~0 Tue Mar 6 10:41:56 2001 > +++ gdb/solib.c Mon May 7 18:11:24 2001 > @@ -39,6 +39,7 @@ > #include "language.h" > #include "gdbcmd.h" > #include "completer.h" > +#include "filenames.h" /* for DOSish file names */ > > #include "solist.h" > > @@ -101,10 +102,14 @@ solib_open (char *in_pathname, char **fo > { > int found_file = -1; > char *temp_pathname = NULL; > + char *p = in_pathname; > > - if (strchr (in_pathname, SLASH_CHAR)) > + while (*p && !IS_DIR_SEPARATOR (*p)) > + p++; > + > + if (*p) > { > - if (! ROOTED_P (in_pathname) || solib_absolute_prefix == NULL) > + if (! IS_ABSOLUTE_PATH (in_pathname) || solib_absolute_prefix == NULL) > temp_pathname = in_pathname; > else > { > @@ -112,7 +117,7 @@ solib_open (char *in_pathname, char **fo > > /* Remove trailing slashes from absolute prefix. */ > while (prefix_len > 0 > - && SLASH_P (solib_absolute_prefix[prefix_len - 1])) > + && IS_DIR_SEPARATOR (solib_absolute_prefix[prefix_len - 1])) > prefix_len--; > > /* Cat the prefixed pathname together. */ > > --- gdb/source.c~0 Tue Mar 27 22:57:04 2001 > +++ gdb/source.c Mon May 7 18:26:20 2001 > @@ -40,6 +40,7 @@ > #include "annotate.h" > #include "gdbtypes.h" > #include "linespec.h" > +#include "filenames.h" /* for DOSish file names */ > #ifdef UI_OUT > #include "ui-out.h" > #endif > @@ -330,12 +331,12 @@ mod_path (char *dirname, char **which_pa > } > } > > - if (!(SLASH_P (*name) && p <= name + 1) /* "/" */ > -#if defined(_WIN32) || defined(__MSDOS__) > + if (!(IS_DIR_SEPARATOR (*name) && p <= name + 1) /* "/" */ > +#if HAVE_DOS_BASED_FILE_SYSTEM > /* On MS-DOS and MS-Windows, h:\ is different from h: */ > - && !(!SLASH_P (*name) && ROOTED_P (name) && p <= name + 3) /* d:/ */ > + && !(p == name + 3 && name[1] == ':') /* "d:/" */ > #endif > - && SLASH_P (p[-1])) > + && IS_DIR_SEPARATOR (p[-1])) > /* Sigh. "foo/" => "foo" */ > --p; > *p = '\0'; > @@ -348,7 +349,7 @@ mod_path (char *dirname, char **which_pa > name = current_directory; > goto append; > } > - else if (p > name + 1 && SLASH_P (p[-2])) > + else if (p > name + 1 && IS_DIR_SEPARATOR (p[-2])) > { > if (p - name == 2) > { > @@ -370,11 +371,11 @@ mod_path (char *dirname, char **which_pa > > if (name[0] == '~') > name = tilde_expand (name); > -#if defined(_WIN32) || defined(__MSDOS__) > - else if (ROOTED_P (name) && p == name + 2) /* "d:" => "d:." */ > +#if HAVE_DOS_BASED_FILE_SYSTEM > + else if (IS_ABSOLUTE_PATH (name) && p == name + 2) /* "d:" => "d:." */ > name = concat (name, ".", NULL); > #endif > - else if (!ROOTED_P (name) && name[0] != '$') > + else if (!IS_ABSOLUTE_PATH (name) && name[0] != '$') > name = concat (current_directory, SLASH_STRING, name, NULL); > else > name = savestring (name, p - name); > @@ -530,7 +531,7 @@ openp (char *path, int try_cwd_first, ch > mode |= O_BINARY; > #endif > > - if (try_cwd_first || ROOTED_P (string)) > + if (try_cwd_first || IS_ABSOLUTE_PATH (string)) > { > int i; > filename = string; > @@ -538,12 +539,12 @@ openp (char *path, int try_cwd_first, ch > if (fd >= 0) > goto done; > for (i = 0; string[i]; i++) > - if (SLASH_P (string[i])) > + if (IS_DIR_SEPARATOR (string[i])) > goto done; > } > > /* ./foo => foo */ > - while (string[0] == '.' && SLASH_P (string[1])) > + while (string[0] == '.' && IS_DIR_SEPARATOR (string[1])) > string += 2; > > alloclen = strlen (path) + strlen (string) + 2; > @@ -581,7 +582,7 @@ openp (char *path, int try_cwd_first, ch > } > > /* Remove trailing slashes */ > - while (len > 0 && SLASH_P (filename[len - 1])) > + while (len > 0 && IS_DIR_SEPARATOR (filename[len - 1])) > filename[--len] = 0; > > strcat (filename + len, SLASH_STRING); > @@ -597,14 +598,14 @@ done: > { > if (fd < 0) > *filename_opened = (char *) 0; > - else if (ROOTED_P (filename)) > + else if (IS_ABSOLUTE_PATH (filename)) > *filename_opened = savestring (filename, strlen (filename)); > else > { > /* Beware the // my son, the Emacs barfs, the botch that catch... */ > > *filename_opened = concat (current_directory, > - SLASH_P (current_directory[strlen (current_directory) - 1]) > + IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]) > ? "" : SLASH_STRING, > filename, NULL); > } > ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Remove OS-specific defines (was: _WIN32?) 2001-05-13 1:29 ` Eli Zaretskii @ 2001-05-13 7:09 ` Fernando Nasser 2001-05-13 23:34 ` Eli Zaretskii 0 siblings, 1 reply; 20+ messages in thread From: Fernando Nasser @ 2001-05-13 7:09 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb-patches Eli Zaretskii wrote: > > > Date: Mon, 7 May 2001 19:10:59 +0300 (IDT) > > From: Eli Zaretskii <eliz@is.elta.co.il> > > > > I'm seeking approval for the following patches. They remove all the > > DOS- and Windows-specific #ifdef's like "#ifdef _WIN32" and use the > > portable macros from filenames.h instead. In addition, they convert > > code which used macros private to GDB, such as SLASH_P and ROOTED_P, > > to use the macros from filenames.h instead. > > Ping! > > I think I still need an approval for patches to source.c, completer.c > and cli-cmds.c (see below). Did I missed some messages? > I looked at completer.c and cli-cmds.c. Approved. Thanks. Fernando > > 2001-05-07 Eli Zaretskii <eliz@is.elta.co.il> > > > > * source.c (mod_path, openp): Use HAVE_DOS_BASED_FILE_SYSTEM > > instead of system-specific define's like _WIN32 and __MSDOS__. > > Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH instead of SLASH_P and > > ROOTED_P. > > (top-level): #include "filenames.h". > > > > * solib.c (solib_open): Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH > > instead of SLASH_CHAR, ROOTED_P and SLASH_P. > > (top-level): #include "filenames.h". > > > > * defs.h (SLASH_P, SLASH_CHAR, ROOTED_P): Remove definitions. > > (SLASH_STRING): Define only for _WIN32. > > > > * completer.c: Use HAVE_DOS_BASED_FILE_SYSTEM instead of > > __MSDOS_. > > > > * cli/cli-cmds.c (cd_command): Use IS_DIR_SEPARATOR and > > IS_ABSOLUTE_PATH instead of SLASH_P and ROOTED_P. Replace > > system-specific ifdefs with HAVE_DOS_BASED_FILE_SYSTEM. > > (top-level): #include "filenames.h". > > > > > > --- gdb/cli/cli-cmds.c~0 Thu Mar 29 01:42:22 2001 > > +++ gdb/cli/cli-cmds.c Mon May 7 18:08:40 2001 > > @@ -23,6 +23,7 @@ > > #include "target.h" /* For baud_rate, remote_debug and remote_timeout */ > > #include "gdb_wait.h" /* For shell escape implementation */ > > #include "gnu-regex.h" /* Used by apropos_command */ > > +#include "filenames.h" /* for DOSish file names */ > > > > #ifdef UI_OUT > > #include "ui-out.h" > > @@ -292,7 +293,7 @@ cd_command (char *dir, int from_tty) > > if (chdir (dir) < 0) > > perror_with_name (dir); > > > > -#if defined(_WIN32) || defined(__MSDOS__) > > +#if HAVE_DOS_BASED_FILE_SYSTEM > > /* There's too much mess with DOSish names like "d:", "d:.", > > "d:./foo" etc. Instead of having lots of special #ifdef'ed code, > > simply get the canonicalized name of the current directory. */ > > @@ -300,24 +301,24 @@ cd_command (char *dir, int from_tty) > > #endif > > > > len = strlen (dir); > > - if (SLASH_P (dir[len - 1])) > > + if (IS_DIR_SEPARATOR (dir[len - 1])) > > { > > /* Remove the trailing slash unless this is a root directory > > (including a drive letter on non-Unix systems). */ > > if (!(len == 1) /* "/" */ > > -#if defined(_WIN32) || defined(__MSDOS__) > > - && !(!SLASH_P (*dir) && ROOTED_P (dir) && len <= 3) /* "d:/" */ > > +#if HAVE_DOS_BASED_FILE_SYSTEM > > + && !(len == 3 && dir[1] == ':') /* "d:/" */ > > #endif > > ) > > len--; > > } > > > > dir = savestring (dir, len); > > - if (ROOTED_P (dir)) > > + if (IS_ABSOLUTE_PATH (dir)) > > current_directory = dir; > > else > > { > > - if (SLASH_P (current_directory[strlen (current_directory) - 1])) > > + if (IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])) > > current_directory = concat (current_directory, dir, NULL); > > else > > current_directory = concat (current_directory, SLASH_STRING, dir, NULL); > > @@ -329,17 +330,18 @@ cd_command (char *dir, int from_tty) > > found_real_path = 0; > > for (p = current_directory; *p;) > > { > > - if (SLASH_P (p[0]) && p[1] == '.' && (p[2] == 0 || SLASH_P (p[2]))) > > + if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.' > > + && (p[2] == 0 || IS_DIR_SEPARATOR (p[2]))) > > strcpy (p, p + 2); > > - else if (SLASH_P (p[0]) && p[1] == '.' && p[2] == '.' > > - && (p[3] == 0 || SLASH_P (p[3]))) > > + else if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.' && p[2] == '.' > > + && (p[3] == 0 || IS_DIR_SEPARATOR (p[3]))) > > { > > if (found_real_path) > > { > > /* Search backwards for the directory just before the "/.." > > and obliterate it and the "/..". */ > > char *q = p; > > - while (q != current_directory && !SLASH_P (q[-1])) > > + while (q != current_directory && !IS_DIR_SEPARATOR (q[-1])) > > --q; > > > > if (q == current_directory) > > > > --- gdb/completer.c~5 Sun May 6 13:10:30 2001 > > +++ gdb/completer.c Mon May 7 17:21:02 2001 > > @@ -66,7 +66,7 @@ static char *gdb_completer_command_word_ > > break characters any characters that are commonly used in file > > names, such as '-', '+', '~', etc. Otherwise, readline displays > > incorrect completion candidates. */ > > -#ifdef __MSDOS__ > > +#if HAVE_DOS_BASED_FILE_SYSTEM > > /* MS-DOS and MS-Windows use colon as part of the drive spec, and most > > programs support @foo style response files. */ > > static char *gdb_completer_file_name_break_characters = " \t\n*|\"';?><@"; > > > > --- gdb/defs.h~0 Sat Mar 24 02:00:36 2001 > > +++ gdb/defs.h Mon May 7 18:08:48 2001 > > @@ -1330,34 +1330,14 @@ extern int use_windows; > > #define DIRNAME_SEPARATOR ':' > > #endif > > > > -#ifndef SLASH_P > > -#if defined(__GO32__)||defined(_WIN32) > > -#define SLASH_P(X) ((X)=='\\') > > -#else > > -#define SLASH_P(X) ((X)=='/') > > -#endif > > -#endif > > - > > -#ifndef SLASH_CHAR > > -#if defined(__GO32__)||defined(_WIN32) > > -#define SLASH_CHAR '\\' > > -#else > > -#define SLASH_CHAR '/' > > -#endif > > -#endif > > - > > #ifndef SLASH_STRING > > -#if defined(__GO32__)||defined(_WIN32) > > +#ifdef _WIN32 > > #define SLASH_STRING "\\" > > #else > > #define SLASH_STRING "/" > > #endif > > #endif > > > > -#ifndef ROOTED_P > > -#define ROOTED_P(X) (SLASH_P((X)[0])) > > -#endif > > - > > /* On some systems, PIDGET is defined to extract the inferior pid from > > an internal pid that has the thread id and pid in seperate bit > > fields. If not defined, then just use the entire internal pid as > > > > --- gdb/solib.c~0 Tue Mar 6 10:41:56 2001 > > +++ gdb/solib.c Mon May 7 18:11:24 2001 > > @@ -39,6 +39,7 @@ > > #include "language.h" > > #include "gdbcmd.h" > > #include "completer.h" > > +#include "filenames.h" /* for DOSish file names */ > > > > #include "solist.h" > > > > @@ -101,10 +102,14 @@ solib_open (char *in_pathname, char **fo > > { > > int found_file = -1; > > char *temp_pathname = NULL; > > + char *p = in_pathname; > > > > - if (strchr (in_pathname, SLASH_CHAR)) > > + while (*p && !IS_DIR_SEPARATOR (*p)) > > + p++; > > + > > + if (*p) > > { > > - if (! ROOTED_P (in_pathname) || solib_absolute_prefix == NULL) > > + if (! IS_ABSOLUTE_PATH (in_pathname) || solib_absolute_prefix == NULL) > > temp_pathname = in_pathname; > > else > > { > > @@ -112,7 +117,7 @@ solib_open (char *in_pathname, char **fo > > > > /* Remove trailing slashes from absolute prefix. */ > > while (prefix_len > 0 > > - && SLASH_P (solib_absolute_prefix[prefix_len - 1])) > > + && IS_DIR_SEPARATOR (solib_absolute_prefix[prefix_len - 1])) > > prefix_len--; > > > > /* Cat the prefixed pathname together. */ > > > > --- gdb/source.c~0 Tue Mar 27 22:57:04 2001 > > +++ gdb/source.c Mon May 7 18:26:20 2001 > > @@ -40,6 +40,7 @@ > > #include "annotate.h" > > #include "gdbtypes.h" > > #include "linespec.h" > > +#include "filenames.h" /* for DOSish file names */ > > #ifdef UI_OUT > > #include "ui-out.h" > > #endif > > @@ -330,12 +331,12 @@ mod_path (char *dirname, char **which_pa > > } > > } > > > > - if (!(SLASH_P (*name) && p <= name + 1) /* "/" */ > > -#if defined(_WIN32) || defined(__MSDOS__) > > + if (!(IS_DIR_SEPARATOR (*name) && p <= name + 1) /* "/" */ > > +#if HAVE_DOS_BASED_FILE_SYSTEM > > /* On MS-DOS and MS-Windows, h:\ is different from h: */ > > - && !(!SLASH_P (*name) && ROOTED_P (name) && p <= name + 3) /* d:/ */ > > + && !(p == name + 3 && name[1] == ':') /* "d:/" */ > > #endif > > - && SLASH_P (p[-1])) > > + && IS_DIR_SEPARATOR (p[-1])) > > /* Sigh. "foo/" => "foo" */ > > --p; > > *p = '\0'; > > @@ -348,7 +349,7 @@ mod_path (char *dirname, char **which_pa > > name = current_directory; > > goto append; > > } > > - else if (p > name + 1 && SLASH_P (p[-2])) > > + else if (p > name + 1 && IS_DIR_SEPARATOR (p[-2])) > > { > > if (p - name == 2) > > { > > @@ -370,11 +371,11 @@ mod_path (char *dirname, char **which_pa > > > > if (name[0] == '~') > > name = tilde_expand (name); > > -#if defined(_WIN32) || defined(__MSDOS__) > > - else if (ROOTED_P (name) && p == name + 2) /* "d:" => "d:." */ > > +#if HAVE_DOS_BASED_FILE_SYSTEM > > + else if (IS_ABSOLUTE_PATH (name) && p == name + 2) /* "d:" => "d:." */ > > name = concat (name, ".", NULL); > > #endif > > - else if (!ROOTED_P (name) && name[0] != '$') > > + else if (!IS_ABSOLUTE_PATH (name) && name[0] != '$') > > name = concat (current_directory, SLASH_STRING, name, NULL); > > else > > name = savestring (name, p - name); > > @@ -530,7 +531,7 @@ openp (char *path, int try_cwd_first, ch > > mode |= O_BINARY; > > #endif > > > > - if (try_cwd_first || ROOTED_P (string)) > > + if (try_cwd_first || IS_ABSOLUTE_PATH (string)) > > { > > int i; > > filename = string; > > @@ -538,12 +539,12 @@ openp (char *path, int try_cwd_first, ch > > if (fd >= 0) > > goto done; > > for (i = 0; string[i]; i++) > > - if (SLASH_P (string[i])) > > + if (IS_DIR_SEPARATOR (string[i])) > > goto done; > > } > > > > /* ./foo => foo */ > > - while (string[0] == '.' && SLASH_P (string[1])) > > + while (string[0] == '.' && IS_DIR_SEPARATOR (string[1])) > > string += 2; > > > > alloclen = strlen (path) + strlen (string) + 2; > > @@ -581,7 +582,7 @@ openp (char *path, int try_cwd_first, ch > > } > > > > /* Remove trailing slashes */ > > - while (len > 0 && SLASH_P (filename[len - 1])) > > + while (len > 0 && IS_DIR_SEPARATOR (filename[len - 1])) > > filename[--len] = 0; > > > > strcat (filename + len, SLASH_STRING); > > @@ -597,14 +598,14 @@ done: > > { > > if (fd < 0) > > *filename_opened = (char *) 0; > > - else if (ROOTED_P (filename)) > > + else if (IS_ABSOLUTE_PATH (filename)) > > *filename_opened = savestring (filename, strlen (filename)); > > else > > { > > /* Beware the // my son, the Emacs barfs, the botch that catch... */ > > > > *filename_opened = concat (current_directory, > > - SLASH_P (current_directory[strlen (current_directory) - 1]) > > + IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]) > > ? "" : SLASH_STRING, > > filename, NULL); > > } > > -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Remove OS-specific defines (was: _WIN32?) 2001-05-13 7:09 ` Fernando Nasser @ 2001-05-13 23:34 ` Eli Zaretskii 2001-05-14 13:18 ` Andrew Cagney 0 siblings, 1 reply; 20+ messages in thread From: Eli Zaretskii @ 2001-05-13 23:34 UTC (permalink / raw) To: fnasser; +Cc: gdb-patches > Date: Sun, 13 May 2001 10:07:00 -0400 > From: Fernando Nasser <fnasser@redhat.com> > > Eli Zaretskii wrote: > > > > > Date: Mon, 7 May 2001 19:10:59 +0300 (IDT) > > > From: Eli Zaretskii <eliz@is.elta.co.il> > > > > > > I'm seeking approval for the following patches. They remove all the > > > DOS- and Windows-specific #ifdef's like "#ifdef _WIN32" and use the > > > portable macros from filenames.h instead. In addition, they convert > > > code which used macros private to GDB, such as SLASH_P and ROOTED_P, > > > to use the macros from filenames.h instead. > > > > Ping! > > > > I think I still need an approval for patches to source.c, completer.c > > and cli-cmds.c (see below). Did I missed some messages? > > > > I looked at completer.c and cli-cmds.c. Approved. Thanks! Who is the responsible maintainer of source.c? I cannot figure that out from MAINTAINERS. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Remove OS-specific defines (was: _WIN32?) 2001-05-13 23:34 ` Eli Zaretskii @ 2001-05-14 13:18 ` Andrew Cagney 2001-06-04 0:46 ` Eli Zaretskii 0 siblings, 1 reply; 20+ messages in thread From: Andrew Cagney @ 2001-05-14 13:18 UTC (permalink / raw) To: Eli Zaretskii; +Cc: fnasser, gdb-patches > I looked at completer.c and cli-cmds.c. Approved. > > > Thanks! > > Who is the responsible maintainer of source.c? I cannot figure that > out from MAINTAINERS. FYI, I've been working on the assumption that everyone has decided this change is obvious. enjoy, and thanks for cleaning these out. Andrew ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Remove OS-specific defines (was: _WIN32?) 2001-05-14 13:18 ` Andrew Cagney @ 2001-06-04 0:46 ` Eli Zaretskii 0 siblings, 0 replies; 20+ messages in thread From: Eli Zaretskii @ 2001-06-04 0:46 UTC (permalink / raw) To: Andrew Cagney; +Cc: fnasser, gdb-patches On Mon, 14 May 2001, Andrew Cagney wrote: > > I looked at completer.c and cli-cmds.c. Approved. > > > > > > Thanks! > > > > Who is the responsible maintainer of source.c? I cannot figure that > > out from MAINTAINERS. > > > FYI, I've been working on the assumption that everyone has decided this > change is obvious. Commited (sorry for a long delay). ^ permalink raw reply [flat|nested] 20+ messages in thread
[parent not found: <200105071609.TAA24129@is.elta.co.il>]
[parent not found: <200105081141.OAA06131@is.elta.co.il>]
* [RFA] Re: DOS/Windows-specific code: cli-cmds.c [not found] ` <200105081141.OAA06131@is.elta.co.il> @ 2001-06-10 6:27 ` Eli Zaretskii 0 siblings, 0 replies; 20+ messages in thread From: Eli Zaretskii @ 2001-06-10 6:27 UTC (permalink / raw) To: gdb-patches; +Cc: Christopher Faylor > Date: Tue, 8 May 2001 14:41:53 +0300 (IDT) > From: Eli Zaretskii <eliz@is.elta.co.il> > > * cli-cmds.c: > > /* FIXME: this should be auto-configured! */ > #ifdef __MSDOS__ > # define CANT_FORK > #endif > > This seems to cry for either an Autoconf test (based on whether the > compiler defines __MSDOS__ or not) or perhaps the whole snippet should > be moved to config/i386/xm-go32.h. > > > * cli-cmds.c:shell_escape() > > #ifdef __DJGPP__ > /* Make sure to return to the directory GDB thinks it is, in case the > shell command we just ran changed it. */ > chdir (current_directory); > #endif > > This code is there because the current working directory is a global > notion (as opposed to being private to each process on Posix > systems). Windows ports, at least the non-Cygwin ones, probably want > this as well. Suggestions how to test this, anyone? Should we define > a GLOBAL_CURDIR macro (zero by default)? Here's the patch to fix these two issues. Okay to commit? 2001-06-10 Eli Zaretskii <eliz@is.elta.co.il> * cli/cli-cmds.c (shell_escape) [GLOBAL_CURDIR]: Condition the call to chdir on this symbol rather than on __DJGPP__. (CANT_FORK) [__MSDOS__]: Move from here... * defs.h (CANT_FORK) [__MSDOS__]: ...to here. (GLOBAL_CURDIR) [__MSDOS__]: Define. --- gdb/defs.h~0 Mon Jun 4 09:38:04 2001 +++ gdb/defs.h Sun Jun 10 16:08:22 2001 @@ -1372,6 +1372,11 @@ #endif #endif +#ifdef __MSDOS__ +# define CANT_FORK +# define GLOBAL_CURDIR +#endif + /* Provide default definitions of PIDGET, TIDGET, and MERGEPID. The name ``TIDGET'' is a historical accident. Many uses of TIDGET in the code actually refer to a lightweight process id, i.e, --- gdb/cli/cli-cmds.c~0 Wed Jun 6 12:25:24 2001 +++ gdb/cli/cli-cmds.c Sun Jun 10 16:10:18 2001 @@ -39,11 +39,6 @@ #define GDBINIT_FILENAME ".gdbinit" #endif -/* FIXME: this should be auto-configured! */ -#ifdef __MSDOS__ -# define CANT_FORK -#endif - /* From gdb/top.c */ extern void dont_repeat (void); @@ -454,7 +449,7 @@ fprintf_unfiltered (gdb_stderr, "%s exited with status %d\n", arg, rc); gdb_flush (gdb_stderr); } -#ifdef __DJGPP__ +#ifdef GLOBAL_CURDIR /* Make sure to return to the directory GDB thinks it is, in case the shell command we just ran changed it. */ chdir (current_directory); ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Re: DOS/Windows-specific code: cli-cmds.c
@ 2001-06-21 9:47 David Taylor
2001-06-21 11:44 ` Eli Zaretskii
2001-07-12 0:50 ` Eli Zaretskii
0 siblings, 2 replies; 20+ messages in thread
From: David Taylor @ 2001-06-21 9:47 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches, Christopher Faylor
Date: Sun, 10 Jun 2001 16:28:57 +0300 (IDT)
From: Eli Zaretskii <eliz@is.elta.co.il>
> Date: Tue, 8 May 2001 14:41:53 +0300 (IDT)
> From: Eli Zaretskii <eliz@is.elta.co.il>
>
> * cli-cmds.c:
>
> /* FIXME: this should be auto-configured! */
> #ifdef __MSDOS__
> # define CANT_FORK
> #endif
>
> This seems to cry for either an Autoconf test (based on whether the
> compiler defines __MSDOS__ or not) or perhaps the whole snippet should
> be moved to config/i386/xm-go32.h.
>
>
> * cli-cmds.c:shell_escape()
>
> #ifdef __DJGPP__
> /* Make sure to return to the directory GDB thinks it is, in case the
> shell command we just ran changed it. */
> chdir (current_directory);
> #endif
>
> This code is there because the current working directory is a global
> notion (as opposed to being private to each process on Posix
> systems). Windows ports, at least the non-Cygwin ones, probably want
> this as well. Suggestions how to test this, anyone? Should we define
> a GLOBAL_CURDIR macro (zero by default)?
Here's the patch to fix these two issues. Okay to commit?
2001-06-10 Eli Zaretskii <eliz@is.elta.co.il>
* cli/cli-cmds.c (shell_escape) [GLOBAL_CURDIR]: Condition the
call to chdir on this symbol rather than on __DJGPP__.
(CANT_FORK) [__MSDOS__]: Move from here...
* defs.h (CANT_FORK) [__MSDOS__]: ...to here.
(GLOBAL_CURDIR) [__MSDOS__]: Define.
Sorry for the delay. The defs.h part is approved.
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [RFA] Re: DOS/Windows-specific code: cli-cmds.c 2001-06-21 9:47 David Taylor @ 2001-06-21 11:44 ` Eli Zaretskii 2001-07-12 0:50 ` Eli Zaretskii 1 sibling, 0 replies; 20+ messages in thread From: Eli Zaretskii @ 2001-06-21 11:44 UTC (permalink / raw) To: taylor; +Cc: gdb-patches, cgf > Date: Thu, 21 Jun 2001 12:47:14 -0400 > From: David Taylor <taylor@candd.org> > > 2001-06-10 Eli Zaretskii <eliz@is.elta.co.il> > > * cli/cli-cmds.c (shell_escape) [GLOBAL_CURDIR]: Condition the > call to chdir on this symbol rather than on __DJGPP__. > (CANT_FORK) [__MSDOS__]: Move from here... > * defs.h (CANT_FORK) [__MSDOS__]: ...to here. > (GLOBAL_CURDIR) [__MSDOS__]: Define. > > Sorry for the delay. The defs.h part is approved. Thanks. Fernando, is the patch to cli-cmds.c okay with you? ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Re: DOS/Windows-specific code: cli-cmds.c 2001-06-21 9:47 David Taylor 2001-06-21 11:44 ` Eli Zaretskii @ 2001-07-12 0:50 ` Eli Zaretskii 2001-07-12 5:29 ` Fernando Nasser ` (2 more replies) 1 sibling, 3 replies; 20+ messages in thread From: Eli Zaretskii @ 2001-07-12 0:50 UTC (permalink / raw) To: Fernando Nasser; +Cc: gdb-patches, cgf > Date: Thu, 21 Jun 2001 12:47:14 -0400 > From: David Taylor <taylor@candd.org> > > Date: Sun, 10 Jun 2001 16:28:57 +0300 (IDT) > From: Eli Zaretskii <eliz@is.elta.co.il> > > > Date: Tue, 8 May 2001 14:41:53 +0300 (IDT) > > From: Eli Zaretskii <eliz@is.elta.co.il> > > > > * cli-cmds.c: > > > > /* FIXME: this should be auto-configured! */ > > #ifdef __MSDOS__ > > # define CANT_FORK > > #endif > > > > This seems to cry for either an Autoconf test (based on whether the > > compiler defines __MSDOS__ or not) or perhaps the whole snippet should > > be moved to config/i386/xm-go32.h. > > > > > > * cli-cmds.c:shell_escape() > > > > #ifdef __DJGPP__ > > /* Make sure to return to the directory GDB thinks it is, in case the > > shell command we just ran changed it. */ > > chdir (current_directory); > > #endif > > > > This code is there because the current working directory is a global > > notion (as opposed to being private to each process on Posix > > systems). Windows ports, at least the non-Cygwin ones, probably want > > this as well. Suggestions how to test this, anyone? Should we define > > a GLOBAL_CURDIR macro (zero by default)? > > Here's the patch to fix these two issues. Okay to commit? > > > 2001-06-10 Eli Zaretskii <eliz@is.elta.co.il> > > * cli/cli-cmds.c (shell_escape) [GLOBAL_CURDIR]: Condition the > call to chdir on this symbol rather than on __DJGPP__. > (CANT_FORK) [__MSDOS__]: Move from here... > * defs.h (CANT_FORK) [__MSDOS__]: ...to here. > (GLOBAL_CURDIR) [__MSDOS__]: Define. > > Sorry for the delay. The defs.h part is approved. Fernando, could you please review this? Thanks. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Re: DOS/Windows-specific code: cli-cmds.c 2001-07-12 0:50 ` Eli Zaretskii @ 2001-07-12 5:29 ` Fernando Nasser 2001-07-12 8:07 ` Eli Zaretskii 2001-07-12 10:21 ` Christopher Faylor 2001-07-12 15:38 ` Fernando Nasser 2 siblings, 1 reply; 20+ messages in thread From: Fernando Nasser @ 2001-07-12 5:29 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb-patches, cgf I cant't find the original message. Can someone send me a copy? Thanks. Fernando Eli Zaretskii wrote: > > > Date: Thu, 21 Jun 2001 12:47:14 -0400 > > From: David Taylor <taylor@candd.org> > > > > Date: Sun, 10 Jun 2001 16:28:57 +0300 (IDT) > > From: Eli Zaretskii <eliz@is.elta.co.il> > > > > > Date: Tue, 8 May 2001 14:41:53 +0300 (IDT) > > > From: Eli Zaretskii <eliz@is.elta.co.il> > > > > > > * cli-cmds.c: > > > > > > /* FIXME: this should be auto-configured! */ > > > #ifdef __MSDOS__ > > > # define CANT_FORK > > > #endif > > > > > > This seems to cry for either an Autoconf test (based on whether the > > > compiler defines __MSDOS__ or not) or perhaps the whole snippet should > > > be moved to config/i386/xm-go32.h. > > > > > > > > > * cli-cmds.c:shell_escape() > > > > > > #ifdef __DJGPP__ > > > /* Make sure to return to the directory GDB thinks it is, in case the > > > shell command we just ran changed it. */ > > > chdir (current_directory); > > > #endif > > > > > > This code is there because the current working directory is a global > > > notion (as opposed to being private to each process on Posix > > > systems). Windows ports, at least the non-Cygwin ones, probably want > > > this as well. Suggestions how to test this, anyone? Should we define > > > a GLOBAL_CURDIR macro (zero by default)? > > > > Here's the patch to fix these two issues. Okay to commit? > > > > > > 2001-06-10 Eli Zaretskii <eliz@is.elta.co.il> > > > > * cli/cli-cmds.c (shell_escape) [GLOBAL_CURDIR]: Condition the > > call to chdir on this symbol rather than on __DJGPP__. > > (CANT_FORK) [__MSDOS__]: Move from here... > > * defs.h (CANT_FORK) [__MSDOS__]: ...to here. > > (GLOBAL_CURDIR) [__MSDOS__]: Define. > > > > Sorry for the delay. The defs.h part is approved. > > Fernando, could you please review this? Thanks. -- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Re: DOS/Windows-specific code: cli-cmds.c 2001-07-12 5:29 ` Fernando Nasser @ 2001-07-12 8:07 ` Eli Zaretskii 0 siblings, 0 replies; 20+ messages in thread From: Eli Zaretskii @ 2001-07-12 8:07 UTC (permalink / raw) To: Fernando Nasser; +Cc: gdb-patches, cgf On Thu, 12 Jul 2001, Fernando Nasser wrote: > I cant't find the original message. Can someone send me a copy? I don't have a copy, but you can find the original message here: http://sources.redhat.com/ml/gdb-patches/2001-06/msg00196.html ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Re: DOS/Windows-specific code: cli-cmds.c 2001-07-12 0:50 ` Eli Zaretskii 2001-07-12 5:29 ` Fernando Nasser @ 2001-07-12 10:21 ` Christopher Faylor 2001-07-12 11:22 ` Eli Zaretskii 2001-07-12 15:38 ` Fernando Nasser 2 siblings, 1 reply; 20+ messages in thread From: Christopher Faylor @ 2001-07-12 10:21 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Fernando Nasser, gdb-patches On Thu, Jul 12, 2001 at 10:51:59AM +0300, Eli Zaretskii wrote: >> Date: Thu, 21 Jun 2001 12:47:14 -0400 >> From: David Taylor <taylor@candd.org> >> >> Date: Sun, 10 Jun 2001 16:28:57 +0300 (IDT) >> From: Eli Zaretskii <eliz@is.elta.co.il> >> >> > Date: Tue, 8 May 2001 14:41:53 +0300 (IDT) >> > From: Eli Zaretskii <eliz@is.elta.co.il> >> > >> > * cli-cmds.c: >> > >> > /* FIXME: this should be auto-configured! */ >> > #ifdef __MSDOS__ >> > # define CANT_FORK >> > #endif >> > >> > This seems to cry for either an Autoconf test (based on whether the >> > compiler defines __MSDOS__ or not) or perhaps the whole snippet should >> > be moved to config/i386/xm-go32.h. >> > >> > >> > * cli-cmds.c:shell_escape() >> > >> > #ifdef __DJGPP__ >> > /* Make sure to return to the directory GDB thinks it is, in case the >> > shell command we just ran changed it. */ >> > chdir (current_directory); >> > #endif >> > >> > This code is there because the current working directory is a global >> > notion (as opposed to being private to each process on Posix >> > systems). Windows ports, at least the non-Cygwin ones, probably want >> > this as well. Suggestions how to test this, anyone? Should we define >> > a GLOBAL_CURDIR macro (zero by default)? >> >> Here's the patch to fix these two issues. Okay to commit? >> >> >> 2001-06-10 Eli Zaretskii <eliz@is.elta.co.il> >> >> * cli/cli-cmds.c (shell_escape) [GLOBAL_CURDIR]: Condition the >> call to chdir on this symbol rather than on __DJGPP__. >> (CANT_FORK) [__MSDOS__]: Move from here... >> * defs.h (CANT_FORK) [__MSDOS__]: ...to here. >> (GLOBAL_CURDIR) [__MSDOS__]: Define. >> >> Sorry for the delay. The defs.h part is approved. > >Fernando, could you please review this? Thanks. FWIW, Cygwin doesn't need any special chdir considerations. This should be a MSDOS only issue. cgf ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Re: DOS/Windows-specific code: cli-cmds.c 2001-07-12 10:21 ` Christopher Faylor @ 2001-07-12 11:22 ` Eli Zaretskii 2001-07-12 11:27 ` Christopher Faylor 0 siblings, 1 reply; 20+ messages in thread From: Eli Zaretskii @ 2001-07-12 11:22 UTC (permalink / raw) To: cgf; +Cc: fnasser, gdb-patches > Date: Thu, 12 Jul 2001 13:21:45 -0400 > From: Christopher Faylor <cgf@redhat.com> > >> > >> 2001-06-10 Eli Zaretskii <eliz@is.elta.co.il> > >> > >> * cli/cli-cmds.c (shell_escape) [GLOBAL_CURDIR]: Condition the > >> call to chdir on this symbol rather than on __DJGPP__. > >> (CANT_FORK) [__MSDOS__]: Move from here... > >> * defs.h (CANT_FORK) [__MSDOS__]: ...to here. > >> (GLOBAL_CURDIR) [__MSDOS__]: Define. > >> > >> Sorry for the delay. The defs.h part is approved. > > > >Fernando, could you please review this? Thanks. > > FWIW, Cygwin doesn't need any special chdir considerations. This > should be a MSDOS only issue. Well, that's why GLOBAL_CURDIR is not defined for Cygwin... ;-) ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Re: DOS/Windows-specific code: cli-cmds.c 2001-07-12 11:22 ` Eli Zaretskii @ 2001-07-12 11:27 ` Christopher Faylor 0 siblings, 0 replies; 20+ messages in thread From: Christopher Faylor @ 2001-07-12 11:27 UTC (permalink / raw) To: gdb-patches On Thu, Jul 12, 2001 at 09:22:33PM +0300, Eli Zaretskii wrote: >> Date: Thu, 12 Jul 2001 13:21:45 -0400 >> From: Christopher Faylor <cgf@redhat.com> >> >> >> >> 2001-06-10 Eli Zaretskii <eliz@is.elta.co.il> >> >> >> >> * cli/cli-cmds.c (shell_escape) [GLOBAL_CURDIR]: Condition the >> >> call to chdir on this symbol rather than on __DJGPP__. >> >> (CANT_FORK) [__MSDOS__]: Move from here... >> >> * defs.h (CANT_FORK) [__MSDOS__]: ...to here. >> >> (GLOBAL_CURDIR) [__MSDOS__]: Define. >> >> >> >> Sorry for the delay. The defs.h part is approved. >> > >> >Fernando, could you please review this? Thanks. >> >> FWIW, Cygwin doesn't need any special chdir considerations. This >> should be a MSDOS only issue. > >Well, that's why GLOBAL_CURDIR is not defined for Cygwin... ;-) Ok. I'm just responding since I am being Cc'ed in this email. I've redirected future responses back to gdb-patches only. cgf ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Re: DOS/Windows-specific code: cli-cmds.c 2001-07-12 0:50 ` Eli Zaretskii 2001-07-12 5:29 ` Fernando Nasser 2001-07-12 10:21 ` Christopher Faylor @ 2001-07-12 15:38 ` Fernando Nasser 2001-07-16 7:14 ` Eli Zaretskii 2 siblings, 1 reply; 20+ messages in thread From: Fernando Nasser @ 2001-07-12 15:38 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Fernando Nasser, gdb-patches, cgf Eli Zaretskii wrote: > > > Date: Thu, 21 Jun 2001 12:47:14 -0400 > > From: David Taylor <taylor@candd.org> > > > > Date: Sun, 10 Jun 2001 16:28:57 +0300 (IDT) > > From: Eli Zaretskii <eliz@is.elta.co.il> > > > > > Date: Tue, 8 May 2001 14:41:53 +0300 (IDT) > > > From: Eli Zaretskii <eliz@is.elta.co.il> > > > > > > * cli-cmds.c: > > > > > > /* FIXME: this should be auto-configured! */ > > > #ifdef __MSDOS__ > > > # define CANT_FORK > > > #endif > > > > > > This seems to cry for either an Autoconf test (based on whether the > > > compiler defines __MSDOS__ or not) or perhaps the whole snippet should > > > be moved to config/i386/xm-go32.h. > > > > > > > > > * cli-cmds.c:shell_escape() > > > > > > #ifdef __DJGPP__ > > > /* Make sure to return to the directory GDB thinks it is, in case the > > > shell command we just ran changed it. */ > > > chdir (current_directory); > > > #endif > > > > > > This code is there because the current working directory is a global > > > notion (as opposed to being private to each process on Posix > > > systems). Windows ports, at least the non-Cygwin ones, probably want > > > this as well. Suggestions how to test this, anyone? Should we define > > > a GLOBAL_CURDIR macro (zero by default)? > > > > Here's the patch to fix these two issues. Okay to commit? > > > > > > 2001-06-10 Eli Zaretskii <eliz@is.elta.co.il> > > > > * cli/cli-cmds.c (shell_escape) [GLOBAL_CURDIR]: Condition the > > call to chdir on this symbol rather than on __DJGPP__. > > (CANT_FORK) [__MSDOS__]: Move from here... > > * defs.h (CANT_FORK) [__MSDOS__]: ...to here. > > (GLOBAL_CURDIR) [__MSDOS__]: Define. > > > > Sorry for the delay. The defs.h part is approved. > > Fernando, could you please review this? Thanks. OK to commit. Sorry for the delay. Regards, Fernando -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9 ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [RFA] Re: DOS/Windows-specific code: cli-cmds.c 2001-07-12 15:38 ` Fernando Nasser @ 2001-07-16 7:14 ` Eli Zaretskii 0 siblings, 0 replies; 20+ messages in thread From: Eli Zaretskii @ 2001-07-16 7:14 UTC (permalink / raw) To: Fernando Nasser; +Cc: gdb-patches On Thu, 12 Jul 2001, Fernando Nasser wrote: > > > 2001-06-10 Eli Zaretskii <eliz@is.elta.co.il> > > > > > > * cli/cli-cmds.c (shell_escape) [GLOBAL_CURDIR]: Condition the > > > call to chdir on this symbol rather than on __DJGPP__. > > > (CANT_FORK) [__MSDOS__]: Move from here... > > > * defs.h (CANT_FORK) [__MSDOS__]: ...to here. > > > (GLOBAL_CURDIR) [__MSDOS__]: Define. > > > > > > Sorry for the delay. The defs.h part is approved. > > > > Fernando, could you please review this? Thanks. > > OK to commit. Committed. Thanks. ^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2001-07-16 7:14 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20010503211502.21716.qmail@web6401.mail.yahoo.com>
[not found] ` <3AF1DAA0.3060702@cygnus.com>
[not found] ` <200105071610.TAA24144@is.elta.co.il>
[not found] ` <1010507173855.ZM18890@ocotillo.lan>
2001-05-07 11:24 ` [RFA] Remove OS-specific defines (was: _WIN32?) Eli Zaretskii
2001-06-10 6:28 ` Eli Zaretskii
2001-06-12 17:14 ` Christopher Faylor
2001-06-13 2:08 ` Eli Zaretskii
2001-05-13 1:29 ` Eli Zaretskii
2001-05-13 7:09 ` Fernando Nasser
2001-05-13 23:34 ` Eli Zaretskii
2001-05-14 13:18 ` Andrew Cagney
2001-06-04 0:46 ` Eli Zaretskii
[not found] ` <200105071609.TAA24129@is.elta.co.il>
[not found] ` <200105081141.OAA06131@is.elta.co.il>
2001-06-10 6:27 ` [RFA] Re: DOS/Windows-specific code: cli-cmds.c Eli Zaretskii
2001-06-21 9:47 David Taylor
2001-06-21 11:44 ` Eli Zaretskii
2001-07-12 0:50 ` Eli Zaretskii
2001-07-12 5:29 ` Fernando Nasser
2001-07-12 8:07 ` Eli Zaretskii
2001-07-12 10:21 ` Christopher Faylor
2001-07-12 11:22 ` Eli Zaretskii
2001-07-12 11:27 ` Christopher Faylor
2001-07-12 15:38 ` Fernando Nasser
2001-07-16 7:14 ` Eli Zaretskii
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox