From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id B06FA3858D35 for ; Sun, 5 Jul 2020 22:58:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B06FA3858D35 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-84-cXoZgmCCNX-_yBe26FyWJw-1; Sun, 05 Jul 2020 18:58:42 -0400 X-MC-Unique: cXoZgmCCNX-_yBe26FyWJw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8FFED1005510 for ; Sun, 5 Jul 2020 22:58:41 +0000 (UTC) Received: from f32-1.lan (ovpn-112-21.phx2.redhat.com [10.3.112.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FC3C60BEC; Sun, 5 Jul 2020 22:58:41 +0000 (UTC) From: Kevin Buettner To: gdb-patches@sourceware.org Subject: [PATCH v4 00/14] Fix BZ 25631 - core file memory access problem Date: Sun, 5 Jul 2020 15:57:53 -0700 Message-Id: <20200705225807.2264705-1-kevinb@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2020 22:58:49 -0000 This series fixes several core file related bugs. The bug which started this work can be viewed here: https://sourceware.org/bugzilla/show_bug.cgi?id=25631 Other problems were found either during review or during development. I discuss these in my commit log remarks. Only some of these patches still need review. A brief status of each can be found below: 1) Remove hack for GDB which sets the section size to 0 Nick Clifton has approved this patch. 2) Adjust corefile.exp test to show regression after bfd hack removal 3) section_table_xfer_memory: Replace section name with callback predicate 4) Provide access to non SEC_HAS_CONTENTS core file sections 5) Test ability to access unwritten-to mmap data in core file I think that Pedro is okay with #2 thru #5. 6) Update binary_get_section_contents to seek using section's file position Nick Cliften has approved patch #6. 7) Add new gdbarch method, read_core_file_mappings This is a new patch which needs review. 8) Use NT_FILE note section for reading core target memory This patch is significantly different than the v3 patch. It needs review. 9) Add test for accessing read-only mmapped data in a core file I think that Pedro is oky with this one. 10) gcore command: Place all file-backed mappings in NT_FILE note 11) xfail gdb.base/coredump-filter.exp test which now works without a binary 12) Add new command "maint print core-file-backed-mappings" #10 thru #12 are new patches which need review. 13) Add documentation for "maint print core-file-backed-mappings" This one needs a review from Eli. 14) New core file tests with mappings over existing program memory I've made all the changes that Pedro recommended, plus added a test for the new maint print command. It needs review. bfd/binary.c | 12 +- bfd/elf.c | 8 - gdb/NEWS | 4 + gdb/arch-utils.c | 16 ++ gdb/arch-utils.h | 12 + gdb/bfd-target.c | 3 +- gdb/corelow.c | 260 ++++++++++++++++++++- gdb/doc/gdb.texinfo | 8 + gdb/exec.c | 8 +- gdb/exec.h | 13 +- gdb/gdbarch.c | 23 ++ gdb/gdbarch.h | 6 + gdb/gdbarch.sh | 3 + gdb/linux-tdep.c | 244 +++++++++++++------ gdb/target.c | 18 +- gdb/testsuite/gdb.base/coredump-filter.exp | 21 ++ gdb/testsuite/gdb.base/corefile.exp | 24 +- gdb/testsuite/gdb.base/corefile2.exp | 179 ++++++++++++++ gdb/testsuite/gdb.base/coremaker.c | 30 ++- gdb/testsuite/gdb.base/coremaker2.c | 150 ++++++++++++ 20 files changed, 933 insertions(+), 109 deletions(-) create mode 100644 gdb/testsuite/gdb.base/corefile2.exp create mode 100644 gdb/testsuite/gdb.base/coremaker2.c -- 2.26.2