2002-12-13 Jeff Johnston <jjohnstn@redhat.com>
authorJeff Johnston <jjohnstn@redhat.com>
Fri, 13 Dec 2002 17:55:49 +0000 (17:55 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Fri, 13 Dec 2002 17:55:49 +0000 (17:55 +0000)
        * defs.h (init_last_source_visited): New prototype.
        (add_path): Ditto.
        * source.c (add_path): New function that adds to a specified path.
        (mod_path): Change to call add_path.
        (init_last_source_visited): New function to allow interfaces to
        initialize static variable: last_source_visited.  Part of fix
        for PR gdb/741.
        * Makefile.in: Add support for mi/mi-cmd-env.c.

gdb/ChangeLog
gdb/Makefile.in
gdb/defs.h
gdb/source.c

index bd4af6a2ec6edd18310ea2214930b620ca4d1ae8..374231b9db5b0a74ccd8b7930e062b5bb1b7cfab 100644 (file)
@@ -1,3 +1,14 @@
+2002-12-13  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * defs.h (init_last_source_visited): New prototype.
+       (add_path): Ditto.
+       * source.c (add_path): New function that adds to a specified path.
+       (mod_path): Change to call add_path.
+       (init_last_source_visited): New function to allow interfaces to
+       initialize static variable: last_source_visited.  Part of fix
+       for PR gdb/741.
+       * Makefile.in: Add support for mi/mi-cmd-env.c.
+
 2002-12-13  Andrew Cagney  <ac131313@redhat.com>
 
        * frame.h (frame_id_unwind): Declare.
index 441f7332360531f87450ae777c016da7af63fb27..28dca01ece6b52d9aa2fd186d3804bac2b4612ee 100644 (file)
@@ -168,12 +168,12 @@ SUBDIR_CLI_UNINSTALL=
 #
 SUBDIR_MI_OBS = \
        mi-out.o mi-console.o \
-       mi-cmds.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \
+       mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \
        mi-cmd-disas.o \
        mi-main.o mi-parse.o mi-getopt.o
 SUBDIR_MI_SRCS = \
        mi/mi-out.c mi/mi-console.c \
-       mi/mi-cmds.c \
+       mi/mi-cmds.c mi/mi-cmd-env.c \
        mi/mi-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \
        mi/mi-cmd-disas.c \
        mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c
@@ -2536,6 +2536,10 @@ mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \
 mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \
        $(mi_cmds_h) $(mi_getopt_h) $(ui_out_h) $(gdb_string_h) $(disasm_h)
        $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c
+mi-cmd-env.o: $(srcdir)/mi/mi-cmd-env.c $(defs_h) $(mi_cmds_h) $(ui_out_h) \
+       $(mi_out_h) $(varobj_h) $(value_h) $(gdb_string_h) $(inferior.h) \
+       $(mi_getopt_h) $(environ_h) $(gdbcmd_h) $(top_h)
+       $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-env.c
 mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \
        $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h)
        $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-stack.c
index 3ac3d9a5d60b5894281e495b2b4cd46b55faac35..9aa604cf632c4c761a6df5d67f891c96022cad2e 100644 (file)
@@ -572,10 +572,16 @@ extern int source_full_path_of (char *, char **);
 
 extern void mod_path (char *, char **);
 
+extern void add_path (char *, char **, int);
+
 extern void directory_command (char *, int);
 
+extern char *source_path;
+
 extern void init_source_path (void);
 
+extern void init_last_source_visited (void);
+
 extern char *symtab_to_filename (struct symtab *);
 
 /* From exec.c */
index be5d90c338651d6186e89e50c29cf64b76e058ae..c2991b5bfd1f995acb74ef3ed33e3a440ec59765 100644 (file)
@@ -358,6 +358,12 @@ init_source_path (void)
   forget_cached_source_info ();
 }
 
+void
+init_last_source_visited (void)
+{
+  last_source_visited = NULL;
+}
+
 /* Add zero or more directories to the front of the source path.  */
 
 void
@@ -387,6 +393,18 @@ directory_command (char *dirname, int from_tty)
 
 void
 mod_path (char *dirname, char **which_path)
+{
+  add_path (dirname, which_path, 1);
+}
+
+/* Workhorse of mod_path.  Takes an extra argument to determine
+   if dirname should be parsed for separators that indicate multiple
+   directories.  This allows for interfaces that pre-parse the dirname
+   and allow specification of traditional separator characters such
+   as space or tab. */
+
+void
+add_path (char *dirname, char **which_path, int parse_separators)
 {
   char *old = *which_path;
   int prefix = 0;
@@ -404,9 +422,16 @@ mod_path (char *dirname, char **which_path)
       struct stat st;
 
       {
-       char *separator = strchr (name, DIRNAME_SEPARATOR);
-       char *space = strchr (name, ' ');
-       char *tab = strchr (name, '\t');
+       char *separator = NULL;
+       char *space = NULL;
+       char *tab = NULL;
+
+       if (parse_separators)
+         {
+           separator = strchr (name, DIRNAME_SEPARATOR);
+           space = strchr (name, ' ');
+           tab = strchr (name, '\t');
+         }
 
        if (separator == 0 && space == 0 && tab == 0)
          p = dirname = name + strlen (name);
@@ -537,7 +562,8 @@ mod_path (char *dirname, char **which_path)
            tinybuf[0] = DIRNAME_SEPARATOR;
            tinybuf[1] = '\0';
 
-           /* If we have already tacked on a name(s) in this command,                     be sure they stay on the front as we tack on some more.  */
+           /* If we have already tacked on a name(s) in this command, be sure they stay 
+              on the front as we tack on some more.  */
            if (prefix)
              {
                char *temp, c;
This page took 0.041331 seconds and 4 git commands to generate.