From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2586 invoked by alias); 24 Mar 2015 23:57:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 2576 invoked by uid 89); 24 Mar 2015 23:57:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 24 Mar 2015 23:57:27 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2ONvQ0k007790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 24 Mar 2015 19:57:26 -0400 Received: from psique.yyz.redhat.com (unused-10-15-17-126.yyz.redhat.com [10.15.17.126]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2ONvPnW026140; Tue, 24 Mar 2015 19:57:26 -0400 From: Sergio Durigan Junior To: GDB Patches Cc: Pedro Alves , Sergio Durigan Junior Subject: [PATCH v4 0/2] Improve corefile generation by using /proc/PID/coredump_filter (PR corefile/16902) Date: Tue, 24 Mar 2015 23:57:00 -0000 Message-Id: <1427241443-5939-1-git-send-email-sergiodj@redhat.com> X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00816.txt.bz2 Hello, This is the fifth version of this patch series. It basically includes fixes to make GDB mimic the Linux kernel's behavior when dealing with "file-backed mappings with anonymous pages". As explained on: in this situation, the Linux kernel dumps this "special" mapping both when the user has requested file-backed or anonymous mappings to be included in the corefile. Now, GDB does the same thing. The patch also extends the testcase in order to make sure that, depending on the type of the corefile we are dealing with, we can or cannot disassemble a section of the code without loading a binary. The approach I took for this is: - For corefiles that include the file-backed mappings, GDB should be able to disassemble. - For corefiles that do not include file-backed nor anonymous mappings, GDB should not be able to disassemble. It was necessary to "relax" the second test because, as explained in the message linked above, when you load a binary inside GDB its .text segment contains anonymous pages, so if you ask for a corefile without file-backed mappings (which, in theory, should exclude the .text segment), GDB will still include the .text segment because this kind of mapping is *also* considered an anonymous mapping (the Linux kernel does the same thing here). Other than that, the code is the same. The documentation has been approved already, but I am including a NEWS entry this time (I wasn't sure if it was worth it or not, so I decided to go ahead and do it). OK to apply? Sergio Durigan Junior (2): Implement support for checking /proc/PID/coredump_filter Documentation and testcase gdb/doc/gdb.texinfo | 33 +++ gdb/linux-tdep.c | 455 +++++++++++++++++++++++++++-- gdb/testsuite/gdb.base/coredump-filter.c | 61 ++++ gdb/testsuite/gdb.base/coredump-filter.exp | 198 +++++++++++++ 4 files changed, 719 insertions(+), 28 deletions(-) create mode 100644 gdb/testsuite/gdb.base/coredump-filter.c create mode 100644 gdb/testsuite/gdb.base/coredump-filter.exp -- 1.9.3