From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21288 invoked by alias); 15 Nov 2013 06:39:27 -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 21277 invoked by uid 89); 15 Nov 2013 06:39:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,RDNS_NONE,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from Unknown (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 15 Nov 2013 06:39:25 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id DBFE4116288; Fri, 15 Nov 2013 01:39:49 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Djb3yhr9ACUM; Fri, 15 Nov 2013 01:39:49 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 7CDC8116287; Fri, 15 Nov 2013 01:39:49 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id DB9ACE0D3A; Fri, 15 Nov 2013 10:39:15 +0400 (RET) Date: Fri, 15 Nov 2013 07:28:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFA/Ada(v2) 1/3] Add command to list Ada exceptions Message-ID: <20131115063915.GU3481@adacore.com> References: <1383912219-13012-1-git-send-email-brobecker@adacore.com> <1383912219-13012-2-git-send-email-brobecker@adacore.com> <87r4akz2n6.fsf@fleche.redhat.com> <20131113172135.GL3481@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Dzs2zDY0zgkG72+7" Content-Disposition: inline In-Reply-To: <20131113172135.GL3481@adacore.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-11/txt/msg00401.txt.bz2 --Dzs2zDY0zgkG72+7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1354 > > The new test fails for me like this: > > > > (gdb) info exceptions > > All defined Ada exceptions: > > const.aint_global_e: 0x608120 > > (gdb) FAIL: gdb.ada/info_exc.exp: info exceptions > > > > The test case expects there to be more exceptions: > > > > gdb_test "info exceptions" \ > > [multi_line "All defined Ada exceptions:" \ > > "constraint_error: $hex" \ > > "program_error: $hex" \ > > "storage_error: $hex" \ > > "tasking_error: $hex" \ > > "const.aint_global_e: $hex"] > > > > Any ideas why this may happen? I think I have an idea, now. It is similar to what we need to do in the "catch exception" testcases, where we start the program in order to be certain that we can find the symbols from the GNAT runtime. On Fedora, and I suspect may other distros, the default for gnatmake is to like against the shared libgnat, whereas the gnatmake I use links against the static libgnat - this is why I didn't see that omission. Can you try the attached? gdb/ChangeLog: * gdb.ada/info_exc.exp: Start inferior before starting the "info exceptions" tests. * gdb.ada/mi_exc_info.exp: Start inferior before starting the "-info-ada-exceptions" tests. Tested on x86_64-linux. -- Joel --Dzs2zDY0zgkG72+7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Start-inferior-before-running-test-listing-Ada-excep.patch" Content-length: 1978 >From d0aa384d0eb08c4bf855a967af49ec15bb513d97 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Fri, 15 Nov 2013 10:30:00 +0400 Subject: [PATCH] Start inferior before running test listing Ada exceptions. This patch fixes some spurious failures when the inferior is linked against the shared version of libgnat by default, as appears to be the case on many GNU/Linux distributions. When that happens, we have to start the program in order to ensure that the GNAT runtime is mapped to memory, in order for us to find the standard exceptions (defined within the runtime). Otherwise, they will not be shown, as expected, by the debugger. gdb/ChangeLog: * gdb.ada/info_exc.exp: Start inferior before starting the "info exceptions" tests. * gdb.ada/mi_exc_info.exp: Start inferior before starting the "-info-ada-exceptions" tests. --- gdb/testsuite/gdb.ada/info_exc.exp | 5 +++++ gdb/testsuite/gdb.ada/mi_exc_info.exp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/gdb/testsuite/gdb.ada/info_exc.exp b/gdb/testsuite/gdb.ada/info_exc.exp index 3ff5180..9637bce 100644 --- a/gdb/testsuite/gdb.ada/info_exc.exp +++ b/gdb/testsuite/gdb.ada/info_exc.exp @@ -34,6 +34,11 @@ proc multi_line { args } { clean_restart ${testfile} +if ![runto_main] then { + fail "Cannot run to main, testcase aborted" + return 0 +} + gdb_test "info exceptions" \ [multi_line "All defined Ada exceptions:" \ "constraint_error: $hex" \ diff --git a/gdb/testsuite/gdb.ada/mi_exc_info.exp b/gdb/testsuite/gdb.ada/mi_exc_info.exp index b77ccbc..8325e90 100644 --- a/gdb/testsuite/gdb.ada/mi_exc_info.exp +++ b/gdb/testsuite/gdb.ada/mi_exc_info.exp @@ -29,6 +29,11 @@ if [mi_gdb_start] { continue } +if ![mi_run_to_main] then { + fail "Cannot run to main, testcase aborted" + return 0 +} + mi_delete_breakpoints mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} -- 1.8.1.2 --Dzs2zDY0zgkG72+7--