binutils-gdb/gdb/compile
Andrew Burgess e454ae416a gdb: allow quoted filenames for commands that have custom completion
This commit changes how GDB processes command arguments for the
following commands:

  compile file
  maint print c-tdesc
  save gdb-index

After this commit these commands will now expect their single filename
argument to be (optionally) quoted if it contains any special
characters (e.g. whit space or quotes).

If the filename does not contain any special characters then nothing
changes.  As an example:

   (gdb) save gdb-index /path/to/some/directory/

will work before and after this patch.  However, if the directory
name contains a white space then before this patch a user would write:

  (gdb) save gdb-index /path/to some/directory/

But this will now fail as GDB will consider this as two arguments,
'/path/to' and 'some/directory/'.  To pass this single directory name
a user must now do one of these:

  (gdb) save gdb-index "/path/to some/directory/"
  (gdb) save gdb-index '/path/to some/directory/'
  (gdb) save gdb-index /path/to\ some/directory/

This brings these commands into line with commands like 'file' and
'symbol-file', which have supported quoted filenames for a while.

The motivation for this change is to make handling of filename
arguments consistent throughout GDB.  We can't move to all commands
taking non-quoted filenames as the non-quoted style only allows for a
single argument.  Additionally, the non-quoted style doesn't allow for
filenames that end in white space (though this is probably pretty
rare).  So, if we want to have consistency the only choice is to move
towards supporting quote filenames.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2024-09-07 20:28:59 +01:00
..
compile-c-support.c
compile-c-symbols.c gdb: add program_space parameter to lookup_minimal_symbol 2024-08-12 10:31:09 -04:00
compile-c-types.c
compile-c.h
compile-cplus-symbols.c gdb: add program_space parameter to lookup_minimal_symbol 2024-08-12 10:31:09 -04:00
compile-cplus-types.c gdb: remove gdbcmd.h 2024-04-25 12:59:02 -04:00
compile-cplus.h
compile-internal.h
compile-loc2c.c
compile-object-load.c gdb: add program_space parameter to lookup_minimal_symbol 2024-08-12 10:31:09 -04:00
compile-object-load.h gdb: move enum compile_i_scope_types to compile/compile.h 2024-04-22 21:34:19 -04:00
compile-object-run.c
compile-object-run.h
compile.c gdb: allow quoted filenames for commands that have custom completion 2024-09-07 20:28:59 +01:00
compile.h gdb: move enum compile_i_scope_types to compile/compile.h 2024-04-22 21:34:19 -04:00
gcc-c-plugin.h
gcc-cp-plugin.h