From patchwork Mon Oct 7 12:19:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 34841 Received: (qmail 74612 invoked by alias); 7 Oct 2019 12:19:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 74447 invoked by uid 89); 7 Oct 2019 12:19:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Google-Smtp-Source:APXvYqy, mi_catch_ex.exp, mi_catch_exexp, UD:mi_catch_ex.exp X-HELO: mail-wr1-f43.google.com Received: from mail-wr1-f43.google.com (HELO mail-wr1-f43.google.com) (209.85.221.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Oct 2019 12:19:48 +0000 Received: by mail-wr1-f43.google.com with SMTP id r3so15043155wrj.6 for ; Mon, 07 Oct 2019 05:19:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id; bh=QeJ6VcUn/jGZav+YOZOhl1J6bwoWUVDX1H5VMaDuU9E=; b=U5EWsjAA39N6hdt7dYQ9a1jOAXrdrmHH7TrtpkIpXrB3trUn60HohFY1ld0B5GKnlZ 25rtVOfRWQbs/UNmgQBu/g0xEl02pqXo37wS71n5Skr3LGNJ2/EiEz6mPqNAcW2Ih7BC 1drh5xbj2ClvGKxkUVUAcZDWYt6Q51GUDd2w5nM8x5bsDc8WbTgUODImhCcsKYtXGRAU 2ErM/9uG7oHUk932cMTgMX953Y2cvcTTsZNDuY/+7QhLKvuXS8hseTrFZ6eF3t8jCBXr vz85yJBDvqO7fTQznuQxjRlMbuiZ4SJf8RtsJtpKVlquTsWHR7moauiHDS6lSrRqZncB qEfQ== Return-Path: Received: from localhost (cust64-dsl91-135-5.idnet.net. [91.135.5.64]) by smtp.gmail.com with ESMTPSA id g1sm15009225wrv.68.2019.10.07.05.19.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Oct 2019 05:19:45 -0700 (PDT) From: Andrew Burgess To: gdb-patches Cc: Andrew Burgess Subject: [PUSHED] gdb/testsuite/ada: Handle missing debug info case Date: Mon, 7 Oct 2019 13:19:42 +0100 Message-Id: <20191007121942.22849-1-andrew.burgess@embecosm.com> X-IsSubscribed: yes Update a test script to handle the case where missing Ada debug information means we can't catch exceptions. This was discussed on the list here: https://sourceware.org/ml/gdb-patches/2019-08/msg00607.html And is similar to code that already exists in the test scripts gdb.ada/catch_ex.exp and gdb.ada/mi_catch_ex.exp. gdb/testsuite/ChangeLog: * gdb.ada/catch_ex_std.exp: Handle being unabled to catch Ada exceptions due to missing debug information. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.ada/catch_ex_std.exp | 25 ++++++++++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.ada/catch_ex_std.exp b/gdb/testsuite/gdb.ada/catch_ex_std.exp index 839d0bb092f..f3a4e59d4b9 100644 --- a/gdb/testsuite/gdb.ada/catch_ex_std.exp +++ b/gdb/testsuite/gdb.ada/catch_ex_std.exp @@ -95,12 +95,23 @@ if {![runto_main]} then { return 0 } -gdb_test "catch exception some_kind_of_error" \ - "Catchpoint \[0-9\]+: `some_kind_of_error' Ada exception" +set can_catch_exceptions 0 +gdb_test_multiple "catch exception some_kind_of_error" "" { + -re "Catchpoint \[0-9\]+: `some_kind_of_error' Ada exception\r\n$gdb_prompt $" { + pass $gdb_test_name + set can_catch_exceptions 1 + } -gdb_test "cont" \ - "Catchpoint \[0-9\]+, .* at .*foo\.adb:\[0-9\]+.*" \ - "caught the exception" + -re "Your Ada runtime appears to be missing some debugging information.\r\nCannot insert Ada exception catchpoint in this configuration.\r\n$gdb_prompt $" { + unsupported $gdb_test_name + } +} -gdb_test "print \$_ada_exception = some_package.some_kind_of_error'Address" \ - " = true" +if { $can_catch_exceptions } { + gdb_test "cont" \ + "Catchpoint \[0-9\]+, .* at .*foo\.adb:\[0-9\]+.*" \ + "caught the exception" + + gdb_test "print \$_ada_exception = some_package.some_kind_of_error'Address" \ + " = true" +}