Better handling of realpath() failure in windows_make_so() on Cygwin
authorJon Turney <jon.turney@dronecode.org.uk>
Wed, 13 Jan 2016 18:27:48 +0000 (18:27 +0000)
committerJon Turney <jon.turney@dronecode.org.uk>
Wed, 15 Apr 2020 14:07:02 +0000 (15:07 +0100)
It seems Cygwin's realpath() can fail on certain DLLs (apparently some
AV software prevent it working on it's DLLs; See [1], [2]).  Warn rather
than stopping with an error if that occurs.

Based on an original patch from Tim Chick.

[1] https://cygwin.com/ml/cygwin/2014-08/msg00401.html
[2] https://cygwin.com/ml/cygwin/2015-11/msg00353.html

gdb/ChangeLog:

2016-01-20  Jon Turney  <jon.turney@dronecode.org.uk>

* windows-nat.c (windows_make_so): Warn rather than stopping with
an error if realpath() fails.

gdb/ChangeLog
gdb/windows-nat.c

index 8998636a1d7840dd277b2d37a72f40a08c89a0ff..425c44599224952a02f408611339f04dee07cfa7 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-20  Jon Turney  <jon.turney@dronecode.org.uk>
+
+       * windows-nat.c (windows_make_so): Warn rather than stopping with
+       an error if realpath() fails.
+
 2020-04-14  Kamil Rytarowski  <n54@gmx.com>
 
        * nbsd-nat.c (nbsd_pid_to_kinfo_proc2): New.
index 881240c6934751f1317a63f051a9b9f9ab85058b..613153bfac6fc48f70f4cf6065951a59467d3e1c 100644 (file)
@@ -820,7 +820,10 @@ windows_make_so (const char *name, LPVOID load_addr)
          free (rname);
        }
       else
-       error (_("dll path too long"));
+       {
+         warning (_("dll path for \"%s\" too long or inaccessible"), name);
+         strcpy (so->so_name, so->so_original_name);
+       }
     }
   /* Record cygwin1.dll .text start/end.  */
   p = strchr (so->so_name, '\0') - (sizeof ("/cygwin1.dll") - 1);