This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb/409: build failures for targets that should build with -Werror


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]