Debugging through exec() (Linux MAY_FOLLOW_EXEC)

Eli Zaretskii eliz@gnu.org
Mon Aug 14 21:20:00 GMT 2006


> Date: Mon, 14 Aug 2006 17:06:28 +0200
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: Daniel Jacobowitz <drow@false.org>
> 
> please review the proposed functionality to be able to debug though exec().

Thanks.  Please wait for others to comment; what's below are
relatively minor comments.

> +  if (filename_new != NULL && 
> +      (exec_bfd == NULL || strcmp (get_exec_file (0), filename_new)))

Please don't use literal strcmp for file names; use FILENAME_CMP
instead.  That's because of case-insensitive file systems and other
similar complications with file-name comparisons.  The assumption that
file names are just strings is non-portable.

> +      printf_unfiltered (_("Restoring the program name before exec().\n"));

Please don't use "exec()" to indicate that it's a function: it looks
like a call to `exec' with no arguments, which is not what you want.
Just `exec' (with single quotes) is all you need.

> +  if (filename_new != NULL && (symfile_objfile == NULL
> +      || strcmp (symfile_objfile->name, filename_new)))

File-name comparison again.

> +      printf_unfiltered (_("Restoring the symbol table before exec().\n"));

"exec()" again.

Finally, if this change has user-visible effects, it should be
accompanied by a suitable change in NEWS and the user manual.



More information about the Gdb mailing list