+ /* Check if the user wants to set a different working directory for
+ the inferior. */
+ inferior_cwd = get_inferior_cwd ();
+
+ if (inferior_cwd != NULL)
+ {
+ /* Expand before forking because between fork and exec, the child
+ process may only execute async-signal-safe operations. */
+ expanded_inferior_cwd = gdb_tilde_expand (inferior_cwd);
+ inferior_cwd = expanded_inferior_cwd.c_str ();
+ }
+