From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63948 invoked by alias); 10 Jul 2019 18:20:59 -0000 Mailing-List: contact gdb-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: gdb-cvs-owner@sourceware.org List-Subscribe: Sender: gdb-cvs-owner@sourceware.org Received: (qmail 63898 invoked by uid 306); 10 Jul 2019 18:20:59 -0000 Date: Wed, 10 Jul 2019 18:20:00 -0000 Message-ID: <20190710182059.63897.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Specialize value_cast error message for Ada X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 43dd762689eb80d5c93a6c1079697c3791fb46fa X-Git-Newrev: 32372d80caba2e223157eca6db2fb0e65369c3c7 X-SW-Source: 2019-07/txt/msg00045.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=32372d80caba2e223157eca6db2fb0e65369c3c7 commit 32372d80caba2e223157eca6db2fb0e65369c3c7 Author: Tom Tromey Date: Tue Jun 18 08:59:00 2019 -0600 Specialize value_cast error message for Ada 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-07-10 Tom Tromey * valops.c (value_cast): Specialize error message for Ada. Diff: --- gdb/ChangeLog | 4 ++++ gdb/valops.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c4db196..410a8d8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2019-07-10 Tom Tromey + + * valops.c (value_cast): Specialize error message for Ada. + 2019-07-10 Simon Marchi * breakpoint.c (breakpoint_1): Update doc and parameter names. diff --git a/gdb/valops.c b/gdb/valops.c index 663edae..82b54561 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; } }