From patchwork Tue Jun 18 15:00:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33185 Received: (qmail 16361 invoked by alias); 18 Jun 2019 15:00:57 -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 16315 invoked by uid 89); 18 Jun 2019 15:00:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.1 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=carrying, HContent-Transfer-Encoding:8bit 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; Tue, 18 Jun 2019 15:00:55 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A02B456089; Tue, 18 Jun 2019 11:00:52 -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 9ScM6DFTEKfq; Tue, 18 Jun 2019 11:00:52 -0400 (EDT) Received: from murgatroyd.Home (75-166-12-78.hlrn.qwest.net [75.166.12.78]) (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 4A9BF56071; Tue, 18 Jun 2019 11:00:52 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Specialize value_cast error message for Ada Date: Tue, 18 Jun 2019 09:00:49 -0600 Message-Id: <20190618150049.15300-1-tromey@adacore.com> MIME-Version: 1.0 In Ada, the term for a cast is "type conversion". AdaCore has been carrying a local patch to specialize the error message in value_cast, but it seemed fine to me for this to be part of gdb. This also removes a dead "return" statement. gdb/ChangeLog 2019-06-18 Tom Tromey * valops.c (value_cast): Specialize error message for Ada. --- gdb/ChangeLog | 4 ++++ gdb/valops.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/valops.c b/gdb/valops.c index 948ad89fe92..0b32c5de9ef 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -555,8 +555,9 @@ value_cast (struct type *type, struct value *arg2) return value_at_lazy (to_type, value_address (arg2)); else { + if (current_language->la_language == language_ada) + error (_("Invalid type conversion.")); error (_("Invalid cast.")); - return 0; } }