This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Debugging through exec() (Linux MAY_FOLLOW_EXEC)
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb at sourceware dot org
- Date: Tue, 15 Aug 2006 00:20:12 +0300
- Subject: Re: Debugging through exec() (Linux MAY_FOLLOW_EXEC)
- References: <20060614142552.GA15021@nevyn.them.org> <20060615203519.GA9603@host0.dyn.jankratochvil.net> <20060721181556.GA9150@lace.redhat.com> <20060721184421.GA22820@nevyn.them.org> <20060722123102.GA1936@lace.redhat.com> <20060724190332.GA13612@nevyn.them.org> <20060729185317.GA16200@host0.dyn.jankratochvil.net> <200607312038.k6VKchKj018729@elgar.sibelius.xs4all.nl> <20060805164144.GA23819@host0.dyn.jankratochvil.net> <20060808160113.GC21032@nevyn.them.org> <20060814150628.GA24544@host0.dyn.jankratochvil.net>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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.