Module Name:    src
Committed By:   christos
Date:           Sun Sep 20 14:39:26 UTC 2020

Modified Files:
        src/external/gpl3/gdb/dist/gdb: corelow.c

Log Message:
Don't read data from sections without contents on NetBSD. We end up reading
0's and svr4_exec_displacement read phdrs_target successfully, and we
end up in the rabbit-hole of 0 displacement for pie binaries and then we
can't load our shared libaries from the core file.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/gpl3/gdb/dist/gdb/corelow.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/corelow.c
diff -u src/external/gpl3/gdb/dist/gdb/corelow.c:1.1.1.9 src/external/gpl3/gdb/dist/gdb/corelow.c:1.2
--- src/external/gpl3/gdb/dist/gdb/corelow.c:1.1.1.9	Mon Sep 14 21:43:29 2020
+++ src/external/gpl3/gdb/dist/gdb/corelow.c	Sun Sep 20 10:39:26 2020
@@ -841,6 +841,7 @@ core_target::xfer_partial (enum target_o
 	if (xfer_status == TARGET_XFER_OK)
 	  return TARGET_XFER_OK;
 
+#ifndef __NetBSD__
 	/* Finally, attempt to access data in core file sections with
 	   no contents.  These will typically read as all zero.  */
 	auto no_contents_cb = [&] (const struct target_section *s)
@@ -853,7 +854,7 @@ core_target::xfer_partial (enum target_o
 			 m_core_section_table.sections,
 			 m_core_section_table.sections_end,
 			 no_contents_cb);
-
+#endif
 	return xfer_status;
       }
     case TARGET_OBJECT_AUXV:

Reply via email to