public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Specialize value_cast error message for Ada
@ 2019-07-10 18:20 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-07-10 18:20 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=32372d80caba2e223157eca6db2fb0e65369c3c7

commit 32372d80caba2e223157eca6db2fb0e65369c3c7
Author: Tom Tromey <tromey@adacore.com>
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  <tromey@adacore.com>
    
    	* 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  <tromey@adacore.com>
+
+	* valops.c (value_cast): Specialize error message for Ada.
+
 2019-07-10  Simon Marchi  <simon.marchi@polymtl.ca>
 
 	* 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;
     }
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-10 18:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10 18:20 [binutils-gdb] Specialize value_cast error message for Ada Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).