]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Darwin: change message for failure to open a binary
authorPaul Floyd <pjfloyd@wanadoo.fr>
Thu, 13 Mar 2025 07:35:17 +0000 (08:35 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Thu, 13 Mar 2025 07:35:17 +0000 (08:35 +0100)
Previously was always ELF, now either ELF or mach-o.

coregrind/m_debuginfo/debuginfo.c

index 6c4a6926560ba493e1df58194ac5a1242c92dc29..18fd33535c0fa1f3d61273120e39833c36f8ab37 100644 (file)
@@ -1329,12 +1329,16 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV, Int use_fd )
       SysRes fd = VG_(open)( filename, oflags, 0 );
       if (sr_isError(fd)) {
          if (sr_Err(fd) != VKI_EACCES) {
+#if defined(VGO_darwin)
+            const HChar* message = "can't open file to inspect mach-o header";
+#else
+            const HChar* message = "can't open file to inspect ELF header";
+#endif
             DebugInfo fake_di;
             VG_(memset)(&fake_di, 0, sizeof(fake_di));
             fake_di.fsm.filename = ML_(dinfo_strdup)("di.debuginfo.nmm",
                                                      filename);
-            ML_(symerr)(&fake_di, True,
-                        "can't open file to inspect ELF header");
+            ML_(symerr)(&fake_di, True, message);
          }
          return 0;
       }