This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Fix issues with DOSish file names in symbol tables
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Subject: Re: [RFA] Fix issues with DOSish file names in symbol tables
- From: Elena Zannoni <ezannoni at cygnus dot com>
- Date: Sun, 29 Apr 2001 18:56:56 -0400 (EDT)
- Cc: gdb-patches at sources dot redhat dot com
- References: <1438-Sat28Apr2001115732+0300-eliz@is.elta.co.il>
Eli Zaretskii writes:
> The following minor changes fix GDB handling of DOS-style file and
> directory names recorded in the debug info. The specific issues are:
> the form of an absolute file name and the case-insensitive nature of
> the underlying file system, which can leak into the debug info.
>
> It seems like Jim Blandy and/or Elena need to approve this.
>
> Okay to commit?
Eli,
yes, ok with me. 2 less occurrences of STREQ, excellent!
Elena
>
> 2001-04-28 Eli Zaretskii <eliz@is.elta.co.il>
>
> * buildsym.c (start_subfile): Use FILENAME_CMP instead of STREQ.
> (top-level): #include filenames.h.
>
> * dwarf2read.c (dwarf2_start_subfile): Use IS_ABSOLUTE_PATH and
> FILENAME_CMP, to DTRT on non-Posix platforms.
> (top-level): #include filenames.h.
>
> --- gdb/buildsym.c~0 Fri Dec 15 03:01:44 2000
> +++ gdb/buildsym.c Sat Apr 28 11:19:40 2001
> @@ -37,6 +37,7 @@
> #include "expression.h" /* For "enum exp_opcode" used by... */
> #include "language.h" /* For "longest_local_hex_string_custom" */
> #include "bcache.h"
> +#include "filenames.h" /* For DOSish file names */
> /* Ask buildsym.h to define the vars it normally declares `extern'. */
> #define EXTERN
> /**/
> @@ -531,7 +532,7 @@ start_subfile (char *name, char *dirname
>
> for (subfile = subfiles; subfile; subfile = subfile->next)
> {
> - if (STREQ (subfile->name, name))
> + if (FILENAME_CMP (subfile->name, name) == 0)
> {
> current_subfile = subfile;
> return;
> --- gdb/dwarf2read.c~0 Wed Jan 24 02:22:46 2001
> +++ gdb/dwarf2read.c Sat Apr 28 11:14:34 2001
> @@ -35,6 +35,7 @@
> #include "buildsym.h"
> #include "demangle.h"
> #include "expression.h"
> +#include "filenames.h" /* for DOSish file names */
>
> #include "language.h"
> #include "complaints.h"
> @@ -4058,14 +4059,14 @@ dwarf2_start_subfile (char *filename, ch
> /* If the filename isn't absolute, try to match an existing subfile
> with the full pathname. */
>
> - if (*filename != '/' && dirname != NULL)
> + if (!IS_ABSOLUTE_PATH (filename) && dirname != NULL)
> {
> struct subfile *subfile;
> char *fullname = concat (dirname, "/", filename, NULL);
>
> for (subfile = subfiles; subfile; subfile = subfile->next)
> {
> - if (STREQ (subfile->name, fullname))
> + if (FILENAME_CMP (subfile->name, fullname) == 0)
> {
> current_subfile = subfile;
> xfree (fullname);
>