From patchwork Wed Jul 10 17:06:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33664 Received: (qmail 59451 invoked by alias); 10 Jul 2019 17:06:48 -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 59438 invoked by uid 89); 10 Jul 2019 17:06:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.8 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=sk:Constra X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Jul 2019 17:06:46 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B1DAC5612D; Wed, 10 Jul 2019 13:06:44 -0400 (EDT) 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 1i-URVLhQd1k; Wed, 10 Jul 2019 13:06:44 -0400 (EDT) Received: from murgatroyd.Home (97-122-178-82.hlrn.qwest.net [97.122.178.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 3952356129; Wed, 10 Jul 2019 13:06:44 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Joel Brobecker , Pedro Alves , Tom Tromey Subject: [PATCH] Change Ada catchpoints to be bp_catchpoint Date: Wed, 10 Jul 2019 11:06:35 -0600 Message-Id: <20190710170635.19023-1-tromey@adacore.com> MIME-Version: 1.0 Like Pedro's earlier patches to change catchpoint to be of type bp_catchpoint, this changes the Ada catchpoints to follow. Tested on x86-64 Fedora 29. gdb/ChangeLog 2019-07-10 Tom Tromey * breakpoint.c (init_ada_exception_breakpoint): Register as bp_catchpoint. * ada-lang.c (class ada_catchpoint_location): Pass bp_loc_software_breakpoint to bp_location constructor. gdb/testsuite/ChangeLog 2019-07-10 Tom Tromey * gdb.ada/mi_ex_cond.exp: Update expected results. * gdb.ada/mi_catch_ex_hand.exp: Update expected results. * gdb.ada/mi_catch_ex.exp: Update expected results. * gdb.ada/mi_catch_assert.exp: Update expected results. * gdb.ada/catch_ex.exp (catch_exception_info) (catch_exception_entry, catch_assert_entry) (catch_unhandled_entry): Update. * gdb.ada/catch_assert_if.exp: Update expected results. --- gdb/ChangeLog | 7 +++++++ gdb/ada-lang.c | 9 +++------ gdb/breakpoint.c | 2 +- gdb/testsuite/ChangeLog | 11 +++++++++++ gdb/testsuite/gdb.ada/catch_assert_if.exp | 2 +- gdb/testsuite/gdb.ada/catch_ex.exp | 8 ++++---- gdb/testsuite/gdb.ada/mi_catch_assert.exp | 2 +- gdb/testsuite/gdb.ada/mi_catch_ex.exp | 8 ++++---- gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp | 4 ++-- gdb/testsuite/gdb.ada/mi_ex_cond.exp | 2 +- 10 files changed, 35 insertions(+), 20 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index ae28265d496..c1a4e3d93b6 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -12283,7 +12283,7 @@ class ada_catchpoint_location : public bp_location { public: ada_catchpoint_location (breakpoint *owner) - : bp_location (owner) + : bp_location (owner, bp_loc_software_breakpoint) {} /* The condition that checks whether the exception that was raised @@ -12546,14 +12546,11 @@ print_one_exception (enum ada_exception_catchpoint_kind ex, struct value_print_options opts; get_user_print_options (&opts); + if (opts.addressprint) - { - annotate_field (4); - uiout->field_core_addr ("addr", b->loc->gdbarch, b->loc->address); - } + uiout->field_skip ("addr"); annotate_field (5); - *last_loc = b->loc; switch (ex) { case ada_catch_exception: diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index f780bed27ec..573118430ef 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -11206,7 +11206,7 @@ init_ada_exception_breakpoint (struct breakpoint *b, enough for now, though. */ } - init_raw_breakpoint (b, gdbarch, sal, bp_breakpoint, ops); + init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint, ops); b->enable_state = enabled ? bp_enabled : bp_disabled; b->disposition = tempflag ? disp_del : disp_donttouch; diff --git a/gdb/testsuite/gdb.ada/catch_assert_if.exp b/gdb/testsuite/gdb.ada/catch_assert_if.exp index 0bf2dd6a66b..61a12a7d738 100644 --- a/gdb/testsuite/gdb.ada/catch_assert_if.exp +++ b/gdb/testsuite/gdb.ada/catch_assert_if.exp @@ -70,7 +70,7 @@ gdb_test "catch assert if Global_Var = 2" \ # Check that condition is stored and properly displayed. -set exp_bp ".*$decimal${sp}breakpoint${sp}keep${sp}y${sp}$hex failed Ada assertions$eol${sp}stop only if Global_Var = 2.*" +set exp_bp ".*$decimal${sp}catchpoint${sp}keep${sp}y${sp}failed Ada assertions$eol${sp}stop only if Global_Var = 2.*" gdb_test "info breakpoint" $exp_bp "Check catch assertions with condition" set bp_location [gdb_get_line_number "STOP" ${testdir}/bla.adb] diff --git a/gdb/testsuite/gdb.ada/catch_ex.exp b/gdb/testsuite/gdb.ada/catch_ex.exp index 772100ac127..5a560c1217d 100644 --- a/gdb/testsuite/gdb.ada/catch_ex.exp +++ b/gdb/testsuite/gdb.ada/catch_ex.exp @@ -32,7 +32,7 @@ set sp "\[ \t\]*" set info_break_header "Num${sp}Type${sp}Disp${sp}Enb${sp}Address${sp}What" set catch_exception_info \ - "$any_nb${sp}breakpoint${sp}keep${sp}y${sp}$any_addr${sp}all Ada exceptions" + "$any_nb${sp}catchpoint${sp}keep${sp}y${sp}all Ada exceptions" #################################### # 1. Try catching all exceptions. # @@ -105,11 +105,11 @@ gdb_test "catch exception unhandled" \ "insert catchpoint on unhandled exceptions" set catch_exception_entry \ - "$any_nb${sp}breakpoint${sp}keep${sp}y${sp}$any_addr${sp}\`Program_Error' Ada exception" + "$any_nb${sp}catchpoint${sp}keep${sp}y${sp}\`Program_Error' Ada exception" set catch_assert_entry \ - "$any_nb${sp}breakpoint${sp}keep${sp}y${sp}$any_addr${sp}failed Ada assertions" + "$any_nb${sp}catchpoint${sp}keep${sp}y${sp}failed Ada assertions" set catch_unhandled_entry \ - "$any_nb${sp}breakpoint${sp}keep${sp}y${sp}$any_addr${sp}unhandled Ada exceptions" + "$any_nb${sp}catchpoint${sp}keep${sp}y${sp}unhandled Ada exceptions" gdb_test "info break" \ "$info_break_header$eol.*$catch_exception_entry$eol$catch_assert_entry$eol$catch_unhandled_entry" \ diff --git a/gdb/testsuite/gdb.ada/mi_catch_assert.exp b/gdb/testsuite/gdb.ada/mi_catch_assert.exp index ebecf03bd5b..6e6093ed521 100644 --- a/gdb/testsuite/gdb.ada/mi_catch_assert.exp +++ b/gdb/testsuite/gdb.ada/mi_catch_assert.exp @@ -81,7 +81,7 @@ if ![mi_run_to_main] then { } mi_gdb_test "-catch-assert -c \"Global_Var = 2\"" \ - "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",addr=\"$hex\",what=\"failed Ada assertions\",.*,cond=\"Global_Var = 2\",.*}" \ + "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"failed Ada assertions\",.*,cond=\"Global_Var = 2\",.*}" \ "catch assert failures with condition" set bp_location [gdb_get_line_number "STOP" ${testdir}/bla.adb] diff --git a/gdb/testsuite/gdb.ada/mi_catch_ex.exp b/gdb/testsuite/gdb.ada/mi_catch_ex.exp index 772a0506a29..93585989b8e 100644 --- a/gdb/testsuite/gdb.ada/mi_catch_ex.exp +++ b/gdb/testsuite/gdb.ada/mi_catch_ex.exp @@ -75,7 +75,7 @@ if ![mi_run_to_main] then { } mi_gdb_test "-catch-exception" \ - "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",addr=\"$hex\",what=\"all Ada exceptions\",.*}" \ + "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"all Ada exceptions\",.*}" \ "catch all exceptions" # Continue to caught exception. @@ -131,15 +131,15 @@ if ![mi_run_to_main] then { } mi_gdb_test "-catch-exception -e Program_Error" \ - "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",addr=\"$hex\",what=\"`Program_Error' Ada exception\",.*}" \ + "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"`Program_Error' Ada exception\",.*}" \ "catch Program_Error" mi_gdb_test "-catch-assert" \ - "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",addr=\"$hex\",what=\"failed Ada assertions\",.*}" \ + "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"failed Ada assertions\",.*}" \ "catch assert failures" mi_gdb_test "-catch-exception -u" \ - "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",addr=\"$hex\",what=\"unhandled Ada exceptions\",.*}" \ + "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"unhandled Ada exceptions\",.*}" \ "catch unhandled exceptions" mi_execute_to "exec-continue" \ diff --git a/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp b/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp index 11a9d1dc667..a4734b99094 100644 --- a/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp +++ b/gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp @@ -70,7 +70,7 @@ if ![mi_run_to_main] then { } mi_gdb_test "-catch-handlers" \ - "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",addr=\"$hex\",what=\"all Ada exceptions handlers\",.*}" \ + "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"all Ada exceptions handlers\",.*}" \ "catch all exceptions handlers" # Continue to exception handler. @@ -120,7 +120,7 @@ if ![mi_run_to_main] then { } mi_gdb_test "-catch-handlers -e Constraint_Error" \ - "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",addr=\"$hex\",what=\"`Constraint_Error' Ada exception handlers\",.*}" \ + "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"`Constraint_Error' Ada exception handlers\",.*}" \ "catch Constraint_Error" mi_execute_to "exec-continue" \ diff --git a/gdb/testsuite/gdb.ada/mi_ex_cond.exp b/gdb/testsuite/gdb.ada/mi_ex_cond.exp index ccbbe1f5d8c..16aa198e5e0 100644 --- a/gdb/testsuite/gdb.ada/mi_ex_cond.exp +++ b/gdb/testsuite/gdb.ada/mi_ex_cond.exp @@ -69,7 +69,7 @@ mi_gdb_load ${binfile} # catchpoint that uses both conditions and exception name. mi_gdb_test "-catch-exception -c \"i = 2\" -e constraint_error" \ - "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",addr=\"$hex\",what=\"`constraint_error' Ada exception\",.*,cond=\"i = 2\",.*}" \ + "\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",what=\"`constraint_error' Ada exception\",.*,cond=\"i = 2\",.*}" \ "catch C_E if i = 2" # It is important that we start the program's execution after having