This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Allow spaces in filenames to load command


Jim Blandy wrote:
On 12/5/05, Andrew STUBBS <andrew.stubbs@st.com> wrote:

2005-12-05 Andrew Stubbs <andrew.stubbs@st.com>

       * symfile.c (generic_load): Use buildargv and tilde_expand
       to parse file names with quoting, spaces and tildes properly.


Hi, Andrew. I like the idea of using buildargv and tilde_expand.


+  /* Do we have args from the user or from the default?  */
+  if (exec_bfd && args == get_exec_file (1))
+      /* The string is ONLY the file name.  */
+      filename = args;


What is this about? This seems very fragile.


load_command passes either the string from the command line or else the result of get_exec_file(). If it does the latter then we must not attempt to use build_argv because it would not be properly quoted and would break if there were spaces.


How about a new comment?

/* load_command() may have passed a string from the user or from
   get_exec_file(). In the latter case do not do build_argv.  */


Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]