This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: gdb/409: build failures for targets that should build with -Werror
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Cc: rearnsha at arm dot com, gdb-patches at sources dot redhat dot com, gdb-gnats at sources dot redhat dot com
- Date: Thu, 14 Mar 2002 13:49:21 +0000
- Subject: Re: gdb/409: build failures for targets that should build with -Werror
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=409
>
> I suspect the real bug is in the gdb_realpath() code. It should
> strongly prefer realpath() over canonicalize_file_name(). The latter is
> (as you noticed) GNU centric - I think it comes from the HURD.
>
OK, so how about this patch. It fixes most of the multi-build failures.
<date> Richard Earnshaw <rearnsha@arm.com>
* utils.c (gdb_realpath): Prefer realpath() over
canonicalize_file_name().
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.68
diff -p -r1.68 utils.c
*** utils.c 2002/03/01 06:19:24 1.68
--- utils.c 2002/03/14 13:47:03
*************** string_to_core_addr (const char *my_stri
*** 2532,2540 ****
char *
gdb_realpath (const char *filename)
{
! #ifdef HAVE_CANONICALIZE_FILE_NAME
! return canonicalize_file_name (filename);
! #elif defined (HAVE_REALPATH)
#if defined (PATH_MAX)
char buf[PATH_MAX];
#elif defined (MAXPATHLEN)
--- 2532,2538 ----
char *
gdb_realpath (const char *filename)
{
! #ifdef HAVE_REALPATH
#if defined (PATH_MAX)
char buf[PATH_MAX];
#elif defined (MAXPATHLEN)
*************** gdb_realpath (const char *filename)
*** 2546,2551 ****
--- 2544,2551 ----
#endif
char *rp = realpath (filename, buf);
return xstrdup (rp ? rp : filename);
+ #elif defined (HAVE_CANONICALIZE_FILE_NAME)
+ return canonicalize_file_name (filename);
#else
return xstrdup (filename);
#endif