From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19096 invoked by alias); 25 Mar 2015 00:06:10 -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 19085 invoked by uid 89); 25 Mar 2015 00:06:09 -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; Wed, 25 Mar 2015 00:06:08 +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 t2P066cZ010043 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 24 Mar 2015 20:06:07 -0400 Received: from localhost (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 t2P066jk029116 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Tue, 24 Mar 2015 20:06:06 -0400 From: Sergio Durigan Junior To: GDB Patches Cc: Pedro Alves Subject: [RFC/PATCH] Extend gdb_core_cmd to allow "Cannot access memory..." messages X-URL: http://blog.sergiodj.net Date: Wed, 25 Mar 2015 00:06:00 -0000 Message-ID: <871tke2b6a.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00820.txt.bz2 Hi, While hacking the coredump_filter patch, I noticed that, when you load a corefile on GDB and receive a "Cannot access memory at address..." message, gdb_core_cmd will fail and return -1, which means that some fatal error happened. Unfortunately, this kind of message does not mean that the user cannot continue debugging with the corefile; it meant that some memory region (sometimes not important) was inaccessible. Given that gcore_create_callback, nowadays, will dump memory regions if they don't have the 'read' permission set (but have any other permission set), this kind of error can be expected sometimes. I would like to propose this patch to be applied, which will allow the test to continue even if this message is triggered. I was not sure wether I should use a "pass" or "xfail" there, so I chose the second (which makes more sense to me). WDYT? -- Sergio GPG key ID: 0x65FC5E36 Please send encrypted e-mail if possible http://sergiodj.net/ gdb/testsuite/ChangeLog: 2015-03-24 Sergio Durigan Junior * lib/gdb.exp (gdb_core_cmd): Handle "Cannot access memory at address..." message. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index f274b64..48b50b5 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3573,7 +3573,7 @@ proc gdb_gcore_cmd {core test} { # -1 - core file failed to load proc gdb_core_cmd { core test } { - global gdb_prompt + global gdb_prompt hex gdb_test_multiple "core $core" "$test" { -re "\\\[Thread debugging using \[^ \r\n\]* enabled\\\]\r\n" { @@ -3591,6 +3591,10 @@ proc gdb_core_cmd { core test } { fail "$test (incomplete note section)" return 0 } + -re "Cannot access memory at address $hex\r\n$gdb_prompt $" { + pass "$test (could not access some memory regions)" + return 0 + } -re "Core was generated by .*\r\n$gdb_prompt $" { pass "$test" return 1